Skip to content

Commit 994e241

Browse files
committed
nfs: fix mis-merged __filemap_get_folio() error check
Fix another case of an incorrect check for the returned 'folio' value from __filemap_get_folio(). The failure case used to return NULL, but was changed by commit 66dabbb ("mm: return an ERR_PTR from __filemap_get_folio"). But in the meantime, commit ec108d3 ("NFS: Convert readdir page array functions to use a folio") added a new user of that function. And my merge of the two did not fix this up correctly. The ext4 merge had the same issue, but that one had been caught in linux-next and got properly fixed while merging. Fixes: 0127f25 ("Merge tag 'nfs-for-6.4-1' of git://git.linux-nfs.org/projects/anna/linux-nfs") Cc: Anna Schumaker <anna@kernel.org> Cc: Matthew Wilcox <willy@infradead.org> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 38a55db commit 994e241

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static struct folio *nfs_readdir_folio_get_next(struct address_space *mapping,
448448
folio = __filemap_get_folio(mapping, index,
449449
FGP_LOCK|FGP_CREAT|FGP_NOFS|FGP_NOWAIT,
450450
mapping_gfp_mask(mapping));
451-
if (!folio)
451+
if (IS_ERR(folio))
452452
return NULL;
453453
nfs_readdir_folio_init_and_validate(folio, cookie, change_attr);
454454
if (nfs_readdir_folio_last_cookie(folio) != cookie)

0 commit comments

Comments
 (0)