Skip to contentSkip to conversation

spin_lock_irqsave() in p9_client{,_zc}_rpc() is bogus

PATCH In review Al Viro 2 participants 2 messages Aug 17, 2025 9P file system

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 spin_lock_irqsave() in p9_client{,_zc}_rpc() is bogus

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

---

net/9p/client.c +4 -6
index 5c1ca57ccd28..b708c6ba6b98 100644
@@ -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;
maintainer Acked-by on v1 1/1
#1 lore raw

Al Viro wrote on Sun, Aug 17, 2025 at 05:42:06PM +0100:

Quoted 2 lines

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.

Quoted 1 line

If you want to take it:

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

Signature · 1 line
Dominique