Repository navigation
Commit e2f23b6
committed
md: avoid oops on unload if some process is in poll or select.
If md-mod is unloaded while some process is in poll() or select(),
then that process maintains a pointer to md_event_waiters, and when
the try to unlink from that list, they will oops.
The procfs infrastructure ensures that ->poll won't be called after
remove_proc_entry, but doesn't provide a wait_queue_head for us to
use, and the waitqueue code doesn't provide a way to remove all
listeners from a waitqueue.
So we need to:
1/ make sure no further references to md_event_waiters are taken (by
setting md_unloading)
2/ wake up all processes currently waiting, and
3/ wait until all those processes have disconnected from our
wait_queue_head.
Reported-by: "majianpeng" <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>1 parent da1aab3 commit e2f23b6
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7165 | 7165 | | |
7166 | 7166 | | |
7167 | 7167 | | |
| 7168 | + | |
7168 | 7169 | | |
7169 | 7170 | | |
7170 | 7171 | | |
7171 | 7172 | | |
7172 | 7173 | | |
| 7174 | + | |
| 7175 | + | |
7173 | 7176 | | |
7174 | 7177 | | |
7175 | 7178 | | |
| |||
8655 | 8658 | | |
8656 | 8659 | | |
8657 | 8660 | | |
| 8661 | + | |
8658 | 8662 | | |
8659 | 8663 | | |
8660 | 8664 | | |
| |||
8663 | 8667 | | |
8664 | 8668 | | |
8665 | 8669 | | |
| 8670 | + | |
| 8671 | + | |
| 8672 | + | |
| 8673 | + | |
| 8674 | + | |
| 8675 | + | |
| 8676 | + | |
| 8677 | + | |
| 8678 | + | |
| 8679 | + | |
| 8680 | + | |
8666 | 8681 | | |
| 8682 | + | |
8667 | 8683 | | |
8668 | 8684 | | |
8669 | 8685 | | |
| |||
0 commit comments