lkml.org 
[lkml]   [2000]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[FIX] rename over mount point fails
Date
From
Hi Linus,

A while ago, Chris Yeoh discovered while testing Posix
compliance that renaming a directory over another directory
that was in use as a mount point did very bad things[tm].

It looked like there was a loop in the d_hash list for the
directory we tried this trick in.

Here is a fix ... I do not understand the dcache well enough
to say if this is correct, but it does stop the kernel hanging.

--- 2.4.0-test6/fs/namei.c Thu Aug 10 14:07:01 2000
+++ 2.4.0-test6-fix/fs/namei.c Thu Aug 10 16:56:26 2000
@@ -1690,7 +1690,8 @@
triple_up(&old_dir->i_zombie,
&new_dir->i_zombie,
&target->i_zombie);
- d_rehash(new_dentry);
+ if (d_unhashed(new_dentry))
+ d_rehash(new_dentry);
dput(new_dentry);
} else
double_up(&old_dir->i_zombie,
Cheers,
Stephen
--
Stephen Rothwell, Open Source Researcher, Linuxcare, Inc.
+61-2-62628990 tel, +61-2-62628991 fax
sfr@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.022 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site