aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-12-28 10:20:47 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-01-14 10:17:35 -0500
commitf4013c3879d1bbd9f3ab8351185decd049502368 (patch)
tree553f8978d8126d72c37e1ba172a36d80f6e9040f /drivers/scsi
parent2bae0093cab4ee0a7a8728fdfc35b74569350863 (diff)
[SCSI] sd,sr: kill compat SDEV_MEDIA_CHANGE event
SDEV_MEDIA_CHANGE event was first added by commit a341cd0f (SCSI: add asynchronous event notification API) for SATA AN support and then extended to cover generic media change events by commit 285e9670 ([SCSI] sr,sd: send media state change modification events). This event was mapped to block device in userland with all properties stripped to simulate CHANGE event on the block device, which, in turn, was used to trigger further userspace action on media change. The recent addition of disk event framework kept this event for backward compatibility but it turns out to be unnecessary and causes erratic and inefficient behavior. The new disk event generates proper events on the block devices and the compat events are mapped to block device with all properties stripped, so the block device ends up generating multiple duplicate events for single actual event. This patch removes the compat event generation from both sr and sd as suggested by Kay Sievers. Both existing and newer versions of udev and the associated tools will behave better with the removal of these events as they from the beginning were expecting events on the block devices. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/sd.c5
-rw-r--r--drivers/scsi/sr.c4
2 files changed, 0 insertions, 9 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 7d257465bd9..e56730214c0 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1086,13 +1086,8 @@ out:
1086 * 1086 *
1087 * Medium present state has changed in either direction. 1087 * Medium present state has changed in either direction.
1088 * Device has indicated UNIT_ATTENTION. 1088 * Device has indicated UNIT_ATTENTION.
1089 *
1090 * Report SDEV_EVT_MEDIA_CHANGE too for backward compatibility.
1091 */ 1089 */
1092 if (sdp->changed)
1093 sdev_evt_send_simple(sdp, SDEV_EVT_MEDIA_CHANGE, GFP_KERNEL);
1094 kfree(sshdr); 1090 kfree(sshdr);
1095
1096 retval = sdp->changed ? DISK_EVENT_MEDIA_CHANGE : 0; 1091 retval = sdp->changed ? DISK_EVENT_MEDIA_CHANGE : 0;
1097 sdp->changed = 0; 1092 sdp->changed = 0;
1098 return retval; 1093 return retval;
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index be6baf8ad70..aefadc6a160 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -249,10 +249,6 @@ skip_tur:
249 cd->device->changed = 0; 249 cd->device->changed = 0;
250 } 250 }
251 251
252 /* for backward compatibility */
253 if (events & DISK_EVENT_MEDIA_CHANGE)
254 sdev_evt_send_simple(cd->device, SDEV_EVT_MEDIA_CHANGE,
255 GFP_KERNEL);
256 return events; 252 return events;
257} 253}
258 254