Skip to contentSkip to conversation

Where does NFS client associate the file handle received from server with inode?

DISCUSSION Xin Zhao 2 participants 3 messages Aug 20, 2006 – Aug 23, 2006 VFS

lore
Share & tools
lore

Xin Zhao

author
#0 lore raw

I ran into a problem:

I extend several fields to file handle, and change compose_fh() to initialize some value into the file handle. I think the client side should be able to associate the file handle with inode and used them properly afterwards. However, I found a problem:

Say I have a program 'postmark" in /tmp, and my current directory is /

If I do '/tmp/postmark', getattr() funciton will not use the right file handle with extension. Instead, it seems to use a file handle excluding my extension

but if I change to '/tmp', do 'ls -al' first, then I do 'postmark', getattr() will use the right file handle.

So I think maybe I need to change NFS client to associate the extened file handle with inode . But I don't know where NFS client does this. Can someone give me a help?

Many thanks!

-x

#1 lore raw
Quoted 13 lines · Xin Zhao

I ran into a problem:

I extend several fields to file handle, and change compose_fh() to initialize some value into the file handle. I think the client side should be able to associate the file handle with inode and used them properly afterwards. However, I found a problem:

Say I have a program 'postmark" in /tmp, and my current directory is /

If I do '/tmp/postmark', getattr() funciton will not use the right file handle with extension. Instead, it seems to use a file handle excluding my extension

Quoted 6 lines

but if I change to '/tmp', do 'ls -al' first, then I do 'postmark', getattr() will use the right file handle.

So I think maybe I need to change NFS client to associate the extened file handle with inode . But I don't know where NFS client does this. Can someone give me a help?

Why are you changing the file handle? We should already be caching the correct one (i.e. the one that was sent to us by the server in the LOOKUP call) in the 'struct nfs_inode'.

Cheers,
Trond

author
#2 lore raw

Because I have to carry some additional information of the file identified by the file handle. :) But never mind, the problem has been fixed.

Thanks anyway,
xin

Quoted 29 lines · Trond Myklebust
Quoted 13 lines · Xin Zhao

I ran into a problem:

I extend several fields to file handle, and change compose_fh() to initialize some value into the file handle. I think the client side should be able to associate the file handle with inode and used them properly afterwards. However, I found a problem:

Say I have a program 'postmark" in /tmp, and my current directory is /

If I do '/tmp/postmark', getattr() funciton will not use the right file handle with extension. Instead, it seems to use a file handle excluding my extension

Quoted 6 lines

but if I change to '/tmp', do 'ls -al' first, then I do 'postmark', getattr() will use the right file handle.

So I think maybe I need to change NFS client to associate the extened file handle with inode . But I don't know where NFS client does this. Can someone give me a help?

Why are you changing the file handle? We should already be caching the correct one (i.e. the one that was sent to us by the server in the LOOKUP call) in the 'struct nfs_inode'.

Cheers,
Trond