Re: [RFC PATCH 05/13] vfs: take i_mutex on renamed file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux