On Tue, May 06, 2008 at 08:59:48AM +0100, [EMAIL PROTECTED] wrote:

> > mv /export/home/us/oldfile /export/home/us/newfile
> > but rename(2) never update cache path. v_path = /export/home/us/oldfile.
> > help me...,how about update caceh path?
> 
> Why do you need that ?
> 
> v_path is _NOT_ the cached path used for name lookups via system call. 
> It's the pathname the vnode had when it was first initialized. Doing a 
> rename() syscall does not preserve that.
> 
> There's a request for enhancement pending that asks to have rename() 
> update v_path. Question is - what's gained by that, compared to what it 
> will cost to do that ?

Like I stated in the bug[1]:

> knowing the old path can actually be more important

This might be true, but only when:

1) a process which originally opened the file under this old name
   is still running
2) the process is examined using a method that uses ->v_path directly
   without verification.

Thus, in terms of observability, I believe the tradeoff of an update is
worth it:

1) pfiles(1) will give at least /some/ path to the vnode instead of
   nothing
2) all processes which open the file under the new name will give
   correct info

Given that from the point of rename(2) onwards, no new processes can
open the file under the old name, it seems much more likely that users
will want the new name rather than the old (and in a pfiles(1) context,
a name rather than no name).

regards
john

[1] 6410381 UFS rename should update ->v_path
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to