From: Al Viro <viro@ZenIV.linux.org.uk>
To: dsterba@suse.cz, Qu Wenruo <quwenruo@cn.fujitsu.com>,
linux-btrfs@vger.kernel.org,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH RESEND v4 6/8] vfs: Add get_vfsmount_sb() function to get vfsmount from a given sb.
Date: Thu, 29 Jan 2015 15:23:47 +0000 [thread overview]
Message-ID: <20150129152347.GE29656@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20150129123758.GJ3641@twin.jikos.cz>
On Thu, Jan 29, 2015 at 01:37:58PM +0100, David Sterba wrote:
> Adding Al Viro into CC
>
> On Thu, Jan 29, 2015 at 10:24:39AM +0800, Qu Wenruo wrote:
> > +struct vfsmount *get_vfsmount_sb(struct super_block *sb)
> > +{
> > + struct vfsmount *ret_vfs = NULL;
> > + struct mount *mnt;
> > + int ret = 0;
> > +
> > + lock_mount_hash();
> > + if (list_empty(&sb->s_mounts))
> > + goto out;
> > + mnt = list_entry(sb->s_mounts.next, struct mount, mnt_instance);
>
> from include/linux/fs.h:
>
> struct super_block {
> ...
> struct list_head s_mounts; /* list of mounts; _not_ for fs use */
> ...
> };
>
> I hear a storm in the distance coming our direction ... so I'll
> preemptively NAK this change.
Could you explain what the devil is that for? The primitive looks rather
bogus - if nothing else, it includes "make random instance of the filesystem
in someone's namespace appear busy to umount", which doesn't look like a
part of useful interface... The only piece of context I'd been able to find
was something vague about sysfs-inflicted operations and wanting to use
mnt_want_write() but having nothing to pass it; BTW, what if the (random)
instance you run into happens to mounted r/o?
Assuming that your superblock is guaranteed to stay alive and usable for
whatever work you are trying to do, what's wrong with sb_want_write()?
If it's _not_ guaranteed to stay so, and this is what you are trying to
solve, you are doing that at the wrong level - just take sysfs entry
removals earlier in shutdown process and be done with that. Beginning of
close_ctree() would probably be early enough to be safe, but if that's
not enough, you can take it into the beginning of btrfs_kill_super().
next prev parent reply other threads:[~2015-01-29 15:23 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 2:24 [PATCH RESEND v4 0/8] Fix freeze/sysfs deadlock in better method Qu Wenruo
2015-01-29 2:24 ` [PATCH RESEND v4 1/8] Revert "btrfs: add support for processing pending changes" related commits Qu Wenruo
2015-01-29 2:24 ` [PATCH RESEND v4 2/8] btrfs: Make btrfs_parse_options() parse mount option in a atomic way Qu Wenruo
2015-01-30 0:31 ` Miao Xie
2015-01-30 1:20 ` Qu Wenruo
2015-01-30 1:29 ` Miao Xie
2015-01-30 1:33 ` Qu Wenruo
2015-01-30 2:06 ` Miao Xie
2015-01-30 2:51 ` Qu Wenruo
2015-01-30 3:21 ` Miao Xie
2015-01-30 3:25 ` Qu Wenruo
2015-01-29 2:24 ` [PATCH RESEND v4 3/8] btrfs: Introduce per-transaction mount_opt to keep mount option consistent during transaction Qu Wenruo
2015-01-29 2:24 ` [PATCH RESEND v4 4/8] btrfs: Use btrfs_test_trans_opt() to handle SPACE_CACHE if it's under transaction protect Qu Wenruo
2015-01-29 2:24 ` [PATCH RESEND v4 5/8] btrfs: Use btrfs_test_trans_opt() to handle INODE_CACHE " Qu Wenruo
2015-01-29 2:24 ` [PATCH RESEND v4 6/8] vfs: Add get_vfsmount_sb() function to get vfsmount from a given sb Qu Wenruo
2015-01-29 12:37 ` David Sterba
2015-01-29 15:23 ` Al Viro [this message]
2015-01-30 1:11 ` Qu Wenruo
2015-01-30 1:11 ` Qu Wenruo
2015-01-30 2:09 ` Al Viro
2015-01-30 2:20 ` Qu Wenruo
2015-01-30 2:20 ` Qu Wenruo
2015-01-30 0:52 ` Miao Xie
2015-01-30 1:44 ` Qu Wenruo
2015-01-30 1:44 ` Qu Wenruo
2015-01-30 2:02 ` Qu Wenruo
2015-01-30 2:02 ` Qu Wenruo
2015-01-30 3:22 ` Miao Xie
2015-01-30 3:22 ` Miao Xie
2015-01-30 3:30 ` Qu Wenruo
2015-01-30 3:30 ` Qu Wenruo
2015-01-30 2:14 ` Al Viro
2015-01-30 4:14 ` Miao Xie
2015-01-30 4:37 ` Al Viro
2015-01-30 5:34 ` Miao Xie
2015-01-30 6:15 ` Al Viro
2015-01-30 5:30 ` Qu Wenruo
2015-01-30 5:30 ` Qu Wenruo
2015-01-29 2:24 ` [PATCH RESEND v4 7/8] btrfs: Use mnt_want_write() to protect label change Qu Wenruo
2015-01-29 2:24 ` [PATCH RESEND v4 8/8] btrfs: Use mnt_want_write() to protect sysfs feature change Qu Wenruo
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=20150129152347.GE29656@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=quwenruo@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.