All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix CLUSTERED flag in new _vg_read_for_update() and vg_read().
@ 2009-05-26 16:52 Dave Wysochanski
  2009-05-26 17:33 ` Petr Rockai
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Wysochanski @ 2009-05-26 16:52 UTC (permalink / raw)
  To: lvm-devel

In the new _vg_read_for_update(), we always do the check for CLUSTERED vg
status flag after reading the volume group.  Thus, no need to set the flag
in vg_read() or clear it later before calling _vg_bad_status_bits().

Also, add back in the !lockingfailed() as part of the CLUSTERED flag check.
It's unclear why it was removed when the check was moved from
_vg_bad_status_bits() to inside _vg_lock_and_read().

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
---
 lib/metadata/metadata.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index f16cd55..55c4578 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -2763,7 +2763,8 @@ static vg_t *_vg_lock_and_read(struct cmd_context *cmd, const char *vg_name,
 		goto_bad;
 	}
 
-	if (vg_is_clustered(vg) && !locking_is_clustered()) {
+	if ((vg_is_clustered(vg)) && !locking_is_clustered() &&
+	    !lockingfailed()) {
 		log_error("Skipping clustered volume group %s", vg->name);
 		failure |= FAILED_CLUSTERED;
 		goto_bad;
@@ -2779,9 +2780,8 @@ static vg_t *_vg_lock_and_read(struct cmd_context *cmd, const char *vg_name,
 			goto_bad;
 		}
 	}
-	
 
-	failure |= _vg_bad_status_bits(vg, status_flags & ~CLUSTERED);
+	failure |= _vg_bad_status_bits(vg, status_flags);
 	if (failure)
 		goto_bad;
 
@@ -2828,7 +2828,7 @@ bad:
 vg_t *vg_read(struct cmd_context *cmd, const char *vg_name,
 	      const char *vgid, uint32_t flags)
 {
-	uint32_t status = CLUSTERED;
+	uint32_t status = 0;
 	uint32_t lock_flags = LCK_VG_READ;
 
 	if (flags & READ_FOR_UPDATE) {
-- 
1.6.0.6



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

* [PATCH] Fix CLUSTERED flag in new _vg_read_for_update() and vg_read().
  2009-05-26 16:52 [PATCH] Fix CLUSTERED flag in new _vg_read_for_update() and vg_read() Dave Wysochanski
@ 2009-05-26 17:33 ` Petr Rockai
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Rockai @ 2009-05-26 17:33 UTC (permalink / raw)
  To: lvm-devel

Dave Wysochanski <dwysocha@redhat.com> writes:
> In the new _vg_read_for_update(), we always do the check for CLUSTERED vg
> status flag after reading the volume group.  Thus, no need to set the flag
> in vg_read() or clear it later before calling _vg_bad_status_bits().
Ok, makes sense.

> Also, add back in the !lockingfailed() as part of the CLUSTERED flag check.
> It's unclear why it was removed when the check was moved from
> _vg_bad_status_bits() to inside _vg_lock_and_read().
There is a patch floating somewhere removing lockingfailed() altogether, since
it's an ugly piece of global state (a rampant modularity violation, if you
will). But I concede to have it put back, although I don't really know what its
effect here would be, anyway (don't report errors when cluster locking failed?
why?).

Yours,
   Petr.

-- 
Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation



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

end of thread, other threads:[~2009-05-26 17:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-26 16:52 [PATCH] Fix CLUSTERED flag in new _vg_read_for_update() and vg_read() Dave Wysochanski
2009-05-26 17:33 ` 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.