Skip to contentSkip to conversation

linux-next: build failure after merge of the kvm tree

PATCH Stephen Rothwell 1 participant 2 messages Nov 20, 2023 – Dec 11, 2023

Subsystems (3)
lore
Share & tools
lore

Stephen Rothwell

author Applied
#0 lore raw

Hi all,

After merging the kvm tree, today's linux-next build (x86_64 allmodconfig) failed like this:

arch/x86/kvm/../../../virt/kvm/guest_memfd.c:306:10: error: 'const struct address_space_operations' has no member named 'error_remove_page'; did you mean 'error_remove_folio'?

  306 |         .error_remove_page = kvm_gmem_error_page,
      |          ^~~~~~~~~~~~~~~~~
      |          error_remove_folio
arch/x86/kvm/../../../virt/kvm/guest_memfd.c:306:30: error: initialization of 'int (*)(struct folio *)' from incompatible pointer type 'int (*)(struct address_space *, struct page *)' [-Werror=incompatible-pointer-types]
  306 |         .error_remove_page = kvm_gmem_error_page,
      |                              ^~~~~~~~~~~~~~~~~~~

arch/x86/kvm/../../../virt/kvm/guest_memfd.c:306:30: note: (near initialization for 'kvm_gmem_aops.launder_folio')

Caused by commit

640be5bc564f ("fs: convert error_remove_page to error_remove_folio")

from the mm tree intercting with commit

a7800aa80ea4 ("KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory")

I have applied the following supplied merge fix patch (thanks Andrew).

From: Andrew Morton <[email protected]>
Date: Fri, 17 Nov 2023 09:28:33 -0800
Subject: [PATCH] fs: Convert error_remove_page to error_remove_folio

Quoted 22 lines · On Fri, 17 Nov 2023 16:14:47 +0000 "Matthew Wilcox (Oracle)"…

There were already assertions that we were not passing a tail page to error_remove_page(), so make the compiler enforce that by converting everything to pass and use a folio.

---
 Documentation/filesystems/locking.rst |  4 ++--
 Documentation/filesystems/vfs.rst     |  6 +++---
 block/fops.c                          |  2 +-
 fs/afs/write.c                        |  2 +-
 fs/bcachefs/fs.c                      |  2 +-
 fs/btrfs/inode.c                      |  2 +-
 fs/ceph/addr.c                        |  4 ++--
 fs/ext2/inode.c                       |  2 +-
 fs/ext4/inode.c                       |  6 +++---
 fs/f2fs/compress.c                    |  2 +-
 fs/f2fs/inode.c                       |  2 +-
 fs/gfs2/aops.c                        |  4 ++--
 fs/hugetlbfs/inode.c                  |  6 +++---
 fs/nfs/file.c                         |  2 +-
 fs/ntfs/aops.c                        |  6 +++---
 fs/ocfs2/aops.c                       |  2 +-
Quoted 8 lines
 fs/xfs/xfs_aops.c                     |  2 +-
 fs/zonefs/file.c                      |  2 +-
 include/linux/fs.h                    |  2 +-
 include/linux/mm.h                    |  3 ++-
 mm/memory-failure.c                   | 10 +++++-----
 mm/shmem.c                            |  6 +++---
 mm/truncate.c                         |  9 ++++-----
 virt/kvm/guest_memfd.c                |  9 +++++----

virt/kvm/guest_memfd.c exists only in the KVM tree (and hence linux-next). So I assume Stephen will use the change from this patch when doing his resolution.

This:

---
 virt/kvm/guest_memfd.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
virt/kvm/guest_memfd.c +5 -4
index b99272396119..451435123fe7 100644
@@ -267,7 +267,8 @@ static int kvm_gmem_migrate_folio(struct address_space *mapping,
 	return -EINVAL;
 }
 
-static int kvm_gmem_error_page(struct address_space *mapping, struct page *page)
+static int kvm_gmem_error_folio(struct address_space *mapping,
+		struct folio *folio)
 {
 	struct list_head *gmem_list = &mapping->private_list;
 	struct kvm_gmem *gmem;
@@ -275,8 +276,8 @@ static int kvm_gmem_error_page(struct address_space *mapping, struct page *page)
 
 	filemap_invalidate_lock_shared(mapping);
 
-	start = page->index;
-	end = start + thp_nr_pages(page);
+	start = folio->index;
+	end = start + folio_nr_pages(folio);
 
 	list_for_each_entry(gmem, gmem_list, entry)
 		kvm_gmem_invalidate_begin(gmem, start, end);
@@ -303,7 +304,7 @@ static const struct address_space_operations kvm_gmem_aops = {
 #ifdef CONFIG_MIGRATION
 	.migrate_folio	= kvm_gmem_migrate_folio,
 #endif
-	.error_remove_page = kvm_gmem_error_page,
+	.error_remove_folio = kvm_gmem_error_folio,
 };
 
 static int kvm_gmem_getattr(struct mnt_idmap *idmap, const struct path *path,
Signature · 5 lines
2.40.1

-- 
Cheers,
Stephen Rothwell
#1 lore raw

Hi all,

Quoted 60 lines · On Mon, 20 Nov 2023 15:22:27 +1100 Stephen Rothwell <[email protected]>…

After merging the kvm tree, today's linux-next build (x86_64 allmodconfig) failed like this:

arch/x86/kvm/../../../virt/kvm/guest_memfd.c:306:10: error: 'const struct address_space_operations' has no member named 'error_remove_page'; did you mean 'error_remove_folio'?

  306 |         .error_remove_page = kvm_gmem_error_page,
      |          ^~~~~~~~~~~~~~~~~
      |          error_remove_folio
arch/x86/kvm/../../../virt/kvm/guest_memfd.c:306:30: error: initialization of 'int (*)(struct folio *)' from incompatible pointer type 'int (*)(struct address_space *, struct page *)' [-Werror=incompatible-pointer-types]
  306 |         .error_remove_page = kvm_gmem_error_page,
      |                              ^~~~~~~~~~~~~~~~~~~

arch/x86/kvm/../../../virt/kvm/guest_memfd.c:306:30: note: (near initialization for 'kvm_gmem_aops.launder_folio')

Caused by commit

640be5bc564f ("fs: convert error_remove_page to error_remove_folio")

from the mm tree intercting with commit

a7800aa80ea4 ("KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory")

I have applied the following supplied merge fix patch (thanks Andrew).

From: Andrew Morton <[email protected]>
Date: Fri, 17 Nov 2023 09:28:33 -0800
Subject: [PATCH] fs: Convert error_remove_page to error_remove_folio

Quoted 22 lines · On Fri, 17 Nov 2023 16:14:47 +0000 "Matthew Wilcox (Oracle)"…

There were already assertions that we were not passing a tail page to error_remove_page(), so make the compiler enforce that by converting everything to pass and use a folio.

---
 Documentation/filesystems/locking.rst |  4 ++--
 Documentation/filesystems/vfs.rst     |  6 +++---
 block/fops.c                          |  2 +-
 fs/afs/write.c                        |  2 +-
 fs/bcachefs/fs.c                      |  2 +-
 fs/btrfs/inode.c                      |  2 +-
 fs/ceph/addr.c                        |  4 ++--
 fs/ext2/inode.c                       |  2 +-
 fs/ext4/inode.c                       |  6 +++---
 fs/f2fs/compress.c                    |  2 +-
 fs/f2fs/inode.c                       |  2 +-
 fs/gfs2/aops.c                        |  4 ++--
 fs/hugetlbfs/inode.c                  |  6 +++---
 fs/nfs/file.c                         |  2 +-
 fs/ntfs/aops.c                        |  6 +++---
 fs/ocfs2/aops.c                       |  2 +-
Quoted 8 lines
 fs/xfs/xfs_aops.c                     |  2 +-
 fs/zonefs/file.c                      |  2 +-
 include/linux/fs.h                    |  2 +-
 include/linux/mm.h                    |  3 ++-
 mm/memory-failure.c                   | 10 +++++-----
 mm/shmem.c                            |  6 +++---
 mm/truncate.c                         |  9 ++++-----
 virt/kvm/guest_memfd.c                |  9 +++++----  
Quoted 6 lines

virt/kvm/guest_memfd.c exists only in the KVM tree (and hence linux-next). So I assume Stephen will use the change from this patch when doing his resolution.

This:
---

Now this:

 virt/kvm/guest_memfd.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
virt/kvm/guest_memfd.c +5 -4
index c2e2371720a9..c23ce219e21c 100644
@@ -267,7 +267,8 @@ static int kvm_gmem_migrate_folio(struct address_space *mapping,
 	return -EINVAL;
 }
 
-static int kvm_gmem_error_page(struct address_space *mapping, struct page *page)
+static int kvm_gmem_error_folio(struct address_space *mapping,
+		struct folio *folio)
 {
 	struct list_head *gmem_list = &mapping->private_list;
 	struct kvm_gmem *gmem;
@@ -275,8 +276,8 @@ static int kvm_gmem_error_page(struct address_space *mapping, struct page *page)
 
 	filemap_invalidate_lock_shared(mapping);
 
-	start = page->index;
-	end = start + thp_nr_pages(page);
+	start = folio->index;
+	end = start + folio_nr_pages(folio);
 
 	list_for_each_entry(gmem, gmem_list, entry)
 		kvm_gmem_invalidate_begin(gmem, start, end);
@@ -301,7 +302,7 @@ static int kvm_gmem_error_page(struct address_space *mapping, struct page *page)
 static const struct address_space_operations kvm_gmem_aops = {
 	.dirty_folio = noop_dirty_folio,
 	.migrate_folio	= kvm_gmem_migrate_folio,
-	.error_remove_page = kvm_gmem_error_page,
+	.error_remove_folio = kvm_gmem_error_folio,
 };
 
 static int kvm_gmem_getattr(struct mnt_idmap *idmap, const struct path *path,
Signature · 2 lines
Cheers,
Stephen Rothwell