All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Omar Sandoval <osandov@osandov.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
	David Sterba <dsterba@suse.cz>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Qu Wenruo <quwenruo@cn.fujitsu.com>
Subject: Re: [PATCH v2 1/6] Btrfs: lock superblock before remounting for rw subvol
Date: Mon, 11 May 2015 18:07:38 +0200	[thread overview]
Message-ID: <20150511160738.GP23255@twin.jikos.cz> (raw)
In-Reply-To: <ad0f1a6b626ecc879bd23972869c8ab93e0312d0.1428614837.git.osandov@osandov.com>

On Thu, Apr 09, 2015 at 02:34:51PM -0700, Omar Sandoval wrote:
> Since commit 0723a0473fb4 ("btrfs: allow mounting btrfs subvolumes with
> different ro/rw options"), when mounting a subvolume read/write when
> another subvolume has previously been mounted read-only, we first do a
> remount. However, this should be done with the superblock locked, as per
> sync_filesystem():
> 
> 	/*
> 	 * We need to be protected against the filesystem going from
> 	 * r/o to r/w or vice versa.
> 	 */
> 	WARN_ON(!rwsem_is_locked(&sb->s_umount));
> 
> This WARN_ON can easily be hit with:
> 
> mkfs.btrfs -f /dev/vdb
> mount /dev/vdb /mnt
> btrfs subvol create /mnt/vol1
> btrfs subvol create /mnt/vol2
> umount /mnt
> mount -oro,subvol=/vol1 /dev/vdb /mnt
> mount -orw,subvol=/vol2 /dev/vdb /mnt2
> 
> Fixes: 0723a0473fb4 ("btrfs: allow mounting btrfs subvolumes with different ro/rw options")
> Signed-off-by: Omar Sandoval <osandov@osandov.com>

Reviewed-by: David Sterba <dsterba@suse.cz>

  reply	other threads:[~2015-05-11 16:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 21:34 [PATCH v2 0/6] Btrfs: show subvolume name and ID in /proc/mounts Omar Sandoval
2015-04-09 21:34 ` [PATCH v2 1/6] Btrfs: lock superblock before remounting for rw subvol Omar Sandoval
2015-05-11 16:07   ` David Sterba [this message]
2015-04-09 21:34 ` [PATCH v2 2/6] Btrfs: remove all subvol options before mounting top-level Omar Sandoval
2015-05-11 16:08   ` David Sterba
2015-04-09 21:34 ` [PATCH v2 3/6] Btrfs: clean up error handling in mount_subvol() Omar Sandoval
2015-05-11 16:08   ` David Sterba
2015-04-09 21:34 ` [PATCH v2 4/6] Btrfs: fail on mismatched subvol and subvolid mount options Omar Sandoval
2015-04-10  0:39   ` Qu Wenruo
2015-04-14 15:07     ` David Sterba
2015-05-11 16:09   ` David Sterba
2015-04-09 21:34 ` [PATCH v2 5/6] Btrfs: unify subvol= and subvolid= mounting Omar Sandoval
2015-05-11 15:37   ` David Sterba
2015-05-11 21:15     ` Omar Sandoval
2015-05-11 16:10   ` David Sterba
2015-04-09 21:34 ` [PATCH v2 6/6] Btrfs: show subvol= and subvolid= in /proc/mounts Omar Sandoval
2015-05-11 16:10   ` David Sterba
2015-05-11  9:42 ` [PATCH v2 0/6] Btrfs: show subvolume name and ID " Omar Sandoval
2015-05-11 14:51   ` David Sterba
2015-05-11 21:20     ` Omar Sandoval
2015-05-12  0:46   ` 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=20150511160738.GP23255@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osandov@osandov.com \
    --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.