diff options
author | Jeff Mahoney <jeffm@suse.com> | 2013-02-27 14:43:09 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2013-03-11 17:05:56 -0400 |
commit | 68ac8bfb6aa4ce1a146b5a291f03fc2dd6d17cf2 (patch) | |
tree | eabebb028d5b7023bf57c72d5936891a01a0e3d8 /fs/quota | |
parent | f6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff) |
quota: add missing use of dq_data_lock in __dquot_initialize
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.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/quota')
-rw-r--r-- | fs/quota/dquot.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 05ae3c97f7a5..3e64169ef527 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -1439,8 +1439,11 @@ static void __dquot_initialize(struct inode *inode, int type) | |||
1439 | * did a write before quota was turned on | 1439 | * did a write before quota was turned on |
1440 | */ | 1440 | */ |
1441 | rsv = inode_get_rsv_space(inode); | 1441 | rsv = inode_get_rsv_space(inode); |
1442 | if (unlikely(rsv)) | 1442 | if (unlikely(rsv)) { |
1443 | spin_lock(&dq_data_lock); | ||
1443 | dquot_resv_space(inode->i_dquot[cnt], rsv); | 1444 | dquot_resv_space(inode->i_dquot[cnt], rsv); |
1445 | spin_unlock(&dq_data_lock); | ||
1446 | } | ||
1444 | } | 1447 | } |
1445 | } | 1448 | } |
1446 | out_err: | 1449 | out_err: |