• Lukas Czerner's avatar
    ext4: fix xattr block allocation/release with bigalloc · 1231b3a1
    Lukas Czerner authored
    Currently when new xattr block is created or released we we would call
    dquot_free_block() or dquot_alloc_block() respectively, among the else
    decrementing or incrementing the number of blocks assigned to the
    inode by one block.
    
    This however does not work for bigalloc file system because we always
    allocate/free the whole cluster so we have to count with that in
    dquot_free_block() and dquot_alloc_block() as well.
    
    Use the clusters-to-blocks conversion EXT4_C2B() when passing number of
    blocks to the dquot_alloc/free functions to fix the problem.
    
    The problem has been revealed by xfstests #117 (and possibly others).
    Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
    Cc: stable@vger.kernel.org
    1231b3a1
xattr.c 44.4 KB