Blob Blame History Raw
From: NeilBrown <neilb@suse.com>
Subject: KABI FIX FOR NFSv4: Fix free of uninitialized nfs4_label on referral lookup.
Patch-mainline: never, kabi
References: git-fixes

'struct nfs4_fs_locations' is entirely local to the nfsv4 module, so we
can change it with impunity.

The pnfs modules are able to find a pointer to it, but they must only
ever treat it as a void* if they touch it at all.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 include/linux/nfs_xdr.h |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1219,7 +1219,16 @@ struct nfs4_fs_location {
 
 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
 struct nfs4_fs_locations {
+#ifndef __GENKSYMS__
 	struct nfs_fattr *fattr;
+#else
+	/* This structure is entirely private to nfsv4 module.
+	 * pnfs handler can see a pointer to it, but never access it.
+	 * They must (and do) only treat it like a void*.
+	 * So we can change the structure with impunity.
+	 */
+	struct nfs_fattr fattr;
+#endif
 	const struct nfs_server *server;
 	struct nfs4_pathname fs_path;
 	int nlocations;