diff options
author | Jan Kara <jack@suse.cz> | 2011-05-30 13:29:20 +0200 |
---|---|---|
committer | Jonas ABERG <jonas.aberg@stericsson.com> | 2011-10-28 11:13:38 +0200 |
commit | 54ce69c7b1fbed11a0b4c8f9cd177f8d59c1dbc9 (patch) | |
tree | 41fd8f8cd8ed339d2dd4d9d336109bb5c692497b /fs/qnx4 | |
parent | e8829c0dcfa670dcf8c8f3d0772b471656f1604d (diff) |
ext3: Fix oops in ext3_try_to_allocate_with_rsv()
commit ad95c5e9bc8b5885f94dce720137cac8fa8da4c9 upstream.
Block allocation is called from two places: ext3_get_blocks_handle() and
ext3_xattr_block_set(). These two callers are not necessarily synchronized
because xattr code holds only xattr_sem and i_mutex, and
ext3_get_blocks_handle() may hold only truncate_mutex when called from
writepage() path. Block reservation code does not expect two concurrent
allocations to happen to the same inode and thus assertions can be triggered
or reservation structure corruption can occur.
Fix the problem by taking truncate_mutex in xattr code to serialize
allocations.
CC: Sage Weil <sage@newdream.net>
Reported-by: Fyodor Ustinov <ufm@ufm.su>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Change-Id: I9fd6a0095f1372c2e56d07134f598f8bfa9f3567
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/35650
Tested-by: Per VAHLNE <per.xx.vahlne@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'fs/qnx4')
0 files changed, 0 insertions, 0 deletions