]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Btrfs: igrab inode in writepage
authorJosef Bacik <jbacik@fb.com>
Thu, 22 Oct 2015 19:05:09 +0000 (15:05 -0400)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 13 Apr 2016 21:14:20 +0000 (17:14 -0400)
commitbb055e837f904fdc80d4d82819b0a9aaf35dce4a
treec8c5d23c7bada2ca22991d67e8018c18d3bf72ec
parentc0109d289de5a48e54a2d070981a629fc241f112
Btrfs: igrab inode in writepage

[ Upstream commit be7bd730841e69fe8f70120098596f648cd1f3ff ]

We hit this panic on a few of our boxes this week where we have an
ordered_extent with an NULL inode.  We do an igrab() of the inode in writepages,
but weren't doing it in writepage which can be called directly from the VM on
dirty pages.  If the inode has been unlinked then we could have I_FREEING set
which means igrab() would return NULL and we get this panic.  Fix this by trying
to igrab in btrfs_writepage, and if it returns NULL then just redirty the page
and return AOP_WRITEPAGE_ACTIVATE; so the VM knows it wasn't successful.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
fs/btrfs/inode.c