From: Jeff Mahoney <jeffm@suse.com>
To: Linux FS Maling List <linux-fsdevel@vger.kernel.org>
Cc: Jan Kara <jack@suse.com>
Subject: [PATCH] quota: add missing use of dq_data_lock in __dquot_initialize
Date: Wed, 27 Feb 2013 14:43:09 -0500 [thread overview]
Message-ID: <512E61CD.5020501@suse.com> (raw)
The bulk of __dquot_initialize runs under the dqptr_sem which
protects the inode->i_dquot pointers. It doesn't protect the
dereferenced contents, though. Those are protected by the
dq_data_lock, which is missing around the dquot_resv_space call.
Cc: Jan Kara <jack@suse.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
--
fs/quota/dquot.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1439,8 +1439,11 @@ static void __dquot_initialize(struct in
* did a write before quota was turned on
*/
rsv = inode_get_rsv_space(inode);
- if (unlikely(rsv))
+ if (unlikely(rsv)) {
+ spin_lock(&dq_data_lock);
dquot_resv_space(inode->i_dquot[cnt], rsv);
+ spin_unlock(&dq_data_lock);
+ }
}
}
out_err:
--
Jeff Mahoney
SUSE Labs
next reply other threads:[~2013-02-27 19:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 19:43 Jeff Mahoney [this message]
2013-03-01 9:35 ` [PATCH] quota: add missing use of dq_data_lock in __dquot_initialize 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=512E61CD.5020501@suse.com \
--to=jeffm@suse.com \
--cc=jack@suse.com \
--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.