Skip to content

Commit 2de3d04

Browse files
Trond Myklebustamschuma-ntap
authored andcommitted
NFS: Remove unnecessary check in nfs_read_folio()
All the callers are expected to supply a valid struct file argument, so there is no need for the NULL check. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 256093f commit 2de3d04

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

fs/nfs/read.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,7 @@ int nfs_read_folio(struct file *file, struct folio *folio)
355355
if (NFS_STALE(inode))
356356
goto out_unlock;
357357

358-
if (file == NULL) {
359-
ret = -EBADF;
360-
desc.ctx = nfs_find_open_context(inode, NULL, FMODE_READ);
361-
if (desc.ctx == NULL)
362-
goto out_unlock;
363-
} else
364-
desc.ctx = get_nfs_open_context(nfs_file_open_context(file));
358+
desc.ctx = get_nfs_open_context(nfs_file_open_context(file));
365359

366360
xchg(&desc.ctx->error, 0);
367361
nfs_pageio_init_read(&desc.pgio, inode, false,

0 commit comments

Comments
 (0)