ergo the new root inode should not have any existing lookups/references
so d_count for
As you are re-using the existing dentry, you are pretending that there is no "new" root inode. Sure, you are changing pointers behind the kernel's back, but all the references to that dentry still exist, and if you set the d_count to 1, it could underflow. or worse./afs should become 1.
And in case my point still doesn't make sense, I'll try again: most references to inodes are not direct. Instead, things like a) sb->s_root b) fs_struct->pwd c) file->f_dentryare all dentry pointers and all take references on the dentry, and let the dentry hold the reference on the inode. Since you aren't making all the references to the old root go away, you cannot change the dentry's refcount
p7sA9cbi8xIJu.p7s
Description: S/MIME cryptographic signature
