[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH 9/9] Wait for devices being created



Before command's exit and before device is needed for open in set_lv().

Signed-off-by: Zdenek Kabelac <zkabelac redhat com>
---
 lib/metadata/lv_manip.c |    3 +++
 tools/lvmcmdline.c      |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 6f553cd..48e4b7c 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -2999,6 +2999,9 @@ int set_lv(struct cmd_context *cmd, struct logical_volume *lv,
 	struct device *dev;
 	char *name;
 
+	if (!unlock_fs(cmd)) /* waits until device is ready for regular open */
+		stack;
+
 	/*
 	 * FIXME:
 	 * <clausen> also, more than 4k
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 9f20d4b..2fba753 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1117,6 +1117,9 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
 
 	ret = cmd->command->fn(cmd, argc, argv);
 
+	if (!unlock_fs(cmd))
+		stack;
+
 	fin_locking();
 
       out:
-- 
1.7.3.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]