aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-01-06 18:03:36 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-01-18 10:19:43 -0800
commit38c4d8d579c4e752e03edcdd2e96a49787d71a3a (patch)
tree1d9f7fc08bd857f7f8a4863c4444537687c3cb39 /fs
parenta61dcb0c6ac2aac895a17b37dcbe57b249a3d826 (diff)
quota: Fix dquot_transfer for filesystems different from ext4
commit 05b5d898235401c489c68e1f3bc5706a29ad5713 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 c4d07a803bd..25349873997 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1425,6 +1425,9 @@ static void inode_sub_rsv_space(struct inode *inode, qsize_t number)
static qsize_t inode_get_rsv_space(struct inode *inode)
{
qsize_t ret;
+
+ if (!inode->i_sb->dq_op->get_reserved_space)
+ return 0;
spin_lock(&inode->i_lock);
ret = *inode_reserved_space(inode);
spin_unlock(&inode->i_lock);