Skip to content

Commit 8325f41

Browse files
josefbacikkdave
authored andcommitted
btrfs: push extent lock down in submit_one_async_extent
We don't need to include the time we spend in the allocator under our extent lock protection, move it after the allocator and make sure we lock the extent in the error case to ensure we're not clearing these bits without the extent lock held. Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent d456c25 commit 8325f41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/btrfs/inode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,6 @@ static void submit_one_async_extent(struct async_chunk *async_chunk,
11791179
goto done;
11801180
}
11811181

1182-
lock_extent(io_tree, start, end, NULL);
11831182
ret = btrfs_reserve_extent(root, async_extent->ram_size,
11841183
async_extent->compressed_size,
11851184
async_extent->compressed_size,
@@ -1195,6 +1194,8 @@ static void submit_one_async_extent(struct async_chunk *async_chunk,
11951194
goto done;
11961195
}
11971196

1197+
lock_extent(io_tree, start, end, NULL);
1198+
11981199
/* Here we're doing allocation and writeback of the compressed pages */
11991200
em = create_io_em(inode, start,
12001201
async_extent->ram_size, /* len */

0 commit comments

Comments
 (0)