[Devel] [PATCH RHEL7 COMMIT] ms/epoll: Make fdinfo to always success

Konstantin Khorenko khorenko at virtuozzo.com
Wed Nov 18 06:42:10 PST 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.9.10
------>
commit d23eadb30d0ab8b14f1d804cec0a0399b0b044ec
Author: Cyrill Gorcunov <gorcunov at odin.com>
Date:   Wed Nov 18 18:42:10 2015 +0400

    ms/epoll: Make fdinfo to always success
    
    It is a diet backport of vanilla's
    
    ML: a3816ab0e8fe542a89a53b82506a8ddac063fbe3
    
    which allows to display a large numbers of inotify assigned.
    Otherwise only ones fit to 4K buffer would be shown.
    
    https://jira.sw.ru/browse/PSBM-41386
    
    Reported-by: Pavel Emelyanov <xemul at parallels.com>
    Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
    
    CC: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/eventpoll.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index af52bad..0a1623a 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -874,21 +874,19 @@ static int ep_show_fdinfo(struct seq_file *m, struct file *f)
 {
 	struct eventpoll *ep = f->private_data;
 	struct rb_node *rbp;
-	int ret = 0;
 
 	mutex_lock(&ep->mtx);
 	for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) {
 		struct epitem *epi = rb_entry(rbp, struct epitem, rbn);
 
-		ret = seq_printf(m, "tfd: %8d events: %8x data: %16llx\n",
-				 epi->ffd.fd, epi->event.events,
-				 (long long)epi->event.data);
-		if (ret)
+		seq_printf(m, "tfd: %8d events: %8x data: %16llx\n",
+			   epi->ffd.fd, epi->event.events,
+			   (long long)epi->event.data);
+		if (m->count == m->size)
 			break;
 	}
 	mutex_unlock(&ep->mtx);
-
-	return ret;
+	return 0;
 }
 #endif
 


More information about the Devel mailing list