From patchwork Wed Apr 27 03:51:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8952251 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D4D7CBF29F for ; Wed, 27 Apr 2016 03:52:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21C9320225 for ; Wed, 27 Apr 2016 03:52:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 322CE20222 for ; Wed, 27 Apr 2016 03:52:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752839AbcD0Dvn (ORCPT ); Tue, 26 Apr 2016 23:51:43 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34231 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751848AbcD0Dvl (ORCPT ); Tue, 26 Apr 2016 23:51:41 -0400 Received: by mail-pf0-f193.google.com with SMTP id 145so3253986pfz.1; Tue, 26 Apr 2016 20:51:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FR0KYNncWYJggNybRIyfp2Vdca5Z8Rq01lxRl8q9ZCg=; b=j3seGiAeeQhYw8rDJzNkiK41cahAr+Dwpg4EBW8KALVb7jHtjUbaU1t4MT7eovIrKA 37euA8V5GZ1UY1wHKA7nMeXq/BacUp02iOI/UgBEymzDZn0ARL3kiwb6I9CJX+czEO3H BIa9fzry27VauL333c/5ADajq19O93YguBeTgN5SnHMn+0IHY2pb4sNUsqJhpTsY3Htb cFqUijpDg+PWh//AesV42ZijGutCVkWaYJ6N8Z/ZlFB14Ujv96BrMQX0Q4a1pvXGFh0k YpZvrXqevn2vLhdXTmobUbdGpQa4regkN7tDEWbozf0NIBUgTlJ5QHrDg4rM/KjTE0db /4gw== X-Gm-Message-State: AOPr4FWReR6HI38eY8xQAteSDCWY3v07Lgrl5nQsNTR4hKU5GnO+n8nQT0r495UtY8P04w== X-Received: by 10.98.13.88 with SMTP id v85mr8627701pfi.150.1461729100871; Tue, 26 Apr 2016 20:51:40 -0700 (PDT) Received: from localhost ([14.153.220.45]) by smtp.gmail.com with ESMTPSA id uw2sm2170674pac.10.2016.04.26.20.51.39 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 26 Apr 2016 20:51:40 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , linux-btrfs@vger.kernel.org, Ming Lei , Alexander Viro , linux-fsdevel@vger.kernel.org (open list:FILESYSTEMS (VFS and infrastructure)) Subject: [PATCH v2 1/3] fs: direct-io: handle error in dio_end_io() Date: Wed, 27 Apr 2016 11:51:34 +0800 Message-Id: <1461729094-22898-1-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If error is passed to dio_end_io(), it should have been dealt with. Unfortunately current code just ignores that silently. Only btrfs uses dio_end_io(). Signed-off-by: Ming Lei --- fs/direct-io.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/direct-io.c b/fs/direct-io.c index 4720377..a8dd60a 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -352,6 +352,9 @@ void dio_end_io(struct bio *bio, int error) { struct dio *dio = bio->bi_private; + if (!bio->bi_error) + bio->bi_error = error; + if (dio->is_async) dio_bio_end_aio(bio); else