• Jan Kara's avatar
    ext2: Fix BUG_ON in evict() on inode deletion · c288d296
    Jan Kara authored
    Commit 8e3dffc6 introduced a regression where deleting inode with
    large extended attributes leads to triggering
      BUG_ON(inode->i_state != (I_FREEING | I_CLEAR))
    in fs/inode.c:evict(). That happens because freeing of xattr block
    dirtied the inode and it happened after clear_inode() has been called.
    
    Fix the issue by moving removal of xattr block into ext2_evict_inode()
    before clear_inode() call close to a place where data blocks are
    truncated. That is also more logical place and removes surprising
    requirement that ext2_free_blocks() mustn't dirty the inode.
    Reported-by: default avatarTyler Hicks <tyhicks@canonical.com>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    c288d296
ialloc.c 18.3 KB