diff options
author | David Teigland <teigland@redhat.com> | 2022-09-30 12:16:32 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2022-10-03 12:42:02 -0500 |
commit | a23588d77cb1585e642946fe84c3eaafe7e2d270 (patch) | |
tree | 9e78ba7a55defc21a1c6a117b9a3c87964d5b47f /lib/metadata | |
parent | 599cbd7dd37ba50b44579f64207cc1e47e004899 (diff) | |
download | lvm2-a23588d77cb1585e642946fe84c3eaafe7e2d270.tar.gz |
lvresize: move the lockd_lv earlier
the lock should cover any potential activation,
not just the resizing changes
Diffstat (limited to 'lib/metadata')
-rw-r--r-- | lib/metadata/lv_manip.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 99045c220..d6452e849 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -6815,6 +6815,13 @@ int lv_resize(struct cmd_context *cmd, struct logical_volume *lv, } /* + * If the LV is locked due to being active, this lock call is a no-op. + * Otherwise, this acquires a transient lock on the lv (not PERSISTENT) + */ + if (!lockd_lv_resize(cmd, lv_top, "ex", 0, lp)) + return_0; + + /* * Active 'hidden' -tpool can be waiting for resize, but the pool LV * itself might be inactive. Here plain suspend/resume would not work. * So active temporarily pool LV (with on disk metadata) then use @@ -6909,13 +6916,6 @@ int lv_resize(struct cmd_context *cmd, struct logical_volume *lv, if (is_reduce && !lp->fsopt[0] && !_lv_reduce_confirmation(lv_top, lp)) goto_out; - /* - * If the LV is locked due to being active, this lock call is a no-op. - * Otherwise, this acquires a transient lock on the lv (not PERSISTENT) - */ - if (!lockd_lv_resize(cmd, lv_top, "ex", 0, lp)) - goto_out; - /* Part of old approach to fs handling using fsadm. */ if (!strcmp(lp->fsopt, "resize_fsadm") && !lp->nofsck && !_fsadm_cmd(FSADM_CMD_CHECK, lv_top, 0, lp->yes, lp->force, &status)) { |