Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3626045imu; Mon, 10 Dec 2018 05:24:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/WKNylLVYir0dh085C7BhLA2TyNGLQ6bwztXH/GzDq5eJnfE3nKULd8LlRvF5lcxCC+B6mi X-Received: by 2002:a65:57cb:: with SMTP id q11mr10913954pgr.60.1544448288224; Mon, 10 Dec 2018 05:24:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544448288; cv=none; d=google.com; s=arc-20160816; b=qkEgMecwlEJ8vSDKI/dv2F1sZjMTYZgwL2JRmdH8r44UkHsaexDHtwTw0ZQk7+Sf4P mHdELssnT8g2R/uM/Eub686T6cGoaAOV1ClzfBnvwSNpRMBqBo8XjoovBOCH8O3gOxJY C3GaIViAg4hyVPwxHk2i/PqfWUcl/CNn97JtwELxR+EdPxuuSb2m+7sLj36SLkiSFZt5 SecDC77t+tvI6TdbRiKhrHbIUKWYg5SySet7GBFvlpBaiPwampT8D8ZLAx9eTnKFZ442 CR0esUhk8SI9oh/zwT5NSgasBaQM7WVf7QnFhgJWuOL8ZACv1xtPRqNPWGEzR5d/kgzm agnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=EQWDNS3eJagl4GiYLlsHgjmuxl690BcYrbyeXKH+odw=; b=WGl9o+QT8JtunaZEgagallL1JAMF8GqxqHBpkCBkdKyWC36ylx+Ml5csf8c8Sej+X5 cL93SuSCxMFf+eaBsuMA1rdPsrSoLsqDzRDXvcNyNBhj78w8wU7wPkBOPEysG+W2mq+H JxgFI3Wd/BMSRme1jxXJqQWwJqOw+qRHnqcQFreMKZw7StxPeFMP9znADPzLLKdX1/8H vdjPc1wOf/0zMToaWPSozcne4B+ur/b3z1YRgMUsNYjnY5PjZz8+VKTiFfFjQxZwYn1u okMUtgxujj5ttaleuoJIL/Ls84Gpo5N0NYCrRIGzHYyOW54uj8r+7vPX3ML9kYHM6fRt ghKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn22si9890075plb.19.2018.12.10.05.24.33; Mon, 10 Dec 2018 05:24:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727176AbeLJMs3 (ORCPT + 99 others); Mon, 10 Dec 2018 07:48:29 -0500 Received: from mx2.suse.de ([195.135.220.15]:43184 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727054AbeLJMs2 (ORCPT ); Mon, 10 Dec 2018 07:48:28 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BBDFFAF79; Mon, 10 Dec 2018 12:48:26 +0000 (UTC) Date: Mon, 10 Dec 2018 06:48:23 -0600 From: Goldwyn Rodrigues To: Avi Kivity Cc: linux-kernel , linux-aio@kvack.org Subject: Re: Spurious EIO on AIO+DIO+RWF_NOWAIT Message-ID: <20181210124823.iw4mxmdqpsdfeap4@merlin> References: <9bab0f40-5748-f147-efeb-5aac4fd44533@scylladb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9bab0f40-5748-f147-efeb-5aac4fd44533@scylladb.com> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13:19 09/12, Avi Kivity wrote: > I have an application that receives spurious EIO when running with > RWF_NOWAIT enabled. Removing RWF_NOWAIT causes those EIOs to disappear. The > application uses AIO+DIO, and errors were seen on both xfs and ext4. > > > I suspect the following code: > > > /* > ?* Process one completed BIO.? No locks are held. > ?*/ > static blk_status_t dio_bio_complete(struct dio *dio, struct bio *bio) > { > ??????? struct bio_vec *bvec; > ??????? unsigned i; > ??????? blk_status_t err = bio->bi_status; > > ??????? if (err) { > ??????????????? if (err == BLK_STS_AGAIN && (bio->bi_opf & REQ_NOWAIT)) > ??????????????????????? dio->io_error = -EAGAIN; > ??????????????? else > ??????????????????????? dio->io_error = -EIO; > ??????? } > > Could it be that REQ_NOWAIT was dropped from bio->bi_opf? or that > bio->bi_status got changed along the way? > I don't think REQ_NOWAIT is dropped. I am assuming bio->bi_status error is set differently. Is the blk queue being stopped? Is it possible to instrument the kernel in your testcase? -- Goldwyn