lkml.org 
[lkml]   [2020]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/13] cifs: Tell the VFS that readpage was synchronous
Date
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
\
 
 \ /
  Last update: 2020-09-17 17:16    [W:0.119 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site