aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKOSAKI Motohiro <[email protected]>2009-04-09 04:57:59 +0000
committerGreg Kroah-Hartman <[email protected]>2009-04-16 23:17:10 +0000
commit31b07093c44a7a442394d44423e21d783f5523b8 (patch)
tree8569f8450dd2e7560a36a751faeee8d402c031ca
parentsysfs: sysfs poll keep the poll rule of regular file. (diff)
downloadkernel-31b07093c44a7a442394d44423e21d783f5523b8.tar.gz
kernel-31b07093c44a7a442394d44423e21d783f5523b8.zip
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 <[email protected]> Signed-off-by: KOSAKI Motohiro <[email protected]> Cc: Ram Pai <[email protected]> Cc: Miklos Szeredi <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
-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)
{
struct proc_mounts *p = file->private_data;
struct mnt_namespace *ns = p->ns;
- unsigned res = 0;
+ unsigned res = POLLIN | POLLRDNORM;
poll_wait(file, &ns->poll, wait);
spin_lock(&vfsmount_lock);
if (p->event != ns->event) {
p->event = ns->event;
- res = POLLERR;
+ res |= POLLERR | POLLPRI;
}
spin_unlock(&vfsmount_lock);