提交 ecc2b88c 编写于 作者: K Kinglong Mee 提交者: Trond Myklebust

nfs/blocklayout: Make sure calculate signature length aligned

Avoid a bad nfs server return an unaligned length of signature.
Signed-off-by: NKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 11487ddb
...@@ -89,7 +89,8 @@ nfs4_block_decode_volume(struct xdr_stream *xdr, struct pnfs_block_volume *b) ...@@ -89,7 +89,8 @@ nfs4_block_decode_volume(struct xdr_stream *xdr, struct pnfs_block_volume *b)
memcpy(&b->simple.sigs[i].sig, p, memcpy(&b->simple.sigs[i].sig, p,
b->simple.sigs[i].sig_len); b->simple.sigs[i].sig_len);
b->simple.len += 8 + 4 + b->simple.sigs[i].sig_len; b->simple.len += 8 + 4 + \
(XDR_QUADLEN(b->simple.sigs[i].sig_len) << 2);
} }
break; break;
case PNFS_BLOCK_VOLUME_SLICE: case PNFS_BLOCK_VOLUME_SLICE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册