aboutsummaryrefslogtreecommitdiff
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2012-11-13 18:25:38 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-26 11:38:02 -0800
commita23d6310a6fbe4a2a1d3a40251a6d5b8ae39ec22 (patch)
tree00cc6961ca7a0dce1ede5ebc148892d600b7de55 /fs/reiserfs
parent8c7dcc4819098b0166e4559fbfd6fa661fbb5755 (diff)
reiserfs: Protect reiserfs_quota_write() with write lock
commit 361d94a338a3fd0cee6a4ea32bbc427ba228e628 upstream. Calls into reiserfs journalling code and reiserfs_get_block() need to be protected with write lock. We remove write lock around calls to high level quota code in the next patch so these paths would suddently become unprotected. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/super.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 72a06365e9d..8169be93ac0 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -2303,7 +2303,9 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
tocopy = sb->s_blocksize - offset < towrite ?
sb->s_blocksize - offset : towrite;
tmp_bh.b_state = 0;
+ reiserfs_write_lock(sb);
err = reiserfs_get_block(inode, blk, &tmp_bh, GET_BLOCK_CREATE);
+ reiserfs_write_unlock(sb);
if (err)
goto out;
if (offset || tocopy != sb->s_blocksize)
@@ -2319,10 +2321,12 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
flush_dcache_page(bh->b_page);
set_buffer_uptodate(bh);
unlock_buffer(bh);
+ reiserfs_write_lock(sb);
reiserfs_prepare_for_journal(sb, bh, 1);
journal_mark_dirty(current->journal_info, sb, bh);
if (!journal_quota)
reiserfs_add_ordered_list(inode, bh);
+ reiserfs_write_unlock(sb);
brelse(bh);
offset = 0;
towrite -= tocopy;