[CRIU] [PATCH] Fix use of fallocate on systems that do not export FALLOC_FL_KEEP_SIZE and FALLOC_FL_PUNCH_HOLE in fcntl.h

Andrei Vagin avagin at virtuozzo.com
Wed Jul 25 01:23:18 MSK 2018


On Tue, Jul 24, 2018 at 01:25:34PM +0200, Paweł Stradomski wrote:
> I'm not sure how to tell patchwork this should be applied on top of
> the previous change. Any hints?

If a previous patch isn't merged, you need to resent it with a fix.

> wt., 24 lip 2018 o 13:13 Pawel Stradomski <pstradomski at google.com> napisał(a):
> >
> > Signed-off-by: Pawel Stradomski <pstradomski at google.com>
> > ---
> >  criu/pie/restorer.c | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
> > index 3f1a8a6b..c5aee895 100644
> > --- a/criu/pie/restorer.c
> > +++ b/criu/pie/restorer.c
> > @@ -50,6 +50,15 @@
> >  #define PR_SET_PDEATHSIG 1
> >  #endif
> >
> > +#ifndef FALLOC_FL_KEEP_SIZE
> > +#define FALLOC_FL_KEEP_SIZE     0x01
> > +#endif
> > +
> > +#ifndef FALLOC_FL_PUNCH_HOLE
> > +#define FALLOC_FL_PUNCH_HOLE    0x02
> > +#endif
> > +
> > +
> >  #define sys_prctl_safe(opcode, val1, val2, val3)                       \
> >         ({                                                              \
> >                 long __ret = sys_prctl(opcode, val1, val2, val3, 0);    \
> > @@ -1379,7 +1388,6 @@ long __export_restore_task(struct task_restore_args *args)
> >                         /* TODO: Check if auto-dedup is enabled instead of trusting fallocate to fail
> >                          * if the file is not opened for writing. */
> >                         if (r > 0) {
> > -                               pr_debug("   `fallocate %d %ld %ld\n", args->vma_ios_fd,  rio->off, r);
> >                                 sys_fallocate(args->vma_ios_fd, FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE,
> >                                         rio->off, r);
> >                         }
> > --
> > 2.18.0.233.g985f88cf7e-goog
> >
> 
> 
> -- 
> Paweł Stradomski
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list