System information

Level 1: Server details
Level 2: Some mount options; security type; FSID; uniquifier
Level 3: File Handle
Level 4: Page number in file
To avoid coherency management problems between superblocks, all NFS superblocks that wish to
cache data have unique Level 2 keys. Normally, two NFS mounts with same source volume and
options will share a superblock, and thus share the caching, even if they mount different directories
within that volume.
Examp le 10.1. Cach e sharing
Take the following two mo unt commands:
mo unt ho me0 : /d i sk0 /fred /ho me/fred -o fsc
mo unt ho me0 : /d i sk0 /ji m /ho me/ji m -o fsc
Here, /ho me/fred and /ho me/ji m will likely share the superblock as they have the same
options, especially if they come from the same volume/partition on the NFS server (ho me0 ). Now,
consider the next two subsequent mount commands:
mo unt ho me0 : /d i sk0 /fred /ho me/fred -o fsc,rsi ze= 230
mo unt ho me0 : /d i sk0 /ji m /ho me/ji m -o fsc,rsi ze= 231
In this case, /ho me/fred and /ho me/ji m will not share the superblock as they have different
network access parameters, which are part of the Level 2 key. The same goes for the following
mount sequence:
mo unt ho me0 : /d i sk0 /fred /ho me/fred 1 -o fsc,rsi ze= 230
mo unt ho me0 : /d i sk0 /fred /ho me/fred 2 -o fsc,rsi ze= 231
Here, the contents of the two subtrees (/ho me/fred 1 and /ho me/fred 2) will be cached twice.
Another way to avoid superblock sharing is to suppress it explicitly with the no sharecache
parameter. Using the same example:
mo unt ho me0 : /d i sk0 /fred /ho me/fred -o no sharecache,fsc
mo unt ho me0 : /d i sk0 /ji m /ho me/ji m -o no sharecache,fsc
However, in this case only one of the superblocks will be permitted to use cache since there is
nothing to distinguish the Level 2 keys of ho me0 : /d i sk0 /fred and ho me0 : /d i sk0 /ji m. To
address this, add a unique identifier on at least one of the mounts, i.e. fsc= unique-identifier.
For example:
mo unt ho me0 : /d i sk0 /fred /ho me/fred -o no sharecache,fsc
mo unt ho me0 : /d i sk0 /ji m /ho me/ji m -o no sharecache,fsc= ji m
Here, the unique identifier ji m will be added to the Level 2 key used in the cache for /ho me/ji m.
10.3.2. Cache Limit at ions Wit h NFS
Chapt er 1 0 . FS- Cache
77