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/metadata/lv.c lib/display ...
Date: Thu, 12 Jan 2012 16:58:00 -0000	[thread overview]
Message-ID: <20120112165845.5475.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2012-01-12 16:58:45

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv.c 
	lib/display    : display.c 
	man            : lvs.8.in 

Log message:
	Show read-only activation in display tools.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2220&r2=1.2221
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.122&r2=1.123
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvs.8.in.diff?cvsroot=lvm2&r1=1.18&r2=1.19

--- LVM2/WHATS_NEW	2012/01/12 01:51:56	1.2220
+++ LVM2/WHATS_NEW	2012/01/12 16:58:43	1.2221
@@ -1,5 +1,7 @@
 Version 2.02.89 - 
 ==================================
+  Use R lv_attr to indicate read-only activation of non-read-only device in lvs.
+  Show read-only activation override in lvdisplay & add 4 to perms in -c.
   Add activation/read_only_volume_list to override LV permission in metadata.
   Give priority to emcpower devices with duplicate PVIDs.
   Add check for error in _adjust_policy_params() (lvextend --use-policies).
--- LVM2/lib/metadata/lv.c	2011/09/23 15:17:54	1.29
+++ LVM2/lib/metadata/lv.c	2012/01/12 16:58:44	1.30
@@ -431,6 +431,13 @@
 				repstr[4] = 'I'; /* Invalid snapshot */
 		}
 
+		/*
+		 * 'R' indicates read-only activation of a device that
+		 * does not have metadata flagging it as read-only.
+		 */
+		if (repstr[1] != 'r' && info.read_only)
+			repstr[1] = 'R';
+
 		repstr[5] = (info.open_count) ? 'o' : '-';
 	} else {
 		repstr[4] = '-';
--- LVM2/lib/display/display.c	2011/11/23 01:34:38	1.122
+++ LVM2/lib/display/display.c	2012/01/12 16:58:44	1.123
@@ -485,7 +485,8 @@
 		  lv->vg->name,
 		  lv->name,
 		  lv->vg->name,
-		  (lv->status & (LVM_READ | LVM_WRITE)) >> 8, inkernel ? 1 : 0,
+		  ((lv->status & (LVM_READ | LVM_WRITE)) >> 8) |
+		  ((inkernel & info.read_only) ? 4 : 0), inkernel ? 1 : 0,
 		  /* FIXME lv->lv_number,  */
 		  inkernel ? info.open_count : 0, lv->size, lv->le_count,
 		  /* FIXME Add num allocated to struct! lv->lv_allocated_le, */
@@ -500,6 +501,7 @@
 	struct lvinfo info;
 	int inkernel, snap_active = 0;
 	char uuid[64] __attribute__((aligned(8)));
+	const char *access_str;
 	struct lv_segment *snap_seg = NULL, *mirror_seg = NULL;
 	percent_t snap_percent;
 
@@ -508,6 +510,13 @@
 
 	inkernel = lv_info(cmd, lv, 0, &info, 1, 1) && info.exists;
 
+	if ((lv->status & LVM_WRITE) && inkernel && info.read_only)
+		access_str = "read/write (activated read only)";
+	else if (lv->status & LVM_WRITE)
+		access_str = "read/write";
+	else
+		access_str = "read only";
+
 	log_print("--- Logical volume ---");
 
 	log_print("LV Name                %s%s/%s", lv->vg->cmd->dev_dir,
@@ -516,8 +525,7 @@
 
 	log_print("LV UUID                %s", uuid);
 
-	log_print("LV Write Access        %s",
-		  (lv->status & LVM_WRITE) ? "read/write" : "read only");
+	log_print("LV Write Access        %s", access_str);
 
 	if (lv_is_origin(lv)) {
 		log_print("LV snapshot status     source of");
--- LVM2/man/lvs.8.in	2011/11/08 12:16:53	1.18
+++ LVM2/man/lvs.8.in	2012/01/12 16:58:44	1.19
@@ -94,7 +94,8 @@
 under (c)onversion, thin (V)olume, (t)hin pool, (T)hin pool data, raid or
 thin pool m(e)tadata
 .IP 2 3
-Permissions: (w)riteable, (r)ead-only
+Permissions: (w)riteable, (r)ead-only, (R)ead-only activation of non-read-only
+volume
 .IP 3 3
 Allocation policy: (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere, (i)nherited
 This is capitalised if the volume is currently locked against allocation


                 reply	other threads:[~2012-01-12 16:58 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=20120112165845.5475.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: link
Be 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).