proc: mounts_poll() make consistent to mdstat_poll
In recently sysfs_poll discussion, Neil Brown pointed out /proc/mounts also should be fixed. SUSv3 says "Regular files shall always poll TRUE for reading and writing". see http://www.opengroup.org/onlinepubs/009695399/functions/poll.html Then, mounts_poll()'s default should be "POLLIN | POLLRDNORM". it mean always readable. In addition, event trigger should use "POLLERR | POLLPRI" instead POLLERR. it makes consistent to mdstat_poll() and sysfs_poll(). and, select(2) can handle POLLPRI easily. Reported-by: Neil Brown <neilb@suse.de> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Ram Pai <linuxram@us.ibm.com> Cc: Miklos Szeredi <mszeredi@suse.cz> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
1af3557abd
commit
31b07093c4
@ -648,14 +648,14 @@ static unsigned mounts_poll(struct file *file, poll_table *wait)
|
|||||||
{
|
{
|
||||||
struct proc_mounts *p = file->private_data;
|
struct proc_mounts *p = file->private_data;
|
||||||
struct mnt_namespace *ns = p->ns;
|
struct mnt_namespace *ns = p->ns;
|
||||||
unsigned res = 0;
|
unsigned res = POLLIN | POLLRDNORM;
|
||||||
|
|
||||||
poll_wait(file, &ns->poll, wait);
|
poll_wait(file, &ns->poll, wait);
|
||||||
|
|
||||||
spin_lock(&vfsmount_lock);
|
spin_lock(&vfsmount_lock);
|
||||||
if (p->event != ns->event) {
|
if (p->event != ns->event) {
|
||||||
p->event = ns->event;
|
p->event = ns->event;
|
||||||
res = POLLERR;
|
res |= POLLERR | POLLPRI;
|
||||||
}
|
}
|
||||||
spin_unlock(&vfsmount_lock);
|
spin_unlock(&vfsmount_lock);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user