From mboxrd@z Thu Jan 1 00:00:00 1970 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 7D0C131F9A4 for ; Wed, 27 May 2026 13:27:03 +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=1779888424; cv=none; b=Jm1d5o22tOJS76Pj4C/rkbH06Nr5cs8N1/L84UDf1wQu+2bIEuX+wFr5h5T88aov0WxtgqscuvCtYltgdXJfTbxVqPqNIgVZRYpKsyXwzSu3VchDO2MzgjNrg8YCbcoqpZFDd2c5jJzHZgxDfGqy9UknADBn/AN3LH6Nsrd4qvw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779888424; c=relaxed/simple; bh=Z/KPjcDLjH5kfSMSPF7cA4sWOsbfOJb2+RilRCroJQc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QjUAVlvRKh+X00Xk1FBGo0AS9b7g4Ayl5kcdDrVLX8cRgyw0o14/E7D538B9T/DS2kVSYWSWUJU574e+5P1f2wf/ebjcieJkzLXT1nG5if+fAH6qHL/x4RYKmjFgU4YMep9E4KutKbSwXtiL+ATgCS1To2USPebVOvYwQ3g/5Cc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (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=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 30FE968B05; Wed, 27 May 2026 15:26:59 +0200 (CEST) Date: Wed, 27 May 2026 15:26:59 +0200 From: Christoph Hellwig To: Chao Shi Cc: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Sungwoo Kim , Dave Tian , Weidong Zhu Subject: Re: [PATCH] nvme: bound the freeze drain in passthrough commands Message-ID: <20260527132658.GA11713@lst.de> References: <20260527055923.456769-1-coshi036@gmail.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: <20260527055923.456769-1-coshi036@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Wed, May 27, 2026 at 01:59:23AM -0400, Chao Shi wrote: > nvme_passthru_start() drains in-flight I/O via the unbounded > nvme_wait_freeze() before submitting a command with command-set > effects (Format NVM, Sanitize, Namespace Management, vendor unique). > If a completion is silently dropped or the device hangs, the calling > task wedges with ctrl->scan_lock and ctrl->subsys->lock held, fanning > out into hung-task reports on any concurrent open/close/passthru on > the same controller: > > INFO: task syz-executor:NNNN blocked for more than 123 seconds. > nvme_wait_freeze+0x82/0x100 > nvme_passthru_start drivers/nvme/host/core.c:1249 [inline] > nvme_submit_user_cmd+0x1ee/0x3d0 drivers/nvme/host/ioctl.c:189 > > The other freeze-drain sites (pci shutdown, tcp/rdma reset) already > bound the wait with nvme_wait_freeze_timeout(NVME_IO_TIMEOUT). Apply > it here too; on timeout, unwind the freeze and return -EBUSY (or > NVME_SC_INTERNAL on the nvmet path) instead of submitting the command. > > Found by FuzzNvme(Syzkaller with FEMU fuzzing framework). So not blocking forever sounds useful, but this might break existing uses. I guess we could do it based on the O_NONBLOCK flag if people really cared. Note that the blocked message itself is not a problem, but around this time we should have done a controller reset and fixed up the issue. Does that not happen for your test case?