]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: do not defrag a file partially
authorLiu Bo <liubo2009@cn.fujitsu.com>
Thu, 26 Jan 2012 20:01:12 +0000 (15:01 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 26 Jan 2012 20:01:12 +0000 (15:01 -0500)
commit8d502048bc0a6fbd4f95b274ae744017ee42b567
treec0c738e7c27e4ac6185f02acd76de64986218906
parent72a60c3bdc216b3d7676146bfc43affd57e5170d
Btrfs: do not defrag a file partially

xfstests 218 complains that btrfs defrags a file partially:
 After: 1
 Write backwards sync, but contiguous - should defrag to 1 extent
 Before: 10
-After: 1
+After: 2

To fix this, we need to set max_to_defrag count properly.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c