Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFS: fix open_owner_id_maxsz and related fields.

A recent change increased the size of an NFSv4 open owner, but didn't
increase the corresponding max_sz defines. This is not know to have
caused failure, but should be fixed.

This patch also fixes some relates _maxsz fields that are wrong.

Note that the XXX_owner_id_maxsz values now are only the size of the id
and do NOT include the len field that will always preceed the id in xdr
encoding. I think this is clearer.

Reported-by: David Disseldorp <ddiss@suse.com>
Fixes: d98f72272500 ("nfs: simplify and guarantee owner uniqueness.")
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

NeilBrown and committed by
Trond Myklebust
43502f6e e767b59e

+9 -9
+9 -9
fs/nfs/nfs4xdr.c
··· 82 82 * we currently use size 2 (u64) out of (NFS4_OPAQUE_LIMIT >> 2) 83 83 */ 84 84 #define pagepad_maxsz (1) 85 - #define open_owner_id_maxsz (1 + 2 + 1 + 1 + 2) 86 - #define lock_owner_id_maxsz (1 + 1 + 4) 87 - #define decode_lockowner_maxsz (1 + XDR_QUADLEN(IDMAP_NAMESZ)) 85 + #define open_owner_id_maxsz (2 + 1 + 2 + 2) 86 + #define lock_owner_id_maxsz (2 + 1 + 2) 88 87 #define compound_encode_hdr_maxsz (3 + (NFS4_MAXTAGLEN >> 2)) 89 88 #define compound_decode_hdr_maxsz (3 + (NFS4_MAXTAGLEN >> 2)) 90 89 #define op_encode_hdr_maxsz (1) ··· 184 185 #define encode_claim_null_maxsz (1 + nfs4_name_maxsz) 185 186 #define encode_open_maxsz (op_encode_hdr_maxsz + \ 186 187 2 + encode_share_access_maxsz + 2 + \ 187 - open_owner_id_maxsz + \ 188 + 1 + open_owner_id_maxsz + \ 188 189 encode_opentype_maxsz + \ 189 190 encode_claim_null_maxsz) 190 191 #define decode_space_limit_maxsz (3) ··· 254 255 #define encode_link_maxsz (op_encode_hdr_maxsz + \ 255 256 nfs4_name_maxsz) 256 257 #define decode_link_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz) 257 - #define encode_lockowner_maxsz (7) 258 + #define encode_lockowner_maxsz (2 + 1 + lock_owner_id_maxsz) 259 + 258 260 #define encode_lock_maxsz (op_encode_hdr_maxsz + \ 259 261 7 + \ 260 262 1 + encode_stateid_maxsz + 1 + \ 261 263 encode_lockowner_maxsz) 262 264 #define decode_lock_denied_maxsz \ 263 - (8 + decode_lockowner_maxsz) 265 + (2 + 2 + 1 + 2 + 1 + lock_owner_id_maxsz) 264 266 #define decode_lock_maxsz (op_decode_hdr_maxsz + \ 265 267 decode_lock_denied_maxsz) 266 268 #define encode_lockt_maxsz (op_encode_hdr_maxsz + 5 + \ ··· 617 617 encode_lockowner_maxsz) 618 618 #define NFS4_dec_release_lockowner_sz \ 619 619 (compound_decode_hdr_maxsz + \ 620 - decode_lockowner_maxsz) 620 + decode_release_lockowner_maxsz) 621 621 #define NFS4_enc_access_sz (compound_encode_hdr_maxsz + \ 622 622 encode_sequence_maxsz + \ 623 623 encode_putfh_maxsz + \ ··· 1412 1412 __be32 *p; 1413 1413 /* 1414 1414 * opcode 4, seqid 4, share_access 4, share_deny 4, clientid 8, ownerlen 4, 1415 - * owner 4 = 32 1415 + * owner 28 1416 1416 */ 1417 1417 encode_nfs4_seqid(xdr, arg->seqid); 1418 1418 encode_share_access(xdr, arg->share_access); ··· 5077 5077 /* 5078 5078 * We create the owner, so we know a proper owner.id length is 4. 5079 5079 */ 5080 - static int decode_lock_denied (struct xdr_stream *xdr, struct file_lock *fl) 5080 + static int decode_lock_denied(struct xdr_stream *xdr, struct file_lock *fl) 5081 5081 { 5082 5082 uint64_t offset, length, clientid; 5083 5083 __be32 *p;