On Fri, 23 Sep 2022 17:14:38 -0700 (PDT) Hugh Dickins <hughd@xxxxxxxxxx> wrote: > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -2060,7 +2060,7 @@ static vm_fault_t shmem_fault(struct vm_fault *vmf) > struct vm_area_struct *vma = vmf->vma; > struct inode *inode = file_inode(vma->vm_file); > gfp_t gfp = mapping_gfp_mask(inode->i_mapping); > - struct folio *folio; > + struct folio *folio = NULL; > int err; > vm_fault_t ret = VM_FAULT_LOCKED; > > @@ -2127,7 +2127,8 @@ static vm_fault_t shmem_fault(struct vm_fault *vmf) > gfp, vma, vmf, &ret); > if (err) > return vmf_error(err); > - vmf->page = folio_file_page(folio, vmf->pgoff); > + if (folio) > + vmf->page = folio_file_page(folio, vmf->pgoff); > return ret; > } I grabbed this as a fix against shmem-convert-shmem_fault-to-use-shmem_get_folio_gfp.patch. Hopefully someone can send along something more formal when ready.