lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 08 Jul 2011 17:46:16 +0900
From:	Nao Nishijima <nao.nishijima.xt@...achi.com>
To:	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org
Cc:	James.Bottomley@...senPartnership.com, kay.sievers@...y.org,
	jcm@...hat.com, greg@...ah.com, dle-develop@...ts.sourceforge.net,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	yrl.pp-manager.tt@...achi.com, dgilbert@...erlog.com,
	stefanr@...6.in-berlin.de, hare@...e.de,
	Nao Nishijima <nao.nishijima.xt@...achi.com>
Subject: [RFC PATCH 3/4] fs: modify disk_name() for alias name

Make disk_name() return alais_name instead of disk_name when alias_name is set.
disk_name() is used in /proc/{partitions, diskstats}. Therefore, those files
show alias_name.

Signed-off-by: Nao Nishijima <nao.nishijima.xt@...achi.com>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
---

 Documentation/ABI/testing/sysfs-block |    8 ++++----
 fs/partitions/check.c                 |    6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block
index 07c4fcd..432140c 100644
--- a/Documentation/ABI/testing/sysfs-block
+++ b/Documentation/ABI/testing/sysfs-block
@@ -217,7 +217,7 @@ Description:
 		instead of raw device name. However, kernel doesn't show those
 		persistent names on its message (e.g. dmesg).
 		This file can store an alias name of the disk and it would be
-		appeared in kernel messages if it is set. A disk can have an
-		alias name which length is up to 255bytes. Users can use
-		use alphabets, numbers, "-" and "_" in alias name and can
-		change it anytime.
+		appeared in kernel messages and procfs if it is set. A disk
+		can have an alias name which length is up to 255bytes. Users
+		can use use alphabets, numbers, "-" and "_" in alias name and
+		can change it anytime.
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index d545e97..d0bfe56 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -125,11 +125,11 @@ static int (*check_part[])(struct parsed_partitions *) = {
 char *disk_name(struct gendisk *hd, int partno, char *buf)
 {
 	if (!partno)
-		snprintf(buf, BDEVNAME_SIZE, "%s", hd->disk_name);
+		snprintf(buf, BDEVNAME_SIZE, "%s", alias_name(hd));
 	else if (isdigit(hd->disk_name[strlen(hd->disk_name)-1]))
-		snprintf(buf, BDEVNAME_SIZE, "%sp%d", hd->disk_name, partno);
+		snprintf(buf, BDEVNAME_SIZE, "%sp%d", alias_name(hd), partno);
 	else
-		snprintf(buf, BDEVNAME_SIZE, "%s%d", hd->disk_name, partno);
+		snprintf(buf, BDEVNAME_SIZE, "%s%d", alias_name(hd), partno);
 
 	return buf;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ