All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Christian Brauner <christian@brauner.io>
Cc: David Howells <dhowells@redhat.com>,
	Paulo Alcantara <pc@manguebit.org>,
	Christoph Hellwig <hch@infradead.org>,
	netfs@lists.linux.dev, linux-afs@lists.infradead.org,
	linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 00/15] netfs: Miscellaneous fixes
Date: Thu, 25 Jun 2026 15:06:18 +0100	[thread overview]
Message-ID: <20260625140640.3116900-1-dhowells@redhat.com> (raw)

Hi Christian,

Here are some miscellaneous fixes for netfslib.  I separated them from my
netfs-next branch.  Various Sashiko review comments[1][2][3] are addressed:

 (1) Fix the decision whether to disallow write-streaming due to fscache
     use.

 (2) Fix netfs_create_write_req() to better handle async cache object
     creation.

 (3) Fix a double fput in cachefiles_create_tmpfile().

 (4) Fix alteration of S_KERNEL_FILE inode flag without holding inode lock.

 (5) Fix a potential mathematical underflow in
     iov_iter_extract_xarray_pages() and make it return 0 and free the
     array if no pages could be extracted.

 (6) Fix a missing alloc failure check in iov_iter_extract_bvec_pages().

 (7) Fix iov_iter_extract_user_pages() so that it doesn't leak the pages
     array if it returns an error or 0 (inasmuch as the leak is really in
     the callers).

 (8) Remove an unused variable in kunit_iov_iter.c.

 (9) Fix extract_xarray_to_sg() to calculate folio offset correctly.

(10) Fix a kdoc comment.

(11) Replace the netfs_inode::wb_lock mutex with a bit lock so that the
     lock can be passed to the collector so that multiple asynchronous
     writebacks won't interfere with each other.

(12) Fix writeback error handling to go through writeback_iter() so that it
     can clean up its state.

(13) Fix ENOMEM handling in writeback to clean up the current folio if we
     can't allocate a rolling buffer segment.

(14) Fix unbuffered/DIO write retry for filesystems that don't have a
     ->prepare_write() method.

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

[1] https://sashiko.dev/#/patchset/20260608145432.681865-1-dhowells%40redhat.com
[2] https://sashiko.dev/#/patchset/20260616100821.2062304-1-dhowells%40redhat.com
[3] https://sashiko.dev/#/patchset/20260619140646.2633762-1-dhowells%40redhat.com
[4] https://sashiko.dev/#/patchset/20260624115737.2964520-1-dhowells%40redhat.com

Changes
=======
ver #3)
- Addressed more Sashiko comments[4]:
  - Applied the disallow write-streaming fix to netfs_write_begin() also.
  - Improve the synchronisation with async cache object creation in
    netfs_create_write_req().
  - Fix netfs_writepages() so it doesn't both redirty and kill folios (and
    double unlock) if it can't create the request.
  - Move the cleanup of the folio on ENOMEM from netfs_write_folio() to
    netfs_writepages() as writethrough shouldn't do this.
  - Alter the unbuffered/DIO write retry fix so that it sets the
    IN_PROGRESS flag.  Also made it clear the MADE_PROGRESS flag and update
    wreq->transferred.

ver #2)
- Addressed various Sashiko comments[3]:
  - Changed some kfree() to kvfree().
  - Added some writeback error handling patches.
- Fixed DIO write retry.

ver #1)
- Added a fix for S_KERNEL_FILE in cachefiles_bury_object().
- Fixed how iov_iter_extract_*_pages() deals with *pages when returning 0
  or error.
- Fixed the replacement of wb_lock with bit lock:
  - Only release the bit lock for writeback, writethrough and write-single,
    not for PG_private_2-based I/O, which doesn't take the lock.
  - In netfs_writeback_single(), need to redirty the inode if can't get the
    lock.

David Howells (15):
  netfs: Fix decision whether to disallow write-streaming due to fscache
    use
  netfs: Fix netfs_create_write_req() to handle async cache object
    creation
  cachefiles: Fix double fput
  cachefiles: Fix file burial to take lock when unsetting S_KERNEL_FILE
  iov_iter: Fix potential underflow in iov_iter_extract_xarray_pages()
  iov_iter: Fix missing alloc fail check in
    iov_iter_extract_bvec_pages()
  iov_iter: Fix a memory leak in iov_iter_extract_user_pages()
  iov_iter: Remove unused variable in kunit_iov_iter.c
  scatterlist: Fix offset in folio calc in extract_xarray_to_sg()
  netfs: Fix kdoc warning
  netfs: Replace wb_lock with a bit lock for asynchronicity
  netfs: Fix writethrough to use collection offload
  netfs: Fix writeback error handling
  netfs: Fix folio state after ENOMEM whilst under writeback iteration
  netfs: Fix DIO write retry for filesystems without a ->prepare_write()

 fs/afs/symlink.c           |  4 +-
 fs/cachefiles/namei.c      |  3 +-
 fs/netfs/buffered_read.c   |  2 +-
 fs/netfs/buffered_write.c  |  2 +-
 fs/netfs/direct_write.c    | 18 +++-----
 fs/netfs/internal.h        | 12 +++++
 fs/netfs/locking.c         | 95 ++++++++++++++++++++++++++++++++++++++
 fs/netfs/write_collect.c   | 10 ++++
 fs/netfs/write_issue.c     | 55 ++++++++++------------
 include/linux/netfs.h      | 13 ++++--
 lib/iov_iter.c             | 20 +++++++-
 lib/scatterlist.c          |  1 +
 lib/tests/kunit_iov_iter.c |  5 +-
 13 files changed, 185 insertions(+), 55 deletions(-)


             reply	other threads:[~2026-06-25 14:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 14:06 David Howells [this message]
2026-06-25 14:06 ` [PATCH v3 01/15] netfs: Fix decision whether to disallow write-streaming due to fscache use David Howells
2026-06-25 14:06 ` [PATCH v3 02/15] netfs: Fix netfs_create_write_req() to handle async cache object creation David Howells
2026-06-25 14:06 ` [PATCH v3 03/15] cachefiles: Fix double fput David Howells
2026-06-25 14:06 ` [PATCH v3 04/15] cachefiles: Fix file burial to take lock when unsetting S_KERNEL_FILE David Howells
2026-06-26  3:17   ` NeilBrown
2026-06-25 14:06 ` [PATCH v3 05/15] iov_iter: Fix potential underflow in iov_iter_extract_xarray_pages() David Howells
2026-06-26  5:49   ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 06/15] iov_iter: Fix missing alloc fail check in iov_iter_extract_bvec_pages() David Howells
2026-06-26  5:50   ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 07/15] iov_iter: Fix a memory leak in iov_iter_extract_user_pages() David Howells
2026-06-26  5:50   ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 08/15] iov_iter: Remove unused variable in kunit_iov_iter.c David Howells
2026-06-26  5:51   ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 09/15] scatterlist: Fix offset in folio calc in extract_xarray_to_sg() David Howells
2026-06-26  5:51   ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 10/15] netfs: Fix kdoc warning David Howells
2026-06-25 14:06 ` [PATCH v3 11/15] netfs: Replace wb_lock with a bit lock for asynchronicity David Howells
2026-06-25 14:06 ` [PATCH v3 12/15] netfs: Fix writethrough to use collection offload David Howells
2026-06-25 14:06 ` [PATCH v3 13/15] netfs: Fix writeback error handling David Howells
2026-06-25 14:06 ` [PATCH v3 14/15] netfs: Fix folio state after ENOMEM whilst under writeback iteration David Howells
2026-06-25 14:06 ` [PATCH v3 15/15] netfs: Fix DIO write retry for filesystems without a ->prepare_write() David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260625140640.3116900-1-dhowells@redhat.com \
    --to=dhowells@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=christian@brauner.io \
    --cc=hch@infradead.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfs@lists.linux.dev \
    --cc=pc@manguebit.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.