Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: <llvm@lists.linux.dev>, <oe-kbuild-all@lists.linux.dev>
Subject: [bvanassche:thread-safety 36/36] net/vmw_vsock/virtio_transport.c:228:2: warning: releasing mutex 'vsock->tx_lock' that was not held
Date: Sun, 9 Feb 2025 00:26:19 +0800	[thread overview]
Message-ID: <Z6eFq+Md1EMp/fWJ@rli9-mobl> (raw)

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


                 reply	other threads:[~2025-02-08 16:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z6eFq+Md1EMp/fWJ@rli9-mobl \
    --to=lkp@intel.com \
    --cc=bvanassche@acm.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox