]> rtime.felk.cvut.cz Git - linux-imx.git/commit
Btrfs: btrfs_drop_extent_cache should never fail
authorJosef Bacik <jbacik@fusionio.com>
Fri, 31 Aug 2012 00:06:49 +0000 (20:06 -0400)
committerChris Mason <chris.mason@fusionio.com>
Mon, 1 Oct 2012 19:19:09 +0000 (15:19 -0400)
commit7014cdb49305eda0767d2ae6136f8c191ea8fd81
treec13ca983bdb7ffdabf2b4bd3bade52ab431904a5
parentac14aed66558d686b1f95dac1f07ecfe11d8c30e
Btrfs: btrfs_drop_extent_cache should never fail

I noticed this when I was doing the fsync stuff, we allocate split extents if we
drop an extent range that is in the middle of an existing extent.  This BUG()'s
if we fail to allocate memory, but the fact is this is just a cache, we will
just regenerate the cache if we need it, the important part is that we free the
range we are given.  This can be done without allocations, so if we fail to
allocate splits just skip the splitting stage and free our em and look for more
extents to drop.  This also makes btrfs_drop_extent_cache a void since nobody
was checking the return value anyway.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/ctree.h
fs/btrfs/file.c