[sheepdog] [PATCH] add early test for xattr support

Dietmar Maurer dietmar at proxmox.com
Thu Jul 19 10:08:25 CEST 2012


We want to detect that early and prevent startup. Else the daemon starts and simply crash with panic() later.

Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 sheep/farm/farm.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/sheep/farm/farm.c b/sheep/farm/farm.c
index 7d4b2a3..ce76e3e 100644
--- a/sheep/farm/farm.c
+++ b/sheep/farm/farm.c
@@ -15,6 +15,8 @@
 #include <pthread.h>
 #include <linux/limits.h>
 #include <sys/file.h>
+#include <sys/types.h>
+#include <sys/xattr.h>
 
 #include "farm.h"
 #include "sheep_priv.h"
@@ -334,6 +336,9 @@ static int farm_init(char *p)
 	if (create_directory(p) < 0)
 		goto err;
 
+	if ((listxattr(p, NULL, 0) == -1) && (errno == ENOTSUP))
+		goto err;
+
 	if (trunk_init() < 0)
 		goto err;
 
-- 
1.7.2.5





More information about the sheepdog mailing list