From: Li Zefan Date: Mon, 11 Jun 2012 08:03:35 +0000 (+0800) Subject: Btrfs: fix defrag regression X-Git-Tag: v3.5-rc3~18^2~8 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c282eb40ed6f64a51ff447707714df551d85b8e;p=pandora-kernel.git Btrfs: fix defrag regression If a file has 3 small extents: | ext1 | ext2 | ext3 | Running "btrfs fi defrag" will only defrag the last two extents, if those extent mappings hasn't been read into memory from disk. This bug was introduced by commit 17ce6ef8d731af5edac8c39e806db4c7e1f6956f ("Btrfs: add a check to decide if we should defrag the range") The cause is, that commit looked into previous and next extents using lookup_extent_mapping() only. While at it, remove the code that checks the previous extent, since it's sufficient to check the next extent. Signed-off-by: Li Zefan --- Reading git-diff-tree failed