aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-01-06 12:03:36 -0500
committerJan Kara <jack@suse.cz>2010-01-11 07:06:41 -0500
commit05b5d898235401c489c68e1f3bc5706a29ad5713 (patch)
tree2f8efc6ff1152ed53d297843891b6232a3e14eb1 /fs
parent3c8ad49b015eb115fbd6982f56d530f53cf57f84 (diff)
quota: Fix dquot_transfer for filesystems different from ext4
Commit fd8fbfc1 modified the way we find amount of reserved space belonging to an inode. The amount of reserved space is checked from dquot_transfer and thus inode_reserved_space gets called even for filesystems that don't provide get_reserved_space callback which results in a BUG. Fix the problem by checking get_reserved_space callback and return 0 if the filesystem does not provide it. CC: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/quota/dquot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index dea86abdf2e7..3fc62b097bed 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1377,6 +1377,9 @@ static void inode_sub_rsv_space(struct inode *inode, qsize_t number)
1377static qsize_t inode_get_rsv_space(struct inode *inode) 1377static qsize_t inode_get_rsv_space(struct inode *inode)
1378{ 1378{
1379 qsize_t ret; 1379 qsize_t ret;
1380
1381 if (!inode->i_sb->dq_op->get_reserved_space)
1382 return 0;
1380 spin_lock(&inode->i_lock); 1383 spin_lock(&inode->i_lock);
1381 ret = *inode_reserved_space(inode); 1384 ret = *inode_reserved_space(inode);
1382 spin_unlock(&inode->i_lock); 1385 spin_unlock(&inode->i_lock);