Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1586712rdb; Tue, 20 Feb 2024 00:09:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVv5Nws+GYECzFqCbKnsBNRw94Y0+sCDjZmEX3q8VWVo7l36DKtpYeuiiYmGHnIUDoRrDlAlazk+DSu/gxkuOdgjfFvDGnyZjn5Ij5GsA== X-Google-Smtp-Source: AGHT+IE6XM+3QiWsrNgpoKPqaKnCZED8nk0SA01f4eReFgp0mT4jvEcuOTTIG8/T2431DvIv5KJj X-Received: by 2002:a17:906:2c48:b0:a3e:7d78:1293 with SMTP id f8-20020a1709062c4800b00a3e7d781293mr3524802ejh.40.1708416577532; Tue, 20 Feb 2024 00:09:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708416577; cv=pass; d=google.com; s=arc-20160816; b=1C2i+P8rqWYqVmiN1gUAQ4raStMN6qi9IYuNXmH8X7SwZhuyx0ebacSP5N4gILUSv7 Hk5F0OLDhtcW/zXimJ/nx3vnhVtSkXfKXoSyFsOW3n1XUPw4z/atO+lH1UiEWgDhlN+w OaaksqAgUuO1QNEPEItfOlSd9dA+qA0MYBewFNlbRRuhby+2KwoLBXan8uzguXma0YdB tDmmpfA09z4Zuc2DxKez+cPOrp3C4hT+9dXyGL8G1b/jvdcm7WBZ+2C9l5gqg6/n/szc SQmT/bnGU9gpc/PBwusEbGdpglm2ZMBclZwbnNGURsYIQGFjfcGbGaTnR/Wqjto3QdEm jh4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=23gmd6AM93+8T//wPQJsm57Mh1q/fvhzogxTAx0a4kg=; fh=QlwBPVopUEJeLOUCZk2qzlIj2zSv11wS6vx2wAnnRPk=; b=DdbtDcaN5B/rmZbNAkhF3j22Z917eGt/+iVlQ6FJVihOQSdqTMmohCjk4cPO2zM7ZK CgH5m6OPQzb7Gu/iHOrpzfarkoM1IKkhQaTPPUYSncxshGZWe3eMigtSjKO4qhvMy28r BzaxSmEzhuEdpFgcLEgE3ZlScYqK9XOjK+/V1UlX5flazVMq9UtCEw3kXmxXWRrg9Rb7 leevDfZSEhikpsIzRk0IHqJPvvLHOLkaY+oxIoaUfGRi50KpgmAulsISV6K0h+UZ64WC qS5nG22FT6ug4sOGveXxciv80Cx9u5vpR1Jdvd+Ls0fPlJeSfu2EbmojgrojCJxqLEGo DybA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-72513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72513-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hr34-20020a1709073fa200b00a3ec6df30besi1227962ejc.132.2024.02.20.00.09.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 00:09:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-72513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72513-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4A6561F21516 for ; Tue, 20 Feb 2024 08:09:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2BAB5C60B; Tue, 20 Feb 2024 08:09:24 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 D5CCB5C5E5; Tue, 20 Feb 2024 08:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708416564; cv=none; b=Skn/oMLc84mKXtOZFi0zAo2asTQw9bWX1YfU2pPQkKM2GQJ0TZmEIEO1CLTj/0/6YHWlgInMmA1W7kwwTJd9mtWKFsgypD0Y0ppdiRs+0iyQerZj/S7GE2emd/haxKs3Yf7/VgPPHwI++uDGb2xZ2Ec6GLxhSPHm65bVcG0q3OM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708416564; c=relaxed/simple; bh=nX2AD5Yn46v4roqbEyYbgRuT5aKw1JyhcTzpsdhhXNE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q8yccynMa+97w5PNJXTj5wvXg+T2YN4yHGM8wcEM3JiQDI+Mga3718rRc7WUbgSEv0XhaLLQK3bZETqR/DEIR0+N69YHoBGIu/4s/Xb5zhvDM//2tYV+yOjBJsLIs3J5JkvGLZnqpS0saK8Zx3XOfXuSeURbxNF8olmXgQEkvRk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id D5EB168CFE; Tue, 20 Feb 2024 09:09:17 +0100 (CET) Date: Tue, 20 Feb 2024 09:09:17 +0100 From: Christoph Hellwig To: Yu Kuai Cc: linan666@huaweicloud.com, axboe@kernel.dk, Christoph Hellwig , "yukuai (C)" , linux-raid@vger.kernel.org, song@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com Subject: Re: [PATCH] block: fix deadlock between bd_link_disk_holder and partition scan Message-ID: <20240220080917.GA13056@lst.de> References: <20240207092756.2087888-1-linan666@huaweicloud.com> 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Feb 19, 2024 at 04:53:36PM +0800, Yu Kuai wrote: > Can you take a look at this patch? I think for raid(perhaps and dm and > other drivers), it's reasonable to suspend IO while hot adding new > underlying disks. And I think add new slaves to holder is not related to > open the holder disk, because caller should already open the holder disk > to hot add slaves, hence 'open_mutex' for holder is not necessary here. > > Actually bd_link_disk_holder() is protected by 'reconfig_mutex' for > raid, and 'table_devices_lock' for dm(I'm not sure yet if other drivers > have similiar lock). > > For raid, we do can fix this problem in raid by delay > bd_link_disk_holder() while the array is not suspended, however, we'll > consider this fix later if you think this patch is not acceptable. Yes, not taking open_lock here seems reasonable, open_lock or it's previous name has always been a bit of a catchall without very well defined semantics. I'd give the symbol a blk_ prefix, though.