Skip to contentSkip to conversation

md/raid5 - fix build error

PATCH In review [email protected] 2 participants 4 messages Jan 7, 2017 – Jan 9, 2017 MD RAID

lore
Share & tools
lore
#0 lore raw

cover md/raid5 - fix build error

From: Jes Sorensen <[email protected]>

Hi,

commit 6995f0b247e15e34fbcd10852c08b30bdc1a78da

Author: Shaohua Li <[email protected]>
Date:   Thu Dec 8 15:48:17 2016 -0800

md: takeover should clear unrelated bits

Introduced a bug comparing a pointer against an integer, which fails the build when stricter checking is in place. This should ideally be included in 4.10.

Cheers,
Jes

Jes Sorensen (1):
md/raid5: Use correct IS_ERR() variation on pointer check

 drivers/md/raid5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 md/raid5: Use correct IS_ERR() variation on pointer check

From: Jes Sorensen <[email protected]>

This fixes a build error on certain architectures, such as ppc64.

Fixes 6995f0b247e("md: takeover should clear unrelated bits")
---
 drivers/md/raid5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid5.c +1 -1
index 06d7279..0e0646b 100644
@@ -7829,7 +7829,7 @@ static void *raid5_takeover_raid1(struct mddev *mddev)
 	mddev->new_chunk_sectors = chunksect;
 
 	ret = setup_conf(mddev);
-	if (!IS_ERR_VALUE(ret))
+	if (!IS_ERR(ret))
 		clear_bit(MD_FAILFAST_SUPPORTED, &mddev->flags);
 	return ret;
 }
Signature · 1 line
2.9.3
#2 lore raw

Re: [PATCH 1/1] md/raid5: Use correct IS_ERR() variation on pointer check

Quoted 3 lines · On Fri, Jan 06, 2017 at 07:31:35PM -0500, [email protected] wrote:

From: Jes Sorensen <[email protected]>

This fixes a build error on certain architectures, such as ppc64.

Yep, we should use IS_ERR here, applied this. I'm curious why there is a compile error. The IS_ERR_VALUE casts the pointer to 'unsigned long'.

Thanks,
Shaohua

Quoted 22 lines
Fixes 6995f0b247e("md: takeover should clear unrelated bits")
---
 drivers/md/raid5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid5.c +1 -1
index 06d7279..0e0646b 100644
@@ -7829,7 +7829,7 @@ static void *raid5_takeover_raid1(struct mddev *mddev)
 	mddev->new_chunk_sectors = chunksect;
 
 	ret = setup_conf(mddev);
-	if (!IS_ERR_VALUE(ret))
+	if (!IS_ERR(ret))
 		clear_bit(MD_FAILFAST_SUPPORTED, &mddev->flags);
 	return ret;
 }
Signature · 1 line
2.9.3
#3 lore raw

Re: [PATCH 1/1] md/raid5: Use correct IS_ERR() variation on pointer check

Quoted 7 lines · Shaohua Li
Quoted 3 lines · On Fri, Jan 06, 2017 at 07:31:35PM -0500, [email protected] wrote:

From: Jes Sorensen <[email protected]>

This fixes a build error on certain architectures, such as ppc64.

Yep, we should use IS_ERR here, applied this. I'm curious why there is a compile error. The IS_ERR_VALUE casts the pointer to 'unsigned long'.

When building on ppc64 I get a -Wsign-compare build error due to -Werror.

Cheers,
Jes