From: dmonakhov@openvz.org
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] quota: add per-inode reservaton space sanity checks.
Date: Tue, 30 Mar 2010 20:20:00 +0400 [thread overview]
Message-ID: <87ljd9dbnz.fsf@openvz.org> (raw)
In-Reply-To: <20100330153933.GC3424@quack.suse.cz> (Jan Kara's message of "Tue, 30 Mar 2010 17:39:34 +0200")
[-- Attachment #1: Type: text/plain, Size: 819 bytes --]
Jan Kara <jack@suse.cz> writes:
> On Tue 30-03-10 18:25:28, Dmitry Monakhov wrote:
>> We already has per-dquot sanity checks, but with per-inode checks
>> quota leakage investigation becomes much easier.
>>
>> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
>> ---
>> fs/quota/dquot.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
>> index e0b870f..4db57b7 100644
>> --- a/fs/quota/dquot.c
>> +++ b/fs/quota/dquot.c
>> @@ -1428,6 +1428,8 @@ EXPORT_SYMBOL(inode_add_rsv_space);
>> void inode_claim_rsv_space(struct inode *inode, qsize_t number)
>> {
>> spin_lock(&inode->i_lock);
>> + if (*inode_reserved_space(inode) < number)
>> + WARN_ON_ONCE(1);
> Maybe just: WARN_ON_ONCE(*inode_reserved_space(inode) < number)
As you wish.
[-- Attachment #2: 0001-quota-add-per-inode-reservaton-space-sanity-checks.patch --]
[-- Type: text/plain, Size: 1222 bytes --]
>From 610afddec4ae4e33d2481284d2c3463439284833 Mon Sep 17 00:00:00 2001
From: Dmitry Monakhov <dmonakhov@openvz.org>
Date: Tue, 30 Mar 2010 20:08:12 +0400
Subject: [PATCH] quota: add per-inode reservaton space sanity checks.
We already has per-dquot sanity checks, but with per-inode checks
quota leakage investigation becomes much easier.
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 e0b870f..f1c50e4 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1428,6 +1428,7 @@ EXPORT_SYMBOL(inode_add_rsv_space);
void inode_claim_rsv_space(struct inode *inode, qsize_t number)
{
spin_lock(&inode->i_lock);
+ WARN_ON_ONCE(*inode_reserved_space(inode) < number);
*inode_reserved_space(inode) -= number;
__inode_add_bytes(inode, number);
spin_unlock(&inode->i_lock);
@@ -1437,6 +1438,7 @@ EXPORT_SYMBOL(inode_claim_rsv_space);
void inode_sub_rsv_space(struct inode *inode, qsize_t number)
{
spin_lock(&inode->i_lock);
+ WARN_ON_ONCE(*inode_reserved_space(inode) < number);
*inode_reserved_space(inode) -= number;
spin_unlock(&inode->i_lock);
}
--
1.6.6.1
next prev parent reply other threads:[~2010-03-30 16:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-30 14:25 [PATCH] quota: add per-inode reservaton space sanity checks Dmitry Monakhov
2010-03-30 15:39 ` Jan Kara
2010-03-30 16:20 ` dmonakhov [this message]
2010-03-31 5:20 ` Dmitry Monakhov
2010-03-31 6:55 ` Dave Chinner
2010-03-31 7:17 ` dmonakhov
2010-03-31 23:23 ` Dave Chinner
2010-03-31 14:29 ` Jan Kara
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=87ljd9dbnz.fsf@openvz.org \
--to=dmonakhov@openvz.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.