Skip to content

Limit scope of extent locks in btrfs_buffered_write()

Goldwyn Rodrigues linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: btrfs_has_ordered_extent() to check for ordered extent in rangefs/btrfs/ordered-data.c fs/btrfs/ordered-data.h+12 -01 reply
2/2btrfs: reduce scope of extent locks during buffered writefs/btrfs/file.c+16 -932 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Limit scope of extent locks in btrfs_buffered_write()

From: Goldwyn Rodrigues <[email protected]>

This is in preparation for using iomap for btrfs. It will help in keeping the extent lock limited to iomap_end() function.

The extent locks are taken for a majority of the write sequence. With Josef patches limiting the extent locks to recording extent changes, we can reduce the scope of locking of extent locks during write to only when recording the extent as delalloc. Restrict the locking to btrfs_dirty_pages(). However, the write needs to make sure that there are no pending ordered extents. So, wait for any pending ordered extents before performing the copying of data from userspace.

As for testing, it did go through a round of xfstests without any crash or failure. However, since this touches a crucial part of write, please make sure this is correct especially in terms of data corruption by overwrites/staleness.

Goldwyn Rodrigues (2):
btrfs: btrfs_has_ordered_extent() to check for ordered extent in range
btrfs: reduce scope of extent locks during buffered write

 fs/btrfs/file.c         | 109 ++++++----------------------------------
 fs/btrfs/ordered-data.c |  11 ++++
 fs/btrfs/ordered-data.h |   1 +
 3 files changed, 28 insertions(+), 93 deletions(-)
Signature · 1 line
2.46.0