From 75b28ab49d888614885f07daf8394b50212a1855 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 14 Jul 2023 13:26:42 +0200 Subject: [PATCH] lvmlockd: query the simplest check first Check for visibility of the LV first. TODO: Short check list and test only for those that can't be locked, but they are visible LVs. --- lib/locking/lvmlockd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c index b2c074816..a8db25d7a 100644 --- a/lib/locking/lvmlockd.c +++ b/lib/locking/lvmlockd.c @@ -3315,6 +3315,9 @@ out: int lockd_lv_uses_lock(struct logical_volume *lv) { + if (!lv_is_visible(lv)) + return 0; + if (lv_is_thin_volume(lv)) return 0; @@ -3368,9 +3371,6 @@ int lockd_lv_uses_lock(struct logical_volume *lv) if (lv_is_raid_metadata(lv)) return 0; - if (!lv_is_visible(lv)) - return 0; - return 1; }