From ec1fc69d3945f67684a2c15969dfb309ed967168 Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Mon, 24 Aug 2015 16:45:03 +0800 Subject: btrfs-progs: close all fs_devices before exit in some commands mkfs creates more than one fs_devices in fs_uuids. 1: one is for file system being created 2: others are created in test_dev_for_mkfs in order to check mount point test_dev_for_mkfs()-> ... -> btrfs_scan_one_device() Current code only closes 1, and this patch also closes in case 2. Similar problem exist in other tools, eg.:: cmd-check.c: the function is: cmd_check()->check_mounted()-> ... -> btrfs_scan_one_device() ... Signed-off-by: Zhao Lei Signed-off-by: David Sterba --- mkfs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'mkfs.c') diff --git a/mkfs.c b/mkfs.c index 7d635dc2..3e609652 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1843,6 +1843,7 @@ raid_groups: out: ret = close_ctree(root); BUG_ON(ret); + btrfs_close_all_devices(); free(label); return 0; } -- cgit v1.2.3