]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Remove false alert when fiemap range is smaller than on-disk extent
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Thu, 22 Jun 2017 02:01:21 +0000 (10:01 +0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 29 Jun 2017 18:25:20 +0000 (20:25 +0200)
commita130d3bdb8904178d1909b7bdf5fe11d48ed9d37
tree21a9247ef8e9070e818e62bb0e47ae4c08ecfc1f
parentbdbfdb555d40d5961d745e3049dbef944a9fb013
btrfs: Remove false alert when fiemap range is smaller than on-disk extent

Commit 7bbed8ec6633 ("btrfs: fiemap: Cache and merge fiemap extent before
submit it to user") introduced a warning to catch unemitted cached
fiemap extent.

However such warning doesn't take the following case into consideration:

0 4K 8K
|<---- fiemap range --->|
|<----------- On-disk extent ------------------>|

In this case, the whole 0~8K is cached, and since it's larger than
fiemap range, it break the fiemap extent emit loop.
This leaves the fiemap extent cached but not emitted, and caught by the
final fiemap extent sanity check, causing kernel warning.

This patch removes the kernel warning and renames the sanity check to
emit_last_fiemap_cache() since it's possible and valid to have cached
fiemap extent.

Reported-by: David Sterba <dsterba@suse.cz>
Reported-by: Adam Borowski <kilobyte@angband.pl>
Fixes: 7bbed8ec6633 ("btrfs: fiemap: Cache and merge fiemap extent ...")
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c