home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.protocols.nfs
- Path: sparky!uunet!wupost!spool.mu.edu!umn.edu!csus.edu!netcom.com!netapp
- From: hitz@netapp.com
- Subject: Re: NFS cookies
- Message-ID: <1992Dec14.053207.5392@netcom.com>
- Sender: netapp@netcom.com (Network Appliance)
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <7594@fury.BOEING.COM>
- Date: Mon, 14 Dec 1992 05:32:07 GMT
- Lines: 43
-
- In article <7594@fury.BOEING.COM> krm@sdc.boeing.com (Keith Michaels) writes:
- >Does anyone know what the practical limitations are for the 32 bit
- >NFS "cookie" that is used in the READDIR function?
-
- >Also, is there any truth to the rumor that the first byte of the cookie is
- >reserved for use by the client?
-
- Here is what the NFS 2 spec (RFP 1094) has to say about the directory entries
- returned by READDIR:
-
- Each "entry" contains a "fileid" which consists of a unique
- number to identify the file within a filesystem, the "name" of
- | the file, and a "cookie" which is an opaque pointer to the next
- | entry in the directory. The cookie is used in the next READDIR
- | call to get more entries starting at a given point in the
- | directory. The special cookie zero (all bits zero) can be used
- | to get the entries starting at the beginning of the directory.
-
- The word "opaque" here means that the server is allowed to put
- absolutely anything in this field that it wants to. No reserved byte
- for clients. No restriction on what characters to use.
-
- >How can NFS guarantee correct behavior of an operation that exhausts the
- >address space of the cookie?
-
- This isn't a problem. With a 32-bit cookie, there are 2^32 possible
- cookies. It's hard to imagine a directory structure much smaller than
- 16 bytes per entry, so a directory big enough to exhaust the cookie
- space would be about 32 GB.
-
- >This is not just of theoretical interest! We have acually hit this problem
- >on recursive operations like find.
-
- It is very unlikely that this is the reason for your problem. As
- someone else pointed out, most UNIX servers use as their "cookie" the
- offset of the directory entry in a given directory. The problem is,
- when a directory gets compacted, the offset of directory entries can
- change. This results in the offset pointing to the wrong location.
- Depending on how the server handles this, some directory entries will be
- repeated, or else some will not be reported at all.
-
- Dave Hitz hitz@netapp.com
- Network Appliance (408) 562-1906
-