]> git.baikalelectronics.ru Git - kernel.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)
commitc3e80fc621536e5e2f85c762abc75b286b6ff529
treec13ca983bdb7ffdabf2b4bd3bade52ab431904a5
parent597a19907eb97cb3380316745744820090ce22bf
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