From patchwork Tue Mar 14 21:53:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Zwisler X-Patchwork-Id: 9624597 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 94617604A9 for ; Tue, 14 Mar 2017 21:54:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8677027B2F for ; Tue, 14 Mar 2017 21:54:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B396285A7; Tue, 14 Mar 2017 21:54:17 +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=unavailable 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 0439B27B2F for ; Tue, 14 Mar 2017 21:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752886AbdCNVyG (ORCPT ); Tue, 14 Mar 2017 17:54:06 -0400 Received: from mga07.intel.com ([134.134.136.100]:30204 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751752AbdCNVyF (ORCPT ); Tue, 14 Mar 2017 17:54:05 -0400 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP; 14 Mar 2017 14:54:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,165,1486454400"; d="scan'208";a="76832103" Received: from theros.lm.intel.com ([10.232.112.77]) by fmsmga006.fm.intel.com with ESMTP; 14 Mar 2017 14:54:03 -0700 From: Ross Zwisler To: Andrew Morton , linux-kernel@vger.kernel.org Cc: Ross Zwisler , "Darrick J. Wong" , Alexander Viro , Christoph Hellwig , Dan Williams , Jan Kara , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-mm@kvack.org, linux-next@vger.kernel.org, Xiong Zhou Subject: [PATCH] dax: fix regression in dax_writeback_mapping_range() Date: Tue, 14 Mar 2017 15:53:58 -0600 Message-Id: <20170314215358.31451-1-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170314025642.nwpf7zxbc6655gum@XZHOUW.usersys.redhat.com> References: <20170314025642.nwpf7zxbc6655gum@XZHOUW.usersys.redhat.com> 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 commit 354ae7432ee8 ("dax: add tracepoints to dax_writeback_mapping_range()") in the -next tree, which appears in next-20170310, inadvertently changed dax_writeback_mapping_range() so that it could end up returning a positive value: the number of bytes flushed, as returned by dax_writeback_one(). This was incorrect. This function either needs to return a negative error value, or zero on success. This change was causing xfstest failures, as reported by Xiong: https://lkml.org/lkml/2017/3/13/1220 With this fix applied to next-20170310, all the test failures reported by Xiong (generic/075 generic/112 generic/127 generic/231 generic/263) are resolved. Reported-by: Xiong Zhou Signed-off-by: Ross Zwisler --- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index 1861ef0..60688c7 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -907,7 +907,7 @@ int dax_writeback_mapping_range(struct address_space *mapping, } out: trace_dax_writeback_range_done(inode, start_index, end_index); - return ret; + return (ret < 0 ? ret : 0); } EXPORT_SYMBOL_GPL(dax_writeback_mapping_range);