• Josef Bacik's avatar
    Btrfs: igrab inode in writepage · 84d075f3
    Josef Bacik authored
    commit be7bd730 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: default avatarJosef Bacik <jbacik@fb.com>
    Reviewed-by: default avatarLiu Bo <bo.li.liu@oracle.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
    84d075f3
inode.c 232 KB