public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: Dmitry Monakhov <rjevskiy@gmail.com>
Cc: Greg KH <gregkh@suse.de>, Thomas Voegtle <tv@lio96.de>,
	Jan Kara <jack@suse.cz>, "Theodore Ts'o" <tytso@mit.edu>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	torvalds@linux-foundation.org, stable@kernel.org
Subject: [PATCH] quota: fix reserved space management for ordinary fs
Date: Fri, 08 Jan 2010 03:53:54 +0300	[thread overview]
Message-ID: <87wrztpgbh.fsf_-_@openvz.org> (raw)
In-Reply-To: <c18d6aa21001071603hbe4935clf78984fc837e4bd@mail.gmail.com> (Dmitry Monakhov's message of "Fri, 8 Jan 2010 03:03:30 +0300")


In fact inode_get_rsv_space() function is special in comparison
with inode_{add,sub,claim}_rsv_space() functions, because
it may return correct result even for fs without reserved space
support(correct val == 0). Add trivial check for that case.
The patch fix regression(BUG at fs/quota/dquot.c:1350) introduced
in following commit: fd8fbfc1709822bd94247c5b2ab15a5f5041e103

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/quota/dquot.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index dea86ab..d9f06cf 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1377,6 +1377,8 @@ 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);
-- 
1.6.3.3




  reply	other threads:[~2010-01-08  0:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06 23:45 Linux 2.6.31.10 Greg KH
2010-01-06 23:45 ` Greg KH
2010-01-07 14:27 ` Thomas Voegtle
2010-01-07 18:04   ` Greg KH
2010-01-07 19:36     ` Thomas Voegtle
2010-01-07 19:41       ` Greg KH
2010-01-07 20:33         ` Thomas Voegtle
2010-01-07 20:42           ` Thomas Voegtle
2010-01-07 22:02             ` Greg KH
2010-01-08  0:03               ` Dmitry Monakhov
2010-01-08  0:53                 ` Dmitry Monakhov [this message]
2010-01-08 11:03                   ` [PATCH] quota: fix reserved space management for ordinary fs Thomas Voegtle
2010-01-08 12:24                     ` Teck Choon Giam
2010-01-08 12:41                   ` Jan Kara
2010-01-08 15:52                     ` Greg KH
2010-01-12 12:23                       ` Jan Kara
2010-01-12 14:24                         ` Greg KH
2010-01-08 12:39                 ` Linux 2.6.31.10 Jan Kara
2010-01-13 21:15               ` Ozan Çağlayan
2010-01-13 21:17                 ` Ozan Çağlayan
2010-01-13 21:45                   ` Greg KH
2010-01-07 18:12   ` Teck Choon Giam

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=87wrztpgbh.fsf_-_@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@suse.de \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjevskiy@gmail.com \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tv@lio96.de \
    --cc=tytso@mit.edu \
    /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