Skip to content

Commit d17bb46

Browse files
committed
overlayfs.rst: fix ReST formatting
Fix some indentation issues and fix missing newlines in quoted text by converting quoted text to code blocks. Reported-by: Christian Brauner <[email protected]> Suggested-by: Bagas Sanjaya <[email protected]> Reviewed-by: Bagas Sanjaya <[email protected]> Reviewed-by: Akira Yokosawa <[email protected]> Signed-off-by: Amir Goldstein <[email protected]>
1 parent bdc10bd commit d17bb46

File tree

1 file changed

+39
-38
lines changed

1 file changed

+39
-38
lines changed

Documentation/filesystems/overlayfs.rst

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Where both upper and lower objects are directories, a merged directory
118118
is formed.
119119

120120
At mount time, the two directories given as mount options "lowerdir" and
121-
"upperdir" are combined into a merged directory:
121+
"upperdir" are combined into a merged directory::
122122

123123
mount -t overlay overlay -olowerdir=/lower,upperdir=/upper,\
124124
workdir=/work /merged
@@ -172,12 +172,12 @@ directory is being read. This is unlikely to be noticed by many
172172
programs.
173173

174174
seek offsets are assigned sequentially when the directories are read.
175-
Thus if
175+
Thus if:
176176

177-
- read part of a directory
178-
- remember an offset, and close the directory
179-
- re-open the directory some time later
180-
- seek to the remembered offset
177+
- read part of a directory
178+
- remember an offset, and close the directory
179+
- re-open the directory some time later
180+
- seek to the remembered offset
181181

182182
there may be little correlation between the old and new locations in
183183
the list of filenames, particularly if anything has changed in the
@@ -290,9 +290,9 @@ Permission checking in the overlay filesystem follows these principles:
290290
2) task creating the overlay mount MUST NOT gain additional privileges
291291

292292
3) non-mounting task MAY gain additional privileges through the overlay,
293-
compared to direct access on underlying lower or upper filesystems
293+
compared to direct access on underlying lower or upper filesystems
294294

295-
This is achieved by performing two permission checks on each access
295+
This is achieved by performing two permission checks on each access:
296296

297297
a) check if current task is allowed access based on local DAC (owner,
298298
group, mode and posix acl), as well as MAC checks
@@ -311,11 +311,11 @@ to create setups where the consistency rule (1) does not hold; normally,
311311
however, the mounting task will have sufficient privileges to perform all
312312
operations.
313313

314-
Another way to demonstrate this model is drawing parallels between
314+
Another way to demonstrate this model is drawing parallels between::
315315

316316
mount -t overlay overlay -olowerdir=/lower,upperdir=/upper,... /merged
317317

318-
and
318+
and::
319319

320320
cp -a /lower /upper
321321
mount --bind /upper /merged
@@ -328,7 +328,7 @@ Multiple lower layers
328328
---------------------
329329

330330
Multiple lower layers can now be given using the colon (":") as a
331-
separator character between the directory names. For example:
331+
separator character between the directory names. For example::
332332

333333
mount -t overlay overlay -olowerdir=/lower1:/lower2:/lower3 /merged
334334

@@ -340,13 +340,13 @@ rightmost one and going left. In the above example lower1 will be the
340340
top, lower2 the middle and lower3 the bottom layer.
341341

342342
Note: directory names containing colons can be provided as lower layer by
343-
escaping the colons with a single backslash. For example:
343+
escaping the colons with a single backslash. For example::
344344

345345
mount -t overlay overlay -olowerdir=/a\:lower\:\:dir /merged
346346

347347
Since kernel version v6.8, directory names containing colons can also
348348
be configured as lower layer using the "lowerdir+" mount options and the
349-
fsconfig syscall from new mount api. For example:
349+
fsconfig syscall from new mount api. For example::
350350

351351
fsconfig(fs_fd, FSCONFIG_SET_STRING, "lowerdir+", "/a:lower::dir", 0);
352352

@@ -405,7 +405,7 @@ A normal lower layer is not allowed to be below a data-only layer, so single
405405
colon separators are not allowed to the right of double colon ("::") separators.
406406

407407

408-
For example:
408+
For example::
409409

410410
mount -t overlay overlay -olowerdir=/l1:/l2:/l3::/do1::/do2 /merged
411411

@@ -419,7 +419,7 @@ to the absolute path of the "lower data" file in the "data-only" lower layer.
419419

420420
Since kernel version v6.8, "data-only" lower layers can also be added using
421421
the "datadir+" mount options and the fsconfig syscall from new mount api.
422-
For example:
422+
For example::
423423

424424
fsconfig(fs_fd, FSCONFIG_SET_STRING, "lowerdir+", "/l1", 0);
425425
fsconfig(fs_fd, FSCONFIG_SET_STRING, "lowerdir+", "/l2", 0);
@@ -429,7 +429,7 @@ For example:
429429

430430

431431
fs-verity support
432-
----------------------
432+
-----------------
433433

434434
During metadata copy up of a lower file, if the source file has
435435
fs-verity enabled and overlay verity support is enabled, then the
@@ -547,15 +547,15 @@ filesystem.
547547

548548
This is the list of cases that overlayfs doesn't currently handle:
549549

550-
a) POSIX mandates updating st_atime for reads. This is currently not
551-
done in the case when the file resides on a lower layer.
550+
a) POSIX mandates updating st_atime for reads. This is currently not
551+
done in the case when the file resides on a lower layer.
552552

553-
b) If a file residing on a lower layer is opened for read-only and then
554-
memory mapped with MAP_SHARED, then subsequent changes to the file are not
555-
reflected in the memory mapping.
553+
b) If a file residing on a lower layer is opened for read-only and then
554+
memory mapped with MAP_SHARED, then subsequent changes to the file are not
555+
reflected in the memory mapping.
556556

557-
c) If a file residing on a lower layer is being executed, then opening that
558-
file for write or truncating the file will not be denied with ETXTBSY.
557+
c) If a file residing on a lower layer is being executed, then opening that
558+
file for write or truncating the file will not be denied with ETXTBSY.
559559

560560
The following options allow overlayfs to act more like a standards
561561
compliant filesystem:
@@ -647,12 +647,13 @@ directory inode.
647647
When encoding a file handle from an overlay filesystem object, the
648648
following rules apply:
649649

650-
1. For a non-upper object, encode a lower file handle from lower inode
651-
2. For an indexed object, encode a lower file handle from copy_up origin
652-
3. For a pure-upper object and for an existing non-indexed upper object,
653-
encode an upper file handle from upper inode
650+
1. For a non-upper object, encode a lower file handle from lower inode
651+
2. For an indexed object, encode a lower file handle from copy_up origin
652+
3. For a pure-upper object and for an existing non-indexed upper object,
653+
encode an upper file handle from upper inode
654654

655655
The encoded overlay file handle includes:
656+
656657
- Header including path type information (e.g. lower/upper)
657658
- UUID of the underlying filesystem
658659
- Underlying filesystem encoding of underlying inode
@@ -662,15 +663,15 @@ are stored in extended attribute "trusted.overlay.origin".
662663

663664
When decoding an overlay file handle, the following steps are followed:
664665

665-
1. Find underlying layer by UUID and path type information.
666-
2. Decode the underlying filesystem file handle to underlying dentry.
667-
3. For a lower file handle, lookup the handle in index directory by name.
668-
4. If a whiteout is found in index, return ESTALE. This represents an
669-
overlay object that was deleted after its file handle was encoded.
670-
5. For a non-directory, instantiate a disconnected overlay dentry from the
671-
decoded underlying dentry, the path type and index inode, if found.
672-
6. For a directory, use the connected underlying decoded dentry, path type
673-
and index, to lookup a connected overlay dentry.
666+
1. Find underlying layer by UUID and path type information.
667+
2. Decode the underlying filesystem file handle to underlying dentry.
668+
3. For a lower file handle, lookup the handle in index directory by name.
669+
4. If a whiteout is found in index, return ESTALE. This represents an
670+
overlay object that was deleted after its file handle was encoded.
671+
5. For a non-directory, instantiate a disconnected overlay dentry from the
672+
decoded underlying dentry, the path type and index inode, if found.
673+
6. For a directory, use the connected underlying decoded dentry, path type
674+
and index, to lookup a connected overlay dentry.
674675

675676
Decoding a non-directory file handle may return a disconnected dentry.
676677
copy_up of that disconnected dentry will create an upper index entry with
@@ -773,9 +774,9 @@ Testsuite
773774
There's a testsuite originally developed by David Howells and currently
774775
maintained by Amir Goldstein at:
775776

776-
https://github.com/amir73il/unionmount-testsuite.git
777+
https://github.com/amir73il/unionmount-testsuite.git
777778

778-
Run as root:
779+
Run as root::
779780

780781
# cd unionmount-testsuite
781782
# ./run --ov --verify

0 commit comments

Comments
 (0)