Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp687018ybz; Wed, 15 Apr 2020 16:43:43 -0700 (PDT) X-Google-Smtp-Source: APiQypIABd4YwCUf3erVzX02Znd3qegpo6VJC/sPD/ig/lstyeWfQGZ8487jU/KPI0CvO/gTsGxo X-Received: by 2002:a05:6402:2c8:: with SMTP id b8mr26488739edx.242.1586994223215; Wed, 15 Apr 2020 16:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586994223; cv=none; d=google.com; s=arc-20160816; b=YnRWtULkdO1J/mCdfMT5IdCF4dXiBdF6791B/GcLd5DisDkmtcShgFAt0s0cdNykYX r4GSqF7HqsIw0/TlCVEZb3TaaNzH083+XyAq/nXgVesWuzUfc9iNBZXwbLF3vsrdVfcv hGqOlbAEmcyMNF8LUWhcSoBaazpLFVTd2IezUD3ZHJBApXf/Qj7jtyJFIQF/hdWgcT7D Au4tEHmMFLGeiPyM5TAioUCsrxCZRDxwTa8yTOBa9xDYwgFvn6JN9lJ8l/4p3RtcaSS8 Kya92nUInx9OhbSD5fzWsMCWakPg0iyaVtQ8xOzAFcU8/yDYDrQR6zrXdIB8O/hzPcD0 tW5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JzUzg/mW68+ufFV5qcTuM5sEEYmvYc+6RGs1lG03lg0=; b=SZqNhdBuwNxLtIErIvqAbxpAXGmufTIswJxkNq/TjrNQJ4TiSdlfU4cNe4PO95EPTi WPnP/rkJH3cC3IZOupQeVxP6EseC+DGQdNpF0Y+/KXKhMRGfnh52C/8Au9mbtUN3OtCV tCClYknGkQLp3rF1s7TTx2HtfST37MUO3M8Wp5Z+W+X8fu+gTkNJYZqDvq/lfzek/ZfM o3VJyMCriO/zFUGY72f79HD7MyRtc2bkstmsSsgJsTKrk1oxT41vfsY+OAozqywSDmRN csGFP6wVLvqV6E35QqC+Q44bXnwV+B3YN/H8DeYN9Lbjf8OK8f5qPSAC1ehI24JtGh7E nhbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FmMuX+Ji; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si11340051ejx.502.2020.04.15.16.43.20; Wed, 15 Apr 2020 16:43:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FmMuX+Ji; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441116AbgDOHPC (ORCPT + 99 others); Wed, 15 Apr 2020 03:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390559AbgDOHO6 (ORCPT ); Wed, 15 Apr 2020 03:14:58 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77E15C061A0C; Wed, 15 Apr 2020 00:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=JzUzg/mW68+ufFV5qcTuM5sEEYmvYc+6RGs1lG03lg0=; b=FmMuX+JibdIFYgAXEY1r2PHZfA B6B5zj7G5Q0xig3P+EqdOp9okOT/6pUfs/hJ6jp3mokJUa2kVkgxvL0o268Dmm//QdY3sCehn9W/M 8LBFnKP6FW+f4rCqJG2SKKOW4szpZ30CA8uej5/nzN9v4V8w1eMM78y7m5L1w0jwgoVaMQaGE+PIA mc5Xhco0YqAsDEootkgKFBn8fqXCExSnuOm+EFhD0RGpSTbBaXunYLtrlVqd6nSEPpnIsaxcgCNP1 nyLiRlxsxPNphoVRfgE/zZY6hPfr9yvrzGiWBcrqSxNt7F4sXyMllwf8EIYvlgdEtNmnFLJN4JVvC RLvFKpzw==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOcFd-0004Uk-AU; Wed, 15 Apr 2020 07:14:25 +0000 Date: Wed, 15 Apr 2020 00:14:25 -0700 From: Christoph Hellwig To: Luis Chamberlain Cc: Christoph Hellwig , axboe@kernel.dk, viro@zeniv.linux.org.uk, bvanassche@acm.org, gregkh@linuxfoundation.org, rostedt@goodmis.org, mingo@redhat.com, jack@suse.cz, ming.lei@redhat.com, nstange@suse.de, akpm@linux-foundation.org, mhocko@suse.com, yukuai3@huawei.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Omar Sandoval , Hannes Reinecke , Michal Hocko Subject: Re: [PATCH 3/5] blktrace: refcount the request_queue during ioctl Message-ID: <20200415071425.GA21099@infradead.org> References: <20200414041902.16769-1-mcgrof@kernel.org> <20200414041902.16769-4-mcgrof@kernel.org> <20200414154044.GB25765@infradead.org> <20200415061649.GS11244@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200415061649.GS11244@42.do-not-panic.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 15, 2020 at 06:16:49AM +0000, Luis Chamberlain wrote: > The BLKTRACESETUP above works on request_queue which later > LOOP_CTL_DEL races on and sweeps the debugfs dir underneath us. > If you use this commit alone though, this doesn't fix the race issue > however, and that's because of both still the debugfs_lookup() use > and that we're still using asynchronous removal at this point. > > refcounting will just ensure we don't take the request_queue underneath > our noses. > > Should I just add this to the commit log? That sounds much more useful than the trace. Btw, Isn't blk_get_queue racy as well? Shouldn't we check blk_queue_dying after getting the reference and undo it if the queue is indeeed dying?