btrfs-progs: fsck: fix a infinite loop on discount file extent repair
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Wed, 5 Aug 2015 08:03:13 +0000 (16:03 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 31 Aug 2015 17:25:12 +0000 (19:25 +0200)
commit773ede50c002a28eabc16b5afa43951993170ab3
tree2571d27c729a082bb96c1891bffc874a4bda4268
parent1ffa833a910b5a7070d9ee4456fb833aab7cf91d
btrfs-progs: fsck: fix a infinite loop on discount file extent repair

For a special case, discount file extent repair function will cause
infinite loop.

The case is, if the file loses all its extents, we won't have a hole
to fill, causing repair function doing nothing. Since the
I_ERR_DISCOUNT doesn't disappear, fsck will do an infinite loop.

For such case, just puch hole to fill the whole range to fix it.

Reported-by: Robert Munteanu <robert.munteanu@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c