提交 7c7d90f2 编写于 作者: E Eric Van Hensbergen

9p: Fix soft lockup in virtio transport

This fixes a poorly placed spinlock which could result in a
soft lockup condition.
Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
上级 c55703d8
...@@ -232,7 +232,6 @@ p9_virtio_rpc(struct p9_trans *t, struct p9_fcall *tc, struct p9_fcall **rc, ...@@ -232,7 +232,6 @@ p9_virtio_rpc(struct p9_trans *t, struct p9_fcall *tc, struct p9_fcall **rc,
rdata = (char *)*rc+sizeof(struct p9_fcall); rdata = (char *)*rc+sizeof(struct p9_fcall);
spin_lock_irqsave(&chan->lock, flags);
n = P9_NOTAG; n = P9_NOTAG;
if (tc->id != P9_TVERSION) { if (tc->id != P9_TVERSION) {
n = p9_idpool_get(chan->tagpool); n = p9_idpool_get(chan->tagpool);
...@@ -240,6 +239,7 @@ p9_virtio_rpc(struct p9_trans *t, struct p9_fcall *tc, struct p9_fcall **rc, ...@@ -240,6 +239,7 @@ p9_virtio_rpc(struct p9_trans *t, struct p9_fcall *tc, struct p9_fcall **rc,
return -ENOMEM; return -ENOMEM;
} }
spin_lock_irqsave(&chan->lock, flags);
req = p9_lookup_tag(chan, n); req = p9_lookup_tag(chan, n);
spin_unlock_irqrestore(&chan->lock, flags); spin_unlock_irqrestore(&chan->lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册