All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: unlisted-recipients:; (no To-header on input)
Cc: dhowells@redhat.com, Trond Myklebust <trondmy@hammerspace.com>,
	Anna Schumaker <anna.schumaker@netapp.com>,
	Steve French <sfrench@samba.org>,
	Dominique Martinet <asmadeus@codewreck.org>,
	Shyam Prasad N <nspmangalore@gmail.com>,
	linux-cifs@vger.kernel.org, linux-cachefs@redhat.com,
	Jeff Layton <jlayton@redhat.com>,
	Matthew Wilcox <willy@infradead.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org,
	ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 07/10] cifs: (untested) Move to using the alternate fallback fscache I/O API
Date: Fri, 29 Oct 2021 15:02:36 +0100	[thread overview]
Message-ID: <1876665.1635516156@warthog.procyon.org.uk> (raw)
In-Reply-To: <163363944839.1980952.3311507543724895463.stgit@warthog.procyon.org.uk>

David Howells <dhowells@redhat.com> wrote:

> Move cifs/smb to using the alternate fallback fscache I/O API instead of
> the old upstream I/O API as that is about to be deleted.  The alternate API
> will also be deleted at some point in the future as it's dangerous (as is
> the old API) and can lead to data corruption if the backing filesystem can
> insert/remove bridging blocks of zeros into its extent list[1].
> 
> The alternate API reads and writes pages synchronously, with the intention
> of allowing removal of the operation management framework and thence the
> object management framework from fscache.
> 
> The preferred change would be to use the netfs lib, but the new I/O API can
> be used directly.  It's just that as the cache now needs to track data for
> itself, caching blocks may exceed page size...
> 
> Changes
> =======
> ver #2:
>   - Changed "deprecated" to "fallback" in the new function names[2].

I've managed to test this now.  There was a bug in it, fixed by the following
incremental change:

--- a/fs/cifs/fscache.h
+++ b/fs/cifs/fscache.h
@@ -75,7 +75,7 @@ static inline int cifs_readpage_from_fscache(struct inode *inode,
 static inline void cifs_readpage_to_fscache(struct inode *inode,
 					    struct page *page)
 {
-	if (PageFsCache(page))
+	if (CIFS_I(inode)->fscache)
 		__cifs_readpage_to_fscache(inode, page);
 }
 

It shouldn't be using PageFsCache() here.  That's only used to indicate that
an async DIO is in progress on the page, but since we're using the synchronous
fallback API, that should not happen.  Also, it's no longer used to indicate
that a page is being cached and trigger writeback that way.

David


      parent reply	other threads:[~2021-10-29 14:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 20:42 [PATCH v3 00/10] fscache: Replace and remove old I/O API David Howells
2021-10-07 20:43 ` [PATCH v3 01/10] fscache: Generalise the ->begin_read_operation method David Howells
2021-10-07 20:43 ` [PATCH v3 02/10] fscache: Fix fscache_cookie_enabled() to handle NULL cookie David Howells
2021-10-07 20:43 ` [PATCH v3 03/10] cachefiles: Always indicate we should fill a post-EOF page with zeros David Howells
2021-10-07 20:43 ` [PATCH v3 04/10] fscache: Implement a fallback I/O interface to replace the old API David Howells
2021-10-07 20:43 ` [PATCH v3 05/10] nfs: Move to using the alternate fallback fscache I/O API David Howells
2021-10-07 20:43 ` [PATCH v3 06/10] 9p: Convert to using the netfs helper lib to do reads and caching David Howells
2021-10-07 20:44 ` [PATCH v3 07/10] cifs: (untested) Move to using the alternate fallback fscache I/O API David Howells
2021-10-07 20:44 ` [PATCH v3 08/10] fscache: Remove the old " David Howells
2021-10-07 20:44 ` [PATCH v3 09/10] fscache: Remove stats that are no longer used David Howells
2021-10-07 20:44 ` [PATCH v3 10/10] fscache: Update the documentation to reflect I/O API changes David Howells
2021-10-29 14:02 ` David Howells [this message]

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=1876665.1635516156@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=anna.schumaker@netapp.com \
    --cc=asmadeus@codewreck.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=jlayton@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=nspmangalore@gmail.com \
    --cc=sfrench@samba.org \
    --cc=trondmy@hammerspace.com \
    --cc=v9fs-developer@lists.sourceforge.net \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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.