Skip to contentSkip to conversation

nfs/blocklayout: Make sure calculate signature length aligned

PATCH New Kinglong Mee 1 participant 1 message Jul 14, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs/blocklayout: Make sure calculate signature length aligned

Avoid a bad nfs server return an unaligned length of signature.

---
 fs/nfs/blocklayout/dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfs/blocklayout/dev.c +2 -1
index e5b8967..3021015 100644
@@ -89,7 +89,8 @@ nfs4_block_decode_volume(struct xdr_stream *xdr, struct pnfs_block_volume *b)
 			memcpy(&b->simple.sigs[i].sig, p,
 				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;
 	case PNFS_BLOCK_VOLUME_SLICE:
Signature · 1 line
2.7.4