]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: check if the to-be-added device is writable
authorLi Zefan <lizf@cn.fujitsu.com>
Thu, 8 Dec 2011 01:08:40 +0000 (20:08 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 8 Dec 2011 13:55:46 +0000 (08:55 -0500)
commit72e3cbdcc7002b8e6aca8cb52652aca0a0c33cf0
tree8c91371ea5f77630ce3683bf4971bd3e6012cd0c
parent3c451256fea55e7eae6f7076baaa6b5b128bf6fc
Btrfs: check if the to-be-added device is writable

If we call ioctl(BTRFS_IOC_ADD_DEV) directly, we'll succeed in adding
a readonly device to a btrfs filesystem, and btrfs will write to
that device, emitting kernel errors:

[ 3109.833692] lost page write due to I/O error on loop2
[ 3109.833720] lost page write due to I/O error on loop2
...

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/volumes.c