From: Nathan Chancellor <nathan@kernel.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, Satish Kharat <satishkh@cisco.com>,
Sesidhar Baddela <sebaddel@cisco.com>,
Karan Tilak Kumar <kartilak@cisco.com>,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
"Martin K. Petersen" <mkp@kernel.org>
Subject: Re: [PATCH] scsi: fnic: Annotate fnic_nvme functions with __must_hold()
Date: Sun, 18 Oct 2026 14:22:32 -0700 [thread overview]
Message-ID: <20261018212232.GA4068315@ax162> (raw)
In-Reply-To: <3c41b84d7d832dd767b30bc04cf875f800ce748d.1792283587.git.bvanassche@acm.org>
On Sat, Oct 17, 2026 at 05:40:51PM -0700, Bart Van Assche wrote:
> Add __must_hold() annotations for fnic_lock to
> nvfnic_process_ls_abts_rsp(), nvfnic_ls_rsp_recv(),
> nvfnic_delete_tport(), and nvfnic_add_tport() in
> drivers/scsi/fnic/fnic_nvme.c.
>
> Document that callers must hold fnic_lock on entry and exit because
> these functions temporarily release and reacquire fnic_lock, and
> suppress context imbalance warnings reported by lock context analysis
> and sparse.
>
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Closes: https://lore.kernel.org/all/20261016023120.GA2863622@ax162/
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
> ---
> drivers/scsi/fnic/fnic_nvme.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/scsi/fnic/fnic_nvme.c b/drivers/scsi/fnic/fnic_nvme.c
> index 00d9d5d439a3..d1b327c5c5e0 100644
> --- a/drivers/scsi/fnic/fnic_nvme.c
> +++ b/drivers/scsi/fnic/fnic_nvme.c
> @@ -1284,6 +1284,7 @@ void nvfnic_fcpio_cmpl(struct fnic_io_req *io_req)
>
> void nvfnic_process_ls_abts_rsp(struct fnic_iport_s *iport,
> struct fc_frame_header *fchdr)
> + __must_hold(&iport->fnic->fnic_lock)
> {
> uint32_t tport_fcid;
> struct fnic_tport_s *tport;
> @@ -1348,6 +1349,7 @@ void nvfnic_process_ls_abts_rsp(struct fnic_iport_s *iport,
> */
> void nvfnic_ls_rsp_recv(struct fnic_iport_s *iport,
> struct fc_frame_header *fchdr, int len)
> + __must_hold(&iport->fnic->fnic_lock)
> {
> uint8_t *fcid;
> uint32_t tport_fcid;
> @@ -2086,6 +2088,7 @@ void nvfnic_exch_reset(struct fnic_iport_s *iport, struct fnic_tport_s *tport)
> void nvfnic_delete_tport(struct fnic_iport_s *iport,
> struct fnic_tport_s *tport,
> unsigned long flags)
> + __must_hold(&iport->fnic->fnic_lock)
> {
> struct fnic *fnic = iport->fnic;
> int ret;
> @@ -2179,6 +2182,7 @@ void nvfnic_delete_tport(struct fnic_iport_s *iport,
>
> int nvfnic_add_tport(struct fnic *fnic, struct fnic_tport_s *tport,
> unsigned long flags)
> + __must_hold(&fnic->fnic_lock)
> {
> struct fnic_iport_s *iport = &fnic->iport;
> struct nvme_fc_port_info pinfo;
--
Cheers,
Nathan
prev parent reply other threads:[~2026-10-18 21:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 0:40 [PATCH] scsi: fnic: Annotate fnic_nvme functions with __must_hold() Bart Van Assche
2026-10-18 21:22 ` Nathan Chancellor [this message]
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=20261018212232.GA4068315@ax162 \
--to=nathan@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=bvanassche@acm.org \
--cc=kartilak@cisco.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mkp@kernel.org \
--cc=satishkh@cisco.com \
--cc=sebaddel@cisco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.