Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 841590ce authored by Al Viro's avatar Al Viro
Browse files

fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.



On ramfs and other simple_rename() users IN_DELETE_SELF is not generated
for victim of overwriting rename() if it's is a directory.  Works on
most of the local filesystems and really trivial to fix...

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent ed70afcd
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -328,8 +328,10 @@ int simple_rename(struct inode *old_dir, struct dentry *old_dentry,

	if (new_dentry->d_inode) {
		simple_unlink(new_dir, new_dentry);
		if (they_are_dirs)
		if (they_are_dirs) {
			drop_nlink(new_dentry->d_inode);
			drop_nlink(old_dir);
		}
	} else if (they_are_dirs) {
		drop_nlink(old_dir);
		inc_nlink(new_dir);