diff mbox

NFS exporting btrfs subvolumes.

Message ID 20100602134145.0d523a75@notabene.brown (mailing list archive)
State New, archived
Headers show

Commit Message

NeilBrown June 2, 2010, 3:41 a.m. UTC
None
diff mbox

Patch

diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index caef5b2..ffc5ac7 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -176,7 +176,8 @@  static const char *get_uuid_blkdev(char *path)
 	blkid_tag_iterate iter;
 	blkid_dev dev;
 	const char *type;
-	const char *val = NULL;
+	const char *val;
+	const char *uuid_val = NULL;
 
 	if (cache == NULL)
 		blkid_get_cache(&cache, NULL);
@@ -193,11 +194,16 @@  static const char *get_uuid_blkdev(char *path)
 	iter = blkid_tag_iterate_begin(dev);
 	if (!iter)
 		return NULL;
-	while (blkid_tag_next(iter, &type, &val) == 0)
+	while (blkid_tag_next(iter, &type, &val) == 0) {
 		if (strcmp(type, "UUID") == 0)
+			uuid_val = val;
+		if (strcmp(type, "TYPE") == 0 &&
+		    strcmp(val, "btrfs") == 0) {
+			uuid_val = NULL;
 			break;
+	}
 	blkid_tag_iterate_end(iter);
-	return val;
+	return uuid_val;
 }
 #else
 #define get_uuid_blkdev(path) (NULL)