Whamcloud - gitweb
LU-15971 llite: implicit default LMV inherit
[fs/lustre-release.git] / lustre / llite / dcache.c
index 495092f..7746563 100644 (file)
@@ -274,10 +274,11 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request,
        ll_set_lock_data(ll_i2sbi(inode)->ll_md_exp, inode, it,
                         &bits);
        if (bits & MDS_INODELOCK_LOOKUP) {
-               ll_update_dir_depth(de->d_parent->d_inode, inode);
                if (!ll_d_setup(de, true))
                        RETURN(-ENOMEM);
                d_lustre_revalidate(de);
+               if (S_ISDIR(inode->i_mode))
+                       ll_update_dir_depth_dmv(de->d_parent->d_inode, de);
        }
 
        RETURN(rc);
@@ -318,8 +319,11 @@ static int ll_revalidate_dentry(struct dentry *dentry,
        /* If this is intermediate component path lookup and we were able to get
         * to this dentry, then its lock has not been revoked and the
         * path component is valid. */
-       if (lookup_flags & (LOOKUP_CONTINUE | LOOKUP_PARENT))
+       if (lookup_flags & (LOOKUP_CONTINUE | LOOKUP_PARENT)) {
+               if (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode))
+                       ll_update_dir_depth_dmv(dir, dentry);
                return 1;
+       }
 
        /* Symlink - always valid as long as the dentry was found */
        /* only special case is to prevent ELOOP error from VFS during open
@@ -350,6 +354,9 @@ static int ll_revalidate_dentry(struct dentry *dentry,
        if (dentry_may_statahead(dir, dentry))
                ll_revalidate_statahead(dir, &dentry, dentry->d_inode == NULL);
 
+       if (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode))
+               ll_update_dir_depth_dmv(dir, dentry);
+
        return 1;
 }