From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E62435C184; Wed, 3 Dec 2025 16:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764779868; cv=none; b=V7P9wXFx8euGKlTD99SWTjtNokG8Y+xm4RYKJI+rXs+s/Pdkc1MMWHF6fSxQFwS+iinOkIvYkAksbu4PQWXzr9VdEyMU5vM9otOh2A2AfS5WBS1x8XCgpaiG37uKgyNkJGd+3yyrwOMEhedRdgGixChHOWoME6sV21r11saDutE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764779868; c=relaxed/simple; bh=U3515F7c2aWWVnHYigHnssz+q1jcYkttaLhISJJj8ok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ono54IVfuErjTA5U/7K0W+DQEIUveXJa76nTbBZRPlj2CwDE/cZgjmNz+r/jT8TbObc4iL99SBbp7YVVbNTtru2jYZsa5LdIAheohEl860knwjxZTW92I/BlG5K6pnbz8QABnE4LGHab8d80XkjdRLzYpg0cDeppcHTGrEyOR9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yxfub1NQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yxfub1NQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D678AC116B1; Wed, 3 Dec 2025 16:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764779868; bh=U3515F7c2aWWVnHYigHnssz+q1jcYkttaLhISJJj8ok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yxfub1NQQvEsGg9AYU9batdhtmHU7ww+cEtZH9GlrZsL9/bWuXD+S6epqSIF/NJai vxOIEKREUwRTxZnBmgTlbXpZHs4XGshHgyvKSiKkYNSTy7r+MNH3fKo6FSOzw7yeZo lHH2oND7tUbtz2ri6J6D4X0IIXoZc6Q6f8JG+WEE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dan Carpenter , Harshit Mogalapalli , Trond Myklebust , Anna Schumaker , Sasha Levin Subject: [PATCH 6.1 385/568] NFSv4: Fix an incorrect parameter when calling nfs4_call_sync() Date: Wed, 3 Dec 2025 16:26:27 +0100 Message-ID: <20251203152454.794768302@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152440.645416925@linuxfoundation.org> References: <20251203152440.645416925@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust [ Upstream commit 1f214e9c3aef2d0936be971072e991d78a174d71 ] The Smatch static checker noted that in _nfs4_proc_lookupp(), the flag RPC_TASK_TIMEOUT is being passed as an argument to nfs4_init_sequence(), which is clearly incorrect. Since LOOKUPP is an idempotent operation, nfs4_init_sequence() should not ask the server to cache the result. The RPC_TASK_TIMEOUT flag needs to be passed down to the RPC layer. Reported-by: Dan Carpenter Reported-by: Harshit Mogalapalli Fixes: 76998ebb9158 ("NFSv4: Observe the NFS_MOUNT_SOFTREVAL flag in _nfs4_proc_lookupp") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- fs/nfs/nfs4proc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index f387a3862ca09..d4ae2ce56af4a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -4584,16 +4584,19 @@ static int _nfs4_proc_lookupp(struct inode *inode, }; unsigned short task_flags = 0; - if (NFS_SERVER(inode)->flags & NFS_MOUNT_SOFTREVAL) + if (server->flags & NFS_MOUNT_SOFTREVAL) task_flags |= RPC_TASK_TIMEOUT; + if (server->caps & NFS_CAP_MOVEABLE) + task_flags |= RPC_TASK_MOVEABLE; args.bitmask = nfs4_bitmask(server, fattr->label); nfs_fattr_init(fattr); + nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0); dprintk("NFS call lookupp ino=0x%lx\n", inode->i_ino); - status = nfs4_call_sync(clnt, server, &msg, &args.seq_args, - &res.seq_res, task_flags); + status = nfs4_do_call_sync(clnt, server, &msg, &args.seq_args, + &res.seq_res, task_flags); dprintk("NFS reply lookupp: %d\n", status); return status; } -- 2.51.0