aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-21 15:49:09 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-22 19:42:11 -0400
commit841590ce16c19a3ce38028adfc8b1955482ee00c (patch)
tree83f20931de0103f1b3b60f6ba4b8aa8490c08084
parented70afcd6e795e3de98df56f1cd0f898fbf641a7 (diff)
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: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/libfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/libfs.c b/fs/libfs.c
index 8f2271a5df53..c18e9a1235b6 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -328,8 +328,10 @@ int simple_rename(struct inode *old_dir, struct dentry *old_dentry,
328 328
329 if (new_dentry->d_inode) { 329 if (new_dentry->d_inode) {
330 simple_unlink(new_dir, new_dentry); 330 simple_unlink(new_dir, new_dentry);
331 if (they_are_dirs) 331 if (they_are_dirs) {
332 drop_nlink(new_dentry->d_inode);
332 drop_nlink(old_dir); 333 drop_nlink(old_dir);
334 }
333 } else if (they_are_dirs) { 335 } else if (they_are_dirs) {
334 drop_nlink(old_dir); 336 drop_nlink(old_dir);
335 inc_nlink(new_dir); 337 inc_nlink(new_dir);