From nobody Wed Jul 9 17:38:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bclZ119XRz60khl; Wed, 09 Jul 2025 17:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bclZ04cxTz3J40; Wed, 09 Jul 2025 17:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752082696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ld7qTkCuG893bmxyBGvxSYug9yM0/L5EyhnGIj+hbVE=; b=dsKxZTrL0re9KQkUC6OOvRWNLcVeT0aKMcLUO8eYa01OPNbAycFhNeclk07UV/0tABUkcl eMioJNqs0w2Flj5Y7F7pLP/MQlle7jIXa7K6ms1+mrgKw43XwoE4xUUU+Do0YCEaTJzRIn V/nyr5dJrCO9uXmuzlcgeK01Cw7gsxImusJAb5/YNIDMjMuK8ZHyU8Gd1RmBn/WYwPhZS9 I3MDr202f4aRAK9E9DAnFI8hcnSnJy0Fe1MGHgFxoaxw6BDMw/kIkhidhqsYL9MrHSltDP uPst9cBHT2rG4qyezPnEU8+FuG/NUD04eynn8oNXO2O1K/MnrssN+sM8LnBZog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752082696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ld7qTkCuG893bmxyBGvxSYug9yM0/L5EyhnGIj+hbVE=; b=Sia0YT8qLe7xsNbUB18S20uUXWvz2zXdIA6lh4vTjKPrp+EDm+A3F/h8cn8q0wTpKywTs4 Lf+a1iOFPmJh0r+rffFjtajBoM3RheUxLYCQrBSqhXg2ZJaS3Ucb/VvegiPDKFn8NA+zwX EA22Ds0dSWjjJ+Gg+LGg2y2qXI4l/7C5NFRCKL5kbbYbQl5RZaINCMPLLHr6gV1Q6RPq07 NtfWBCUpe4tTmlPBBoK52I8rUdbYb4TWxu/bk0fJrMKyDwR4Avobb39ok5Suu+LKS98ifq pYKfX2NEVUXLNpvp62s8TRIm90xxTe4uHvmH8uNDjM2k+vk7qfu6sBSZsrTPjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752082696; a=rsa-sha256; cv=none; b=DatNG8EkfKLXYqmIGEVAOL/x4kPBE1zVyaAoXvS/AOlJqDX9qxne21SHT16w71A3+6iUzQ jSbLdIG+KCw5DJrSXOjBY/2ShOjc/xbvZ4PJb2qgwLe/MsC4vwlxPWD6w2tNsiCKnV3uHh JgBdx11oeo3FfGlmJ6RWifTgW/Rpfvr9UcsLJ+IT5pvMrEocUr81x+VGDoeoGD3ebh7pgZ Sc5kvKSAi9u7fqe3KcxfoWA9CP/9Ky7F3TvndxQRZzE0Tnyw/F8Y5f7VZwi1IwXXubrMsk vIYT8T1xmdbw+4y+2hI0mIgf+5IWjLuey20dJrGq96GFV8XIeZ3sQbNBbbT4vA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bclZ03vdRzY1n; Wed, 09 Jul 2025 17:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569HcG4j028616; Wed, 9 Jul 2025 17:38:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569HcGof028613; Wed, 9 Jul 2025 17:38:16 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:38:16 GMT Message-Id: <202507091738.569HcGof028613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 44e9c9f8f391 - main - nfsvno_rename(): do not use -1 as special error indicator List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44e9c9f8f3916200292e8191f3534dc7946c5c37 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=44e9c9f8f3916200292e8191f3534dc7946c5c37 commit 44e9c9f8f3916200292e8191f3534dc7946c5c37 Author: Konstantin Belousov AuthorDate: 2025-07-08 19:52:44 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-09 17:38:11 +0000 nfsvno_rename(): do not use -1 as special error indicator it clashes with ERESTART. Use EJUSTRETURN for the case, as it is often done in other places in the kernel. Reviewed by: markj, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51211 --- sys/fs/nfsserver/nfs_nfsdport.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index a81f1492ef95..95dc44438acc 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1652,10 +1652,11 @@ nfsvno_rename(struct nameidata *fromndp, struct nameidata *tondp, } if (fvp == tvp) { /* - * If source and destination are the same, there is nothing to - * do. Set error to -1 to indicate this. + * If source and destination are the same, there is + * nothing to do. Set error to EJUSTRETURN to indicate + * this. */ - error = -1; + error = EJUSTRETURN; goto out; } if (nd->nd_flag & ND_NFSV4) { @@ -1710,7 +1711,7 @@ out: vput(tvp); vrele(fromndp->ni_dvp); vrele(fvp); - if (error == -1) + if (error == EJUSTRETURN) error = 0; }