Skip to content

Commit

Permalink
ovl: fix copy up opaque directory
Browse files Browse the repository at this point in the history
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
  • Loading branch information
dmcgowan committed Aug 2, 2016
1 parent 2dcd0af commit 7fb53fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions fs/overlayfs/copy_up.c
Expand Up @@ -281,6 +281,9 @@ static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir,
if (err)
goto out_cleanup;

if (ovl_is_opaquedir(newdentry))
ovl_remove_opaque(newdentry);

inode_lock(newdentry->d_inode);
err = ovl_set_attr(newdentry, stat);
inode_unlock(newdentry->d_inode);
Expand Down
2 changes: 1 addition & 1 deletion fs/overlayfs/dir.c
Expand Up @@ -121,7 +121,7 @@ static int ovl_set_opaque(struct dentry *upperdentry)
return ovl_do_setxattr(upperdentry, OVL_XATTR_OPAQUE, "y", 1, 0);
}

static void ovl_remove_opaque(struct dentry *upperdentry)
void ovl_remove_opaque(struct dentry *upperdentry)
{
int err;

Expand Down
4 changes: 4 additions & 0 deletions fs/overlayfs/overlayfs.h
Expand Up @@ -194,10 +194,14 @@ int ovl_create_real(struct inode *dir, struct dentry *newdentry,
struct kstat *stat, const char *link,
struct dentry *hardlink, bool debug);
void ovl_cleanup(struct inode *dir, struct dentry *dentry);
void ovl_remove_opaque(struct dentry *upperdentry);

/* copy_up.c */
int ovl_copy_up(struct dentry *dentry);
int ovl_copy_up_one(struct dentry *parent, struct dentry *dentry,
struct path *lowerpath, struct kstat *stat);
int ovl_copy_xattr(struct dentry *old, struct dentry *new);
int ovl_set_attr(struct dentry *upper, struct kstat *stat);

/* super.c */
bool ovl_is_opaquedir(struct dentry *dentry);
2 changes: 1 addition & 1 deletion fs/overlayfs/super.c
Expand Up @@ -265,7 +265,7 @@ bool ovl_is_whiteout(struct dentry *dentry)
return inode && IS_WHITEOUT(inode);
}

static bool ovl_is_opaquedir(struct dentry *dentry)
bool ovl_is_opaquedir(struct dentry *dentry)
{
int res;
char val;
Expand Down

0 comments on commit 7fb53fb

Please sign in to comment.