From patchwork Tue Jan 2 10:34:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 123113 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8805377qgn; Tue, 2 Jan 2018 02:35:52 -0800 (PST) X-Google-Smtp-Source: ACJfBot9w2ex0yiEfm+jWlukT5GJaBMA/RC5s19J4GM8qcFo/2Jog4+KPu4kKM/O0Zhwlh8cJRCL X-Received: by 10.98.242.9 with SMTP id m9mr44621926pfh.168.1514889352798; Tue, 02 Jan 2018 02:35:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514889352; cv=none; d=google.com; s=arc-20160816; b=mCk+bdERazBfvQ61dPmUXAiCsyC7Kcl7UzdaLlPT4FVri2+xMj0jbcPjdTHEI3nDs+ BwA20zh3OnKjhbxB2faM0v79tavlS1Im1Do5MkbfblDOyCjl3n5x1mHfcmwvY9XUDwhA WG+YAsZJYGGRLH+e5Z4+vbb/4zPBXZXVniz2IWMxzvw8P8TLw520sTqPPMvZwTjSfB3s NfZcg9ncshvQEZWApNvi8ZfPDY+HpLtv9MGax/EwMiy3nv0SK/IZvNhZVUC/8HGoJ7+X xFRETKmah0nte1ahYWHViL0YI7oqMlcAxsq51FUTOe42kxqy8SvAwge5p0k4XmJGP2ba TgVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fdrKsbJY5v5LuUaE0Tq5wv0fHdkDVxFSRGzZowlIX6s=; b=GkoJ1jaMKUSynJZI2/UO23LF4DG1BirHUBzefl0svgRRrQwPNExoU85gfzQgjiPaHk AFCdzym+iqe0tQT14EE45PdoINUjb83AZdAXh+ymG9ubaK8QX55b9lq7/yjCYpOFDVPs thqlsgb2LoZ1RB00O8IAFZv7bdmU4ZVZgG/VTorw8R3kNmwlrCHwpri+ZLQJVpWhv7+L EfjzH/bHHrZe/Ud6ZyneUXvURFLzpFGGfHtENlXikZgtR0viUxpRCTR05Jhaf9S6KU21 9UZMFvt5hhXlTPa6yoHRfDF0BRRgcGNQRKTL46sfPV09mloPyH4v4fAEDT5pyaBHotQ1 gp6A== ARC-Authentication-Results: i=1; mx.google.com; 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 i1si9712486pgt.556.2018.01.02.02.35.52; Tue, 02 Jan 2018 02:35:52 -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; 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 S1752533AbeABKfs (ORCPT + 28 others); Tue, 2 Jan 2018 05:35:48 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:59907 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283AbeABKfr (ORCPT ); Tue, 2 Jan 2018 05:35:47 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0M53la-1eqloQ1mPO-00zHHI; Tue, 02 Jan 2018 11:35:24 +0100 From: Arnd Bergmann To: Andrew Morton , Mark Fasheh , Joel Becker Cc: Arnd Bergmann , Changwei Ge , Stephen Rothwell , Jun Piao , Fabian Frederick , alex chen , ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: [PATCH] ocfs: fix fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix Date: Tue, 2 Jan 2018 11:34:42 +0100 Message-Id: <20180102103520.865665-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:iEuVZ8sn3fdmK0zBu/g+trNRCf+JmMsAduUnNimzVaSG2TUfcq7 DQwZQJiakn5PHEQ1nR1OCDGXhSZ+jk01ecFtDocDXWbHvOYXzp0dqujSsr5w06/zYL6FIG8 D9hStzPy2ggE29+g/O7L3WZen62bcUd0RaLDSd40pcckonraJYTFpkhn1LqnlrPkPW7SQEC Gkr0yE6kceCZYemD8dzSA== X-UI-Out-Filterresults: notjunk:1; V01:K0:paPQYMkV5Qk=:o4nq+GYHkJv8rf7HmXCwkd Km4ogbJyBZlsMKn96VpxDCWO3UuCnITtnAq1p1DReAa7moeG2aLfqFzZ0EZ/fsj0USIIaTooa dNR0VZdA6EfP/b1lneoFOHp5cpBINuT/Nq9KXl0DLQBBEySLmACfi6+Fj1bL2rndcO61ZZeCJ +v0yS5m0J7FB+MDvel+FUzpOx7FIq/DqUGbJj/fq62RgY+wWbUsImfgxborrwbmgHLlGlLFEh hgWQbO3kclJrcN5vpe75NncBq1rjLy1eSc4FMKlSP0Qtk+ur3J9pGuGM2tLVjARPulyBndRnt hRPVxu4YOh283uTzY7kwiCHQNK6k1i2AtG3E8ZLAX/Z+HU4gdbgnJSJXnGPTseFxGOeaAa/RJ L1UV6n0Pr1yKVREySl18FLkVb9lkGmn6fmCZJ2Hu3VFigWTDmcAi0W3LRa15ysRlreAsZHTsH wYusZkFDT99OWZY9pouB1HrA+8+Q2xUExQea6uoWkk6vJZqQ9RW4+bbGRaxfZxhJvqlg9/v/0 5/hKdvyNEyp1ZQ5zRzQi1akM4yiWSC+2OeHwMFsKxuOYluo5/Lk8jrr/Bd5/tqeOngCbOHS/B FjunHKU6z25kcPZZ/5kl3l4wcVOo2Fnd9my0OYKuiAflf7sBssGO1r4xX+zrnlbpugdCf6K4M UM6c0F1Mxyx4dmO3x9wJ8UnJksznUtsGbTpsKOT5xULDW07k7gQ1+nqiqzUawueh9r7zTMslu DYLKv3D9dRlFvNKUsWqsGNTnjXpRHhZNUus58Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 'ret' variable is used to store the integer return value of ocfs2_get_clusters(), as shown by this warning from modern compilers: fs/ocfs2/aops.c: In function 'ocfs2_range_has_holes': fs/ocfs2/aops.c:2437:11: error: comparison of constant '0' with boolean expression is always false [-Werror=bool-compare] Fixes: mmotm ("ocfs2-fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix") Signed-off-by: Arnd Bergmann --- fs/ocfs2/aops.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.9.0 diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 87562112cb5e..8aa2519a0966 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -2432,10 +2432,11 @@ static bool ocfs2_range_has_holes(struct inode *inode, loff_t pos, size_t count) clusters = ocfs2_clusters_for_bytes(sb, pos + count) - cpos; while (clusters) { - ret = ocfs2_get_clusters(inode, cpos, &phys_cpos, &extent_len, - &extent_flags); - if (ret < 0) { - mlog_errno(ret); + int err = ocfs2_get_clusters(inode, cpos, &phys_cpos, + &extent_len, &extent_flags); + if (err < 0) { + mlog_errno(err); + ret = true; goto out; }