v9fs.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] spin_lock_irqsave() in p9_client{,_zc}_rpc() is bogus
@ 2025-08-17 16:42 Al Viro
  2025-08-17 22:30 ` Dominique Martinet
  0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2025-08-17 16:42 UTC (permalink / raw)
  To: v9fs

	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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spin_lock_irqsave() in p9_client{,_zc}_rpc() is bogus
  2025-08-17 16:42 [PATCH] spin_lock_irqsave() in p9_client{,_zc}_rpc() is bogus Al Viro
@ 2025-08-17 22:30 ` Dominique Martinet
  0 siblings, 0 replies; 2+ messages in thread
From: Dominique Martinet @ 2025-08-17 22:30 UTC (permalink / raw)
  To: Al Viro; +Cc: v9fs

Al Viro wrote on Sun, Aug 17, 2025 at 05:42:06PM +0100:
> 	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().

Makes sense.

> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

If you want to take it:
Acked-by: Dominique Martinet <asmadeus@codewreck.org>

Otherwise I'll pick it up for 6.18 tomorrow-ish

-- 
Dominique

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-17 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-17 16:42 [PATCH] spin_lock_irqsave() in p9_client{,_zc}_rpc() is bogus Al Viro
2025-08-17 22:30 ` Dominique Martinet

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).