summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/util.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2017-07-04 22:03:17 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2017-07-04 22:03:17 +0200
commitb9ac5c274b8c9d642567022c0e319bca4db31956 (patch)
treeb28e97ec8acea6f9f752bb27c4bd8d3b55c36427 /fs/overlayfs/util.c
parent415543d5c64fe490b4b6a7e21c3ea2f1310c442f (diff)
downloadlinux-b9ac5c274b8c9d642567022c0e319bca4db31956.tar.bz2
ovl: hash overlay non-dir inodes by copy up origin
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/util.c')
-rw-r--r--fs/overlayfs/util.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 90b50b8e75ab..22ed51f80e58 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -236,7 +236,6 @@ void ovl_inode_update(struct inode *inode, struct dentry *upperdentry)
{
struct inode *upperinode = d_inode(upperdentry);
- WARN_ON(!inode_unhashed(inode));
WARN_ON(!inode_is_locked(upperdentry->d_parent->d_inode));
WARN_ON(OVL_I(inode)->__upperdentry);
@@ -245,7 +244,7 @@ void ovl_inode_update(struct inode *inode, struct dentry *upperdentry)
*/
smp_wmb();
OVL_I(inode)->__upperdentry = upperdentry;
- if (!S_ISDIR(upperinode->i_mode)) {
+ if (!S_ISDIR(upperinode->i_mode) && inode_unhashed(inode)) {
inode->i_private = upperinode;
__insert_inode_hash(inode, (unsigned long) upperinode);
}