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:19:43 +0000 (10:19 -0800)
commit38c4d8d579c4e752e03edcdd2e96a49787d71a3a
tree1d9f7fc08bd857f7f8a4863c4444537687c3cb39
parenta61dcb0c6ac2aac895a17b37dcbe57b249a3d826
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>
fs/quota/dquot.c