|
@@ -362,14 +362,19 @@ static int nfs4_stat_to_errno(int);
|
|
XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 5)
|
|
XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 5)
|
|
#define encode_reclaim_complete_maxsz (op_encode_hdr_maxsz + 4)
|
|
#define encode_reclaim_complete_maxsz (op_encode_hdr_maxsz + 4)
|
|
#define decode_reclaim_complete_maxsz (op_decode_hdr_maxsz + 4)
|
|
#define decode_reclaim_complete_maxsz (op_decode_hdr_maxsz + 4)
|
|
-#define encode_getdeviceinfo_maxsz (op_encode_hdr_maxsz + 4 + \
|
|
|
|
- XDR_QUADLEN(NFS4_DEVICEID4_SIZE))
|
|
|
|
|
|
+#define encode_getdeviceinfo_maxsz (op_encode_hdr_maxsz + \
|
|
|
|
+ XDR_QUADLEN(NFS4_DEVICEID4_SIZE) + \
|
|
|
|
+ 1 /* layout type */ + \
|
|
|
|
+ 1 /* maxcount */ + \
|
|
|
|
+ 1 /* bitmap size */ + \
|
|
|
|
+ 1 /* notification bitmap length */ + \
|
|
|
|
+ 1 /* notification bitmap, word 0 */)
|
|
#define decode_getdeviceinfo_maxsz (op_decode_hdr_maxsz + \
|
|
#define decode_getdeviceinfo_maxsz (op_decode_hdr_maxsz + \
|
|
1 /* layout type */ + \
|
|
1 /* layout type */ + \
|
|
1 /* opaque devaddr4 length */ + \
|
|
1 /* opaque devaddr4 length */ + \
|
|
/* devaddr4 payload is read into page */ \
|
|
/* devaddr4 payload is read into page */ \
|
|
1 /* notification bitmap length */ + \
|
|
1 /* notification bitmap length */ + \
|
|
- 1 /* notification bitmap */)
|
|
|
|
|
|
+ 1 /* notification bitmap, word 0 */)
|
|
#define encode_layoutget_maxsz (op_encode_hdr_maxsz + 10 + \
|
|
#define encode_layoutget_maxsz (op_encode_hdr_maxsz + 10 + \
|
|
encode_stateid_maxsz)
|
|
encode_stateid_maxsz)
|
|
#define decode_layoutget_maxsz (op_decode_hdr_maxsz + 8 + \
|
|
#define decode_layoutget_maxsz (op_decode_hdr_maxsz + 8 + \
|
|
@@ -1918,12 +1923,15 @@ encode_getdeviceinfo(struct xdr_stream *xdr,
|
|
__be32 *p;
|
|
__be32 *p;
|
|
|
|
|
|
encode_op_hdr(xdr, OP_GETDEVICEINFO, decode_getdeviceinfo_maxsz, hdr);
|
|
encode_op_hdr(xdr, OP_GETDEVICEINFO, decode_getdeviceinfo_maxsz, hdr);
|
|
- p = reserve_space(xdr, 12 + NFS4_DEVICEID4_SIZE);
|
|
|
|
|
|
+ p = reserve_space(xdr, NFS4_DEVICEID4_SIZE + 4 + 4);
|
|
p = xdr_encode_opaque_fixed(p, args->pdev->dev_id.data,
|
|
p = xdr_encode_opaque_fixed(p, args->pdev->dev_id.data,
|
|
NFS4_DEVICEID4_SIZE);
|
|
NFS4_DEVICEID4_SIZE);
|
|
*p++ = cpu_to_be32(args->pdev->layout_type);
|
|
*p++ = cpu_to_be32(args->pdev->layout_type);
|
|
*p++ = cpu_to_be32(args->pdev->maxcount); /* gdia_maxcount */
|
|
*p++ = cpu_to_be32(args->pdev->maxcount); /* gdia_maxcount */
|
|
- *p++ = cpu_to_be32(0); /* bitmap length 0 */
|
|
|
|
|
|
+
|
|
|
|
+ p = reserve_space(xdr, 4 + 4);
|
|
|
|
+ *p++ = cpu_to_be32(1); /* bitmap length */
|
|
|
|
+ *p++ = cpu_to_be32(NOTIFY_DEVICEID4_CHANGE | NOTIFY_DEVICEID4_DELETE);
|
|
}
|
|
}
|
|
|
|
|
|
static void
|
|
static void
|
|
@@ -5767,9 +5775,16 @@ static int decode_getdeviceinfo(struct xdr_stream *xdr,
|
|
p = xdr_inline_decode(xdr, 4 * len);
|
|
p = xdr_inline_decode(xdr, 4 * len);
|
|
if (unlikely(!p))
|
|
if (unlikely(!p))
|
|
goto out_overflow;
|
|
goto out_overflow;
|
|
- for (i = 0; i < len; i++, p++) {
|
|
|
|
- if (be32_to_cpup(p)) {
|
|
|
|
- dprintk("%s: notifications not supported\n",
|
|
|
|
|
|
+
|
|
|
|
+ if (be32_to_cpup(p++) &
|
|
|
|
+ ~(NOTIFY_DEVICEID4_CHANGE | NOTIFY_DEVICEID4_DELETE)) {
|
|
|
|
+ dprintk("%s: unsupported notification\n",
|
|
|
|
+ __func__);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (i = 1; i < len; i++) {
|
|
|
|
+ if (be32_to_cpup(p++)) {
|
|
|
|
+ dprintk("%s: unsupported notification\n",
|
|
__func__);
|
|
__func__);
|
|
return -EIO;
|
|
return -EIO;
|
|
}
|
|
}
|