Skip to content

Commit

Permalink
ovl: prepare to copy up without workdir
Browse files Browse the repository at this point in the history
With index=on, we copy up lower hardlinks to work dir and move them into
index dir. Fix locking to allow work dir and index dir to be the same
directory.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
  • Loading branch information
Amir Goldstein authored and Miklos Szeredi committed May 13, 2020
1 parent 3011645 commit 773cb4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/overlayfs/copy_up.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,10 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
.link = c->link
};

err = ovl_lock_rename_workdir(c->workdir, c->destdir);
if (err)
return err;
/* workdir and destdir could be the same when copying up to indexdir */
err = -EIO;
if (lock_rename(c->workdir, c->destdir) != NULL)
goto unlock;

err = ovl_prep_cu_creds(c->dentry, &cc);
if (err)
Expand Down

0 comments on commit 773cb4c

Please sign in to comment.