[pnfs] [PATCH] filelayout_encode_layoutlist_item encodes 4 bytes of garbage
Ricardo Labiaga
ricardo.labiaga at netapp.com
Thu Jun 7 03:31:50 EDT 2007
The encoding of dev_layout_type (32 bits) was removed from
filelayout_encode_layoutlist_item() by commit:
21ea95d098e20662992c9e4f975ca998a3027878.
The returned length needs to also be updated.
This change reduces the returned length by 4 bytes to avoid XDR
encoding a hole with trash in the buffer.
---
fs/nfsd/nfs4filelayoutxdr.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfsd/nfs4filelayoutxdr.c b/fs/nfsd/nfs4filelayoutxdr.c
index 63198e7..28badc6 100644
--- a/fs/nfsd/nfs4filelayoutxdr.c
+++ b/fs/nfsd/nfs4filelayoutxdr.c
@@ -89,7 +89,7 @@ filelayout_encode_layoutlist_item(u32 *p, u32 *end,
struct nfsd4_pnfs_layoutlist
int len;
unsigned int fhlen = item->dev_fh.fh_size;
- len = 16 + fhlen;
+ len = 12 + fhlen;
if (p + XDR_QUADLEN(len) > end)
return -ENOMEM;
WRITE32(item->dev_id);
--
1.5.0.6
More information about the pNFS
mailing list