mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Neil Brown <neilb@suse.de>, Greg Kroah-Hartman <gregkh@suse.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Al Viro <viro@ZenIV.linux.org.uk>, Ram Pai <linuxram@us.ibm.com>,
	Miklos Szeredi <mszeredi@suse.cz>
Cc: kosaki.motohiro@jp.fujitsu.com
Subject: [PATCH v2 2/2] mounts_poll() make consistent to mdstat_poll
Date: Thu,  9 Apr 2009 13:57:59 +0900 (JST)	[thread overview]
Message-ID: <20090409135633.B3E9.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20090409134916.B3E6.A69D9226@jp.fujitsu.com>

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>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
--
 fs/proc/base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index f715597..aa763ab 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);
 




  reply	other threads:[~2009-04-09  4:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08  8:43 [PATCH] sysfs poll should keep the poll rule of normal regular file KOSAKI Motohiro
2009-04-09  0:15 ` Neil Brown
2009-04-09  0:26   ` KOSAKI Motohiro
2009-04-09  4:53     ` [PATCH v2 1/2] sysfs poll keep the poll rule of " KOSAKI Motohiro
2009-04-09  4:57       ` KOSAKI Motohiro [this message]
2009-04-09  6:05     ` [PATCH] sysfs poll should keep the poll rule of normal " Neil Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090409135633.B3E9.A69D9226@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=mszeredi@suse.cz \
    --cc=neilb@suse.de \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®