Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361706
b: refs/heads/master
c: 90584fc
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Brassow authored and NeilBrown committed Mar 20, 2013
1 parent b249b2b commit b763dcf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3620a3ad52609f64a2402e4b59300afb4b83b77
refs/heads/master: 90584fc93d461520a888f691144f0879283b3624
6 changes: 2 additions & 4 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -7663,10 +7663,8 @@ static int remove_and_add_spares(struct mddev *mddev)
removed++;
}
}
if (removed)
sysfs_notify(&mddev->kobj, NULL,
"degraded");

if (removed && mddev->kobj.sd)
sysfs_notify(&mddev->kobj, NULL, "degraded");

rdev_for_each(rdev, mddev) {
if (rdev->raid_disk >= 0 &&
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/md/md.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ 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)) {
if (!test_bit(Replacement, &rdev->flags) && mddev->kobj.sd) {
sprintf(nm, "rd%d", rdev->raid_disk);
return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm);
} else
Expand All @@ -516,7 +516,7 @@ 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)) {
if (!test_bit(Replacement, &rdev->flags) && mddev->kobj.sd) {
sprintf(nm, "rd%d", rdev->raid_disk);
sysfs_remove_link(&mddev->kobj, nm);
}
Expand Down

0 comments on commit b763dcf

Please sign in to comment.