Skip to content

Fix locking for btrfs direct writes

Goldwyn Rodrigues linux-btrfs linux-fsdevel oe-kbuild-all 1 version NAK

Status from this message: NACK.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 3 repliesNAK

Patches in v2

#Subject and filesSizeRepliesApplied
1/2iomap: Separate out generic_write_sync() from iomap_dio_complete()fs/iomap/direct-io.c include/linux/iomap.h+14 -41 reply
2/2btrfs: Make btrfs_direct_write atomic with respect to inode_lockfs/btrfs/file.c+40 -292 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/2] Fix locking for btrfs direct writes

From: Goldwyn Rodrigues <[email protected]>

BTRFS direct write takes the inode lock for performing the direct write. In case of a failure or an incomplete write, it falls back to buffered writes. Before initiating the buffered write, it releases the inode lock and reacquires it for buffered write. This may lead to corruption if another process attempts to write around the same offset between the unlock and the relock. The patches change the flow so that the lock is taken only once before the write and released only after the I/O is complete.

Goldwyn Rodrigues (2):
iomap: Separate out generic_write_sync() from iomap_dio_complete()
btrfs: Make btrfs_direct_write atomic with respect to inode_lock

 fs/btrfs/file.c       | 69 +++++++++++++++++++++++++------------------
 fs/iomap/direct-io.c  | 16 ++++++++--
 include/linux/iomap.h |  2 +-
 3 files changed, 54 insertions(+), 33 deletions(-)
Signature · 1 line
2.29.2