summaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-05-06 20:25:03 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2023-05-06 20:25:03 +0200
commit706ce3caea1cc1dab8c7fd6e7d1389b46ad1570e (patch)
treeba7d065f00d18c0f98c88d5d8aee2120b0020337 /fs/afs
parentnfs: fix mis-merged __filemap_get_folio() error check (diff)
parentafs: fix the afs_dir_get_folio return value (diff)
downloadlinux-706ce3caea1cc1dab8c7fd6e7d1389b46ad1570e.tar.xz
linux-706ce3caea1cc1dab8c7fd6e7d1389b46ad1570e.zip
Merge tag 'mm-hotfixes-stable-2023-05-06-10-45' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull hotfixes from Andrew Morton: "Five hotfixes. Three are cc:stable, two pertain to merge window changes" * tag 'mm-hotfixes-stable-2023-05-06-10-45' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: afs: fix the afs_dir_get_folio return value nilfs2: do not write dirty data after degenerating to read-only mm: do not reclaim private data from pinned page nilfs2: fix infinite loop in nilfs_mdt_get_block() mm/mmap/vma_merge: always check invariants
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/dir_edit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/afs/dir_edit.c b/fs/afs/dir_edit.c
index f0eddccbdd95..e2fa577b66fe 100644
--- a/fs/afs/dir_edit.c
+++ b/fs/afs/dir_edit.c
@@ -115,11 +115,12 @@ static struct folio *afs_dir_get_folio(struct afs_vnode *vnode, pgoff_t index)
folio = __filemap_get_folio(mapping, index,
FGP_LOCK | FGP_ACCESSED | FGP_CREAT,
mapping->gfp_mask);
- if (IS_ERR(folio))
+ if (IS_ERR(folio)) {
clear_bit(AFS_VNODE_DIR_VALID, &vnode->flags);
- else if (folio && !folio_test_private(folio))
+ return NULL;
+ }
+ if (!folio_test_private(folio))
folio_attach_private(folio, (void *)1);
-
return folio;
}