-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kern…
…el/git/tytso/ext4 Pull ext4 updates from Ted Ts'o: "In addition to some ext4 bug fixes and cleanups, this cycle we add the orphan_file feature, which eliminates bottlenecks when doing a large number of parallel truncates and file deletions, and move the discard operation out of the jbd2 commit thread when using the discard mount option, to better support devices with slow discard operations" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (23 commits) ext4: make the updating inode data procedure atomic ext4: remove an unnecessary if statement in __ext4_get_inode_loc() ext4: move inode eio simulation behind io completeion ext4: Improve scalability of ext4 orphan file handling ext4: Orphan file documentation ext4: Speedup ext4 orphan inode handling ext4: Move orphan inode handling into a separate file ext4: Support for checksumming from journal triggers ext4: fix race writing to an inline_data file while its xattrs are changing jbd2: add sparse annotations for add_transaction_credits() ext4: fix sparse warnings ext4: Make sure quota files are not grabbed accidentally ext4: fix e2fsprogs checksum failure for mounted filesystem ext4: if zeroout fails fall back to splitting the extent node ext4: reduce arguments of ext4_fc_add_dentry_tlv ext4: flush background discard kwork when retry allocation ext4: get discard out of jbd2 commit kthread contex ext4: remove the repeated comment of ext4_trim_all_free ext4: add new helper interface ext4_try_to_trim_range() ext4: remove the 'group' parameter of ext4_trim_extent ...
- Loading branch information
Showing
27 changed files
with
1,443 additions
and
731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.. SPDX-License-Identifier: GPL-2.0 | ||
Orphan file | ||
----------- | ||
|
||
In unix there can inodes that are unlinked from directory hierarchy but that | ||
are still alive because they are open. In case of crash the filesystem has to | ||
clean up these inodes as otherwise they (and the blocks referenced from them) | ||
would leak. Similarly if we truncate or extend the file, we need not be able | ||
to perform the operation in a single journalling transaction. In such case we | ||
track the inode as orphan so that in case of crash extra blocks allocated to | ||
the file get truncated. | ||
|
||
Traditionally ext4 tracks orphan inodes in a form of single linked list where | ||
superblock contains the inode number of the last orphan inode (s\_last\_orphan | ||
field) and then each inode contains inode number of the previously orphaned | ||
inode (we overload i\_dtime inode field for this). However this filesystem | ||
global single linked list is a scalability bottleneck for workloads that result | ||
in heavy creation of orphan inodes. When orphan file feature | ||
(COMPAT\_ORPHAN\_FILE) is enabled, the filesystem has a special inode | ||
(referenced from the superblock through s\_orphan_file_inum) with several | ||
blocks. Each of these blocks has a structure: | ||
|
||
.. list-table:: | ||
:widths: 8 8 24 40 | ||
:header-rows: 1 | ||
|
||
* - Offset | ||
- Type | ||
- Name | ||
- Description | ||
* - 0x0 | ||
- Array of \_\_le32 entries | ||
- Orphan inode entries | ||
- Each \_\_le32 entry is either empty (0) or it contains inode number of | ||
an orphan inode. | ||
* - blocksize - 8 | ||
- \_\_le32 | ||
- ob\_magic | ||
- Magic value stored in orphan block tail (0x0b10ca04) | ||
* - blocksize - 4 | ||
- \_\_le32 | ||
- ob\_checksum | ||
- Checksum of the orphan block. | ||
|
||
When a filesystem with orphan file feature is writeably mounted, we set | ||
RO\_COMPAT\_ORPHAN\_PRESENT feature in the superblock to indicate there may | ||
be valid orphan entries. In case we see this feature when mounting the | ||
filesystem, we read the whole orphan file and process all orphan inodes found | ||
there as usual. When cleanly unmounting the filesystem we remove the | ||
RO\_COMPAT\_ORPHAN\_PRESENT feature to avoid unnecessary scanning of the orphan | ||
file and also make the filesystem fully compatible with older kernels. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.