On Mon, Sep 10, 2012 at 02:37:24PM +0800, Guo Chao wrote: > On Mon, Sep 10, 2012 at 01:10:37PM +0800, Ram Pai wrote: > > On Mon, Sep 10, 2012 at 10:40:51AM +0800, Guo Chao wrote: > > > > > > Hard to say whether it's a bug or what's problems of being able to rename > > > mountpoint. > > > > 'man 2 rename' says it is ok to rename a directory that is already > > mounted. > > > > EBUSY The rename fails because oldpath or newpath is a directory that is > > in use by some process (perhaps as current working directory, or as root > > directory, or beacuse it was open for reading) or is in use by the > > system (for example as mount point), while the system considers this an > > error. (Note that there is no requirement to return EBUSY in such > > cases-- there is nothing wrong with doing the rename anyway -- but is > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > allowed to return EBUSY if the system cannot otherwise handle such > > situations) > > > > RP > > Erhh, good point. > > However, current implementation seems to return EBUSY unconditionally, > instead of considering whether it can handle this situation. It can be > descripted as 'it may return EBUSY or not, depends on whether you are > luck enough to rush into the race'. > > This seems still conform to the statement in the manual, in a weird way > though. I think the code that checks if the new dentry or the old dentry is a mount point can be safely removed. It does not serve any purpose AFAICT. RP -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html