From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.95.11.211 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796198548; b=UYbAuVkncafFSCeTz92PxdbUdrW+CgbWLYEVy04Wj9nnzU9LAbBD2qaTpvY1bCrEKrdx Xykfw+0AWZ5l8JhdJU3lMBVHAZd/IeSM7PYYuf4mtUdHmgmCBWFjqpxfLuQaSWvqBMtSF ODmUMF2MD+h8VslD7gDE9ch+0HX6hXo9tR0JQSvDY/uSZbXk+JroXqYXOiBLad3tkHVp6 gUTGE1a9HfqUWm1G7/XlZFBmdbNw+mkmgkBtj8mVmFTkc3CZN7sRl9zuJ9w1TR2PmcLGC gBR2ouyOinvZUWl/nxSHd1grZnte68DI+JUL293VlXeo2avL1e0Zmbux2hYrXUKyW/A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796198548; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; bh=xFRl+IotpgYcBexzBjICfS7odMH2/sAanSUdfu+mT8M=; b=hDoavtd2NTzT97/iakoDMZQcALdFMwWuzcCH6M0oRGHfYwx9FWDXmAk3sjlniEralM+W iXJNPDcOHWwks0tFrl70CuXHJY95InV1I7nWMidUPE6jZxmkJKigvLF9FtOOuI5lHelT0 TAsvLu7LdV8fNV7LoqqbWFsFmrmDilFgZ91PFj4IIT7zjS31OzfENzPjfSxguUAQa/C83 koFrFusAC1Wq/6k1pId3tNHaTPtWBcLu7euc3nOKXngGgzu5ZVuKyi2b5D/xjA7Cdm6gW u55GHT56Xop7WMdzMU+HhbofxoLUDES9oPQkjIAHemu/YoxwOI88wTHZG67TKP6pTjA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.remote-ip=213.95.11.211 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11538606A329; Wed, 2 Dec 2026 08:02:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 11538606A329 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (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 7422068BFE; Wed, 2 Dec 2026 09:02:21 +0100 (CET) Date: Wed, 2 Dec 2026 09:02:21 +0100 From: Christoph Hellwig To: Haris Iqbal Cc: Christoph Hellwig , Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Keith Busch , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [v4 0/3] block: delay support for error injection Message-ID: <20261202080221.GA4326@lst.de> References: <20261111215838.103356-1-haris.iqbal@linux.dev> <179501806989.17649.3138860274842922761.b4-ty@b4> <20261120164416.GA32719@lst.de> <1cf30693-44c6-4761-9900-e36259082e4e@kernel.dk> <20261126083421.GA7403@lst.de> <970946a8-855e-4d65-97d9-71c7cb2ceb20@kernel.dk> <20261130080659.GA8222@lst.de> X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 Tue, Dec 01, 2026 at 10:34:16PM +0100, Haris Iqbal wrote: > I was looking into the report and the scenarios, and I think part of this > is real, but I'm not sure the rest can happen. > > The delayed bio is resubmitted through submit_bio_noacct_nocheck(), which > skips bio_check_eod(). If the disk is removed while the bio waits, I think > the bio can still reach the driver on sd/sr, because their queue is > unfrozen again after del_gendisk(). So this part makes sense and I think > failing the bio in the work when GD_DEAD should fix it. Yes. > > I don't think the use-after-free through nvme multipath can happen. Path > disks are hidden, so their bdev is never added and disk_live() is false, > and error_inject_add() returns -ENODEV for a disk that isn't live. I tried > it with nvme-loop: writing a rule to the path disk's eror_injection file > fails with ENODEV. If that's right, a bio is never delayed on a path disk, > only on the head disk. Ok. > So I'm thinking of adding just the GD_DEAD check. One thing I'd like an > opinion on: a delayed bio holds no q_usage_counter, so del_gendisk() > doesn't wait for it, and only the issuer's open keeps the disk allocated. > Is that fine to rely on, or should the delayed bio take its own reference > on the bdev (and the driver module) for the duration of the delay? I think clearing BIO_ERROR_INJECTED on remapping is also still needed.