summaryrefslogtreecommitdiffstats
path: root/fs/eventpoll.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2017-07-12 17:34:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-12 19:26:01 -0400
commit77493f04b74cdff3a61fb3fb14b1f5a71d88fd5f (patch)
tree49586bd3acbb1fec1b2a961c0880b00121d09874 /fs/eventpoll.c
parent9263969a46fc899092ba4f8c4206fa2340c9a64e (diff)
procfs: fdinfo: extend information about epoll target files
Since it is possbile to have same number in tfd field (say file added, closed, then nother file dup'ed to same number and added back) it is imposible to distinguish such target files solely by their numbers. Strictly speaking regular applications don't need to recognize these targets at all but for checkpoint/restore sake we need to collect targets to be able to push them back on restore stage in a proper order. Thus lets add file position, inode and device number where this target lays. This three fields can be used as a primary key for sorting, and together with kcmp help CRIU can find out an exact file target (from the whole set of processes being checkpointed). Link: http://lkml.kernel.org/r/20170424154423.436491881@gmail.com Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by: Andrei Vagin <avagin@virtuozzo.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Pavel Emelyanov <xemul@virtuozzo.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Jason Baron <jbaron@akamai.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/eventpoll.c')
-rw-r--r--fs/eventpoll.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index a6d194831ed8..322904c3ebdf 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -960,10 +960,14 @@ static void ep_show_fdinfo(struct seq_file *m, struct file *f)
960 mutex_lock(&ep->mtx); 960 mutex_lock(&ep->mtx);
961 for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) { 961 for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) {
962 struct epitem *epi = rb_entry(rbp, struct epitem, rbn); 962 struct epitem *epi = rb_entry(rbp, struct epitem, rbn);
963 struct inode *inode = file_inode(epi->ffd.file);
963 964
964 seq_printf(m, "tfd: %8d events: %8x data: %16llx\n", 965 seq_printf(m, "tfd: %8d events: %8x data: %16llx "
966 " pos:%lli ino:%lx sdev:%x\n",
965 epi->ffd.fd, epi->event.events, 967 epi->ffd.fd, epi->event.events,
966 (long long)epi->event.data); 968 (long long)epi->event.data,
969 (long long)epi->ffd.file->f_pos,
970 inode->i_ino, inode->i_sb->s_dev);
967 if (seq_has_overflowed(m)) 971 if (seq_has_overflowed(m))
968 break; 972 break;
969 } 973 }