From: David Sterba <dsterba@suse.cz>
To: Liu Bo <bo.li.liu@oracle.com>,
clm@fb.com, linux-btrfs@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] btrfs: do not return EBUSY on concurrent subvolume mounts
Date: Thu, 28 Apr 2016 12:05:01 +0200 [thread overview]
Message-ID: <20160428100501.GU29353@suse.cz> (raw)
In-Reply-To: <20160428091220.GT29353@suse.cz>
On Thu, Apr 28, 2016 at 11:12:20AM +0200, David Sterba wrote:
> On Wed, Apr 27, 2016 at 04:22:17PM -0700, Liu Bo wrote:
> > On Wed, Apr 27, 2016 at 05:14:36PM +0200, David Sterba wrote:
> > > A user reported mount failures with EBUSY during boot, there's root
> > > partition and many subvolumes, mounted via /etc/fstab.
> > >
> > > The failure depends on timing, when multiple subvolumes reach the code
> > > between superblock creation in RO mode, while the subvolumes are RW.
> > > This discrepancy leads to EBUSY and the code has been there since ages.
> > >
> > > If the subvolumes are mounted after a short delay, there's no EBUSY.
> > > There's no missing locking, the supreblock creation is atomic and the
> > > error code seems to be just artificial. We support different RO/RW
> > > mounts in mount_subvol and do the relevant adjustments if the flags do
> > > not match.
> >
> > Looks good to me.
> >
> > Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
> >
> > But What I'm worrying about is that mount_subvol() will help subvolume
> > mounting get correct mount flags by calling btrfs_remount(), and
> > btrfs_remount() can remove sb->s_flags's MS_RDONLY. In all syscall cases
> > it's ok as we have mnt->mnt_flags, but for btrfs's add_dev ioctl, we
> > don't check mnt_want_write_file() while btrfs's rm_dev ioctl does the
> > check, should we add that for add_dev ioctl?
>
> That's right, I have patches to fix that and will send them.
So, after a bit of refreshing, the patches are not finished, as add
device must respect read only mount and seeding devices, that can turn
RO to RW. And I got stuck in the device replace case, where we have to
do the drop_mnt_write some time later. Not sure when I'll get to it,
pushed to my git repos, branch fix/ioctl-want-write-local .
next prev parent reply other threads:[~2016-04-28 10:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-27 15:14 [PATCH] btrfs: do not return EBUSY on concurrent subvolume mounts David Sterba
2016-04-27 19:34 ` Josef Bacik
2016-04-27 23:22 ` Liu Bo
2016-04-28 9:12 ` David Sterba
2016-04-28 10:05 ` David Sterba [this message]
2016-04-28 10:01 ` Filipe Manana
2016-04-28 16:17 ` David Sterba
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=20160428100501.GU29353@suse.cz \
--to=dsterba@suse.cz \
--cc=bo.li.liu@oracle.com \
--cc=clm@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=stable@vger.kernel.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 NNTP newsgroup(s).