The present invention provides a technique for efficiently generating and validating external file handles at a storage
operating system of a filer. According to one aspect of the technique, the storage
operating system associates a unique internal file
handle with each file or
directory stored in the filer. This unique internal file
handle is used to generate a corresponding external file
handle. Unlike previous approaches, the internal file handle' representations do not change depending on the location of their corresponding files or directories, e.g., on-disk or in-core, within the filer, thereby simplifying
file management within the filer. According to another aspect of the inventive technique, the filer executes a file-handle validation procedure to determine whether an external file handle received with a file access request has become invalid (or “stale”) as a result of an NVRAM failure in the filer. The file-handle validation procedure enables the filer to efficiently determine the validity of the external file handle without having to perform conventional time-consuming and
processing-intensive operations. Advantageously, the inventive technique is preferably only applied to generation and validation of external file handles configured in accordance with a stateless file-
system protocol, such as the NFS protocol. In this way, there is no overhead added to the filer's storage
operating system for generating and validating external file handles configured in accordance with stateful file-
system protocols.