Skip to content

Commit 361d94a

Browse files
committed
reiserfs: Protect reiserfs_quota_write() with write lock
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. CC: stable@vger.kernel.org # >= 3.0 Signed-off-by: Jan Kara <jack@suse.cz>
1 parent b9e06ef commit 361d94a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎fs/reiserfs/super.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,9 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
23382338
tocopy = sb->s_blocksize - offset < towrite ?
23392339
sb->s_blocksize - offset : towrite;
23402340
tmp_bh.b_state = 0;
2341+
reiserfs_write_lock(sb);
23412342
err = reiserfs_get_block(inode, blk, &tmp_bh, GET_BLOCK_CREATE);
2343+
reiserfs_write_unlock(sb);
23422344
if (err)
23432345
goto out;
23442346
if (offset || tocopy != sb->s_blocksize)
@@ -2354,10 +2356,12 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
23542356
flush_dcache_page(bh->b_page);
23552357
set_buffer_uptodate(bh);
23562358
unlock_buffer(bh);
2359+
reiserfs_write_lock(sb);
23572360
reiserfs_prepare_for_journal(sb, bh, 1);
23582361
journal_mark_dirty(current->journal_info, sb, bh);
23592362
if (!journal_quota)
23602363
reiserfs_add_ordered_list(inode, bh);
2364+
reiserfs_write_unlock(sb);
23612365
brelse(bh);
23622366
offset = 0;
23632367
towrite -= tocopy;

0 commit comments

Comments
 (0)