]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nfs: Remove calls to folio_set_error
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 30 May 2024 20:21:01 +0000 (21:21 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 31 May 2024 10:31:41 +0000 (12:31 +0200)
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 <trond.myklebust@hammerspace.com>
Cc: Anna Schumaker <anna@kernel.org>
Cc: linux-nfs@vger.kernel.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://lore.kernel.org/r/20240530202110.2653630-10-willy@infradead.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/nfs/read.c
fs/nfs/symlink.c
fs/nfs/write.c

index a142287d86f68ed411dce6f9c410e41948c570b2..cca80b5f54e01a44198ecb163ddc563ebb317709 100644 (file)
@@ -122,8 +122,6 @@ static void nfs_readpage_release(struct nfs_page *req, int error)
 {
        struct folio *folio = nfs_page_to_folio(req);
 
-       if (nfs_error_is_fatal_on_server(error) && error != -ETIMEDOUT)
-               folio_set_error(folio);
        if (nfs_page_group_sync_on_bit(req, PG_UNLOCKPAGE))
                if (nfs_netfs_folio_unlock(folio))
                        folio_unlock(folio);
index 0e27a2e4e68b84c97e96e63491d7905d61eb3430..1c62a5a9f51d40b79551a8ad6a42d3bbb85e3e9e 100644 (file)
@@ -32,16 +32,8 @@ static int nfs_symlink_filler(struct file *file, struct folio *folio)
        int error;
 
        error = NFS_PROTO(inode)->readlink(inode, &folio->page, 0, PAGE_SIZE);
-       if (error < 0)
-               goto error;
-       folio_mark_uptodate(folio);
-       folio_unlock(folio);
-       return 0;
-
-error:
-       folio_set_error(folio);
-       folio_unlock(folio);
-       return -EIO;
+       folio_end_read(folio, error == 0);
+       return error;
 }
 
 static const char *nfs_get_link(struct dentry *dentry,
index 2329cbb0e446b97976de4ba587315957fb921a54..a91463ab87a044f51732f4f15291c86181baac05 100644 (file)
@@ -311,7 +311,6 @@ static void nfs_mapping_set_error(struct folio *folio, int error)
 {
        struct address_space *mapping = folio_file_mapping(folio);
 
-       folio_set_error(folio);
        filemap_set_wb_err(mapping, error);
        if (mapping->host)
                errseq_set(&mapping->host->i_sb->s_wb_err,