]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
NFS: CB_OFFLOAD can return NFS4ERR_DELAY
authorChuck Lever <chuck.lever@oracle.com>
Mon, 13 Jan 2025 15:32:36 +0000 (10:32 -0500)
committerAnna Schumaker <anna.schumaker@oracle.com>
Tue, 21 Jan 2025 16:34:50 +0000 (11:34 -0500)
RFC 7862 permits the callback service to respond to a CB_OFFLOAD
operation with NFS4ERR_DELAY. Use that instead of
NFS4ERR_SERVERFAULT for temporary memory allocation failure, as that
is more consistent with how other operations report memory
allocation failure.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/callback_proc.c

index 7832fb0369a126bac21a04856c300e90f6d15144..8397c43358bd13cd964f30600f208d434a74be0f 100644 (file)
@@ -718,7 +718,7 @@ __be32 nfs4_callback_offload(void *data, void *dummy,
 
        copy = kzalloc(sizeof(struct nfs4_copy_state), GFP_KERNEL);
        if (!copy)
-               return htonl(NFS4ERR_SERVERFAULT);
+               return cpu_to_be32(NFS4ERR_DELAY);
 
        spin_lock(&cps->clp->cl_lock);
        rcu_read_lock();