Skip to content

Commit 2811150

Browse files
jankaragregkh
authored andcommitted
reiserfs: Protect reiserfs_quota_write() with write lock
commit 361d94a 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>
1 parent 94bdc25 commit 2811150

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
@@ -2343,7 +2343,9 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
23432343
tocopy = sb->s_blocksize - offset < towrite ?
23442344
sb->s_blocksize - offset : towrite;
23452345
tmp_bh.b_state = 0;
2346+
reiserfs_write_lock(sb);
23462347
err = reiserfs_get_block(inode, blk, &tmp_bh, GET_BLOCK_CREATE);
2348+
reiserfs_write_unlock(sb);
23472349
if (err)
23482350
goto out;
23492351
if (offset || tocopy != sb->s_blocksize)
@@ -2359,10 +2361,12 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
23592361
flush_dcache_page(bh->b_page);
23602362
set_buffer_uptodate(bh);
23612363
unlock_buffer(bh);
2364+
reiserfs_write_lock(sb);
23622365
reiserfs_prepare_for_journal(sb, bh, 1);
23632366
journal_mark_dirty(current->journal_info, sb, bh);
23642367
if (!journal_quota)
23652368
reiserfs_add_ordered_list(inode, bh);
2369+
reiserfs_write_unlock(sb);
23662370
brelse(bh);
23672371
offset = 0;
23682372
towrite -= tocopy;

0 commit comments

Comments
 (0)