Skip to content

Can I force nfs client to perform lookup till current working directory? (trough error codes?) #69

@aasenov

Description

@aasenov

I'm using nfs4j with custom VFS implementation that uses file paths instead of Inode numbers. As Inode data is limited to 64/128 bytes, based on nfs version, I'm keeping cache with mapping between INode and file path. Everything works fine until I reboot the server and I loose this cache, as nfs client also use caching and it sends already cached inode values, but I'm unable to rebuild file path from inode itself. I disable all type of client cache (-o noac,lookupcache=none), but still there are cases that won't work. If I enter some sub-folder structure, restart the nfs server, and execute "ls -al" I get "ls: cannot open directory '.': Stale file handle", as the Inode is not in the cache and I'm unable to complete "getattr()" call. On the other hand, if I call "ls -al ", then the client correctly perform lookup for every path item and I'm able to rebuild the cache mappings and operation succeed.
So is there a way when you perform operation on invalid Inode, to force the client to perform those lookups? I've tried throwing StaleException in such cases, but without luck. Nfs client is v4.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions