On Thu, Jan 19, 2017 at 2:13 PM, Amir Goldstein <amir73il@xxxxxxxxx> wrote: > freeze/thaw of upper is all that is needed. > Miklos, Looking at it again, I believe that not even that is needed. Having fixed ovl_sync_fs() with patch #2, ovl_freeze() and ovl_unfreeze() need to be NOP. Am I right? In fact, freezing upper fs, when many overlayfs mounts share the same base fs (a-la docker) would be quite lame. WRT other use cases of freezing overlayfs, I am not sure if it is needed for correctness of docker checkpoint/restart? Pavel? > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> > --- > fs/overlayfs/super.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c > index 6792bb7..0f8a9c8 100644 > --- a/fs/overlayfs/super.c > +++ b/fs/overlayfs/super.c > @@ -160,6 +160,20 @@ static void ovl_put_super(struct super_block *sb) > kfree(ufs); > } > > +static int ovl_freeze(struct super_block *sb) > +{ > + struct ovl_fs *ufs = sb->s_fs_info; > + > + return ufs->upper_mnt ? freeze_super(ufs->upper_mnt->mnt_sb) : 0; > +} > + > +static int ovl_unfreeze(struct super_block *sb) > +{ > + struct ovl_fs *ufs = sb->s_fs_info; > + > + return ufs->upper_mnt ? thaw_super(ufs->upper_mnt->mnt_sb) : 0; > +} > + > /** > * ovl_statfs > * @sb: The overlayfs super block > @@ -222,6 +236,8 @@ static int ovl_remount(struct super_block *sb, int *flags, char *data) > > static const struct super_operations ovl_super_operations = { > .put_super = ovl_put_super, > + .freeze_fs = ovl_freeze, > + .unfreeze_fs = ovl_unfreeze, > .statfs = ovl_statfs, > .show_options = ovl_show_options, > .remount_fs = ovl_remount, > -- > 2.7.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html