diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2016-01-06 18:24:43 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-02-18 13:18:06 +0100 |
commit | 4da2e26a2a32b174878744bd0f07db180c875f26 (patch) | |
tree | 6418afad08a321846e0b39ed430507cde3e83cc5 /fs/btrfs/async-thread.h | |
parent | 388f7b1d6e8ca06762e2454d28d6c3c55ad0fe95 (diff) | |
download | op-kernel-dev-4da2e26a2a32b174878744bd0f07db180c875f26.zip op-kernel-dev-4da2e26a2a32b174878744bd0f07db180c875f26.tar.gz |
btrfs: Continue write in case of can_not_nocow
btrfs failed in xfstests btrfs/080 with -o nodatacow.
Can be reproduced by following script:
DEV=/dev/vdg
MNT=/mnt/tmp
umount $DEV &>/dev/null
mkfs.btrfs -f $DEV
mount -o nodatacow $DEV $MNT
dd if=/dev/zero of=$MNT/test bs=1 count=2048 &
btrfs subvolume snapshot -r $MNT $MNT/test_snap &
wait
--
We can see dd failed on NO_SPACE.
Reason:
__btrfs_buffered_write should run cow write when no_cow impossible,
and current code is designed with above logic.
But check_can_nocow() have 2 type of return value(0 and <0) on
can_not_no_cow, and current code only continue write on first case,
the second case happened in doing subvolume.
Fix:
Continue write when check_can_nocow() return 0 and <0.
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/async-thread.h')
0 files changed, 0 insertions, 0 deletions