mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-06 08:06:56 +00:00
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:
+4
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user