linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Trond Myklebust <trond.myklebust@hammerspace.com>,
	Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: [bug report] NFSv4: Observe the NFS_MOUNT_SOFTREVAL flag in _nfs4_proc_lookupp
Date: Fri, 31 Oct 2025 16:22:46 +0300	[thread overview]
Message-ID: <aQS4Ju3132AqZeqB@stanley.mountain> (raw)

Hello Trond Myklebust,

This is a new checker rule Harshit and I wrote.

Commit 76998ebb9158 ("NFSv4: Observe the NFS_MOUNT_SOFTREVAL flag in
_nfs4_proc_lookupp") from Oct 20, 2020 (linux-next), leads to the
following Smatch static checker warning:

	fs/nfs/nfs4proc.c:783 nfs4_init_sequence()
	warn: potentially more than 1 'args->sa_cache_this = 0x1001' type='uchar'

fs/nfs/nfs4proc.c
    778 void nfs4_init_sequence(struct nfs4_sequence_args *args,
    779                         struct nfs4_sequence_res *res, int cache_reply,
    780                         int privileged)
    781 {
    782         args->sa_slot = NULL;
--> 783         args->sa_cache_this = cache_reply;

args->sa_cache_this is a 1 bit bitfield in a u8, but the commit mentioned
is passing RPC_TASK_TIMEOUT (0x1000).  Should this code be changed to:

	args->sa_cache_this = cache_reply & RPC_TASK_ASYNC;

Probably not...  _nfs4_proc_lookupp() is the only caller which passes
anything other than zero.

    784         args->sa_privileged = privileged;
    785 
    786         res->sr_slot = NULL;
    787 }

regards,
dan carpenter

             reply	other threads:[~2025-10-31 13:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-31 13:22 Dan Carpenter [this message]
2025-10-31 14:24 ` [bug report] NFSv4: Observe the NFS_MOUNT_SOFTREVAL flag in _nfs4_proc_lookupp Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aQS4Ju3132AqZeqB@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).