@@ -14,9 +14,13 @@ The result will inevitably fail to look exactly like a normal
14
14
filesystem for various technical reasons. The expectation is that
15
15
many use cases will be able to ignore these differences.
16
16
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
20
24
from accessing the corresponding object from the original filesystem.
21
25
This is most obvious from the 'st_dev' field returned by stat(2).
22
26
@@ -34,6 +38,19 @@ make the overlay mount more compliant with filesystem scanners and
34
38
overlay objects will be distinguishable from the corresponding
35
39
objects in the original filesystem.
36
40
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
+
37
54
Upper and Lower
38
55
---------------
39
56
@@ -290,10 +307,19 @@ Non-standard behavior
290
307
---------------------
291
308
292
309
The 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.
295
317
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.
297
323
298
324
Unless "inode index" feature is enabled, if a file with multiple hard
299
325
links 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.
302
328
Unless "redirect_dir" feature is enabled, rename(2) on a lower or merged
303
329
directory will fail with EXDEV.
304
330
331
+
305
332
Changes to underlying filesystems
306
333
---------------------------------
307
334
0 commit comments