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);
/* 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
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;
}