mbox series

[0/6] netfs, cachefiles: More additional patches

Message ID 20240109112029.1572463-1-dhowells@redhat.com
Headers show
Series netfs, cachefiles: More additional patches | expand

Message

David Howells Jan. 9, 2024, 11:20 a.m. UTC
Hi Christian, Jeff, Gao,

Here are some additional patches for my netfs-lib tree:

 (1) Mark netfs_unbuffered_write_iter_locked() static as it's only used in
     the file in which it is defined.

 (2) Display a counter for DIO writes in /proc/fs/netfs/stats.

 (3) Fix the interaction between write-streaming (dirty data in
     non-uptodate pages) and the culling of a cache file trying to write
     that to the cache.

 (4) Fix the loop that unmarks folios after writing to the cache.  The
     xarray iterator only advances the index by 1, so if we unmarked a
     multipage folio and that got split before we advance to the next
     folio, we see a repeat of a fragment of the folio.

 (5) Fix a mixup with signed/unsigned offsets when prepping for writing to
     the cache that leads to missing error detection.

 (6) Fix a wrong ifdef hiding a wait.

David

The netfslib postings:
Link: https://lore.kernel.org/r/20231013160423.2218093-1-dhowells@redhat.com/ # v1
Link: https://lore.kernel.org/r/20231117211544.1740466-1-dhowells@redhat.com/ # v2
Link: https://lore.kernel.org/r/20231207212206.1379128-1-dhowells@redhat.com/ # v3
Link: https://lore.kernel.org/r/20231213152350.431591-1-dhowells@redhat.com/ # v4
Link: https://lore.kernel.org/r/20231221132400.1601991-1-dhowells@redhat.com/ # v5
Link: https://lore.kernel.org/r/20240103145935.384404-1-dhowells@redhat.com/ # added patches

David Howells (6):
  netfs: Mark netfs_unbuffered_write_iter_locked() static
  netfs: Count DIO writes
  netfs: Fix interaction between write-streaming and cachefiles culling
  netfs: Fix the loop that unmarks folios after writing to the cache
  cachefiles: Fix signed/unsigned mixup
  netfs: Fix wrong #ifdef hiding wait

 fs/cachefiles/io.c            | 18 +++++++++---------
 fs/netfs/buffered_write.c     | 27 ++++++++++++++++++++++-----
 fs/netfs/direct_write.c       |  5 +++--
 fs/netfs/fscache_stats.c      |  9 ++++++---
 fs/netfs/internal.h           |  8 ++------
 fs/netfs/io.c                 |  2 +-
 fs/netfs/stats.c              | 13 +++++++++----
 include/linux/fscache-cache.h |  3 +++
 include/linux/netfs.h         |  1 +
 9 files changed, 56 insertions(+), 30 deletions(-)

Comments

Marc Dionne Jan. 9, 2024, 5:11 p.m. UTC | #1
On Tue, Jan 9, 2024 at 7:20 AM David Howells <dhowells@redhat.com> wrote:
>
> Hi Christian, Jeff, Gao,
>
> Here are some additional patches for my netfs-lib tree:
>
>  (1) Mark netfs_unbuffered_write_iter_locked() static as it's only used in
>      the file in which it is defined.
>
>  (2) Display a counter for DIO writes in /proc/fs/netfs/stats.
>
>  (3) Fix the interaction between write-streaming (dirty data in
>      non-uptodate pages) and the culling of a cache file trying to write
>      that to the cache.
>
>  (4) Fix the loop that unmarks folios after writing to the cache.  The
>      xarray iterator only advances the index by 1, so if we unmarked a
>      multipage folio and that got split before we advance to the next
>      folio, we see a repeat of a fragment of the folio.
>
>  (5) Fix a mixup with signed/unsigned offsets when prepping for writing to
>      the cache that leads to missing error detection.
>
>  (6) Fix a wrong ifdef hiding a wait.
>
> David
>
> The netfslib postings:
> Link: https://lore.kernel.org/r/20231013160423.2218093-1-dhowells@redhat.com/ # v1
> Link: https://lore.kernel.org/r/20231117211544.1740466-1-dhowells@redhat.com/ # v2
> Link: https://lore.kernel.org/r/20231207212206.1379128-1-dhowells@redhat.com/ # v3
> Link: https://lore.kernel.org/r/20231213152350.431591-1-dhowells@redhat.com/ # v4
> Link: https://lore.kernel.org/r/20231221132400.1601991-1-dhowells@redhat.com/ # v5
> Link: https://lore.kernel.org/r/20240103145935.384404-1-dhowells@redhat.com/ # added patches
>
> David Howells (6):
>   netfs: Mark netfs_unbuffered_write_iter_locked() static
>   netfs: Count DIO writes
>   netfs: Fix interaction between write-streaming and cachefiles culling
>   netfs: Fix the loop that unmarks folios after writing to the cache
>   cachefiles: Fix signed/unsigned mixup
>   netfs: Fix wrong #ifdef hiding wait
>
>  fs/cachefiles/io.c            | 18 +++++++++---------
>  fs/netfs/buffered_write.c     | 27 ++++++++++++++++++++++-----
>  fs/netfs/direct_write.c       |  5 +++--
>  fs/netfs/fscache_stats.c      |  9 ++++++---
>  fs/netfs/internal.h           |  8 ++------
>  fs/netfs/io.c                 |  2 +-
>  fs/netfs/stats.c              | 13 +++++++++----
>  include/linux/fscache-cache.h |  3 +++
>  include/linux/netfs.h         |  1 +
>  9 files changed, 56 insertions(+), 30 deletions(-)
>
> --
> You received this message because you are subscribed to the Google Groups "linux-cachefs@redhat.com" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-cachefs+unsubscribe@redhat.com.

This passes our kafs tests where a few of the issues fixed here had been seen.
I made the framework use 9p and no related issues were seen there either.

Tested-by: Marc Dionne <marc.dionne@auristor.com>

Marc
Jeffrey Layton Jan. 9, 2024, 6:37 p.m. UTC | #2
On Tue, 2024-01-09 at 11:20 +0000, David Howells wrote:
> Hi Christian, Jeff, Gao,
> 
> Here are some additional patches for my netfs-lib tree:
> 
>  (1) Mark netfs_unbuffered_write_iter_locked() static as it's only used in
>      the file in which it is defined.
> 
>  (2) Display a counter for DIO writes in /proc/fs/netfs/stats.
> 
>  (3) Fix the interaction between write-streaming (dirty data in
>      non-uptodate pages) and the culling of a cache file trying to write
>      that to the cache.
> 
>  (4) Fix the loop that unmarks folios after writing to the cache.  The
>      xarray iterator only advances the index by 1, so if we unmarked a
>      multipage folio and that got split before we advance to the next
>      folio, we see a repeat of a fragment of the folio.
> 
>  (5) Fix a mixup with signed/unsigned offsets when prepping for writing to
>      the cache that leads to missing error detection.
> 
>  (6) Fix a wrong ifdef hiding a wait.
> 
> David
> 
> The netfslib postings:
> Link: https://lore.kernel.org/r/20231013160423.2218093-1-dhowells@redhat.com/ # v1
> Link: https://lore.kernel.org/r/20231117211544.1740466-1-dhowells@redhat.com/ # v2
> Link: https://lore.kernel.org/r/20231207212206.1379128-1-dhowells@redhat.com/ # v3
> Link: https://lore.kernel.org/r/20231213152350.431591-1-dhowells@redhat.com/ # v4
> Link: https://lore.kernel.org/r/20231221132400.1601991-1-dhowells@redhat.com/ # v5
> Link: https://lore.kernel.org/r/20240103145935.384404-1-dhowells@redhat.com/ # added patches
> 
> David Howells (6):
>   netfs: Mark netfs_unbuffered_write_iter_locked() static
>   netfs: Count DIO writes
>   netfs: Fix interaction between write-streaming and cachefiles culling
>   netfs: Fix the loop that unmarks folios after writing to the cache
>   cachefiles: Fix signed/unsigned mixup
>   netfs: Fix wrong #ifdef hiding wait
> 
>  fs/cachefiles/io.c            | 18 +++++++++---------
>  fs/netfs/buffered_write.c     | 27 ++++++++++++++++++++++-----
>  fs/netfs/direct_write.c       |  5 +++--
>  fs/netfs/fscache_stats.c      |  9 ++++++---
>  fs/netfs/internal.h           |  8 ++------
>  fs/netfs/io.c                 |  2 +-
>  fs/netfs/stats.c              | 13 +++++++++----
>  include/linux/fscache-cache.h |  3 +++
>  include/linux/netfs.h         |  1 +
>  9 files changed, 56 insertions(+), 30 deletions(-)
> 

These all look fine to me. You can add:

Reviewed-by: Jeff Layton <jlayton@kernel.org>