@@ -14,9 +14,13 @@ The result will inevitably fail to look exactly like a normal
1414filesystem for various technical reasons. The expectation is that
1515many use cases will be able to ignore these differences.
1616
17- This approach is 'hybrid' because the objects that appear in the
18- filesystem do not all appear to belong to that filesystem. In many
19- cases an object accessed in the union will be indistinguishable
17+
18+ Overlay objects
19+ ---------------
20+
21+ The overlay filesystem approach is 'hybrid', because the objects that
22+ appear in the filesystem do not always appear to belong to that filesystem.
23+ In many cases, an object accessed in the union will be indistinguishable
2024from accessing the corresponding object from the original filesystem.
2125This is most obvious from the 'st_dev' field returned by stat(2).
2226
@@ -34,6 +38,19 @@ make the overlay mount more compliant with filesystem scanners and
3438overlay objects will be distinguishable from the corresponding
3539objects in the original filesystem.
3640
41+ On 64bit systems, even if all overlay layers are not on the same
42+ underlying filesystem, the same compliant behavior could be achieved
43+ with the "xino" feature. The "xino" feature composes a unique object
44+ identifier from the real object st_ino and an underlying fsid index.
45+ If all underlying filesystems support NFS file handles and export file
46+ handles with 32bit inode number encoding (e.g. ext4), overlay filesystem
47+ will use the high inode number bits for fsid. Even when the underlying
48+ filesystem uses 64bit inode numbers, users can still enable the "xino"
49+ feature with the "-o xino=on" overlay mount option. That is useful for the
50+ case of underlying filesystems like xfs and tmpfs, which use 64bit inode
51+ numbers, but are very unlikely to use the high inode number bit.
52+
53+
3754Upper and Lower
3855---------------
3956
@@ -290,10 +307,19 @@ Non-standard behavior
290307---------------------
291308
292309The copy_up operation essentially creates a new, identical file and
293- moves it over to the old name. The new file may be on a different
294- filesystem, so both st_dev and st_ino of the file may change.
310+ moves it over to the old name. Any open files referring to this inode
311+ will access the old data.
312+
313+ The new file may be on a different filesystem, so both st_dev and st_ino
314+ of the real file may change. The values of st_dev and st_ino returned by
315+ stat(2) on an overlay object are often not the same as the real file
316+ stat(2) values to prevent the values from changing on copy_up.
295317
296- Any open files referring to this inode will access the old data.
318+ Unless "xino" feature is enabled, when overlay layers are not all on the
319+ same underlying filesystem, the value of st_dev may be different for two
320+ non-directory objects in the same overlay filesystem and the value of
321+ st_ino for directory objects may be non persistent and could change even
322+ while the overlay filesystem is still mounted.
297323
298324Unless "inode index" feature is enabled, if a file with multiple hard
299325links is copied up, then this will "break" the link. Changes will not be
@@ -302,6 +328,7 @@ propagated to other names referring to the same inode.
302328Unless "redirect_dir" feature is enabled, rename(2) on a lower or merged
303329directory will fail with EXDEV.
304330
331+
305332Changes to underlying filesystems
306333---------------------------------
307334
0 commit comments