From patchwork Wed Sep 21 14:15:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9343657 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2FAE060B16 for ; Wed, 21 Sep 2016 14:16:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21F8B2A6EC for ; Wed, 21 Sep 2016 14:16:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16C6E2A6F4; Wed, 21 Sep 2016 14:16:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACAEF2A6EE for ; Wed, 21 Sep 2016 14:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932858AbcIUOPk (ORCPT ); Wed, 21 Sep 2016 10:15:40 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:38005 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932385AbcIUOPk (ORCPT ); Wed, 21 Sep 2016 10:15:40 -0400 Received: from hch by bombadil.infradead.org with local (Exim 4.85_2 #1 (Red Hat Linux)) id 1bmiJH-0006Vh-4Y; Wed, 21 Sep 2016 14:15:39 +0000 Date: Wed, 21 Sep 2016 07:15:39 -0700 From: Christoph Hellwig To: Jonathan Nicklin Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: BUG: aio/direct-io data corruption in 4.7 Message-ID: <20160921141539.GA17898@infradead.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Jonathan, please keep linux-fsdevel on the Cc list for something like, and if you already track down a commit the author of that commit. > Description: "fs: simplify the generic_write_sync prototype" > Committed: Apr 7, 2016 > Hash: e259221763a40403d5bb232209998e8c45804ab8 > Affects: 4.7-rc1 - master > > I have confirmed a fix for the AIO/Direct-IO failure condition but > have not reviewed the rest of the changes associated with that commit. > If you would like a small patch for direct-io.c, let me know. On travel right now, but I suspect you want something like this fix? --- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/direct-io.c b/fs/direct-io.c index 7c3ce73..891f71f 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -276,7 +276,7 @@ static ssize_t dio_complete(struct dio *dio, ssize_t ret, bool is_async) dio->iocb->ki_pos += transferred; if (dio->op == REQ_OP_WRITE) - ret = generic_write_sync(dio->iocb, transferred); + ret = generic_write_sync(dio->iocb, ret); dio->iocb->ki_complete(dio->iocb, ret, 0); }