[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1608624010-69405-1-git-send-email-abaci-bugfix@linux.alibaba.com>
Date: Tue, 22 Dec 2020 16:00:10 +0800
From: YANG LI <abaci-bugfix@...ux.alibaba.com>
To: song@...nel.org
Cc: linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
YANG LI <abaci-bugfix@...ux.alibaba.com>
Subject: [PATCH] md/raid10: fix: incompatible types in comparison expression (different address spaces).
Fixes the following sparse errors in drivers/md/raid10.c error:
incompatible types in comparison expression (different address spaces).
The error was because of the following line in function read_balance():
rdev = rcu_dereference(conf->mirrors[disk].replacement);
if (rdev == NULL || test_bit(Faulty, &rdev->flags) ||
r10_bio->devs[slot].addr + sectors > rdev->recovery_offset)
rdev = rcu_dereference(conf->mirrors[disk].rdev);
Annotating the struct md_rdev *rdev and *replacement in
drivers/md/raid10.h with __rcu fixes the sparse error.
Signed-off-by: YANG LI <abaci-bugfix@...ux.alibaba.com>
Reported-by: Abaci <abaci@...ux.alibaba.com>
---
drivers/md/raid10.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h
index 79cd2b7..910bd5f 100644
--- a/drivers/md/raid10.h
+++ b/drivers/md/raid10.h
@@ -16,7 +16,8 @@
*/
struct raid10_info {
- struct md_rdev *rdev, *replacement;
+ struct md_rdev __rcu *rdev;
+ struct md_rdev __rcu *replacement;
sector_t head_position;
int recovery_disabled; /* matches
* mddev->recovery_disabled
--
1.8.3.1
Powered by blists - more mailing lists