From patchwork Thu Apr 28 01:09:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8964651 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 5042FBF29F for ; Thu, 28 Apr 2016 01:11:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 824E82025A for ; Thu, 28 Apr 2016 01:11:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F23272026F for ; Thu, 28 Apr 2016 01:11:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753582AbcD1BKA (ORCPT ); Wed, 27 Apr 2016 21:10:00 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:33329 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753343AbcD1BJ5 (ORCPT ); Wed, 27 Apr 2016 21:09:57 -0400 Received: by mail-pa0-f67.google.com with SMTP id vv3so7737096pab.0; Wed, 27 Apr 2016 18:09:57 -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=SZtfLpWfx0JcSkbwELZtfwz+MFo0yByMrgZeocHf0cakK6E+eefQeBjkrSebnSMQj2 fGbX1FaKJ7CBS+r9CPivIxngXifRBZXNWuGs8j1JzTKLbtu6t4J7BJKj+xGz19W4zvzk /gC4jABPS3oCaDtkCROogHaw8cXI8cC4il79rDpBnPpFU0wCN8sV9NRu1vxLpntZvUnT +bgsEbXf8OrwI3zANvb0CRAn0URYGzHGzTEfHgZWxYyaWzSGJKGmhCtFhoz8v+LhNX0l 4tyoTSZ+oBbctKjSR9xhMng45shcDY8kTKLO2koElFWvX+LCF85HjnPjOdzyd8POKAF4 Oe/g== X-Gm-Message-State: AOPr4FVoXDnt8XdAUoxE1gMpPLnPnN1PAeb76X4ta4kgQR5i5gsDYy8N6LEcu9itWLRWsg== X-Received: by 10.66.153.209 with SMTP id vi17mr16516748pab.0.1461805796601; Wed, 27 Apr 2016 18:09:56 -0700 (PDT) Received: from localhost ([103.192.227.7]) by smtp.gmail.com with ESMTPSA id fv10sm9902171pad.40.2016.04.27.18.09.55 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 27 Apr 2016 18:09:55 -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 v3 1/3] fs: direct-io: handle error in dio_end_io() Date: Thu, 28 Apr 2016 09:09:47 +0800 Message-Id: <1461805789-3632-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=unavailable 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