From: David Howells <dhowells@redhat.com>
To: Linux filesystem caching discussion list <linux-cachefs@redhat.com>
Cc: akpm@osdl.org, aviro@redhat.com, linux-kernel@vger.kernel.org,
nfsv4@linux-nfs.org, trond.myklebust@fys.uio.no,
torvalds@osdl.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH] Fix multiple blockdev-based filesystem mounts
Date: Tue, 07 Mar 2006 11:08:41 +0000 [thread overview]
Message-ID: <15962.1141729721@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <20060302213356.7282.26463.stgit@warthog.cambridge.redhat.com>
The attached patch fixes multiple mounts of the same blockdev-based filesystem
(such as EXT3). The problem is that the path through the function that deals
with a second mount of an already extant superblock is going out through the
error path and not the success path that sets up the vfsmount.
The error can be checked by doing something like:
mount /dev/hda6 /a
mount /dev/hda6 /b
Where /dev/hda6 has something like an EXT3 filesystem on it. The second mount
should succeed, but doesn't without this patch.
This patch is dependent on the getsb patch submitted earlier.
Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat -p1 /tmp/get_sb_bdev.diff
fs/super.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/super.c b/fs/super.c
index 7353011..8fe179e 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -697,15 +697,17 @@ int get_sb_bdev(struct file_system_type
s = sget(fs_type, test_bdev_super, set_bdev_super, bdev);
up(&bdev->bd_mount_sem);
if (IS_ERR(s))
- goto out_s_error;
+ goto error_s;
if (s->s_root) {
if ((flags ^ s->s_flags) & MS_RDONLY) {
up_write(&s->s_umount);
deactivate_super(s);
error = -EBUSY;
+ goto error_bdev;
}
- goto out;
+
+ close_bdev_excl(bdev);
} else {
char b[BDEVNAME_SIZE];
@@ -725,9 +727,9 @@ int get_sb_bdev(struct file_system_type
return simple_set_mnt(mnt, s);
-out_s_error:
+error_s:
error = PTR_ERR(s);
-out:
+error_bdev:
close_bdev_excl(bdev);
error:
return error;
next prev parent reply other threads:[~2006-03-07 11:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-02 21:33 [PATCH 0/5] Permit NFS superblock sharing [try #3] David Howells
2006-03-02 21:33 ` [PATCH 1/5] NFS: Permit filesystem to override root dentry on mount " David Howells
2006-03-02 21:34 ` [PATCH 2/5] NFS: Apply mount root dentry override to filesystems " David Howells
2006-03-02 21:34 ` [PATCH 3/5] NFS: Abstract out namespace initialisation " David Howells
2006-03-02 21:34 ` [PATCH 4/5] NFS: Add dentry materialisation op " David Howells
2006-03-02 21:34 ` [PATCH 5/5] NFS: Unify NFS superblocks per-protocol per-server " David Howells
2006-03-03 3:22 ` Andrew Morton
2006-03-02 22:07 ` [PATCH 0/5] Permit NFS superblock sharing " Linus Torvalds
2006-03-03 9:59 ` [PATCH 5/5] NFS: Unify NFS superblocks per-protocol per-server [try #3a] David Howells
2006-03-03 10:49 ` [PATCH 6/5] 9p: Fix error handling on superblock alloc failure David Howells
2006-03-03 11:30 ` [PATCH 7/5] Optimise d_find_alias() David Howells
2006-03-03 11:45 ` Andrew Morton
2006-03-03 14:48 ` Matthew Wilcox
2006-03-03 15:46 ` Al Viro
2006-03-03 13:00 ` David Howells
2006-03-03 15:43 ` Ingo Molnar
2006-03-03 13:01 ` David Howells
2006-03-03 13:38 ` [PATCH 7/5] Optimise d_find_alias() [try #2] David Howells
2006-03-04 12:16 ` [PATCH 0/5] Permit NFS superblock sharing [try #3] Andrew Morton
2006-03-06 11:55 ` David Howells
2006-03-06 13:57 ` Jörn Engel
2006-03-06 15:25 ` Linus Torvalds
2006-03-06 14:03 ` [PATCH 1/5] NFS: Permit filesystem to override root dentry on mount [try #4] David Howells
2006-03-06 14:59 ` [PATCH 1+2/5] NFS: Permit filesystem to override root dentry on mount [try #5] David Howells
2006-03-07 11:08 ` David Howells [this message]
2006-03-07 11:35 ` [PATCH] Fix multiple blockdev-based filesystem mounts Alexander Viro
2006-03-07 13:23 ` David Howells
2006-05-23 16:53 ` [PATCH 0/5] Permit NFS superblock sharing [try #3] David Howells
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=15962.1141729721@warthog.cambridge.redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@osdl.org \
--cc=aviro@redhat.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nfsv4@linux-nfs.org \
--cc=torvalds@osdl.org \
--cc=trond.myklebust@fys.uio.no \
/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 NNTP newsgroup(s).