Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1549596pxb; Thu, 4 Feb 2021 16:28:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyamszsGyBj+puZFX0m3+C/6kc2fOjfQsRAaoeDVsA/xsbZjWCQkNM/KYpxe0Fc01w4GehA X-Received: by 2002:aa7:dd49:: with SMTP id o9mr1107228edw.14.1612484903152; Thu, 04 Feb 2021 16:28:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612484903; cv=none; d=google.com; s=arc-20160816; b=YTpRZ+1SYIaj8y9Zejc5KP8T5bJJJOgCjNbmAOHRQxwQtcSWJOi2bPkcXZIupX+WBP rwIMYEhhJnZffo0l62hS2+X6u+HI3EYtup42+BK6iua3rS60QAFptUwrvvTbrkLHoGQJ XTjJJ86D7MMruvCHxSQKxTaGodgu+iqG/mdl4nQmN9G7nzHM4KUmXZ3GPDyWyVroYehz 8KHvcd2g6hwB7RD3ohj616TBxmAMVsl92nvqOYpxiXRXt+zMwqcAKpOsj1ZZvmll86wp f84G4C24CZcFD46DFYMqI4G3XQy0Hgx82lO3Dv+khQxJJUmuyfknNxpKIaEKbl9i8quE x8Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=4b6g4Ixc+28bqJmLbqvgP9hQfDNHN5yB7hwfEVlSifU=; b=f6vHQJJVyolqrCdpplXNGFEawexUIx7MfRDBaABl0zVs4eyF0HI9SOzhnvW3Zhhbjk fc925DfVoEEkzY5YGwZeiDIz7m9gOaYiv9BNhlJpVaOlg9U8Do4Zr64wELR0KseDXGjS IW6UKp/f/XJGrFG9FMRjSTHY9dnU/tayf5/0vhQHIqVVvAuoxsuDT65fJ1KkfbAUYbGr WDMILQCWvieQme0fm1JAqR4BueYPa6Cm4o9UUCzYBNa80V0yiMVxqd9nMK3NH4oV2mGT 5zszREZiLrQqnB8b8iswKGlzZZaxGaqDi6sX/mSaDfUL7k3shNtLQUrQWjxyshEx+T0o 5VPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=DoDUzF1F; 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 f11si4294218edd.393.2021.02.04.16.27.57; Thu, 04 Feb 2021 16:28:22 -0800 (PST) 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=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=DoDUzF1F; 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 S236862AbhBDOiq (ORCPT + 99 others); Thu, 4 Feb 2021 09:38:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236804AbhBDOhA (ORCPT ); Thu, 4 Feb 2021 09:37:00 -0500 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B08ACC061786 for ; Thu, 4 Feb 2021 06:36:19 -0800 (PST) Received: by mail-io1-xd31.google.com with SMTP id q7so3453720iob.0 for ; Thu, 04 Feb 2021 06:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4b6g4Ixc+28bqJmLbqvgP9hQfDNHN5yB7hwfEVlSifU=; b=DoDUzF1FugVu39+pUjXZWuLuaHXDph+UhmdKadXCiWqSUmC1sJhnXcmmp4Eof4jQ8P n0AnSpOF/hTGapO/LwzkZHzuSCpF/dPQHD2XA4yXTwSxIuzq2JIi6Ziv9awcN6cBccih 5Y3JOLQ9T2pp8qhNcx+U/65i454AmopgdlxTbkPF6eVAPep/AbT/KmIu23CqU8rCrzYg TLdgtYTqKwPnIozcZaDmIwaypdKVPdcGJv7tJI40nduW/Oe3pOJw/9sfbALoAdqHSfaU HE3293si0bclf3cih/YEV9cowsZyuoQ7mbRCbYp6C7IYGtB/sWkp2vIf7OfqizIsY35j ZjFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4b6g4Ixc+28bqJmLbqvgP9hQfDNHN5yB7hwfEVlSifU=; b=JaksiHIH2bx3TmwnJW9RcQDXnxuSiW/B6ExncWlxfjgM29Ht/QJMvEL3LQ8t+SGyTZ QcMc8falhzyN0KQb2cq+GZTmgClNjq0l0elEAU0XKT83KfZj4hD7vVbLqNIeOP1F0cVQ g5dz9kYD5asLzaoNOYWCi8Q3um+XtyCja9Gmfem9rwIE6SClR5zMa8ItJ9+VCsUPcA32 oNzUZLRO8NYU48+6I3dVt9dzFkekvFZRHDP4XmSLWQpbiNpRl4r84ty+BNjKApOvfYhJ ssG56S9xQbC5fotob4QnaB5InUvHYwr9/fniYebqhORn7YkNjNMgNw36V6MCQcfjdLjK O7Dg== X-Gm-Message-State: AOAM532njQTi6MDtxXUkh1aO09W8riTxZypssx1pNh5TSRnInX+SYiji wwsIoajpbn0NXaNsl3XI3kTVLw== X-Received: by 2002:a6b:d010:: with SMTP id x16mr7164658ioa.107.1612449378915; Thu, 04 Feb 2021 06:36:18 -0800 (PST) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id o8sm2594214ilu.55.2021.02.04.06.36.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Feb 2021 06:36:18 -0800 (PST) Subject: Re: [PATCH 5.4 103/142] Revert "block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT" To: Andres Freund Cc: Greg Kroah-Hartman , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Bijan Mottahedeh , Sasha Levin References: <20200601174037.904070960@linuxfoundation.org> <20200601174048.647302799@linuxfoundation.org> <20210203123729.3pfsakawrkoh6qpu@alap3.anarazel.de> <20210203212826.6esa5orgnworwel6@alap3.anarazel.de> <14351e91-5a5f-d742-b087-dc9ec733bbfd@kernel.dk> <20210203235941.2ibyrc5z3desyd2q@alap3.anarazel.de> From: Jens Axboe Message-ID: <207c4fb1-a3cb-9210-e2b6-8e5490872df6@kernel.dk> Date: Thu, 4 Feb 2021 07:36:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210203235941.2ibyrc5z3desyd2q@alap3.anarazel.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/3/21 4:59 PM, Andres Freund wrote: > Hi, > > On 2021-02-03 15:58:33 -0700, Jens Axboe wrote: >> On 2/3/21 3:06 PM, Greg Kroah-Hartman wrote: >>> On Wed, Feb 03, 2021 at 01:28:26PM -0800, Andres Freund wrote: >>>> On 2021-02-03 14:03:09 +0100, Greg Kroah-Hartman wrote: >>>>>> On v5.4.43-101-gbba91cdba612 this fails with >>>>>> fio: io_u error on file /mnt/t2/test.0.0: Input/output error: write offset=0, buflen=4096 >>>>>> fio: pid=734, err=5/file:io_u.c:1834, func=io_u error, error=Input/output error >>>>>> >>>>>> whereas previously it worked. libaio still works... >>>>>> >>>>>> I haven't checked which major kernel version fixed this again, but I did >>>>>> verify that it's still broken in 5.4.94 and that 5.10.9 works. >>>>>> >>>>>> I would suspect it's >>>>>> >>>>>> commit 4503b7676a2e0abe69c2f2c0d8b03aec53f2f048 >>>>>> Author: Jens Axboe >>>>>> Date: 2020-06-01 10:00:27 -0600 >>>>>> >>>>>> io_uring: catch -EIO from buffered issue request failure >>>>>> >>>>>> -EIO bubbles up like -EAGAIN if we fail to allocate a request at the >>>>>> lower level. Play it safe and treat it like -EAGAIN in terms of sync >>>>>> retry, to avoid passing back an errant -EIO. >>>>>> >>>>>> Catch some of these early for block based file, as non-mq devices >>>>>> generally do not support NOWAIT. That saves us some overhead by >>>>>> not first trying, then retrying from async context. We can go straight >>>>>> to async punt instead. >>>>>> >>>>>> Signed-off-by: Jens Axboe >>>>>> >>>>>> >>>>>> which isn't in stable/linux-5.4.y >>>>> >>>>> Can you test that if the above commit is added, all works well again? >>>> >>>> It doesn't apply cleanly, I'll try to resolve the conflict. However, I >>>> assume that the revert was for a concrete reason - but I can't quite >>>> figure out what b0beb28097fa04177b3769f4bb7a0d0d9c4ae76e was concretely >>>> solving, and whether reverting the revert in 5.4 would re-introduce a >>>> different problem. >>>> >>>> commit b0beb28097fa04177b3769f4bb7a0d0d9c4ae76e (tag: block-5.7-2020-05-29, linux-block/block-5.7) >>>> Author: Jens Axboe >>>> Date: 2020-05-28 13:19:29 -0600 >>>> >>>> Revert "block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT" >>>> >>>> This reverts commit c58c1f83436b501d45d4050fd1296d71a9760bcb. >>>> >>>> io_uring does do the right thing for this case, and we're still returning >>>> -EAGAIN to userspace for the cases we don't support. Revert this change >>>> to avoid doing endless spins of resubmits. >>>> >>>> Cc: stable@vger.kernel.org # v5.6 >>>> Reported-by: Bijan Mottahedeh >>>> Signed-off-by: Jens Axboe >>>> >>>> I suspect it just wasn't aimed at 5.4, and that's that, but I'm not >>>> sure. In which case presumably reverting >>>> bba91cdba612fbce4f8575c5d94d2b146fb83ea3 would be the right fix, not >>>> backporting 4503b7676a2e0abe69c2f2c0d8b03aec53f2f048 et al. > > Having looked a bit more through the history, I suspect that the reason > 5.6 doesn't need c58c1f83436b501d45d4050fd1296d71a9760bcb - which I have > confirmed - is that ext4 was converted to the iomap infrastructure in > 5.5, but not in 5.4. > > I've confirmed that the repro I shared upthread triggers in > 378f32bab3714f04c4e0c3aee4129f6703805550^ but not in > 378f32bab3714f04c4e0c3aee4129f6703805550. I checked up on this, and I do see the issue as well. As far as io_uring is concerned, we don't need that revert in 5.4. So I think the right solution here would be to... revert the revert :-) -- Jens Axboe