[lkml]   [2002]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] [BUGFIX] racing between rmdir and rename on 2.4.18

I found a bug and fix it.

When files are moved under a directory which is just being removed,
it may cause a problem because target directory might be dead.

In function vfs_rename_other(), IS_DEADDIR(new_dir) check should
be done after double_down() like vfs_rename_dir() does.

--- linux/fs/namei.c.orig Tue Feb 26 04:38:09 2002
+++ linux/fs/namei.c Tue Apr 2 12:37:37 2002
@@ -1802,7 +1802,9 @@
double_down(&old_dir->i_zombie, &new_dir->i_zombie);
- if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry))
+ if (IS_DEADDIR(old_dir)||IS_DEADDIR(new_dir))
+ error = -ENOENT;
+ else if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry))
error = -EBUSY;
error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-03-22 13:22    [W:0.043 / U:12.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site