]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
NFSv42: Don't fail clone() unless the OP_CLONE operation failed
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 16 Nov 2021 14:55:01 +0000 (09:55 -0500)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:34:38 +0000 (07:34 +0100)
BugLink: https://bugs.launchpad.net/bugs/1953370
[ Upstream commit d3c45824ad65aebf765fcf51366d317a29538820 ]

The failure to retrieve post-op attributes has no bearing on whether or
not the clone operation itself was successful. We must therefore ignore
the return value of decode_getfattr() when looking at the success or
failure of nfs4_xdr_dec_clone().

Fixes: 36022770de6c ("nfs42: add CLONE xdr functions")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
fs/nfs/nfs42xdr.c

index c8bad735e4c19dc00a7f5437d756a790f44ac001..271e5f92ed0195982d50f22952519a19e274b1da 100644 (file)
@@ -1434,8 +1434,7 @@ static int nfs4_xdr_dec_clone(struct rpc_rqst *rqstp,
        status = decode_clone(xdr);
        if (status)
                goto out;
-       status = decode_getfattr(xdr, res->dst_fattr, res->server);
-
+       decode_getfattr(xdr, res->dst_fattr, res->server);
 out:
        res->rpc_status = status;
        return status;