diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-02-16 22:58:36 +0100 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-02-17 18:31:24 +0100 |
commit | 229e66cb9689ef20014ff8e5423316b19bfe6a11 (patch) | |
tree | 51a5a7ddc9542616e6ae5974631de679c16d2402 /Manage.c | |
parent | mdadm.h: rename bswap macros to avoid clash with uClibc definitions (diff) | |
download | mdadm-229e66cb9689ef20014ff8e5423316b19bfe6a11.tar.xz mdadm-229e66cb9689ef20014ff8e5423316b19bfe6a11.zip |
Manage.c: Only issue change events for kernels older than 2.6.28
2.6.28+ kernels handle this themselves and issuing the event here can
cause a race.
Reported-by: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
Suggested-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Diffstat (limited to 'Manage.c')
-rw-r--r-- | Manage.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -493,14 +493,17 @@ done: rv = 1; goto out; } - /* prior to 2.6.28, KOBJ_CHANGE was not sent when an md array - * was stopped, so We'll do it here just to be sure. Drop any - * partitions as well... - */ - if (fd >= 0) - ioctl(fd, BLKRRPART, 0); - if (mdi) - sysfs_uevent(mdi, "change"); + + if (get_linux_version() < 2006028) { + /* prior to 2.6.28, KOBJ_CHANGE was not sent when an md array + * was stopped, so We'll do it here just to be sure. Drop any + * partitions as well... + */ + if (fd >= 0) + ioctl(fd, BLKRRPART, 0); + if (mdi) + sysfs_uevent(mdi, "change"); + } if (devnm[0] && use_udev()) { struct map_ent *mp = map_by_devnm(&map, devnm); |