* [bvanassche:thread-safety 36/36] net/vmw_vsock/virtio_transport.c:228:2: warning: releasing mutex 'vsock->tx_lock' that was not held
@ 2025-02-08 16:26 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-08 16:26 UTC (permalink / raw)
To: Bart Van Assche; +Cc: llvm, oe-kbuild-all
tree: https://github.com/bvanassche/linux thread-safety
head: ce14c650535d31959070629f347cb214f6e51d3d
commit: ce14c650535d31959070629f347cb214f6e51d3d [36/36] scripts/Makefile.clang: Unconditionally enable thread-safety checking
:::::: branch date: 26 hours ago
:::::: commit date: 26 hours ago
config: hexagon-randconfig-002-20250207 (https://download.01.org/0day-ci/archive/20250207/202502071035.uOQ6feeD-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250207/202502071035.uOQ6feeD-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202502071035.uOQ6feeD-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> net/vmw_vsock/virtio_transport.c:228:2: warning: releasing mutex 'vsock->tx_lock' that was not held [-Wthread-safety-analysis]
228 | mutex_unlock(&vsock->tx_lock);
| ^
1 warning generated.
vim +228 net/vmw_vsock/virtio_transport.c
0ea9e1d3a9e3ef Asias He 2016-07-28 210
efcd71af38be40 Luigi Leonardi 2024-07-30 211 /* Caller need to hold RCU for vsock.
efcd71af38be40 Luigi Leonardi 2024-07-30 212 * Returns 0 if the packet is successfully put on the vq.
efcd71af38be40 Luigi Leonardi 2024-07-30 213 */
efcd71af38be40 Luigi Leonardi 2024-07-30 214 static int virtio_transport_send_skb_fast_path(struct virtio_vsock *vsock, struct sk_buff *skb)
efcd71af38be40 Luigi Leonardi 2024-07-30 215 {
efcd71af38be40 Luigi Leonardi 2024-07-30 216 struct virtqueue *vq = vsock->vqs[VSOCK_VQ_TX];
efcd71af38be40 Luigi Leonardi 2024-07-30 217 int ret;
efcd71af38be40 Luigi Leonardi 2024-07-30 218
efcd71af38be40 Luigi Leonardi 2024-07-30 219 /* Inside RCU, can't sleep! */
efcd71af38be40 Luigi Leonardi 2024-07-30 220 ret = mutex_trylock(&vsock->tx_lock);
efcd71af38be40 Luigi Leonardi 2024-07-30 221 if (unlikely(ret == 0))
efcd71af38be40 Luigi Leonardi 2024-07-30 222 return -EBUSY;
efcd71af38be40 Luigi Leonardi 2024-07-30 223
a194c985973276 Michael S. Tsirkin 2024-10-02 224 ret = virtio_transport_send_skb(skb, vq, vsock, GFP_ATOMIC);
efcd71af38be40 Luigi Leonardi 2024-07-30 225 if (ret == 0)
efcd71af38be40 Luigi Leonardi 2024-07-30 226 virtqueue_kick(vq);
efcd71af38be40 Luigi Leonardi 2024-07-30 227
efcd71af38be40 Luigi Leonardi 2024-07-30 @228 mutex_unlock(&vsock->tx_lock);
efcd71af38be40 Luigi Leonardi 2024-07-30 229
efcd71af38be40 Luigi Leonardi 2024-07-30 230 return ret;
efcd71af38be40 Luigi Leonardi 2024-07-30 231 }
efcd71af38be40 Luigi Leonardi 2024-07-30 232
:::::: The code at line 228 was first introduced by commit
:::::: efcd71af38be403fa52223092f79ada446e121ba vsock/virtio: avoid queuing packets when intermediate queue is empty
:::::: TO: Luigi Leonardi <luigi.leonardi@outlook.com>
:::::: CC: Michael S. Tsirkin <mst@redhat.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-02-08 16:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-08 16:26 [bvanassche:thread-safety 36/36] net/vmw_vsock/virtio_transport.c:228:2: warning: releasing mutex 'vsock->tx_lock' that was not held kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox