From 92eb29c41f93770bd76b6f3e9f647a48f4d38c43 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Mon, 14 Dec 2015 17:53:36 -0500 Subject: [PATCH] Wrapfs: update nlinks after rename Signed-off-by: Logeswari P Viswanath Signed-off-by: Erez Zadok --- fs/wrapfs/inode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/wrapfs/inode.c b/fs/wrapfs/inode.c index 8821a8e741b1..d2773156157b 100644 --- a/fs/wrapfs/inode.c +++ b/fs/wrapfs/inode.c @@ -275,6 +275,10 @@ static int wrapfs_rename(struct inode *old_dir, struct dentry *old_dentry, fsstack_copy_inode_size(old_dir, lower_old_dir_dentry->d_inode); } + /* update the hardlink count */ + if (new_dentry->d_inode) + set_nlink(new_dentry->d_inode, + lower_new_dir_dentry->d_inode->i_nlink); out: unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry); -- 2.43.0