]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: get write access when doing resize fs
authorMiao Xie <miaox@cn.fujitsu.com>
Mon, 26 Nov 2012 08:43:45 +0000 (08:43 +0000)
committerChris Mason <chris.mason@fusionio.com>
Mon, 17 Dec 2012 01:46:09 +0000 (20:46 -0500)
commit9d7a9ef4ebed06f22d0057bf9706c66f773e3a6b
tree1dae7f3529ead027b13ae4737f5b5cedb267d3a0
parent9a8eb8f6fe6078f07c4ad99fac924d8d1a1a3f71
Btrfs: get write access when doing resize fs

Steps to reproduce:
 # mkfs.btrfs <partition>
 # mount -o ro <partition> <mnt0>
 # mount -o ro <partition> <mnt1>
 # mount -o remount,rw <mnt0>
 # umount <mnt0>
 # btrfs fi resize 10g <mnt1>

We re-sized 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: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ioctl.c