Skip to content
Commit 5ca49660 authored by Li Zefan's avatar Li Zefan Committed by David Sterba
Browse files

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: default avatarLi Zefan <lizf@cn.fujitsu.com>
parent 151a31b2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment