diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2011-03-24 13:12:30 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-24 13:52:42 -0400 |
commit | 7ebb931598cd95cccea10d4bc4c0123a464ea565 (patch) | |
tree | dec1af6eefdbbc3ce42346d7c6d407088eaf509e /fs/nfs/nfs4xdr.c | |
parent | 5a5ea0d485c9715c86bf858bbdc5f6d373b3db88 (diff) |
NFS: use secinfo when crossing mountpoints
A submount may use different security than the parent
mount does. We should figure out what sec flavor the
submount uses at mount time.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 98afcf947aa4..21c3004b72d5 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -113,7 +113,7 @@ static int nfs4_stat_to_errno(int); | |||
113 | #define encode_restorefh_maxsz (op_encode_hdr_maxsz) | 113 | #define encode_restorefh_maxsz (op_encode_hdr_maxsz) |
114 | #define decode_restorefh_maxsz (op_decode_hdr_maxsz) | 114 | #define decode_restorefh_maxsz (op_decode_hdr_maxsz) |
115 | #define encode_fsinfo_maxsz (encode_getattr_maxsz) | 115 | #define encode_fsinfo_maxsz (encode_getattr_maxsz) |
116 | #define decode_fsinfo_maxsz (op_decode_hdr_maxsz + 11) | 116 | #define decode_fsinfo_maxsz (op_decode_hdr_maxsz + 15) |
117 | #define encode_renew_maxsz (op_encode_hdr_maxsz + 3) | 117 | #define encode_renew_maxsz (op_encode_hdr_maxsz + 3) |
118 | #define decode_renew_maxsz (op_decode_hdr_maxsz) | 118 | #define decode_renew_maxsz (op_decode_hdr_maxsz) |
119 | #define encode_setclientid_maxsz \ | 119 | #define encode_setclientid_maxsz \ |
@@ -2966,6 +2966,7 @@ static int decode_attr_error(struct xdr_stream *xdr, uint32_t *bitmap) | |||
2966 | if (unlikely(!p)) | 2966 | if (unlikely(!p)) |
2967 | goto out_overflow; | 2967 | goto out_overflow; |
2968 | bitmap[0] &= ~FATTR4_WORD0_RDATTR_ERROR; | 2968 | bitmap[0] &= ~FATTR4_WORD0_RDATTR_ERROR; |
2969 | return -be32_to_cpup(p); | ||
2969 | } | 2970 | } |
2970 | return 0; | 2971 | return 0; |
2971 | out_overflow: | 2972 | out_overflow: |
@@ -3953,6 +3954,10 @@ static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap, | |||
3953 | fattr->valid |= status; | 3954 | fattr->valid |= status; |
3954 | 3955 | ||
3955 | status = decode_attr_error(xdr, bitmap); | 3956 | status = decode_attr_error(xdr, bitmap); |
3957 | if (status == -NFS4ERR_WRONGSEC) { | ||
3958 | nfs_fixup_secinfo_attributes(fattr, fh); | ||
3959 | status = 0; | ||
3960 | } | ||
3956 | if (status < 0) | 3961 | if (status < 0) |
3957 | goto xdr_error; | 3962 | goto xdr_error; |
3958 | 3963 | ||
@@ -6314,10 +6319,6 @@ static struct { | |||
6314 | { NFS4ERR_SYMLINK, -ELOOP }, | 6319 | { NFS4ERR_SYMLINK, -ELOOP }, |
6315 | { NFS4ERR_OP_ILLEGAL, -EOPNOTSUPP }, | 6320 | { NFS4ERR_OP_ILLEGAL, -EOPNOTSUPP }, |
6316 | { NFS4ERR_DEADLOCK, -EDEADLK }, | 6321 | { NFS4ERR_DEADLOCK, -EDEADLK }, |
6317 | { NFS4ERR_WRONGSEC, -EPERM }, /* FIXME: this needs | ||
6318 | * to be handled by a | ||
6319 | * middle-layer. | ||
6320 | */ | ||
6321 | { -1, -EIO } | 6322 | { -1, -EIO } |
6322 | }; | 6323 | }; |
6323 | 6324 | ||