netfs, cachefiles: Miscellaneous fixes
Status from this message: Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest10 patches 2 repliesApplied
- v310 patches 0 repliesSuperseded
- v29 patches 0 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 3 patches | 0 replies | Superseded |
Patches in v4 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | netfs: Fix uninitialized return value in netfs_unbuffered_write()fs/ | +1 | 0 replies | |
| 2/10 | netfs: Fix unbuffered/DIO write partial transfer error returnfs/ | +5 | 0 replies | |
| 3/10 | netfs: Fix error vs transferred passed to ->ki_complete()fs/ | +1 | 0 replies | |
| 4/10 | netfs: Fix i_size update for partial transferfs/ | +1 | 0 replies | |
| 5/10 | netfs: Fix subreq ref leakfs/ | +7 | 0 replies | |
| 6/10 | netfs: break unbuffered write when netfs_alloc_subrequest() failsfs/ fs/ | +7 | 0 replies | |
| 7/10 | netfs: Fix readahead synchronisation issues by loading all folios upfrontfs/ fs/ fs/ +6 more | +154 | 0 replies | |
| 8/10 | netfs: Mark folios with COPY_TO_CACHE whilst issuing subreqsfs/ fs/ fs/ +4 more | +121 | 0 replies | |
| 9/10 | netfs: Fix read progress reportingfs/ fs/ fs/ +4 more | +89 | 0 replies | |
| 10/10 | cachefiles: Fix potential UAF/KASAN warningfs/ include/ | +25 | 0 replies |
Reviews trailers per patch
None of the 10 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | [email protected] | Paulo Alcantara |
|---|---|---|
| Series | A-b | |
| 1/10 | ||
| 2/10 | ||
| 3/10 | ||
| 4/10 | ||
| 5/10 | ||
| 6/10 | T-b | |
| 7/10 | ||
| 8/10 | ||
| 9/10 | ||
| 10/10 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 00/10] netfs, cachefiles: Miscellaneous fixes
Hi Christian,
Here are some miscellaneous fixes for netfslib and one for cachefiles, if you could pick them up?
The first six are all in unbuffered/DIO write:
(1) Fix an uninitialised return value from netfs_unbuffered_write().
(2) Fix the normal error return, preferring partial transfer size over request error over immediate error (e.g. EINTR).
(3) Fix the async error return, preferring partial transfer size over error.
(4) Fix the update of i_size on partial transfer ending in an error.
(5) Fix a subrequest leak in an error path.
(6) Fix the code to handle subrequest allocation failure.
Then there's:
(7) Fix synchronisation issues with using a progressive rolling buffer for readahead by fetching everything into it upfront so that the issues don't arise. Dropping the refs so acquired is deferred until after I/O is begun.
(8) Change the marking of folios to be copied to the cache to be done whilst subreqs are being issued rather than at the time they're collected. Whilst this is not strictly a fix, it means that the collector thread doesn't need to try and keep track of that, which means that delayed progress reporting will not be a problem in patch (9).
(9) Fix read progress reporting to avoid 64-bit tearing on a 32-bit machine. This has been modified from the previous submission as part of a different series to take account of a sashiko reported issue[1].
(10) Fix a potential UAF/KASAN warning reported by sashiko[1] in cachefiles in which the coherency data buffer is cast to a __be64* and dereferenced in a tracepoint - even though it might not be at least that large (or aligned).
The patches can also be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=netfs-fixes
Thanks,
David
Changes
=======
ver #4)
- Fixed a number of issues reported by Sashiko[4]:
- Fixed netfs_mark_copy_to_cache() to decrement len to end the loop.
- Fixed netfs_read_to_pagecache() to init offset.
- Fixed netfs_unlock_abandoned_read_pages() to clean up copy mark.
- Fixed netfs_unlock_read_folio() to clean up copy mark.
- Fixed copy-to-cache cancellation handling in netfs_unlock_read_folio().
- Removed duplicate var init in netfs_read_unlock_folios().
- Fixed setting of rreq->progress_at to ULONG_MAX (set to rreq->len instead).
ver #3)
- Fixed a number of issues reported by Sashiko[3]:
- Fixed netfs_unbuffered_write() to return -ENOMEM to async writes too.
- Added a patch to preload the entire readahead folio collection up front to avoid producer-consumer synchronisation issues.
- Added a patch to premark buffered read folios with whether or not they're going to require caching so that the read-progress fix works correctly.
ver #2)
- Imported a patch to add subreq alloc failure handling in unbuffered/DIO write.
- Fixed a number of issues reported by Sashiko[2]:
- Added four patches to fix bugs in unbuffered/DIO write.
- Added a patch to fix readahead rolling buffer issues.
- Fixed the cachefiles xattr stuff to use max() not min() when allocating.
- Fixed the cachefiles trace comment with regard to alignment.
- Fixed netfs_read_set_unlock_at() to use folioq_count(), not
folio_nr_slots().
[1] https://sashiko.dev/#/patchset/20260810144746.574036-1-dhowells%40redhat.com
[2] https://sashiko.dev/#/patchset/20260824120224.504575-1-dhowells%40redhat.com
[3] https://sashiko.dev/#/patchset/20260825132045.1000787-1-dhowells%40redhat.com
[4] https://sashiko.dev/#/patchset/20260827093828.1956211-1-dhowells%40redhat.com
David Howells (8):
netfs: Fix unbuffered/DIO write partial transfer error return
netfs: Fix error vs transferred passed to ->ki_complete()
netfs: Fix i_size update for partial transfer
netfs: Fix subreq ref leak
netfs: Fix readahead synchronisation issues by loading all folios
upfront
netfs: Mark folios with COPY_TO_CACHE whilst issuing subreqs
netfs: Fix read progress reporting
cachefiles: Fix potential UAF/KASAN warning
Edward Adam Davis (1):
netfs: break unbuffered write when netfs_alloc_subrequest() fails
Karl Mehltretter (1):
netfs: Fix uninitialized return value in netfs_unbuffered_write()
fs/cachefiles/xattr.c | 16 +-- fs/netfs/buffered_read.c | 164 ++++++++++++++++++++++-------- fs/netfs/direct_write.c | 31 ++++-- fs/netfs/internal.h | 3 + fs/netfs/misc.c | 19 ++++ fs/netfs/objects.c | 32 +++--- fs/netfs/read_collect.c | 128 ++++++++++++++++------- fs/netfs/read_pgpriv2.c | 15 +-- fs/netfs/read_retry.c | 13 ++- fs/netfs/read_single.c | 2 + fs/netfs/rolling_buffer.c | 81 +++++++++------ fs/netfs/write_issue.c | 2 + include/linux/netfs.h | 5 +- include/linux/rolling_buffer.h | 6 +- include/trace/events/cachefiles.h | 19 +++- include/trace/events/netfs.h | 30 +++++- 16 files changed, 411 insertions(+), 155 deletions(-)