[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180102103520.865665-1-arnd@arndb.de>
Date: Tue, 2 Jan 2018 11:34:42 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Andrew Morton <akpm@...ux-foundation.org>,
Mark Fasheh <mfasheh@...sity.com>,
Joel Becker <jlbec@...lplan.org>
Cc: Arnd Bergmann <arnd@...db.de>, Changwei Ge <ge.changwei@....com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Jun Piao <piaojun@...wei.com>,
Fabian Frederick <fabf@...net.be>,
alex chen <alex.chen@...wei.com>, ocfs2-devel@....oracle.com,
linux-kernel@...r.kernel.org
Subject: [PATCH] ocfs: fix fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix
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 <arnd@...db.de>
---
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
Powered by blists - more mailing lists