Skip to contentSkip to conversation

NFS: SECINFO_NO_NAME for v4.1 initial mount

PATCH In review Bryan Schumaker 1 participant 1 message Apr 12, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 NFS: SECINFO_NO_NAME for v4.1 initial mount

If mounting through AUTH_UNIX returns -EPERM on NFS v4.1, we place a SECINFO_NO_NAME call to find the authflavor needed in order to perform the mount.

---
 fs/nfs/internal.h       |    3 ++
 fs/nfs/namespace.c      |    2 +-
 fs/nfs/nfs4_fs.h        |    2 +
 fs/nfs/nfs4proc.c       |   58 +++++++++++++++++++++++++++++++++++++++-
 fs/nfs/nfs4xdr.c        |   68 +++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/nfs4.h    |    1 +
 include/linux/nfs_xdr.h |    9 ++++++
 7 files changed, 141 insertions(+), 2 deletions(-)
fs/nfs/internal.h +3 -0
index ce118ce..361a3a3 100644
@@ -266,6 +266,9 @@ extern void nfs_sb_deactive(struct super_block *sb);
 extern char *nfs_path(char **p, struct dentry *dentry,
 		      char *buffer, ssize_t buflen);
 extern struct vfsmount *nfs_d_automount(struct path *path);
+#ifdef CONFIG_NFS_V4
+rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *);
+#endif
 
 /* getroot.c */
 extern struct dentry *nfs_get_root(struct super_block *, struct nfs_fh *,
fs/nfs/namespace.c +1 -1
index 1f063ba..8102391 100644
@@ -119,7 +119,7 @@ Elong:
 }
 
 #ifdef CONFIG_NFS_V4
-static rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *flavors)
+rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *flavors)
 {
 	struct gss_api_mech *mech;
 	struct xdr_netobj oid;
fs/nfs/nfs4_fs.h +2 -0
index e1c261d..0478c6d 100644
@@ -65,6 +65,8 @@ struct nfs4_minor_version_ops {
 			int cache_reply);
 	int	(*validate_stateid)(struct nfs_delegation *,
 			const nfs4_stateid *);
+	int	(*find_root_sec)(struct nfs_server *, struct nfs_fh *, 
+			struct nfs_fsinfo *);
 	const struct nfs4_state_recovery_ops *reboot_recovery_ops;
 	const struct nfs4_state_recovery_ops *nograce_recovery_ops;
 	const struct nfs4_state_maintenance_ops *state_renewal_ops;
fs/nfs/nfs4proc.c +57 -1

84 lines not on this page · raw message

fs/nfs/nfs4xdr.c +68 -0

104 lines not on this page · raw message

include/linux/nfs4.h +1 -0
index 178fafe..7668f25 100644
@@ -562,6 +562,7 @@ enum {
 	NFSPROC4_CLNT_LAYOUTGET,
 	NFSPROC4_CLNT_GETDEVICEINFO,
 	NFSPROC4_CLNT_LAYOUTCOMMIT,
+	NFSPROC4_CLNT_SECINFO_NO_NAME,
 };
 
 /* nfs41 types */
include/linux/nfs_xdr.h +9 -0
index 78b101e..c4a0407 100644
@@ -1060,6 +1060,15 @@ struct nfs41_reclaim_complete_args {
 struct nfs41_reclaim_complete_res {
 	struct nfs4_sequence_res	seq_res;
 };
+
+#define SECINFO_STYLE_CURRENT_FH 0
+#define SECINFO_STYLE_PARENT 1
+struct nfs41_secinfo_no_name_args {
+	int				style;
+	struct nfs4_sequence_args	seq_args;
+};
+
+#define nfs41_secinfo_no_name_res nfs4_secinfo_res
 #endif /* CONFIG_NFS_V4_1 */
 
 struct nfs_page;
Signature · 1 line
1.7.4.4