Skip to contentSkip to conversation

master - lvconvert: merge polling fixes for lockd

PATCH David Teigland 1 participant 1 message Jul 22, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=27e6aee3904d195de658505b3bacc65601344d46
Commit:        27e6aee3904d195de658505b3bacc65601344d46
Parent:        8bfcefe11a2ce594d1f6e8ef5a1b17e80786ceab
Author:        David Teigland <[email protected]>
AuthorDate:    Wed Jul 22 11:42:57 2015 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Wed Jul 22 12:28:06 2015 -0500

lvconvert: merge polling fixes for lockd

. the poll check will eventually call finish which will
write the VG, so an ex VG lock is needed from lvmlockd.

. fix missing unlock on poll error path

. remove the lockd locking while monitoring the progress
of the command, as suggested by the earlier FIXME comment, as it's not needed.

---
 tools/lvconvert.c  |   10 +------
 tools/polldaemon.c |   61 +++++++++++++++++++++++++++++-----------------------
 2 files changed, 36 insertions(+), 35 deletions(-)
tools/lvconvert.c +2 -8
index 0c5e2bd..6a0e0ca 100644
@@ -3410,10 +3410,7 @@ static int lvconvert_single(struct cmd_context *cmd, struct lvconvert_params *lp
 		cmd->handles_missing_pvs = 1;
 	}
 
-	/*
-	 * The VG lock will be released when the command exits.
-	 * Commands that poll the LV will reacquire the VG lock.
-	 */
+	/* Unlock on error paths not required, it's automatic when command exits. */
 	if (!lockd_vg(cmd, lp->vg_name, "ex", 0, &lockd_state))
 		goto_out;
 
@@ -3461,10 +3458,7 @@ static int lvconvert_single(struct cmd_context *cmd, struct lvconvert_params *lp
 bad:
 	unlock_vg(cmd, lp->vg_name);
 
-	/*
-	 * The command may sit and monitor progress for some time,
-	 * and we do not need or want the VG lock held during that.
-	 */
+	/* Unlock here so it's not held during polling. */
 	lockd_vg(cmd, lp->vg_name, "un", 0, &lockd_state);
 
 	release_vg(vg);
tools/polldaemon.c +34 -27

117 lines not on this page · raw message