]> 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)
committerJiri Slaby <jslaby@suse.cz>
Thu, 3 Mar 2016 11:46:00 +0000 (12:46 +0100)
commit84d075f30de97089689b0775e122b21b3d3821e9
tree2afae11f98195bab9d80be562c0652c5f2a0b635
parent9ec709846fe9fe45a5d128a7e00f2aaa4e597a7f
Btrfs: igrab inode in writepage

commit be7bd730841e69fe8f70120098596f648cd1f3ff upstream.

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: Jiri Slaby <jslaby@suse.cz>
fs/btrfs/inode.c