diff options
author | Mark Brown <broonie@kernel.org> | 2016-03-18 09:48:58 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-03-18 09:48:58 +0000 |
commit | 917a9133a6b3c6cc2b6b5649d28c617a4ccac3e6 (patch) | |
tree | 2d7ae3b1ae72fbad4f54eb39a651a2e51a79611e /fs/overlayfs/dir.c | |
parent | ddbcfcba5fdc56f30e4d02c3bac8cf965502cece (diff) | |
parent | 6d0b88c88bf58bfd89ffbdaa97b03617fe8c6478 (diff) |
Merge remote-tracking branch 'lsk/linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4lsk-v4.4-16.03
Diffstat (limited to 'fs/overlayfs/dir.c')
-rw-r--r-- | fs/overlayfs/dir.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c index 692ceda3bc21..a2b1d7ce3e1a 100644 --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c @@ -618,7 +618,8 @@ static int ovl_remove_upper(struct dentry *dentry, bool is_dir) * sole user of this dentry. Too tricky... Just unhash for * now. */ - d_drop(dentry); + if (!err) + d_drop(dentry); mutex_unlock(&dir->i_mutex); return err; @@ -903,6 +904,13 @@ static int ovl_rename2(struct inode *olddir, struct dentry *old, if (!overwrite && new_is_dir && !old_opaque && new_opaque) ovl_remove_opaque(newdentry); + /* + * Old dentry now lives in different location. Dentries in + * lowerstack are stale. We cannot drop them here because + * access to them is lockless. This could be only pure upper + * or opaque directory - numlower is zero. Or upper non-dir + * entry - its pureness is tracked by flag opaque. + */ if (old_opaque != new_opaque) { ovl_dentry_set_opaque(old, new_opaque); if (!overwrite) |