Skip to content
  • Josef Bacik's avatar
    Btrfs: hold a ref on the inode during writepages · 7fd1a3f7
    Josef Bacik authored
    
    
    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: default avatarJosef Bacik <jbacik@fusionio.com>
    7fd1a3f7