Re: [PATCH 1/2] Btrfs: don't make a file partly checksummed through file clone

2011-09-15 Thread David Sterba
On Wed, Sep 14, 2011 at 01:25:21PM +0800, Li Zefan wrote: It's because part of the file is checksummed and the other part is not, and then btrfs will complain checksum is not found when we read the file. Disallow file clone if src and dst file have different checksum flag, so we ensure a

Re: [PATCH 1/2] Btrfs: don't make a file partly checksummed through file clone

2011-09-15 Thread Li Zefan
David Sterba wrote: On Wed, Sep 14, 2011 at 01:25:21PM +0800, Li Zefan wrote: It's because part of the file is checksummed and the other part is not, and then btrfs will complain checksum is not found when we read the file. Disallow file clone if src and dst file have different checksum flag,

Re: [PATCH 1/2] Btrfs: don't make a file partly checksummed through file clone

2011-09-14 Thread Sage Weil
On Wed, 14 Sep 2011, Li Zefan wrote: To reproduce the bug: # mount /dev/sda7 /mnt # dd if=/dev/zero of=/mnt/src bs=4K count=1 # umount /mnt # mount -o nodatasum /dev/sda7 /mnt # dd if=/dev/zero of=/mnt/dst bs=4K count=1 # clone_range -s 4K -l 4K /mnt/src /mnt/dst #

[PATCH 1/2] Btrfs: don't make a file partly checksummed through file clone

2011-09-13 Thread Li Zefan
To reproduce the bug: # mount /dev/sda7 /mnt # dd if=/dev/zero of=/mnt/src bs=4K count=1 # umount /mnt # mount -o nodatasum /dev/sda7 /mnt # dd if=/dev/zero of=/mnt/dst bs=4K count=1 # clone_range -s 4K -l 4K /mnt/src /mnt/dst # echo 3 /proc/sys/vm/drop_caches # cat /mnt/dst