diff options
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 67fb32d1124..8af4d655b2d 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1358,7 +1358,7 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto | |||
1358 | bitmap->events_cleared < bitmap->mddev->events) { | 1358 | bitmap->events_cleared < bitmap->mddev->events) { |
1359 | bitmap->events_cleared = bitmap->mddev->events; | 1359 | bitmap->events_cleared = bitmap->mddev->events; |
1360 | bitmap->need_sync = 1; | 1360 | bitmap->need_sync = 1; |
1361 | sysfs_notify_dirent(bitmap->sysfs_can_clear); | 1361 | sysfs_notify_dirent_safe(bitmap->sysfs_can_clear); |
1362 | } | 1362 | } |
1363 | 1363 | ||
1364 | if (!success && ! (*bmc & NEEDED_MASK)) | 1364 | if (!success && ! (*bmc & NEEDED_MASK)) |
@@ -1643,7 +1643,7 @@ int bitmap_create(mddev_t *mddev) | |||
1643 | struct file *file = mddev->bitmap_info.file; | 1643 | struct file *file = mddev->bitmap_info.file; |
1644 | int err; | 1644 | int err; |
1645 | sector_t start; | 1645 | sector_t start; |
1646 | struct sysfs_dirent *bm; | 1646 | struct sysfs_dirent *bm = NULL; |
1647 | 1647 | ||
1648 | BUILD_BUG_ON(sizeof(bitmap_super_t) != 256); | 1648 | BUILD_BUG_ON(sizeof(bitmap_super_t) != 256); |
1649 | 1649 | ||
@@ -1664,7 +1664,8 @@ int bitmap_create(mddev_t *mddev) | |||
1664 | 1664 | ||
1665 | bitmap->mddev = mddev; | 1665 | bitmap->mddev = mddev; |
1666 | 1666 | ||
1667 | bm = sysfs_get_dirent(mddev->kobj.sd, NULL, "bitmap"); | 1667 | if (mddev->kobj.sd) |
1668 | bm = sysfs_get_dirent(mddev->kobj.sd, NULL, "bitmap"); | ||
1668 | if (bm) { | 1669 | if (bm) { |
1669 | bitmap->sysfs_can_clear = sysfs_get_dirent(bm, NULL, "can_clear"); | 1670 | bitmap->sysfs_can_clear = sysfs_get_dirent(bm, NULL, "can_clear"); |
1670 | sysfs_put(bm); | 1671 | sysfs_put(bm); |