From: Arnd Bergmann <arnd@arndb.de>
To: Andrew Morton <akpm@linux-foundation.org>,
Mark Fasheh <mfasheh@versity.com>,
Joel Becker <jlbec@evilplan.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Changwei Ge <ge.changwei@h3c.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Jun Piao <piaojun@huawei.com>, Fabian Frederick <fabf@skynet.be>,
alex chen <alex.chen@huawei.com>,
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 [thread overview]
Message-ID: <20180102103520.865665-1-arnd@arndb.de> (raw)
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@arndb.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
next reply other threads:[~2018-01-02 10:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-02 10:34 Arnd Bergmann [this message]
2018-01-02 11:14 ` alex chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180102103520.865665-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=akpm@linux-foundation.org \
--cc=alex.chen@huawei.com \
--cc=fabf@skynet.be \
--cc=ge.changwei@h3c.com \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfasheh@versity.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=piaojun@huawei.com \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome