public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: ReiserFS List <reiserfs-list@namesys.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>
Subject: [PATCH] reiserfs: fix handling of device names with /'s in them
Date: Wed, 12 Jul 2006 12:42:28 -0400	[thread overview]
Message-ID: <44B52674.8060802@suse.com> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 On systems with block devices containing slashes (virtual dasd, cciss,
 etc), reiserfs will fail to initialize /proc/fs/reiserfs/<dev> due to
 it being interpreted as a subdirectory. The generic block device code
 changes the / to ! for use in the sysfs tree. This patch uses that
 convention.

 Tested by making dm devices use dm/<number> rather than dm-<number>

Signed-off-by: Jeff Mahoney <jeffm@suse.com>

- --

 fs/reiserfs/procfs.c |   25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff -ruNp linux-2.6.17.orig/fs/reiserfs/procfs.c linux-2.6.17.orig.devel/fs/reiserfs/procfs.c
- --- linux-2.6.17.orig/fs/reiserfs/procfs.c	2006-07-12 11:58:56.000000000 -0400
+++ linux-2.6.17.orig.devel/fs/reiserfs/procfs.c	2006-07-12 12:39:17.000000000 -0400
@@ -493,9 +493,17 @@ static void add_file(struct super_block 
 
 int reiserfs_proc_info_init(struct super_block *sb)
 {
+	char bdev[BDEVNAME_SIZE];
+	char *s;
+
+	/* Some block devices use /'s */
+	strlcpy(bdev, reiserfs_bdevname(sb), BDEVNAME_SIZE);
+	s = strchr(bdev, '/');
+	if (s)
+		*s = '!';
+
 	spin_lock_init(&__PINFO(sb).lock);
- -	REISERFS_SB(sb)->procdir =
- -	    proc_mkdir(reiserfs_bdevname(sb), proc_info_root);
+	REISERFS_SB(sb)->procdir = proc_mkdir(bdev, proc_info_root);
 	if (REISERFS_SB(sb)->procdir) {
 		REISERFS_SB(sb)->procdir->owner = THIS_MODULE;
 		REISERFS_SB(sb)->procdir->data = sb;
@@ -509,13 +517,22 @@ int reiserfs_proc_info_init(struct super
 		return 0;
 	}
 	reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s",
- -			 proc_info_root_name, reiserfs_bdevname(sb));
+			 proc_info_root_name, bdev);
 	return 1;
 }
 
 int reiserfs_proc_info_done(struct super_block *sb)
 {
 	struct proc_dir_entry *de = REISERFS_SB(sb)->procdir;
+	char bdev[BDEVNAME_SIZE];
+	char *s;
+
+	/* Some block devices use /'s */
+	strlcpy(bdev, reiserfs_bdevname(sb), BDEVNAME_SIZE);
+	s = strchr(bdev, '/');
+	if (s)
+		*s = '!';
+
 	if (de) {
 		remove_proc_entry("journal", de);
 		remove_proc_entry("oidmap", de);
@@ -529,7 +546,7 @@ int reiserfs_proc_info_done(struct super
 	__PINFO(sb).exiting = 1;
 	spin_unlock(&__PINFO(sb).lock);
 	if (proc_info_root) {
- -		remove_proc_entry(reiserfs_bdevname(sb), proc_info_root);
+		remove_proc_entry(bdev, proc_info_root);
 		REISERFS_SB(sb)->procdir = NULL;
 	}
 	return 0;

- -- 
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFEtSZ0LPWxlyuTD7IRAkfVAJoChixL9icBa5tpe+A9cqE4OdohywCfVW0f
RgF2ffZyXik8NuDy/m0kXUc=
=X3VE
-----END PGP SIGNATURE-----

             reply	other threads:[~2006-07-12 16:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-12 16:42 Jeff Mahoney [this message]
2006-07-12 16:57 ` [PATCH] reiserfs: fix handling of device names with /'s in them Eric Dumazet
2006-07-12 17:02   ` Jeff Mahoney
2006-07-13  0:55 ` Andrew Morton
2006-07-13  3:51   ` Hans Reiser
2006-07-13  4:00     ` Andrew Morton
2006-07-13  7:34       ` Hans Reiser
2006-07-13  5:23   ` H. Peter Anvin
     [not found] <6xQ4C-6NB-43@gated-at.bofh.it>
     [not found] ` <6xQea-6ZX-13@gated-at.bofh.it>
2006-07-14 16:10   ` Bodo Eggert
2006-07-14 17:50     ` Jeff Mahoney
2006-07-16  7:12       ` Hans Reiser
2006-07-16 15:56         ` Jeffrey Mahoney
2006-07-16 18:14           ` Hans Reiser
2006-07-16 22:17             ` Jeff Mahoney
2006-07-17  1:21               ` Hans Reiser
2006-07-17  1:50                 ` Jeffrey Mahoney
2006-07-17  3:02                   ` Hans Reiser
2006-07-17  3:17                     ` Jeffrey Mahoney
2006-07-17  7:29                       ` Hans Reiser
2006-07-17 14:55                         ` Jeff Mahoney
2006-07-17 18:19                           ` Hans Reiser
2006-07-17 18:38                             ` Jeff Mahoney
2006-07-17 19:07                               ` Hans Reiser
2006-07-17 19:59                                 ` Jeff Mahoney
2006-07-17 21:03                                   ` Hans Reiser
2006-07-17 22:26                                     ` Rudy Zijlstra
2006-07-18  0:26                                     ` Horst von Brand
2006-07-18 16:38                                     ` Jan Engelhardt
2006-07-17 18:08                     ` Valdis.Kletnieks
2006-07-17 18:16                       ` Jeff Mahoney
2006-07-17 18:53                         ` Hans Reiser
2006-07-17 19:07                           ` Jeff Mahoney
2006-07-17 18:27                       ` Hans Reiser
2006-07-17 19:52                         ` Valdis.Kletnieks

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=44B52674.8060802@suse.com \
    --to=jeffm@suse.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-list@namesys.com \
    /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