Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2509690imu; Sun, 9 Dec 2018 03:21:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/XTyFQju0v6L52wXhbCgsB/RabI6OwgjmhwwcMnXSW8TAFJzgavgxcBudc3SHaqI6XTE96T X-Received: by 2002:a65:610d:: with SMTP id z13mr7531998pgu.427.1544354511029; Sun, 09 Dec 2018 03:21:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544354511; cv=none; d=google.com; s=arc-20160816; b=TJYvY8Ta2CfwsWXHh251dBIIBYbsqW/jYkX52pUTmurfSCL3IBzJXawS0WZFbMUc10 7XcHErT2WGrhTHFSL7H2YbtP+MPW8j9hJE8I3deT17A8S93nkk5EtwV51WpBeMal/MUx 2/mwNf9YLgNHCdr51ZPsexNJXKKJFBQ+Tk0U6uST9WTynH5NIglDo6Fokq2jTBup2Pd8 kQy87JhA/kYX/xDIC35IQT5KWVyoHBDN6eiB3x+zhggEP3Y8qdNE0AXDONdpLNCePceH TMR9lBh2vueGIDANuKKgmTSRjy80ovEC3BonxEaXXFScECCPyJo9P0yywiq1JSHpPhN5 Ja/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:mime-version:user-agent:date:message-id :organization:subject:from:to:dkim-signature; bh=Dh460xW9kcZcktjxXXqaeV2sn3YJaRvsFIigu3g9zu4=; b=0FRpVO5ojud49QCRn+D1tMIAYpGW5HBOpyWkPEX3P9gUqIWCyBMdBrBuOgOSCtzFGE tHor2LrmzADeNRz3es2X6Qw/k6OfukkrDBDlCJtyXB/Oob3RXe6wfaQ2TD7nW+CqpEv2 9QnfvlEEBkSdztXE/JoAVP2JHel0y2OWADfeqpLXcY/nDfG3eR45hgFCi+8AfErmenkm dguKy4wMfaJAtdmhTlifylaviD6iAdmBjokSNREB6A1vlNjYIytTzAXVRRXu0Y9+8iLq 1bKq10v24HEsJYoQq95iZmnG6pigNRznXZ1ndDOg60yQYyGYNP9B/0XyWsyQFODnNHht WT9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@scylladb-com.20150623.gappssmtp.com header.s=20150623 header.b=qtqb8b7m; 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 w7si6401618ply.421.2018.12.09.03.21.35; Sun, 09 Dec 2018 03:21:50 -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; dkim=pass header.i=@scylladb-com.20150623.gappssmtp.com header.s=20150623 header.b=qtqb8b7m; 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 S1726272AbeLILT4 (ORCPT + 99 others); Sun, 9 Dec 2018 06:19:56 -0500 Received: from mail-wr1-f51.google.com ([209.85.221.51]:44415 "EHLO mail-wr1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726205AbeLILTz (ORCPT ); Sun, 9 Dec 2018 06:19:55 -0500 Received: by mail-wr1-f51.google.com with SMTP id z5so7684154wrt.11 for ; Sun, 09 Dec 2018 03:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scylladb-com.20150623.gappssmtp.com; s=20150623; h=to:from:subject:organization:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=Dh460xW9kcZcktjxXXqaeV2sn3YJaRvsFIigu3g9zu4=; b=qtqb8b7mJLu0Uuun2iacY8epunXL6jSDxEzWhENPJ2xfipjnuusxLCDprDdlUmoPHj HgFRacjbp+T9picVAIbb08n5hc3d2xLfEOcSt/3384l1ZJBQDzYg23AJauGslUJblq5M gpfhxdg7ZZAyL5iGHd+orbtaG8GsqX5NkGdrUEf8b4PG3LsO/9ZejPMr3YVzLHTTRsxC 4HSKNB+M/j7afyDn7ybDZFiNx1p8wiiNoDVRCz3qj7wR6EaUMP3o47yAUVMutvZM8nFh hbgZmo8UcIoavwuBw0xeUeSUwVI9YBwi9O1WP4OWv3qz2dUu3sPWudXM/2JqfqGb0rOU ju5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:organization:message-id:date :user-agent:mime-version:content-transfer-encoding:content-language; bh=Dh460xW9kcZcktjxXXqaeV2sn3YJaRvsFIigu3g9zu4=; b=kE6+TePYhcVOttupAxw6b8DuLX2yN537l/jmzwuGD3eC64mS7CsCnH7hyHjW6SjNo9 t0SLf9+asMGx50KbAneQ/BfCYFyxCEsJTZA4fwbYuYxu/QU4Bcl18AxbopOQmqW5Bm+3 9lh3u/vSyT90rZpCIwaQ68qAJaZaJTgGuXo1A6VOI71+sLFiUTZ29Ojdyw3+m08VuxVC HWYj6oNMGi41jTRTLItm1TofooPO6FHVF9TkDn+5iFau2vwJ68JBn87SuMGsjO+vZcWe Fd+gDgMzKJig5D7523uDK4LYxwm1wS33TaXNEd+Xv9wXNbr2WpNyZYJIU8/MaOfAPbBK BoOw== X-Gm-Message-State: AA+aEWbsieUvWh9E4gBirAJOZW69QvRup2eR7/j3ZXwLX9jHIc+RTZqf mJXtfDmXQXCxLSWExKtKhwqz+NFofL8= X-Received: by 2002:adf:fc89:: with SMTP id g9mr6521311wrr.96.1544354393801; Sun, 09 Dec 2018 03:19:53 -0800 (PST) Received: from avi.cloudius-systems.com (system.cloudius-systems.com. [199.203.229.89]) by smtp.gmail.com with ESMTPSA id j202sm23596138wmf.15.2018.12.09.03.19.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Dec 2018 03:19:52 -0800 (PST) To: linux-kernel , linux-aio@kvack.org, Goldwyn Rodrigues From: Avi Kivity Subject: Spurious EIO on AIO+DIO+RWF_NOWAIT Organization: ScyllaDB Message-ID: <9bab0f40-5748-f147-efeb-5aac4fd44533@scylladb.com> Date: Sun, 9 Dec 2018 13:19:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Reducing the test case may be a lot of work, but I can package a binary using docker if a reproducer is needed. Seen on 4.18.19 and 4.19.something.