public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: agk@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW lib/cache/lvmcache.h lib/lock ... Date: Wed, 19 May 2010 02:36:00 -0000 [thread overview] Message-ID: <20100519023634.21918.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-05-19 02:36:33 Modified files: . : WHATS_NEW lib/cache : lvmcache.h lib/locking : cluster_locking.c file_locking.c locking.c lib/metadata : metadata.c Log message: Add is_global_vg and split out from is_orphan_vg. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1565&r2=1.1566 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.h.diff?cvsroot=lvm2&r1=1.30&r2=1.31 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.45&r2=1.46 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.83&r2=1.84 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.341&r2=1.342 --- LVM2/WHATS_NEW 2010/05/19 02:08:50 1.1565 +++ LVM2/WHATS_NEW 2010/05/19 02:36:33 1.1566 @@ -2,7 +2,7 @@ =============================== Validate orphan and VG_GLOBAL lock order too. Accept orphan VG names as parameters to lock_vol() and related functions. - Use is_orphan_vg in place of hard-coded prefix tests. + Use is_orphan_vg in place of hard-coded prefix tests and add is_global_vg. Version 2.02.65 - 17th May 2010 =============================== --- LVM2/lib/cache/lvmcache.h 2010/03/17 02:11:18 1.30 +++ LVM2/lib/cache/lvmcache.h 2010/05/19 02:36:33 1.31 @@ -19,9 +19,10 @@ #include "dev-cache.h" #include "uuid.h" #include "label.h" +#include "locking.h" -#define ORPHAN_PREFIX "#" -#define ORPHAN_VG_NAME(fmt) ORPHAN_PREFIX "orphans_" fmt +#define ORPHAN_PREFIX VG_ORPHANS +#define ORPHAN_VG_NAME(fmt) ORPHAN_PREFIX "_" fmt #define CACHE_INVALID 0x00000001 #define CACHE_LOCKED 0x00000002 --- LVM2/lib/locking/cluster_locking.c 2010/05/19 00:52:55 1.43 +++ LVM2/lib/locking/cluster_locking.c 2010/05/19 02:36:33 1.44 @@ -406,7 +406,7 @@ } /* If the VG name is empty then lock the unused PVs */ - if (is_orphan_vg(resource) || (flags & LCK_CACHE)) + if (is_orphan_vg(resource) || is_global_vg(resource) || (flags & LCK_CACHE)) dm_snprintf(lockname, sizeof(lockname), "P_%s", resource); else --- LVM2/lib/locking/file_locking.c 2010/05/19 00:52:55 1.45 +++ LVM2/lib/locking/file_locking.c 2010/05/19 02:36:33 1.46 @@ -265,7 +265,7 @@ if (flags & LCK_CACHE) break; - if (is_orphan_vg(resource)) + if (is_orphan_vg(resource) || is_global_vg(resource)) dm_snprintf(lockfile, sizeof(lockfile), "%s/P_%s", _lock_dir, resource + 1); else --- LVM2/lib/locking/locking.c 2010/05/19 02:08:51 1.83 +++ LVM2/lib/locking/locking.c 2010/05/19 02:36:33 1.84 @@ -325,7 +325,7 @@ char path[PATH_MAX]; /* We'll allow operations on orphans */ - if (is_orphan_vg(vgname)) + if (is_orphan_vg(vgname) || is_global_vg(vgname)) return 1; /* LVM1 is only present in 2.4 kernels. */ @@ -369,7 +369,7 @@ return 0; } - if (is_orphan_vg(resource) && (flags & LCK_CACHE)) { + if ((is_orphan_vg(resource) || is_global_vg(resource)) && (flags & LCK_CACHE)) { log_error(INTERNAL_ERROR "P_%s referenced", resource); return 0; } --- LVM2/lib/metadata/metadata.c 2010/05/19 02:08:51 1.341 +++ LVM2/lib/metadata/metadata.c 2010/05/19 02:36:33 1.342 @@ -3337,7 +3337,7 @@ */ int is_orphan_vg(const char *vg_name) { - return (vg_name && vg_name[0] == ORPHAN_PREFIX[0]) ? 1 : 0; + return (vg_name && !strncmp(vg_name, ORPHAN_PREFIX, sizeof(ORPHAN_PREFIX) - 1)) ? 1 : 0; } /**
reply other threads:[~2010-05-19 2:36 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=20100519023634.21918.qmail@sourceware.org \ --to=agk@sourceware.org \ --cc=lvm-devel@redhat.com \ --cc=lvm2-cvs@sourceware.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).