Howdy, I am trying to find the full pathname of the entity being checked in nfs3_access(), and have hit a bit of snag. I was hoping to use the r_unlname and r_rpath entries in the rnode_t that arg0->v_data points to, but they appear to be NULL: $ cat printaddr.d fbt:nfs:nfs3_access:entry { /* arg0 -> vnode_t */ /* arg0 -> v_data -> r_path */ printf("\nStart: ***********************\n"); printf("vnode_t: %x\n", arg0); printf("vdata_t: %x\n", (uintptr_t)(((vnode_t *)arg0)->v_data)); printf("r_path: %x\n", (uintptr_t)(((rnode_t *)(((vnode_t *)arg0)->v_data))->r_path)); printf("r_unlname: %x\n", (uintptr_t)(((rnode_t *)(((vnode_t *)arg0)->v_data))->r_unlname)); printf("End: ***********************\n"); } $ dtrace -s printaddr.d 3 36888 nfs3_access:entry Start: *********************** vnode_t: cc804300 vdata_t: cd0f5c48 r_path: 0 r_unlname: 0 End: *********************** I traced down r_rpath to create_rnode, and it looks like it''s only set if a failover mount is in use. When I opengrok or r_unldvp, it shows up in the NFSv3 inactive, rename and remove routines, and I wasn''t able to spot the location where r_unlname originalyl gets set (poor eyes I recon). Does anyone happen to know if there is a way to get the full path to the file (or directory) being checked in nfs3_access? Thanks for any insight, - Ryan -- UNIX Administrator http://daemons.net/~matty
Spencer Shepler
2006-Apr-17 22:46 UTC
[dtrace-discuss] Locating the pathname in nfs3_access()?
On Mon, Matty wrote:> > Howdy, > > I am trying to find the full pathname of the entity being checked in > nfs3_access(), and have hit a bit of snag. I was hoping to use the > r_unlname and r_rpath entries in the rnode_t that arg0->v_data points > to, but they appear to be NULL: > > $ cat printaddr.d > > fbt:nfs:nfs3_access:entry > { > /* arg0 -> vnode_t */ > /* arg0 -> v_data -> r_path */ > printf("\nStart: ***********************\n"); > printf("vnode_t: %x\n", arg0); > printf("vdata_t: %x\n", (uintptr_t)(((vnode_t *)arg0)->v_data)); > printf("r_path: %x\n", (uintptr_t)(((rnode_t *)(((vnode_t > *)arg0)->v_data))->r_path)); > printf("r_unlname: %x\n", (uintptr_t)(((rnode_t *)(((vnode_t > *)arg0)->v_data))->r_unlname)); > printf("End: ***********************\n"); > } > > $ dtrace -s printaddr.d > > 3 36888 nfs3_access:entry > Start: *********************** > vnode_t: cc804300 > vdata_t: cd0f5c48 > r_path: 0 > r_unlname: 0 > End: *********************** > > I traced down r_rpath to create_rnode, and it looks like it''s only set if > a failover mount is in use. When I opengrok or r_unldvp, it shows up inCorrect. The r_path is only used when it is a replicated mount.> the NFSv3 inactive, rename and remove routines, and I wasn''t able to spot > the location where r_unlname originalyl gets set (poor eyes I recon). DoesThe r_unlname stands for "unlinked name". This is used in the case that a file is open at the client and it is be removed or is the target for a rename. The renamed file usually takes the form of .nfsXXXX and is commonly referred to as "silly rename".> anyone happen to know if there is a way to get the full path to the file > (or directory) being checked in nfs3_access?There is a path in the vnode v_path that is maintained for a file but there are cases where that path will not be entirely correct but it is currently the best available. Spencer
On Mon, 17 Apr 2006, Spencer Shepler wrote:>> the NFSv3 inactive, rename and remove routines, and I wasn''t able to spot >> the location where r_unlname originalyl gets set (poor eyes I recon). Does > > The r_unlname stands for "unlinked name". This is used in the case > that a file is open at the client and it is be removed or is the > target for a rename. The renamed file usually takes the form of .nfsXXXX > and is commonly referred to as "silly rename".Thanks for the cool explanation!>> anyone happen to know if there is a way to get the full path to the file >> (or directory) being checked in nfs3_access? > > There is a path in the vnode v_path that is maintained for a file but > there are cases where that path will not be entirely correct but it is > currently the best available.Based on my testing, v_path seems to contain a directory, and not the full pathname. :( Is the filename stored anywhere by any chance? Thanks, - Ryan -- UNIX Administrator http://daemons.net/~matty
Nagakiran KR
2006-Apr-18 06:02 UTC
[dtrace-discuss] Locating the pathname in nfs3_access()?
> > Based on my testing, v_path seems to contain a directory, and not the > full pathname. :( Is the filename stored anywhere by any chance? >Matt, Although not completely reliable, v_path is still the best bet, Call to nfs3_access need not necessarily be to the file itself. Here is what I used to print the file name # dtrace -n nfs3_access:entry''{trace(stringof(((vnode_t *)arg0)->v_path)); printf(" :: VNODE 0x%p", arg0)}'' $ ls -l zfs_overview.pdf gave 1 52877 nfs3_access:entry /net/ssaesrv/export/scratch/nagki :: VNODE 0xffffffff8b47a240 ....... (approximately 8 lines of same info) 1 52877 nfs3_access:entry /net/ssaesrv/export/scratch/nagki :: VNODE 0xffffffff8b47a240 Most probably the calls to dnlc via nfs3_lookup_dnlc called from nfs3_lookup BUT $ cat zfs_overview.pdf actually located the file and the vnode for it. 1 52877 nfs3_access:entry /net/ssaesrv/export/scratch/nagki/zfs_overview.pdf :: VNODE 0xffffffff8b46ecc0 Regards Kiran