Skip to content

preserve prepare_write errno across write reissue

Iván Ezequiel Rodriguez linux-cifs linux-fsdevel lkml netfs oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyIn review
  2. v12 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- KUnit: allocate netfs_io_request / netfs_io_subrequest with kunit_kzalloc() to fix ARM allyesconfig -Wframe-larger-than= (kernel test robot).

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2netfs: preserve prepare_write errno on reissuefs/netfs/write_issue.c+3 -11 reply
2/2netfs: add KUnit coverage for reissue prepare_write errnofs/netfs/.kunitconfig fs/netfs/Kconfig fs/netfs/Makefile +2 more+98 -00 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH netfs v2 0/2] preserve prepare_write errno across write reissue

cifs (and others) may fail in prepare_write() with netfs_prepare_write_failed() before write_retry calls netfs_reissue_write(). Since 82e8885bd763, reissue clears subreq->error to 0 for a clean I/O retry, so a FAILED subreq is terminated with 0. The collector then does mapping_set_error(0), which is a no-op — writeback errno is lost (not an infinite retry).

Patch 1 skips that clear when FAILED is already set. Patch 2 adds a KUnit stub test: FAIL unpatched, PASS patched.

./tools/testing/kunit/kunit.py run --kunitconfig=fs/netfs/.kunitconfig \
netfs_reissue_write*

Changes in v2:
- KUnit: allocate netfs_io_request / netfs_io_subrequest with kunit_kzalloc() to fix ARM allyesconfig -Wframe-larger-than= (kernel test robot).

No prior lore report found for this interaction; surfaces on top of Shyam's NEED_RETRY change.

Cc David Howells <[email protected]>
Cc Paulo Alcantara <[email protected]>
Cc Shyam Prasad N <[email protected]>
Cc Steve French <[email protected]>

Iván Ezequiel Rodriguez (2):
netfs: preserve prepare_write errno on reissue
netfs: add KUnit coverage for reissue prepare_write errno

 fs/netfs/.kunitconfig          |  3 ++
 fs/netfs/Kconfig               |  9 ++++
 fs/netfs/Makefile              |  2 +
 fs/netfs/write_collect.c       |  4 ++
 fs/netfs/write_issue.c         |  4 +-
 fs/netfs/write_reissue_kunit.c | 80 ++++++++++++++++++++++++++++++++++
 6 files changed, 101 insertions(+), 1 deletion(-)
 create mode 100644 fs/netfs/.kunitconfig
 create mode 100644 fs/netfs/write_reissue_kunit.c
Signature · 1 line
2.43.0