From: Amir Goldstein Date: Fri, 3 Apr 2020 05:43:12 +0000 (+0300) Subject: ovl: prepare to copy up without workdir X-Git-Tag: v5.10.7~2379^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=773cb4c56b1bedeb5644f5bd06b76e348bb21634;p=platform%2Fkernel%2Flinux-rpi.git ovl: prepare to copy up without workdir 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 Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index 9709cf2..6600453 100644 --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c @@ -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)