mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Dmitry Monakhov <dmonakhov@openvz.org>, Jan Kara <jack@suse.cz>
Subject: [6/9] quota: Fix dquot_transfer for filesystems different from ext4
Date: Thu, 14 Jan 2010 14:46:42 -0800	[thread overview]
Message-ID: <20100114224807.086778669@mini.kroah.org> (raw)
In-Reply-To: <20100114224848.GA532@kroah.com>

2.6.31-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jan Kara <jack@suse.cz>

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 |    3 +++
 1 file changed, 3 insertions(+)

--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1425,6 +1425,9 @@ static void inode_sub_rsv_space(struct i
 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);



  parent reply	other threads:[~2010-01-14 22:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-14 22:48 [0/9] 2.6.31.12-stable review Greg KH
2010-01-14 22:46 ` [1/9] fasync: split fasync_helper() into separate add/remove functions Greg KH
2010-01-14 22:46 ` [2/9] hwmon: (adt7462) Fix pin 28 monitoring Greg KH
2010-01-14 22:46 ` [3/9] kernel/signal.c: fix kernel information leak with print-fatal-signals=1 Greg KH
2010-01-14 22:46 ` [4/9] netfilter: ebtables: enforce CAP_NET_ADMIN Greg KH
2010-01-14 22:46 ` [5/9] netfilter: nf_ct_ftp: fix out of bounds read in update_nl_seq() Greg KH
2010-01-14 22:46 ` Greg KH [this message]
2010-01-14 22:46 ` [7/9] fix braindamage in audit_tree.c untag_chunk() Greg KH
2010-01-14 22:46 ` [8/9] fix more leaks in audit_tree.c tag_chunk() Greg KH
2010-01-14 22:46 ` [9/9] ipv6: skb_dst() can be NULL in ipv6_hop_jumbo() Greg KH
2010-01-16 19:03 ` [0/9] 2.6.31.12-stable review Ozan Çağlayan
2010-01-16 19:07   ` H. Peter Anvin
2010-01-17  3:23   ` [stable] " Greg KH
2010-01-17 16:07     ` Ozan Çağlayan
2010-01-17 16:18       ` Greg KH
2010-01-17 16:30         ` Ozan Çağlayan
2010-01-17 18:02         ` Henrique de Moraes Holschuh
2010-01-18  5:42           ` Greg KH
2010-01-18  7:49         ` [Stable-review] " Nikola Ciprich
2010-01-19  4:07           ` [stable] [Stable-review] " Greg KH
2010-01-19 23:02     ` [stable] " Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100114224807.086778669@mini.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dmonakhov@openvz.org \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome