From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:39516 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750918AbdBOU3F (ORCPT ); Wed, 15 Feb 2017 15:29:05 -0500 Date: Wed, 15 Feb 2017 12:29:04 -0800 From: Andrew Morton To: Cyrill Gorcunov Cc: LINUXFS-ML , LKML , Al Viro , Andrew Morton , Andrey Vagin , Pavel Emelyanov Subject: Re: [RFC] fs,eventpoll: Add ability to install target file by its number Message-Id: <20170215122904.33499c5b0af3de12d351e7a1@linux-foundation.org> In-Reply-To: <20170215161453.GA13021@uranus> References: <20170215161453.GA13021@uranus> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 15 Feb 2017 19:14:54 +0300 Cyrill Gorcunov wrote: > When we checkpoint a process we look into /proc//fdinfo/ of eventpoll > file and parse target files list from there. In most situations this is fine > because target file is present in the /proc//fd/ list. But in case if file > descriptor was dup'ed or transferred via unix socket and closed after, > it might not be in the list and we can't figure out which file descriptor > to pass into epoll_ctl call. > > To resolve this tie lets add EPOLL_CTL_ITF ("itf" stands for install > target file) operation which simply takes target file descriptor number > and installs it into a caller's file table, thus we can use kcmp() > syscall and figure out which exactly file to be added into > eventpoll on restore procedure. Can we please see the proposed manpage update. And Cc linux-api and Michael Kerrisk. > --- linux-ml.git.orig/include/uapi/linux/eventpoll.h > +++ linux-ml.git/include/uapi/linux/eventpoll.h > @@ -25,6 +25,7 @@ > #define EPOLL_CTL_ADD 1 > #define EPOLL_CTL_DEL 2 > #define EPOLL_CTL_MOD 3 > +#define EPOLL_CTL_ITF 4 Somewhere we should tell the poor reader what "itf" means. A comment here would suit.