scoutfs: fix parent dir nlink update in rename

Renaming a dir between parents and clobbering an existing empty dir
wasn't correctly updating the parent link counts.  Updating parent link
counts when dirs are moved between parents is an independent operation
from decreasing the link count of a victim existing target of the
rename.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-10-12 14:51:30 -07:00
committed by Mark Fasheh
parent 856f257085
commit 9027775ef2
+4 -1
View File
@@ -1540,7 +1540,10 @@ retry:
drop_nlink(new_dir);
drop_nlink(new_inode);
}
} else if (S_ISDIR(old_inode->i_mode) && (old_dir != new_dir)) {
}
if (S_ISDIR(old_inode->i_mode) && (old_dir != new_dir)) {
drop_nlink(old_dir);
inc_nlink(new_dir);
}