Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2847765lqz; Wed, 3 Apr 2024 10:09:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJIi7CoLdB4DGjKhcp5CfuZQYYjTBWTkTZNupSGJOPw7debc8/1imm8vdtid+JuHGZA+IiM3HePEGQTe7XBKoZQNe+fl41HmuQ6vFSJQ== X-Google-Smtp-Source: AGHT+IEc9EDsPNDRVKNx1GXpxZ63WyUi0PU8Qg8k+YXGev0fO5QqswsF5/2/gPjuGJGP0n/40BOq X-Received: by 2002:ad4:5bc7:0:b0:696:755f:c0cb with SMTP id t7-20020ad45bc7000000b00696755fc0cbmr407044qvt.8.1712164157907; Wed, 03 Apr 2024 10:09:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712164157; cv=pass; d=google.com; s=arc-20160816; b=cj8VwCcaGEsaqMlgKZ5tJQmx31jeUpNrnXiPdvUnJiP4cXEC5wSYeyFzeZEKxanfrh NTxW+mc5M+s9WeuQORSWaAZw8LjmkcCxvd3EDm27lAwz/WDjEZBN/B3xromJW6zWxZjY NDRXdnHZsfPQylMxL4XUpfI6v2YiameR+gZj2RRFBRm06nXpg663LR33C/lMD/H+MfHx EvjWJxV8fCKarwlBKLVj/B8paB+AciPdER5qo24DzVma0ShluG2UmAzUXSB2Axz30gWT piYuRCpdyG6uzn507GmmK7krLTMrI2oIV8ac5OUwEZnAjwabCxod+WRHeZHY7VWz+lb5 /whg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=mEIX8zwty7dKxH47y6oy+4uKOjzsm9yaNYG6n9h1ZLg=; fh=3dUJZ0PN97pHZ+SNnx34EzamFx8MCHMURDjMQacQC/M=; b=H6MeODJzLFxN9j9ZkZornxSYNDofrvPcTioSOiBcD27GN7Xiz6CzMqtwB6FWUajWpW eknx1+rGu0xgwVk/3tq4F+ZvtJckOoaNbxgl4ShUW2QK/50ULI92P+wBNMBdk9AtvniD j+95hM316KXe0duIlpNIM/v10UHQxeUjDqOfYaOic/kPQj+ZZ7AGNrfKOeTANoqsjDFU Yzzw6dJiooGBZMI+0vycAyV89ciawVzRAJPfxJ73gMkf0KoY1XgHQAK2kKDBr40vGKae da8dgeLBpwST5ZUL7lnu3GCxzp5rlBPExw7G2FULe8E/kUpqvZj6jQo9W1QokK0aG6Ot +QxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=U84infRz; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-kernel+bounces-130253-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130253-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c13-20020a056214004d00b00696b2538509si14281392qvr.68.2024.04.03.10.09.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 10:09:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130253-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=U84infRz; arc=pass (i=1 spf=pass spfdomain=inria.fr dkim=pass dkdomain=inria.fr dmarc=pass fromdomain=inria.fr); spf=pass (google.com: domain of linux-kernel+bounces-130253-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130253-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9441D1C20C6E for ; Wed, 3 Apr 2024 17:09:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AB6C15252F; Wed, 3 Apr 2024 17:09:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b="U84infRz" Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 003EF152188 for ; Wed, 3 Apr 2024 17:09:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.134.164.104 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164147; cv=none; b=VfKBIBUe+om38wKTzwmAne4FobAMx+r5p57jWZoAjVWQ0MUGuGMO/BI2TVJNZ12nQF/xdZBelw+m2cBnfjTJxhHDvvgz7TYM+lNImweXydd6mtxp2qdVnzJ5MJ8Sa4E4M0nJPictFXB7SaEyb5LTBfcYlK1P1TfmJZnR0i2bkKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164147; c=relaxed/simple; bh=lyLiABoT0znW9q0c9QeiPcjbxOtFrx1vbT+Bsk6RE60=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=G9zJcTw1H+/z/B4lRqUKVdOmRGpdDUysJuU9epDhKlQHyozdPXgWmqQmuBL1FWEiqYSEbqPxD6bGO6XBcgjgAlsVttRp6Eezvd2tgC5POJD7TlYN9vWtzs73Ch0wy/+MjYe8Bq9B89jTUkDNyYDxZcfcepVKUbrEJ5cSz8Tir64= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr; spf=pass smtp.mailfrom=inria.fr; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b=U84infRz; arc=none smtp.client-ip=192.134.164.104 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=mEIX8zwty7dKxH47y6oy+4uKOjzsm9yaNYG6n9h1ZLg=; b=U84infRzHS1DjDGzDRS2ObN1S2w4N9gFilR5D+2jt9+fr3YzVRMxe8nk I4eiyL8K6H6A5PfAvZBSVs8YO1YZ8T2K5ATn7arthKRjI5egcvUZXFPPz MCdrTLxlXzuLUNf5YvZ1jJAZ7pmeCAJlo0XFkrQjrFH4kaokwj1uq7TQR I=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.07,177,1708383600"; d="scan'208";a="83810300" Received: from 71-51-181-183.chvl.centurylink.net (HELO hadrien) ([71.51.181.183]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2024 19:09:03 +0200 Date: Wed, 3 Apr 2024 13:09:00 -0400 (EDT) From: Julia Lawall To: Mike Snitzer cc: Matthew Sakai , linux-kernel@vger.kernel.org, oe-kbuild-all@lists.linux.dev, dm-devel@list.linux.dev Subject: Re: drivers/md/dm-vdo/data-vio.c:969:2-8: preceding lock on line 966 (fwd) In-Reply-To: Message-ID: <677fa1fd-6f16-438e-2b95-8e81cabf4bf0@inria.fr> References: <801d737e-f7c0-b853-d7e-63eb68c7fd7b@inria.fr> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Wed, 3 Apr 2024, Mike Snitzer wrote: > On Wed, Apr 03 2024 at 12:47P -0400, > Julia Lawall wrote: > > > Hello, > > > > Please check whether the lock should be released before the returns. > > > > julia > > > > ---------- Forwarded message ---------- > > Date: Wed, 3 Apr 2024 22:16:44 +0800 > > From: kernel test robot > > To: oe-kbuild@lists.linux.dev > > Cc: lkp@intel.com, Julia Lawall > > Subject: drivers/md/dm-vdo/data-vio.c:969:2-8: preceding lock on line 966 > > > > BCC: lkp@intel.com > > CC: oe-kbuild-all@lists.linux.dev > > CC: linux-kernel@vger.kernel.org > > TO: Mike Snitzer > > CC: Matthew Sakai > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > head: 3e92c1e6cd876754b64d1998ec0a01800ed954a6 > > commit: f36b1d3ba533d21b5b793623f05761b0297d114e dm vdo: use a proper Makefile for dm-vdo > > date: 6 weeks ago > > :::::: branch date: 11 hours ago > > :::::: commit date: 6 weeks ago > > config: s390-randconfig-r052-20240403 (https://download.01.org/0day-ci/archive/20240403/202404032212.NV7EJ2Zj-lkp@intel.com/config) > > compiler: s390-linux-gcc (GCC) 13.2.0 > > > > 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 > > | Reported-by: Julia Lawall > > | Closes: https://lore.kernel.org/r/202404032212.NV7EJ2Zj-lkp@intel.com/ > > > > cocci warnings: (new ones prefixed by >>) > > >> drivers/md/dm-vdo/data-vio.c:969:2-8: preceding lock on line 966 > > drivers/md/dm-vdo/data-vio.c:972:2-8: preceding lock on line 966 > > > > vim +969 drivers/md/dm-vdo/data-vio.c > > > > 79535a7881c0cb Matthew Sakai 2023-11-16 952 > > 79535a7881c0cb Matthew Sakai 2023-11-16 953 /** > > 79535a7881c0cb Matthew Sakai 2023-11-16 954 * vdo_launch_bio() - Acquire a data_vio from the pool, assign the bio to it, and launch it. > > 79535a7881c0cb Matthew Sakai 2023-11-16 955 * > > 79535a7881c0cb Matthew Sakai 2023-11-16 956 * This will block if data_vios or discard permits are not available. > > 79535a7881c0cb Matthew Sakai 2023-11-16 957 */ > > 79535a7881c0cb Matthew Sakai 2023-11-16 958 void vdo_launch_bio(struct data_vio_pool *pool, struct bio *bio) > > 79535a7881c0cb Matthew Sakai 2023-11-16 959 { > > 79535a7881c0cb Matthew Sakai 2023-11-16 960 struct data_vio *data_vio; > > 79535a7881c0cb Matthew Sakai 2023-11-16 961 > > 79535a7881c0cb Matthew Sakai 2023-11-16 962 ASSERT_LOG_ONLY(!vdo_is_state_quiescent(&pool->state), > > 79535a7881c0cb Matthew Sakai 2023-11-16 963 "data_vio_pool not quiescent on acquire"); > > 79535a7881c0cb Matthew Sakai 2023-11-16 964 > > 79535a7881c0cb Matthew Sakai 2023-11-16 965 bio->bi_private = (void *) jiffies; > > 79535a7881c0cb Matthew Sakai 2023-11-16 @966 spin_lock(&pool->lock); > > 79535a7881c0cb Matthew Sakai 2023-11-16 967 if ((bio_op(bio) == REQ_OP_DISCARD) && > > 79535a7881c0cb Matthew Sakai 2023-11-16 968 !acquire_permit(&pool->discard_limiter, bio)) > > 79535a7881c0cb Matthew Sakai 2023-11-16 @969 return; > > 79535a7881c0cb Matthew Sakai 2023-11-16 970 > > 79535a7881c0cb Matthew Sakai 2023-11-16 971 if (!acquire_permit(&pool->limiter, bio)) > > 79535a7881c0cb Matthew Sakai 2023-11-16 972 return; > > 79535a7881c0cb Matthew Sakai 2023-11-16 973 > > 79535a7881c0cb Matthew Sakai 2023-11-16 974 data_vio = get_available_data_vio(pool); > > 79535a7881c0cb Matthew Sakai 2023-11-16 975 spin_unlock(&pool->lock); > > 79535a7881c0cb Matthew Sakai 2023-11-16 976 launch_bio(pool->completion.vdo, data_vio, bio); > > 79535a7881c0cb Matthew Sakai 2023-11-16 977 } > > 79535a7881c0cb Matthew Sakai 2023-11-16 978 > > > > :::::: The code at line 969 was first introduced by commit > > :::::: 79535a7881c0cbe95063a2670d840cc950ae9282 dm vdo: add data_vio, the request object which services incoming bios > > > > :::::: TO: Matthew Sakai > > :::::: CC: Mike Snitzer > > > > -- > > 0-DAY CI Kernel Test Service > > https://github.com/intel/lkp-tests/wiki > > > > Thanks for the report but this is reacting to older code. Changes were > made to address sparse's concerns about this same code, please see: > commit 872564c501b7 ("dm vdo data-vio: silence sparse warnings about > locking context imbalance"). > > If wait_permit()'s sparse __releases annotation is somehow > insufficient for silencing cocci please let me know. I don't think the Coccinelle rule checks the annotation. But the warning should not be negerated again. thanks, julia