diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2012-11-01 07:34:54 (GMT) |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2012-12-12 22:15:22 (GMT) |
commit | bbe1426764e5dfaa57e7b12cc954acdb3fb7f94b (patch) | |
tree | c6f5fea584e15ccbfa56308fdac998ef4ffacd52 /fs/btrfs | |
parent | 315a9850da2b89c83971b26fe54a60f22bdd91ad (diff) | |
download | linux-fsl-qoriq-bbe1426764e5dfaa57e7b12cc954acdb3fb7f94b.tar.xz |
Btrfs: fix unprotected extent map operation when logging file extents
We forget to protect the modified_extents list, fix it.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/tree-log.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index bcf0e48..d1947af 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3526,8 +3526,10 @@ next_slot: struct extent_map_tree *tree = &BTRFS_I(inode)->extent_tree; struct extent_map *em, *n; + write_lock(&tree->lock); list_for_each_entry_safe(em, n, &tree->modified_extents, list) list_del_init(&em->list); + write_unlock(&tree->lock); } if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) { |