Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1772590ybg; Thu, 4 Jun 2020 19:39:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6hyN7ALouw2mh/tgSBWyFSL7LzqJ4EKFUIAxYlQQ5aLyESLyihhAleI2uq/60C4Syt+2u X-Received: by 2002:a17:906:528b:: with SMTP id c11mr6408546ejm.407.1591324797691; Thu, 04 Jun 2020 19:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591324797; cv=none; d=google.com; s=arc-20160816; b=LzugGCEu8KwY1FsLDymhBcF7IAoHS9BCzYgKtCEIfa6isCvQiAPuanpg/IdoMynEnW TEiulCKpvfwS/MX8/WX/Cdw73JJJV1e+WqouHFmf2PAiwY8eL/BJoMSjJPPJPQtootjF tDOyhQwpca+kq8+F93YXlbnykCOukZTFI4MzxuVq1/QMvc1bA5l2bz+2yWhMgQanA4Z4 F0pL5ZmFE+kqVnXymy8/nmQKZGf6KTGyurnJk+pIH6FvaXh/M1X6o2rp68+TcFjxl6NZ /k9SNNyXzoHfV19I0F/qIpuc7h39ALR3Cwnxgncx+mJD+SoJR+H51nxGUszx5buDvr64 G7bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=z9EotnjM1m15VPlAC5q/xowE94IPhwwOBWYN2BOjzoA=; b=mtKU6b62RocuF79LD4QjYWcNrzWZEbUuBiN8gOhbt2h/nbCRuJfuBQsLJ0n56bx2pS XVb4gchjblMwSZVtnWGe8NVyOkJ1i0aEr8EMkl3PeYR8VVMgg3zpG9faVMnQiuSACMzv vcZT0cRSR40w61MBOnangmRAuw/t+Y1nMnrb5gLenbJOeNc84UG9EzOzJMvzN3Wp5v+v e1XJdEW8GMFE/u5GlFgSaPheKuywoknYireomkVgUMWoPNvhqOCduBiv7VjKlkr51Sj0 xzsaIKg3a7QISQRyob4l5ei1THZHrzROUmkCQj9E5t5BbBa/fFldQGqZnrM1Zqx/+kfc OMtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FhPcPNY6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q21si2860632edw.46.2020.06.04.19.39.35; Thu, 04 Jun 2020 19:39:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FhPcPNY6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726093AbgFECfq (ORCPT + 99 others); Thu, 4 Jun 2020 22:35:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbgFECfp (ORCPT ); Thu, 4 Jun 2020 22:35:45 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1CCFC08C5C0; Thu, 4 Jun 2020 19:35:45 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id j8so8644722iog.13; Thu, 04 Jun 2020 19:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z9EotnjM1m15VPlAC5q/xowE94IPhwwOBWYN2BOjzoA=; b=FhPcPNY6IZzPvkjXJh6YjYMplRHKQ20MHU/nL2NRUfbIITN3kpSznaGAanpix1I4sP 36NwGPenDSyOGhUugL1GqOIhPH68f2hooQlnyzpTFdyqL3vhBrHMPb3dgMQkJpwm5SV2 EGqvjvby629GYnmjl+vMb2qKtBOurXNycaEWPls5zO+ZuBZj9MeHCPlgDaSziUVXceSB qnKOxxHaev+DAVLicPMiX9l7vO9NzXW1nrmJq/7tsutPV9iaz9AX4apsUJ17JpAJur/c nS48mDDv8u7H2gG5uBSjA9+4KiD9wTi594Q/s/d62wEBx0lefPVfXk0NH26jPmVtRKHb GM6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z9EotnjM1m15VPlAC5q/xowE94IPhwwOBWYN2BOjzoA=; b=MJEmbjlkFAKe+kVbdInneIThdj81KxEaJif/N072mjs4WyIiSkBFWU1ThaqnsnoH36 bcxRQtVTGOa8tnyjQQ66Ys9A9QrtfnYNn9WFZaIvbH1MnUmBTDhajCDs77Bb4Hkume1P TrgvOhTFs3Qa3+49rR5l/XgF7XEJzwD99FCaEuJXKME2HzQWlxU3glaPUliRJ9eFQVHQ 07EFlQ+Re1rA/OaNLOjDn5eWFodKKdrX7f8frmfyGPwCoJ0OZuBmgJrc+vRWuaU7o8mc 3VDi+PwloipfwvQPIW78ChxhsG3btEZ64aALVjWCBaPxWMR41bDaVF9zHQcyE0GEqizI yvLw== X-Gm-Message-State: AOAM532iZXtF9dgTJiBG+tmzdELJVk+RabBRek0wT/AVNSrMLTTJgyOt m+rWUBnvUZ7Dq7MCDHpfWyrk2J45y3BdRJG/UFLDsw== X-Received: by 2002:a02:5184:: with SMTP id s126mr6779429jaa.30.1591324544909; Thu, 04 Jun 2020 19:35:44 -0700 (PDT) MIME-Version: 1.0 References: <20200604161133.20949-1-alexander.mikhalitsyn@virtuozzo.com> In-Reply-To: From: Amir Goldstein Date: Fri, 5 Jun 2020 05:35:33 +0300 Message-ID: Subject: Re: [PATCH 0/2] overlayfs: C/R enhancements To: Alexander Mikhalitsyn Cc: Miklos Szeredi , Andrey Vagin , Pavel Tikhomirov , Konstantin Khorenko , Vasiliy Averin , Kirill Tkhai , overlayfs , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 5, 2020 at 12:34 AM Alexander Mikhalitsyn wrote: > > Hello, > > >But overlayfs won't accept these "output only" options as input args, > which is a problem. > > Will it be problematic if we simply ignore "lowerdir_mnt_id" and "upperdir_mnt_id" options in ovl_parse_opt()? > That would solve this small problem. > >Wouldn't it be better for C/R to implement mount options > that overlayfs can parse and pass it mntid and fhandle instead > of paths? > > Problem is that we need to know on C/R "dump stage" which mounts are used on lower layers and upper layer. Most likely I don't understand something but I can't catch how "mount-time" options will help us. As you already know from inotify/fanotify C/R fhandle is timeless, so there would be no distinction between mount time and dump time. About mnt_id, your patches will cause the original mount-time mounts to be busy. That is a problem as well. I think you should describe the use case is more details. Is your goal to C/R any overlayfs mount that the process has open files on? visible to process? For NFS export, we use the persistent descriptor {uuid;fhandle} (a.k.a. struct ovl_fh) to encode an underlying layer object. CRIU can look for an existing mount to a filesystem with uuid as restore stage (or even mount this filesystem) and use open_by_handle_at() to open a path to layer. After mounting overlay, that mount to underlying fs can even be discarded. And if this works for you, you don't have to export the layers ovl_fh in /proc/mounts, you can export them in numerous other ways. One way from the top of my head, getxattr on overlay root dir. "trusted.overlay" xattr is anyway a reserved prefix, so "trusted.overlay.layers" for example could work. Thanks, Amir.