]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Btrfs: hold a ref on the inode during writepages
authorJosef Bacik <jbacik@fusionio.com>
Wed, 27 Jun 2012 21:18:41 +0000 (17:18 -0400)
committerChris Mason <chris.mason@fusionio.com>
Mon, 2 Jul 2012 19:39:18 +0000 (15:39 -0400)
commit7fd1a3f73f3743b4ffd520effe288a70b0ec47c9
tree176c81896d74f9662d6ebc91b902804921551db7
parentbdb7d303b33c1648514c9f9461d7513a4c05ce48
Btrfs: hold a ref on the inode during writepages

We can race with unlink and not actually be able to do our igrab in
btrfs_add_ordered_extent.  This will result in all sorts of problems.
Instead of doing the complicated work to try and handle returning an error
properly from btrfs_add_ordered_extent, just hold a ref to the inode during
writepages.  If we cannot grab a ref we know we're freeing this inode anyway
and can just drop the dirty pages on the floor, because screw them we're
going to invalidate them anyway.  Thanks,

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