Re: [PATCH net-next 3/3] net: qrtr: implement shutdown()

From: Manivannan Sadhasivam

Date: Mon Oct 26 2026 - 09:36:31 EST


On Fri, Oct 16, 2026 at 01:58:20AM -0700, Chunkai Deng wrote:
> QRTR uses sock_no_shutdown(), so shutdown() fails with -EOPNOTSUPP and
> there is no way to wake up a thread blocked in recv() on the socket.
>
> Implement it the same way as unix_shutdown(): map SHUT_* to the
> *_SHUTDOWN bits, set them in sk_shutdown and call sk_state_change().
>
> Do not use lock_sock() here. qrtr_sendmsg() holds it while sleeping in
> qrtr_tx_wait() until the remote returns flow control credit, which would
> leave shutdown() stuck in an uninterruptible wait. Take sk_lock.slock to
> serialize concurrent callers instead, and use WRITE_ONCE() for the
> lockless readers. Do the same for the store in qrtr_release().
>
> A sender already sleeping in qrtr_tx_wait() is not woken by SHUT_WR;
> later sendmsg() calls fail with -EPIPE.
>
> Signed-off-by: Chunkai Deng <chunkai.deng@xxxxxxxxxxxxxxxx>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>

- Mani

--
மணிவண்ணன் சதாசிவம்