Skip to content

Commit ecc2b88

Browse files
kinglongmeetrondmypd
authored andcommitted
nfs/blocklayout: Make sure calculate signature length aligned
Avoid a bad nfs server return an unaligned length of signature. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent 11487dd commit ecc2b88

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎fs/nfs/blocklayout/dev.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ nfs4_block_decode_volume(struct xdr_stream *xdr, struct pnfs_block_volume *b)
8989
memcpy(&b->simple.sigs[i].sig, p,
9090
b->simple.sigs[i].sig_len);
9191

92-
b->simple.len += 8 + 4 + b->simple.sigs[i].sig_len;
92+
b->simple.len += 8 + 4 + \
93+
(XDR_QUADLEN(b->simple.sigs[i].sig_len) << 2);
9394
}
9495
break;
9596
case PNFS_BLOCK_VOLUME_SLICE:

0 commit comments

Comments
 (0)