Skip to content

Commit 2eda9ea

Browse files
amir73ilMiklos Szeredi
authored andcommitted
ovl: document xino expected behavior
Summarize the inode properties of different configurations in a table. Signed-off-by: Amir Goldstein <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 926e94d commit 2eda9ea

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

Documentation/filesystems/overlayfs.rst

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,46 @@ On 64bit systems, even if all overlay layers are not on the same
4040
underlying filesystem, the same compliant behavior could be achieved
4141
with the "xino" feature. The "xino" feature composes a unique object
4242
identifier from the real object st_ino and an underlying fsid index.
43+
4344
If all underlying filesystems support NFS file handles and export file
4445
handles with 32bit inode number encoding (e.g. ext4), overlay filesystem
4546
will use the high inode number bits for fsid. Even when the underlying
4647
filesystem uses 64bit inode numbers, users can still enable the "xino"
4748
feature with the "-o xino=on" overlay mount option. That is useful for the
4849
case of underlying filesystems like xfs and tmpfs, which use 64bit inode
49-
numbers, but are very unlikely to use the high inode number bit.
50+
numbers, but are very unlikely to use the high inode number bits. In case
51+
the underlying inode number does overflow into the high xino bits, overlay
52+
filesystem will fall back to the non xino behavior for that inode.
53+
54+
The following table summarizes what can be expected in different overlay
55+
configurations.
56+
57+
Inode properties
58+
````````````````
59+
60+
+--------------+------------+------------+-----------------+----------------+
61+
|Configuration | Persistent | Uniform | st_ino == d_ino | d_ino == i_ino |
62+
| | st_ino | st_dev | | [*] |
63+
+==============+=====+======+=====+======+========+========+========+=======+
64+
| | dir | !dir | dir | !dir | dir + !dir | dir | !dir |
65+
+--------------+-----+------+-----+------+--------+--------+--------+-------+
66+
| All layers | Y | Y | Y | Y | Y | Y | Y | Y |
67+
| on same fs | | | | | | | | |
68+
+--------------+-----+------+-----+------+--------+--------+--------+-------+
69+
| Layers not | N | Y | Y | N | N | Y | N | Y |
70+
| on same fs, | | | | | | | | |
71+
| xino=off | | | | | | | | |
72+
+--------------+-----+------+-----+------+--------+--------+--------+-------+
73+
| xino=on/auto | Y | Y | Y | Y | Y | Y | Y | Y |
74+
| | | | | | | | | |
75+
+--------------+-----+------+-----+------+--------+--------+--------+-------+
76+
| xino=on/auto,| N | Y | Y | N | N | Y | N | Y |
77+
| ino overflow | | | | | | | | |
78+
+--------------+-----+------+-----+------+--------+--------+--------+-------+
79+
80+
[*] nfsd v3 readdirplus verifies d_ino == i_ino. i_ino is exposed via several
81+
/proc files, such as /proc/locks and /proc/self/fdinfo/<fd> of an inotify
82+
file descriptor.
5083

5184

5285
Upper and Lower
@@ -427,7 +460,8 @@ guarantee that the values of st_ino and st_dev returned by stat(2) and the
427460
value of d_ino returned by readdir(3) will act like on a normal filesystem.
428461
E.g. the value of st_dev may be different for two objects in the same
429462
overlay filesystem and the value of st_ino for directory objects may not be
430-
persistent and could change even while the overlay filesystem is mounted.
463+
persistent and could change even while the overlay filesystem is mounted, as
464+
summarized in the `Inode properties`_ table above.
431465

432466

433467
Changes to underlying filesystems

0 commit comments

Comments
 (0)