Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp260024pxb; Wed, 3 Feb 2021 05:05:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzT0jc7+yUU14HA1Aby+RrARcj6utTh7xuDZBReV5V/cA645eZuTRiZg+AvW2jBljlE226b X-Received: by 2002:a17:906:8612:: with SMTP id o18mr822875ejx.435.1612357537599; Wed, 03 Feb 2021 05:05:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612357537; cv=none; d=google.com; s=arc-20160816; b=UCrRnMeEikmqIUDhtnJd6//tF9h2qokRePQyRKxYlkHMCSwkmuhe6d+hCs1XVc+Oux BdNgQU4hi9qkj5FI/9jBtyTYdXi+phkRCYNjRYNCXAYUXqJ/VoX6Y7w9R/rMT1urksYc 0C7s5XPmEH0DU0ggJn79hcbPolxKGlGwX3HoxlUTvcHGWwxvyBGV4qwNqFdm2BNf6eaA NedqzfBXg/e0xmmSTxaRPZ9LyYaz4UG+IBB+uvGAmO46fQpeGvJGMet/Jop0TpwcVmtj SwmGOcmnScR3EpikNJ774Y77lYonXihg77vdQG7sMjisrplu+uXdMWHBIttM/gpJLY+1 UGOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DNBrtoAIdmtDKxsl6ofXUPR5DzCTPSCeMEpAPUW+6zo=; b=auXTepuqqqlugysyWSdOyqY4CzSuAEwv09zxmvEsPnxu0F+X/myIrKbasnmqXsmPdi ZTOzuX6AoL8b01wFdLiyN8y2/Rg2yjKkzid2j50ZceG9d145bIi/DQD4BJkYZprNGRqT N6tub3NPcZKiy8b9h1QNRXqDTsdSZqT+yxge642nsyxZs+g2cQzwBzTmdtb8aIV5McCL O5dWRLzoLWZIETB5A+cwz+YUI1KXK6dwbixi9Ww+b6o/2xaFzJ0/9fiRzLic9+SbkNQZ nmu/nNjfIEistuygSnaky0l5p9MKYyNnMh7/3W5pCxoBHrdR2MvpyYx8YNMyGMfOPwVa 1WpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oFTFXR1t; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si1341139edk.467.2021.02.03.05.05.01; Wed, 03 Feb 2021 05:05:37 -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=@linuxfoundation.org header.s=korg header.b=oFTFXR1t; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231228AbhBCND5 (ORCPT + 99 others); Wed, 3 Feb 2021 08:03:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:49664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbhBCNDy (ORCPT ); Wed, 3 Feb 2021 08:03:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BEB8064E30; Wed, 3 Feb 2021 13:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612357392; bh=y1R4H32diHXkqOg91sW0kNhHSJoL/Qo6+iEJD0IpDVg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oFTFXR1t8wx8adik09QcoaRU8MgPFF4dPPPBwpHxoVx6ytv1p8qC2FYdK81H5Ywie L2j8MSNrdRtkq6P5ZvJ0V2rIErbiYSYAWP8xL0wzesQrQLm61LbyHNF4Gif+x+zjmI K6RNnKjt1ZDP2IF6QFl2+/k1XO9ZXVb3dLPBtwCo= Date: Wed, 3 Feb 2021 14:03:09 +0100 From: Greg Kroah-Hartman To: Andres Freund Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Bijan Mottahedeh , Sasha Levin Subject: Re: [PATCH 5.4 103/142] Revert "block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT" Message-ID: References: <20200601174037.904070960@linuxfoundation.org> <20200601174048.647302799@linuxfoundation.org> <20210203123729.3pfsakawrkoh6qpu@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210203123729.3pfsakawrkoh6qpu@alap3.anarazel.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2021 at 04:37:29AM -0800, Andres Freund wrote: > Hi, > > On 2020-06-01 19:54:21 +0200, Greg Kroah-Hartman wrote: > > From: Jens Axboe > > > > [ Upstream commit b0beb28097fa04177b3769f4bb7a0d0d9c4ae76e ] > > > > 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 > > Signed-off-by: Sasha Levin > > --- > > block/blk-core.c | 11 ++++------- > > 1 file changed, 4 insertions(+), 7 deletions(-) > > > > This broke io_uring direct-io on ext4 over md. > > fallocate -l $((1024*1024*1024)) /srv/part1 > fallocate -l $((1024*1024*1024)) /srv/part2 > losetup -f /srv/part1 > losetup -f /srv/part2 > losetup -a # assuming these were loop0/1 > mdadm --create -n2 -l stripe -N fast-striped /dev/md/fast-striped /dev/loop0 /dev/loop1 > mkfs.ext4 /dev/md/fast-striped > mount /dev/md/fast-striped /mnt/t2 > fio --directory=/mnt/t2 --ioengine io_uring --rw write --filesize 1MB --overwrite=1 --name=test --direct=1 --bs=4k > > 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? thanks, greg k-h