]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
quota: Fix dquot_transfer for filesystems different from ext4
authorJan Kara <jack@suse.cz>
Wed, 6 Jan 2010 17:03:36 +0000 (18:03 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 Jan 2010 18:28:49 +0000 (10:28 -0800)
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>
fs/quota/dquot.c

index 5c5f08bf526f0aa6be272b21132e2a2132882484..86034fe03059c583d1f1022cc7e41d49efc8098a 100644 (file)
@@ -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);