Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752533AbeABKfs (ORCPT + 1 other); 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 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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(-) 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; } -- 2.9.0