]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix wrong max_to_defrag in btrfs_defrag_file()
authorLi Zefan <lizf@cn.fujitsu.com>
Fri, 2 Sep 2011 07:56:55 +0000 (15:56 +0800)
committerDavid Sterba <dsterba@suse.cz>
Thu, 20 Oct 2011 16:10:37 +0000 (18:10 +0200)
commit748990a1f4764dcc8b63ec6ca41d8f8adeac51dc
tree6a99818b0c54b71c706206bf8981e807e2b0a99b
parent11a078c18c2e53db8d12c04e3ada6a2a4bbda5ee
Btrfs: fix wrong max_to_defrag in btrfs_defrag_file()

It's off-by-one, and thus we may skip the last page while defragmenting.

An example case:

  # create /mnt/file with 2 4K file extents
  # btrfs fi defrag /mnt/file
  # sync
  # filefrag /mnt/file
  /mnt/file: 2 extents found

So it's not defragmented.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
fs/btrfs/ioctl.c