Skip to content

Commit 3ec8a83

Browse files
davidhildenbrandClaudio Imbrenda
authored andcommitted
s390/uv: Don't return 0 from make_hva_secure() if the operation was not successful
If s390_wiggle_split_folio() returns 0 because splitting a large folio succeeded, we will return 0 from make_hva_secure() even though a retry is required. Return -EAGAIN in that case. Otherwise, we'll return 0 from gmap_make_secure(), and consequently from unpack_one(). In kvm_s390_pv_unpack(), we assume that unpacking succeeded and skip unpacking this page. Later on, we run into issues and fail booting the VM. So far, this issue was only observed with follow-up patches where we split large pagecache XFS folios. Maybe it can also be triggered with shmem? We'll cleanup s390_wiggle_split_folio() a bit next, to also return 0 if no split was required. Fixes: d8dfda5 ("KVM: s390: pv: fix race when making a page secure") Cc: [email protected] Signed-off-by: David Hildenbrand <[email protected]> Link: https://lore.kernel.org/r/[email protected] Message-ID: <[email protected]> Reviewed-by: Claudio Imbrenda <[email protected]> Signed-off-by: Claudio Imbrenda <[email protected]>
1 parent 8ffd015 commit 3ec8a83

File tree

1 file changed

+4
-1
lines changed
  • arch/s390/kernel

1 file changed

+4
-1
lines changed

arch/s390/kernel/uv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,11 @@ int make_hva_secure(struct mm_struct *mm, unsigned long hva, struct uv_cb_header
393393
folio_walk_end(&fw, vma);
394394
mmap_read_unlock(mm);
395395

396-
if (rc == -E2BIG || rc == -EBUSY)
396+
if (rc == -E2BIG || rc == -EBUSY) {
397397
rc = s390_wiggle_split_folio(mm, folio, rc == -E2BIG);
398+
if (!rc)
399+
rc = -EAGAIN;
400+
}
398401
folio_put(folio);
399402

400403
return rc;

0 commit comments

Comments
 (0)