[PATCH 01/21] pNFS: Fix CB_NOTIFY_DEVICEID CHANGE to consume ndc_immediate
Benjamin Coddington <[email protected]>
| Newsgroups | org.kernel.vger.linux-nfs |
|---|---|
| Message-ID | <b59cd6c4b551436a39d097ce280a18543d312bf1.1786653063.git.bcodding@hammerspace.com> |
decode_devicenotify_args() gated consuming the trailing ndc_immediate
boolean on cbd_layout_type instead of cbd_notify_type. cbd_layout_type
holds the pNFS layout type (e.g. 4 for flexfiles) and is never equal to
NOTIFY_DEVICEID4_CHANGE (2), so ndc_immediate was never consumed: it was
silently lost for a single CHANGE, and a multi-item cnda_changes<> array
misaligned after the first item and failed with NFS4ERR_INVAL/BADXDR.
Key the decode off the notification type.
Fixes: 1be5683b03a7 ("pnfs: CB_NOTIFY_DEVICEID")
Cc: [email protected]
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Benjamin Coddington <[email protected]>
---
fs/nfs/callback_xdr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 4382baddc9ee..04af8b9078a0 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -312,7 +312,7 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
memcpy(dev->cbd_dev_id.data, p, NFS4_DEVICEID4_SIZE);
p += XDR_QUADLEN(NFS4_DEVICEID4_SIZE);
- if (dev->cbd_layout_type == NOTIFY_DEVICEID4_CHANGE) {
+ if (dev->cbd_notify_type == NOTIFY_DEVICEID4_CHANGE) {
p = xdr_inline_decode(xdr, sizeof(uint32_t));
if (unlikely(p == NULL)) {
status = htonl(NFS4ERR_BADXDR);
--
2.53.0