Commit a817e73
committed
Revert "scsi: make 'state' device attribute pollable"
This reverts commit 8a97712.
This commit added a call to sysfs_notify() from within
scsi_device_set_state(), which in turn turns out to make libata very
unhappy, because ata_eh_detach_dev() does
spin_lock_irqsave(ap->lock, flags);
..
if (ata_scsi_offline_dev(dev)) {
dev->flags |= ATA_DFLAG_DETACHED;
ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG;
}
and ata_scsi_offline_dev() then does that scsi_device_set_state() to set
it offline.
So now we called sysfs_notify() from within a spinlocked region, which
really doesn't work. The 0day robot reported this as:
BUG: sleeping function called from invalid context at kernel/locking/mutex.c:238
because sysfs_notify() ends up calling kernfs_find_and_get_ns() which
then does mutex_lock(&kernfs_mutex)..
The pollability of the device state isn't critical, so revert this all
for now, and maybe we'll do it differently in the future.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent e4880bc commit a817e73
2 files changed
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2685 | 2685 | | |
2686 | 2686 | | |
2687 | 2687 | | |
2688 | | - | |
2689 | 2688 | | |
2690 | 2689 | | |
2691 | 2690 | | |
| |||
3109 | 3108 | | |
3110 | 3109 | | |
3111 | 3110 | | |
3112 | | - | |
3113 | 3111 | | |
3114 | 3112 | | |
3115 | 3113 | | |
3116 | 3114 | | |
3117 | 3115 | | |
3118 | 3116 | | |
3119 | 3117 | | |
3120 | | - | |
3121 | 3118 | | |
3122 | 3119 | | |
3123 | 3120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
559 | | - | |
| 559 | + | |
560 | 560 | | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | 561 | | |
565 | 562 | | |
566 | 563 | | |
| |||
0 commit comments