aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2009-04-09 00:57:59 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-04-16 19:17:10 -0400
commit31b07093c44a7a442394d44423e21d783f5523b8 (patch)
tree8569f8450dd2e7560a36a751faeee8d402c031ca /fs
parent1af3557abdef34ee036a6de4cb79e24468544b8d (diff)
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/base.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index f71559784bfb..aa763ab00777 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -648,14 +648,14 @@ static unsigned mounts_poll(struct file *file, poll_table *wait)
648{ 648{
649 struct proc_mounts *p = file->private_data; 649 struct proc_mounts *p = file->private_data;
650 struct mnt_namespace *ns = p->ns; 650 struct mnt_namespace *ns = p->ns;
651 unsigned res = 0; 651 unsigned res = POLLIN | POLLRDNORM;
652 652
653 poll_wait(file, &ns->poll, wait); 653 poll_wait(file, &ns->poll, wait);
654 654
655 spin_lock(&vfsmount_lock); 655 spin_lock(&vfsmount_lock);
656 if (p->event != ns->event) { 656 if (p->event != ns->event) {
657 p->event = ns->event; 657 p->event = ns->event;
658 res = POLLERR; 658 res |= POLLERR | POLLPRI;
659 } 659 }
660 spin_unlock(&vfsmount_lock); 660 spin_unlock(&vfsmount_lock);
661 661