[CRIU] [PATCH] inotify: Skip opening deleted file
Cyrill Gorcunov
gorcunov at openvz.org
Wed Nov 28 12:47:26 EST 2012
On Wed, Nov 28, 2012 at 09:39:43PM +0400, Pavel Emelyanov wrote:
> On 11/28/2012 09:38 PM, Cyrill Gorcunov wrote:
> > On Wed, Nov 28, 2012 at 09:34:08PM +0400, Cyrill Gorcunov wrote:
> >> On Wed, Nov 28, 2012 at 09:28:59PM +0400, Pavel Emelyanov wrote:
> >>> On 11/28/2012 09:26 PM, Cyrill Gorcunov wrote:
> >>>> In case if we're monitoring deleted file we can't open
> >>>> it on restore procedure, thus simply skip its recreation.
> >>>
> >>> NAK. This should be done the other way.
> >>>
> >>> On dump we should find out, that the file is unlinked and note this
> >>> fact in the image. On restore we should restore a temp file, inotify
> >>> it and unlink back.
> >>
> >> No. Create/unlink generates "delete" event which we should escape
> >> receiving. To figure out that file is unlinked (note we have only
> >> a file handle here) we could try to open it and if we get EBADF
> >> then we can assume it was removed.
> >
> > But same time this attempt to open() may generate an "open" event which we
> > should try to escape on dumping stage as well.
>
> Open event? Does such exist in inotify? Even if yes, we can open it
> _before_ inotifying.
Yup, IN_OPEN mask serves it.
Cyrill
More information about the CRIU
mailing list