lkml.org 
[lkml]   [2015]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/6] Btrfs: lock superblock before remounting for rw subvol
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>


\
 
 \ /
  Last update: 2015-05-11 18:21    [W:0.207 / U:15.816 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site