hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/nfsd/nfs4xdr.c
....@@ -3405,6 +3405,17 @@
34053405 case nfserr_noent:
34063406 xdr_truncate_encode(xdr, start_offset);
34073407 goto skip_entry;
3408
+ case nfserr_jukebox:
3409
+ /*
3410
+ * The pseudoroot should only display dentries that lead to
3411
+ * exports. If we get EJUKEBOX here, then we can't tell whether
3412
+ * this entry should be included. Just fail the whole READDIR
3413
+ * with NFS4ERR_DELAY in that case, and hope that the situation
3414
+ * will resolve itself by the client's next attempt.
3415
+ */
3416
+ if (cd->rd_fhp->fh_export->ex_flags & NFSEXP_V4ROOT)
3417
+ goto fail;
3418
+ fallthrough;
34083419 default:
34093420 /*
34103421 * If the client requested the RDATTR_ERROR attribute,
....@@ -3694,7 +3705,7 @@
36943705 p = xdr_reserve_space(xdr, 32);
36953706 if (!p)
36963707 return nfserr_resource;
3697
- *p++ = cpu_to_be32(0);
3708
+ *p++ = cpu_to_be32(open->op_recall);
36983709
36993710 /*
37003711 * TODO: space_limit's in delegations
....@@ -4396,20 +4407,17 @@
43964407
43974408 *p++ = cpu_to_be32(gdev->gd_layout_type);
43984409
4399
- /* If maxcount is 0 then just update notifications */
4400
- if (gdev->gd_maxcount != 0) {
4401
- ops = nfsd4_layout_ops[gdev->gd_layout_type];
4402
- nfserr = ops->encode_getdeviceinfo(xdr, gdev);
4403
- if (nfserr) {
4404
- /*
4405
- * We don't bother to burden the layout drivers with
4406
- * enforcing gd_maxcount, just tell the client to
4407
- * come back with a bigger buffer if it's not enough.
4408
- */
4409
- if (xdr->buf->len + 4 > gdev->gd_maxcount)
4410
- goto toosmall;
4411
- return nfserr;
4412
- }
4410
+ ops = nfsd4_layout_ops[gdev->gd_layout_type];
4411
+ nfserr = ops->encode_getdeviceinfo(xdr, gdev);
4412
+ if (nfserr) {
4413
+ /*
4414
+ * We don't bother to burden the layout drivers with
4415
+ * enforcing gd_maxcount, just tell the client to
4416
+ * come back with a bigger buffer if it's not enough.
4417
+ */
4418
+ if (xdr->buf->len + 4 > gdev->gd_maxcount)
4419
+ goto toosmall;
4420
+ return nfserr;
44134421 }
44144422
44154423 if (gdev->gd_notify_types) {