All of lore.kernel.org
 help / color / mirror / Atom feed
* master - dev-cache: Filter wipe does not guarantee a full /dev scan.
@ 2014-09-10 22:02 Alasdair Kergon
  0 siblings, 0 replies; 2+ messages in thread
From: Alasdair Kergon @ 2014-09-10 22:02 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1f0c4c811da287e7fc28b8c31dcd03347b16d360
Commit:        1f0c4c811da287e7fc28b8c31dcd03347b16d360
Parent:        47ff145e08f689306762840efd72e8a4e1c91214
Author:        Petr Rockai <prockai@redhat.com>
AuthorDate:    Tue Sep 9 17:14:35 2014 +0200
Committer:     Alasdair G Kergon <agk@redhat.com>
CommitterDate: Wed Sep 10 22:57:49 2014 +0100

dev-cache: Filter wipe does not guarantee a full /dev scan.

The code in dev_iter_create assumes that if a filter can be wiped, doing so will
always trigger a call to _full_scan. This is not true for composite filters
though, since they can always be wiped in principle, but there is no way to know
that a component filter inside will exist that actually triggers the scan.
---
 lib/device/dev-cache.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 1d7a517..ba4ee54 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1009,9 +1009,11 @@ struct dev_iter *dev_iter_create(struct dev_filter *f, int dev_scan)
 	if (dev_scan && !trust_cache()) {
 		/* Flag gets reset between each command */
 		if (!full_scan_done()) {
-			if (f && f->wipe)
-				f->wipe(f); /* Calls _full_scan(1) */
-			else
+			if (f && f->wipe) {
+				f->wipe(f); /* might call _full_scan(1) */
+				if (!full_scan_done())
+					_full_scan(1);
+			} else
 				_full_scan(1);
 		}
 	} else



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* master - dev-cache: Filter wipe does not guarantee a full /dev scan.
@ 2014-09-10 17:57 Petr Rockai
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Rockai @ 2014-09-10 17:57 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=66cce64e6985f7f1614c6bde618c7a4207fea7e9
Commit:        66cce64e6985f7f1614c6bde618c7a4207fea7e9
Parent:        c774d9a3f35c312d5b24c4ba13da707ccd975194
Author:        Petr Rockai <prockai@redhat.com>
AuthorDate:    Tue Sep 9 17:14:35 2014 +0200
Committer:     Petr Rockai <prockai@redhat.com>
CommitterDate: Tue Sep 9 17:14:35 2014 +0200

dev-cache: Filter wipe does not guarantee a full /dev scan.

The code in dev_iter_create assumes that if a filter can be wiped, doing so will
always trigger a call to _full_scan. This is not true for composite filters
though, since they can always be wiped in principle, but there is no way to know
that a component filter inside will exist that actually triggers the scan.
---
 lib/device/dev-cache.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 1d7a517..ba4ee54 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1009,9 +1009,11 @@ struct dev_iter *dev_iter_create(struct dev_filter *f, int dev_scan)
 	if (dev_scan && !trust_cache()) {
 		/* Flag gets reset between each command */
 		if (!full_scan_done()) {
-			if (f && f->wipe)
-				f->wipe(f); /* Calls _full_scan(1) */
-			else
+			if (f && f->wipe) {
+				f->wipe(f); /* might call _full_scan(1) */
+				if (!full_scan_done())
+					_full_scan(1);
+			} else
 				_full_scan(1);
 		}
 	} else



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-10 22:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-10 22:02 master - dev-cache: Filter wipe does not guarantee a full /dev scan Alasdair Kergon
  -- strict thread matches above, loose matches on Subject: below --
2014-09-10 17:57 Petr Rockai

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.