Skip to content

Commit 8f3ab6e

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
nfs: Remove calls to folio_set_error
Common code doesn't test the error flag, so we don't need to set it in nfs. We can use folio_end_read() to combine the setting (or not) of the uptodate flag and clearing the lock flag. Cc: Trond Myklebust <[email protected]> Cc: Anna Schumaker <[email protected]> Cc: [email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent d15b00b commit 8f3ab6e

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

fs/nfs/read.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ static void nfs_readpage_release(struct nfs_page *req, int error)
122122
{
123123
struct folio *folio = nfs_page_to_folio(req);
124124

125-
if (nfs_error_is_fatal_on_server(error) && error != -ETIMEDOUT)
126-
folio_set_error(folio);
127125
if (nfs_page_group_sync_on_bit(req, PG_UNLOCKPAGE))
128126
if (nfs_netfs_folio_unlock(folio))
129127
folio_unlock(folio);

fs/nfs/symlink.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,8 @@ static int nfs_symlink_filler(struct file *file, struct folio *folio)
3232
int error;
3333

3434
error = NFS_PROTO(inode)->readlink(inode, &folio->page, 0, PAGE_SIZE);
35-
if (error < 0)
36-
goto error;
37-
folio_mark_uptodate(folio);
38-
folio_unlock(folio);
39-
return 0;
40-
41-
error:
42-
folio_set_error(folio);
43-
folio_unlock(folio);
44-
return -EIO;
35+
folio_end_read(folio, error == 0);
36+
return error;
4537
}
4638

4739
static const char *nfs_get_link(struct dentry *dentry,

fs/nfs/write.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ static void nfs_mapping_set_error(struct folio *folio, int error)
311311
{
312312
struct address_space *mapping = folio_file_mapping(folio);
313313

314-
folio_set_error(folio);
315314
filemap_set_wb_err(mapping, error);
316315
if (mapping->host)
317316
errseq_set(&mapping->host->i_sb->s_wb_err,

0 commit comments

Comments
 (0)