You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
MD: change journal disk role to disk 0
Neil pointed out setting journal disk role to raid_disks will confuse reshape if we support reshape eventually. Switching the role to 0 (we should be fine as long as the value >=0) and skip sysfs file creation to avoid error. Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
This commit is contained in:
+6
-2
@@ -566,7 +566,9 @@ static inline char * mdname (struct mddev * mddev)
|
||||
static inline int sysfs_link_rdev(struct mddev *mddev, struct md_rdev *rdev)
|
||||
{
|
||||
char nm[20];
|
||||
if (!test_bit(Replacement, &rdev->flags) && mddev->kobj.sd) {
|
||||
if (!test_bit(Replacement, &rdev->flags) &&
|
||||
!test_bit(Journal, &rdev->flags) &&
|
||||
mddev->kobj.sd) {
|
||||
sprintf(nm, "rd%d", rdev->raid_disk);
|
||||
return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm);
|
||||
} else
|
||||
@@ -576,7 +578,9 @@ static inline int sysfs_link_rdev(struct mddev *mddev, struct md_rdev *rdev)
|
||||
static inline void sysfs_unlink_rdev(struct mddev *mddev, struct md_rdev *rdev)
|
||||
{
|
||||
char nm[20];
|
||||
if (!test_bit(Replacement, &rdev->flags) && mddev->kobj.sd) {
|
||||
if (!test_bit(Replacement, &rdev->flags) &&
|
||||
!test_bit(Journal, &rdev->flags) &&
|
||||
mddev->kobj.sd) {
|
||||
sprintf(nm, "rd%d", rdev->raid_disk);
|
||||
sysfs_remove_link(&mddev->kobj, nm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user