All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - lv/vgchange: when refreshing whole vg skip snapshot
Date: Wed,  1 Feb 2023 10:53:14 +0000 (GMT)	[thread overview]
Message-ID: <20230201105314.AD9DC3858002@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=94eda42e7ad7c2dbd7fedfdfbf38032857318fec
Commit:        94eda42e7ad7c2dbd7fedfdfbf38032857318fec
Parent:        0ec087e8b82848891512f100ff594add8f47cfb2
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Tue Jan 31 22:48:43 2023 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Wed Feb 1 11:48:53 2023 +0100

lv/vgchange: when refreshing whole vg skip snapshot

When refreshing all LVs in a VG, skip processing of thick snapshots,
since they will be refreshed through its origin LV.
Should reduce some unnecessary ioctl().
---
 tools/toollib.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/toollib.c b/tools/toollib.c
index d52c9e342..194088ea6 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -883,7 +883,9 @@ int vg_refresh_visible(struct cmd_context *cmd, struct volume_group *vg)
 			break;
 		}
 
-		if (lv_is_visible(lvl->lv) && !lv_refresh(cmd, lvl->lv)) {
+		if (lv_is_visible(lvl->lv) &&
+		    !(lv_is_cow(lvl->lv) && !lv_is_virtual_origin(origin_from_cow(lvl->lv))) &&
+		    !lv_refresh(cmd, lvl->lv)) {
 			r = 0;
 			stack;
 		}
@@ -3292,7 +3294,9 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
 
 		/* Skip availability change for non-virt snaps when processing all LVs */
 		/* FIXME: pass process_all to process_single_lv() */
-		if (process_all && arg_is_set(cmd, activate_ARG) &&
+		if (process_all &&
+		    (arg_is_set(cmd, activate_ARG) ||
+		     arg_is_set(cmd, refresh_ARG)) &&
 		    lv_is_cow(lvl->lv) && !lv_is_virtual_origin(origin_from_cow(lvl->lv)))
 			continue;
 


                 reply	other threads:[~2023-02-01 10:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230201105314.AD9DC3858002@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.