]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix transaction abortion when remounting btrfs from RW to RO
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Tue, 14 Jan 2014 11:42:20 +0000 (19:42 +0800)
committerChris Mason <clm@fb.com>
Tue, 28 Jan 2014 21:20:36 +0000 (13:20 -0800)
commit57985ab6b4f4ef6f6482e019baae688c41b4e030
tree95b303ca51649e3a934a6296042ada3d1dbea687
parent787886a1d682a08fb9ac225751e8ef91da5dfe83
Btrfs: fix transaction abortion when remounting btrfs from RW to RO

Steps to reproduce:
 # mkfs.btrfs -f /dev/sda8
 # mount /dev/sda8 /mnt -o flushoncommit
 # dd if=/dev/zero of=/mnt/data bs=4k count=102400 &
 # mount /dev/sda8 /mnt -o remount, ro

When remounting RW to RO, the logic is to firstly set flag
to RO and then commit transaction, however with option
flushoncommit enabled,we will do RO check within committing
transaction, so we get a transaction abortion here.

Actually,here check is wrong, we should check if FS_STATE_ERROR
is set, fix it.

Reported-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Suggested-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/inode.c