All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs: fix fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix
@ 2018-01-02 10:34 ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2018-01-02 10:34 UTC (permalink / raw)
  To: Andrew Morton, Mark Fasheh, Joel Becker
  Cc: Arnd Bergmann, Changwei Ge, Stephen Rothwell, Jun Piao,
	Fabian Frederick, alex chen, ocfs2-devel, linux-kernel

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ocfs: fix fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix
@ 2018-01-02 10:34 ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2018-01-02 10:34 UTC (permalink / raw)
  To: Andrew Morton, Mark Fasheh, Joel Becker
  Cc: Arnd Bergmann, Changwei Ge, Stephen Rothwell, Jun Piao,
	Fabian Frederick, alex chen, ocfs2-devel, linux-kernel

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs: fix fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix
  2018-01-02 10:34 ` Arnd Bergmann
@ 2018-01-02 11:14   ` alex chen
  -1 siblings, 0 replies; 4+ messages in thread
From: alex chen @ 2018-01-02 11:14 UTC (permalink / raw)
  To: Arnd Bergmann, Andrew Morton
  Cc: Mark Fasheh, Joel Becker, Changwei Ge, Stephen Rothwell, Jun Piao,
	Fabian Frederick, ocfs2-devel, linux-kernel

Hi Arnd,

On 2018/1/2 18:34, Arnd Bergmann wrote:
> Fixes: mmotm ("ocfs2-fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix")
I think this patch is not fit for mainline and will not be apply to mainline in the future.
Andrew can remove it from mm-tree.

Thanks,
Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ocfs: fix fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix
@ 2018-01-02 11:14   ` alex chen
  0 siblings, 0 replies; 4+ messages in thread
From: alex chen @ 2018-01-02 11:14 UTC (permalink / raw)
  To: Arnd Bergmann, Andrew Morton
  Cc: Mark Fasheh, Joel Becker, Changwei Ge, Stephen Rothwell, Jun Piao,
	Fabian Frederick, ocfs2-devel, linux-kernel

Hi Arnd,

On 2018/1/2 18:34, Arnd Bergmann wrote:
> Fixes: mmotm ("ocfs2-fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix")
I think this patch is not fit for mainline and will not be apply to mainline in the future.
Andrew can remove it from mm-tree.

Thanks,
Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-02 11:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-02 10:34 [Ocfs2-devel] [PATCH] ocfs: fix fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix Arnd Bergmann
2018-01-02 10:34 ` Arnd Bergmann
2018-01-02 11:14 ` [Ocfs2-devel] " alex chen
2018-01-02 11:14   ` alex chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.