linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/18] Allow readpage to return a locked page
@ 2020-10-16 16:04 Matthew Wilcox (Oracle)
  2020-10-16 16:04 ` [PATCH v3 08/18] cifs: Tell the VFS that readpage was synchronous Matthew Wilcox (Oracle)
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox (Oracle) @ 2020-10-16 16:04 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Matthew Wilcox (Oracle),
	linux-mm, David Howells, Steve French, linux-cifs, Nicolas Pitre,
	Tyler Hicks, ecryptfs, Theodore Ts'o, Andreas Dilger,
	linux-ext4, Miklos Szeredi, Hans de Goede

I've dropped the conversion of readpage implementations to synchronous
from this patchset.  I realised I'd neglected the requirement for making
the sleep killable, and that turns out to be more convoluted to fix.

So these patches add:
 - An error-path bugfix for cachefiles.
 - The ability for the filesystem to tell the caller of ->readpage
   that the read was successful and the page was not unlocked.  This is
   a performance improvement for some scenarios that I think are rare.
 - Mildly improved error handling for ext4.

v2: https://lore.kernel.org/linux-fsdevel/20201009143104.22673-1-willy@infradead.org/
v1: https://lore.kernel.org/linux-fsdevel/20200917151050.5363-1-willy@infradead.org/
Matthew Wilcox (Oracle) (18):
  cachefiles: Handle readpage error correctly
  swap: Call aops->readahead if appropriate
  fs: Add AOP_UPDATED_PAGE return value
  mm/filemap: Inline wait_on_page_read into its one caller
  9p: Tell the VFS that readpage was synchronous
  afs: Tell the VFS that readpage was synchronous
  ceph: Tell the VFS that readpage was synchronous
  cifs: Tell the VFS that readpage was synchronous
  cramfs: Tell the VFS that readpage was synchronous
  ecryptfs: Tell the VFS that readpage was synchronous
  ext4: Tell the VFS that readpage was synchronous
  ext4: Return error from ext4_readpage
  fuse: Tell the VFS that readpage was synchronous
  hostfs: Tell the VFS that readpage was synchronous
  jffs2: Tell the VFS that readpage was synchronous
  ubifs: Tell the VFS that readpage was synchronous
  udf: Tell the VFS that readpage was synchronous
  vboxsf: Tell the VFS that readpage was synchronous

 Documentation/filesystems/locking.rst |  7 +++---
 Documentation/filesystems/vfs.rst     | 21 +++++++++++------
 fs/9p/vfs_addr.c                      |  6 ++++-
 fs/afs/file.c                         |  3 ++-
 fs/buffer.c                           | 15 +++++++-----
 fs/cachefiles/rdwr.c                  |  9 ++++++++
 fs/ceph/addr.c                        |  9 ++++----
 fs/cifs/file.c                        |  8 +++++--
 fs/cramfs/inode.c                     |  5 ++--
 fs/ecryptfs/mmap.c                    | 11 +++++----
 fs/ext4/inline.c                      |  9 +++++---
 fs/ext4/readpage.c                    | 24 +++++++++++--------
 fs/fuse/file.c                        |  2 ++
 fs/hostfs/hostfs_kern.c               |  2 ++
 fs/jffs2/file.c                       |  6 +++--
 fs/ubifs/file.c                       | 16 ++++++++-----
 fs/udf/file.c                         |  3 +--
 fs/vboxsf/file.c                      |  2 ++
 include/linux/fs.h                    |  5 ++++
 mm/filemap.c                          | 33 +++++++++++++--------------
 mm/page_io.c                          | 27 ++++++++++++++++++++--
 mm/readahead.c                        |  3 ++-
 22 files changed, 151 insertions(+), 75 deletions(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH v3 08/18] cifs: Tell the VFS that readpage was synchronous
  2020-10-16 16:04 [PATCH v3 00/18] Allow readpage to return a locked page Matthew Wilcox (Oracle)
@ 2020-10-16 16:04 ` Matthew Wilcox (Oracle)
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox (Oracle) @ 2020-10-16 16:04 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Matthew Wilcox (Oracle), linux-mm, Steve French, linux-cifs

The cifs readpage implementation was already synchronous, so use
AOP_UPDATED_PAGE to avoid cycling the page lock.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/cifs/file.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index be46fab4c96d..533b151a9143 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -4537,7 +4537,8 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
 	/* send this page to the cache */
 	cifs_readpage_to_fscache(file_inode(file), page);
 
-	rc = 0;
+	kunmap(page);
+	return AOP_UPDATED_PAGE;
 
 io_error:
 	kunmap(page);
@@ -4677,7 +4678,10 @@ static int cifs_write_begin(struct file *file, struct address_space *mapping,
 		 * an error, we don't need to return it. cifs_write_end will
 		 * do a sync write instead since PG_uptodate isn't set.
 		 */
-		cifs_readpage_worker(file, page, &page_start);
+		int err = cifs_readpage_worker(file, page, &page_start);
+
+		if (err == AOP_UPDATED_PAGE)
+			goto out;
 		put_page(page);
 		oncethru = 1;
 		goto start;
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-16 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 16:04 [PATCH v3 00/18] Allow readpage to return a locked page Matthew Wilcox (Oracle)
2020-10-16 16:04 ` [PATCH v3 08/18] cifs: Tell the VFS that readpage was synchronous Matthew Wilcox (Oracle)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).