]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: fix xattr block allocation/release with bigalloc
authorLukas Czerner <lczerner@redhat.com>
Mon, 18 Feb 2013 17:12:07 +0000 (12:12 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 18 Feb 2013 17:12:07 +0000 (12:12 -0500)
commite75941777dcbe370c994d9823e0151ef0361b86e
tree3245999ddac50172fd26fad96dd89f6bb1d1aabd
parent5e6f175f50f07e4dea13a7b1599b2a7372cfead6
ext4: fix xattr block allocation/release with bigalloc

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: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
fs/ext4/xattr.c