Add missing locking to reiserfs_quota_read() and reiserfs_quota_write(). Signed-off-by: Jan Kara --- linux/fs/reiserfs/super.c 2005-01-27 12:56:27.000000000 +0100 +++ linux/fs/reiserfs/super.c 2005-01-27 17:41:20.000000000 +0100 @@ -1993,7 +1993,9 @@ static ssize_t reiserfs_quota_read(struc tocopy = sb->s_blocksize - offset < toread ? sb->s_blocksize - offset : toread; tmp_bh.b_state = 0; /* Quota files are without tails so we can safely use this function */ + reiserfs_write_lock(sb); err = reiserfs_get_block(inode, blk, &tmp_bh, 0); + reiserfs_write_unlock(sb); if (err) return err; if (!buffer_mapped(&tmp_bh)) /* A hole? */ @@ -2041,8 +2043,11 @@ static ssize_t reiserfs_quota_write(stru err = -EIO; goto out; } + lock_buffer(bh); memcpy(bh->b_data+offset, data, tocopy); + flush_dcache_page(bh->b_page); set_buffer_uptodate(bh); + unlock_buffer(bh); reiserfs_prepare_for_journal(sb, bh, 1); journal_mark_dirty(current->journal_info, sb, bh); if (!journal_quota)