• Miao Xie's avatar
    Btrfs: get write access when removing a device · da24927b
    Miao Xie authored
    Steps to reproduce:
     # mkfs.btrfs -d single -m single <disk0> <disk1>
     # mount -o ro <disk0> <mnt0>
     # mount -o ro <disk0> <mnt1>
     # mount -o remount,rw <mnt0>
     # umount <mnt0>
     # btrfs device delete <disk1> <mnt1>
    
    We can remove a device from a R/O filesystem. The reason is that we just check
    the R/O flag of the super block object. It is not enough, because the kernel
    may set the R/O flag only for the mount point. We need invoke
    
    	mnt_want_write_file()
    
    to do a full check.
    Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
    Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
    da24927b
ioctl.c 92.1 KB