@@ -4613,13 +4613,41 @@ nfsd4_encode_rpcsec_gss_info(struct xdr_stream *xdr,
4613
4613
return nfs_ok ;
4614
4614
}
4615
4615
4616
+ static __be32
4617
+ nfsd4_encode_secinfo4 (struct xdr_stream * xdr , rpc_authflavor_t pf ,
4618
+ u32 * supported )
4619
+ {
4620
+ struct rpcsec_gss_info info ;
4621
+ __be32 status ;
4622
+
4623
+ if (rpcauth_get_gssinfo (pf , & info ) == 0 ) {
4624
+ (* supported )++ ;
4625
+
4626
+ /* flavor */
4627
+ status = nfsd4_encode_uint32_t (xdr , RPC_AUTH_GSS );
4628
+ if (status != nfs_ok )
4629
+ return status ;
4630
+ /* flavor_info */
4631
+ status = nfsd4_encode_rpcsec_gss_info (xdr , & info );
4632
+ if (status != nfs_ok )
4633
+ return status ;
4634
+ } else if (pf < RPC_AUTH_MAXFLAVOR ) {
4635
+ (* supported )++ ;
4636
+
4637
+ /* flavor */
4638
+ status = nfsd4_encode_uint32_t (xdr , pf );
4639
+ if (status != nfs_ok )
4640
+ return status ;
4641
+ }
4642
+ return nfs_ok ;
4643
+ }
4644
+
4616
4645
static __be32
4617
4646
nfsd4_do_encode_secinfo (struct xdr_stream * xdr , struct svc_export * exp )
4618
4647
{
4619
4648
u32 i , nflavs , supported ;
4620
4649
struct exp_flavor_info * flavs ;
4621
4650
struct exp_flavor_info def_flavs [2 ];
4622
- static bool report = true;
4623
4651
__be32 * flavorsp ;
4624
4652
__be32 status ;
4625
4653
@@ -4643,42 +4671,17 @@ nfsd4_do_encode_secinfo(struct xdr_stream *xdr, struct svc_export *exp)
4643
4671
}
4644
4672
}
4645
4673
4646
- supported = 0 ;
4647
4674
flavorsp = xdr_reserve_space (xdr , XDR_UNIT );
4648
4675
if (!flavorsp )
4649
4676
return nfserr_resource ;
4650
4677
4651
- for (i = 0 ; i < nflavs ; i ++ ) {
4652
- rpc_authflavor_t pf = flavs [i ].pseudoflavor ;
4653
- struct rpcsec_gss_info info ;
4654
-
4655
- if (rpcauth_get_gssinfo (pf , & info ) == 0 ) {
4656
- supported ++ ;
4657
-
4658
- /* flavor */
4659
- status = nfsd4_encode_uint32_t (xdr , RPC_AUTH_GSS );
4660
- if (status != nfs_ok )
4661
- return status ;
4662
- /* flavor_info */
4663
- status = nfsd4_encode_rpcsec_gss_info (xdr , & info );
4664
- if (status != nfs_ok )
4665
- return status ;
4666
- } else if (pf < RPC_AUTH_MAXFLAVOR ) {
4667
- supported ++ ;
4668
-
4669
- /* flavor */
4670
- status = nfsd4_encode_uint32_t (xdr , pf );
4671
- if (status != nfs_ok )
4672
- return status ;
4673
- } else {
4674
- if (report )
4675
- pr_warn ("NFS: SECINFO: security flavor %u "
4676
- "is not supported\n" , pf );
4677
- }
4678
+ for (i = 0 , supported = 0 ; i < nflavs ; i ++ ) {
4679
+ status = nfsd4_encode_secinfo4 (xdr , flavs [i ].pseudoflavor ,
4680
+ & supported );
4681
+ if (status != nfs_ok )
4682
+ return status ;
4678
4683
}
4679
4684
4680
- if (nflavs != supported )
4681
- report = false;
4682
4685
* flavorsp = cpu_to_be32 (supported );
4683
4686
return 0 ;
4684
4687
}
0 commit comments