[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200917151050.5363-6-willy@infradead.org>
Date: Thu, 17 Sep 2020 16:10:42 +0100
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
To: linux-fsdevel@...r.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
linux-mm@...ck.org, v9fs-developer@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, linux-afs@...ts.infradead.org,
ceph-devel@...r.kernel.org, linux-cifs@...r.kernel.org,
ecryptfs@...r.kernel.org, linux-um@...ts.infradead.org,
linux-mtd@...ts.infradead.org, Richard Weinberger <richard@....at>
Subject: [PATCH 05/13] cifs: Tell the VFS that readpage was synchronous
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@...radead.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
Powered by blists - more mailing lists