Message ID | 20201009143104.22673-4-willy@infradead.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Allow readpage to return a locked page | expand |
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index cce9ace651a2..506ca0ba2ec7 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -65,7 +65,7 @@ static int v9fs_fid_readpage(void *data, struct page *page) SetPageUptodate(page); v9fs_readpage_to_fscache(inode, page); - retval = 0; + return AOP_UPDATED_PAGE; done: unlock_page(page); @@ -280,6 +280,10 @@ static int v9fs_write_begin(struct file *filp, struct address_space *mapping, goto out; retval = v9fs_fid_readpage(v9inode->writeback_fid, page); + if (retval == AOP_UPDATED_PAGE) { + retval = 0; + goto out; + } put_page(page); if (!retval) goto start;