Re: [PATCH] md / procfs: avoid Oops if md-mod removed while /proc/mdstat is being polled.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 27 Feb 2014 17:24:45 +1100 NeilBrown <neilb@xxxxxxx> wrote:

> If poll or select is waiting on /proc/mdstat when md-mod is unloaded
> an oops will ensure when the poll/select completes.
> 
> This is because the wait_queue_head which is registered with poll_wait()
> is local to the module and no longer exists when the poll completes and
> detaches that wait_queue_head (in poll_free_wait -> remove_wait_queue).
> 
> To fix this we need the wait_queue_head to have (at least) the same life
> time as the proc_dir_entry.  So this patch places it in that structure.
> 
> We:
>   - add pde_poll_wait to struct proc_dir_entry
>   - call poll_wait() passing this when poll() is called on the proc file
>   - export a function proc_wake_up which will call wake_up() on pde_poll_wait
> 
> and make use of all that in md.c

This sounds wrong.  If a userspace process is waiting on
md_event_waiters then the md module is "busy" and the rmmod attempt
should fail?
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux