public inbox for v9fs@lists.linux.dev
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: v9fs@lists.linux.dev
Subject: [PATCH] spin_lock_irqsave() in p9_client{,_zc}_rpc() is bogus
Date: Sun, 17 Aug 2025 17:42:06 +0100	[thread overview]
Message-ID: <20250817164206.GW222315@ZenIV> (raw)

	Both of those are blocking; they can't be (and are not) called
with irqs disabled.  So these spin_lock_irqsave() should be spin_lock_irq().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/net/9p/client.c b/net/9p/client.c
index 5c1ca57ccd28..b708c6ba6b98 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -675,7 +675,6 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
 {
 	va_list ap;
 	int sigpending, err;
-	unsigned long flags;
 	struct p9_req_t *req;
 	/* Passing zero for tsize/rsize to p9_client_prepare_req() tells it to
 	 * auto determine an appropriate (small) request/response size
@@ -746,9 +745,9 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
 	}
 recalc_sigpending:
 	if (sigpending) {
-		spin_lock_irqsave(&current->sighand->siglock, flags);
+		spin_lock_irq(&current->sighand->siglock);
 		recalc_sigpending();
-		spin_unlock_irqrestore(&current->sighand->siglock, flags);
+		spin_unlock_irq(&current->sighand->siglock);
 	}
 	if (err < 0)
 		goto reterr;
@@ -783,7 +782,6 @@ static struct p9_req_t *p9_client_zc_rpc(struct p9_client *c, int8_t type,
 {
 	va_list ap;
 	int sigpending, err;
-	unsigned long flags;
 	struct p9_req_t *req;
 
 	va_start(ap, fmt);
@@ -831,9 +829,9 @@ static struct p9_req_t *p9_client_zc_rpc(struct p9_client *c, int8_t type,
 	}
 recalc_sigpending:
 	if (sigpending) {
-		spin_lock_irqsave(&current->sighand->siglock, flags);
+		spin_lock_irq(&current->sighand->siglock);
 		recalc_sigpending();
-		spin_unlock_irqrestore(&current->sighand->siglock, flags);
+		spin_unlock_irq(&current->sighand->siglock);
 	}
 	if (err < 0)
 		goto reterr;

             reply	other threads:[~2025-08-17 16:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-17 16:42 Al Viro [this message]
2025-08-17 22:30 ` [PATCH] spin_lock_irqsave() in p9_client{,_zc}_rpc() is bogus Dominique Martinet

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=20250817164206.GW222315@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=v9fs@lists.linux.dev \
    /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