Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E94CDC433EF for ; Sun, 24 Apr 2022 08:53:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233781AbiDXI4c (ORCPT ); Sun, 24 Apr 2022 04:56:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232243AbiDXI4c (ORCPT ); Sun, 24 Apr 2022 04:56:32 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B91CD289BA for ; Sun, 24 Apr 2022 01:53:32 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 329A3210F3; Sun, 24 Apr 2022 08:53:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1650790411; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kdg0lgHDOz3FbI88bk56kaFqkT01bmBjoFhcJQ3+PKY=; b=NtDu626fmlmj03IR/1U9vnzRJ7eW4aXLmEZ7QXu4bLTWCIRBPPVQTCKFHl7CkCGwHa9/jo IzC36ZEZIEEvlS4uh1VcFg4cNVFs2dAw/74w9OUpbJvoVt1rteLD6YouJWA4TMLDSx4scV jKfzr8JmWr36eKUTUZ+AQqZ2LUVZCvE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1650790411; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kdg0lgHDOz3FbI88bk56kaFqkT01bmBjoFhcJQ3+PKY=; b=yFh4QAhJI41PVHr6NuqxvtBHaM+YNaPSjpCXiCvMR25oiLLL16GxYZJkaH0zDHqdoceQnv DjRwnONOwVszsDCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E1CDD13780; Sun, 24 Apr 2022 08:53:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QwdiNgoQZWICGAAAMHmgww (envelope-from ); Sun, 24 Apr 2022 08:53:30 +0000 Message-ID: <68e17ba8-24ec-5b60-d52e-18d41f91892c@suse.de> Date: Sun, 24 Apr 2022 10:53:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH V2 2/2] block: fix "Directory XXXXX with parent 'block' already present!" Content-Language: en-US To: Ming Lei , Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Greg Kroah-Hartman , Shin'ichiro Kawasaki , Dan Williams , yukuai References: <20220423143952.3162999-1-ming.lei@redhat.com> <20220423143952.3162999-3-ming.lei@redhat.com> From: Hannes Reinecke In-Reply-To: <20220423143952.3162999-3-ming.lei@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On 4/23/22 16:39, Ming Lei wrote: > q->debugfs_dir is used by blk-mq debugfs and blktrace. The dentry is > created when adding disk, and removed when releasing request queue. > > There is small window between releasing disk and releasing request > queue, and during the period, one disk with same name may be created > and added, so debugfs_create_dir() may complain with "Directory XXXXX > with parent 'block' already present!" > > Fixes the issue by moving debugfs_create_dir() into blk_alloc_queue(), > and the dir name is named with q->id from beginning, and switched to > disk name when adding disk, and finally changed to q->id in disk_release(). > > Tested-by: Shin'ichiro Kawasaki > Reported-by: Dan Williams > Cc: yukuai (C) > Cc: Shin'ichiro Kawasaki > Signed-off-by: Ming Lei > --- > block/blk-core.c | 4 ++++ > block/blk-sysfs.c | 4 ++-- > block/genhd.c | 8 ++++++++ > 3 files changed, 14 insertions(+), 2 deletions(-) > Errm. Isn't this superfluous now that Jens merged Yu Kuais patch? Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer