]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: igrab inode in writepage
authorJosef Bacik <jbacik@fb.com>
Thu, 22 Oct 2015 19:05:09 +0000 (15:05 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:51 +0000 (15:45 -0700)
commit33455813642800b3ea3298e774d1dd340cc6c678
treef774a1aada22530b145daa01a22e650ff25400a7
parent3a9f55894835de67b54145673eba99f6bd861492
Btrfs: igrab inode in writepage

Orabug: 23331024

[ 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>
(cherry picked from commit bb055e837f904fdc80d4d82819b0a9aaf35dce4a)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
fs/btrfs/inode.c