From 876625d66a40af489c89f7b43a74abdfa73c5dfd Mon Sep 17 00:00:00 2001
From: Thomas Schoebel-Theuer <tst@1und1.de>
Date: Wed, 18 Mar 2015 13:02:19 +0100
Subject: [PATCH] light: disallow modprobe when UUID is missing

---
 kernel/sy_old/mars_light.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/kernel/sy_old/mars_light.c b/kernel/sy_old/mars_light.c
index 8836669d..cb6a897f 100644
--- a/kernel/sy_old/mars_light.c
+++ b/kernel/sy_old/mars_light.c
@@ -5619,7 +5619,13 @@ static int __init init_light(void)
 {
 	extern int min_free_kbytes;
 	int new_limit = 4096;
-	int status = 0;
+	struct kstat dummy;
+	int status = mars_stat("/mars/uuid", &dummy, true);
+
+	if (unlikely(status < 0)) {
+		printk(KERN_ERR "cannot load MARS: cluster UUID is missing. Mount /mars/, and/or use {create,join}-cluster first.\n");
+		return -ENOENT;
+	}
 
 	// bump the min_free limit
 	if (min_free_kbytes < new_limit)