forked from amir73il/linux
/
Kconfig
526 lines (471 loc) · 20.4 KB
/
Kconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
config EXT4_FS
tristate "The Extended 4 (ext4) filesystem"
select JBD2
select CRC16
help
This is the next generation of the ext3 filesystem.
Unlike the change from ext2 filesystem to ext3 filesystem,
the on-disk format of ext4 is not forwards compatible with
ext3; it is based on extent maps and it supports 48-bit
physical block numbers. The ext4 filesystem also supports delayed
allocation, persistent preallocation, high resolution time stamps,
and a number of other features to improve performance and speed
up fsck time. For more information, please see the web pages at
http://ext4.wiki.kernel.org.
The ext4 filesystem will support mounting an ext3
filesystem; while there will be some performance gains from
the delayed allocation and inode table readahead, the best
performance gains will require enabling ext4 features in the
filesystem, or formatting a new filesystem as an ext4
filesystem initially.
To compile this file system support as a module, choose M here. The
module will be called ext4.
If unsure, say N.
config EXT4_USE_FOR_EXT23
bool "Use ext4 for ext2/ext3 file systems"
depends on EXT4_FS
depends on EXT3_FS=n || EXT2_FS=n
default y
help
Allow the ext4 file system driver code to be used for ext2 or
ext3 file system mounts. This allows users to reduce their
compiled kernel size by using one file system driver for
ext2, ext3, and ext4 file systems.
config EXT4_FS_XATTR
bool "Ext4 extended attributes"
depends on EXT4_FS
default y
help
Extended attributes are name:value pairs associated with inodes by
the kernel or by users (see the attr(5) manual page, or visit
<http://acl.bestbits.at/> for details).
If unsure, say N.
You need this for POSIX ACL support on ext4.
config EXT4_FS_POSIX_ACL
bool "Ext4 POSIX Access Control Lists"
depends on EXT4_FS_XATTR
select FS_POSIX_ACL
help
POSIX Access Control Lists (ACLs) support permissions for users and
groups beyond the owner/group/world scheme.
To learn more about Access Control Lists, visit the POSIX ACLs for
Linux website <http://acl.bestbits.at/>.
If you don't know what Access Control Lists are, say N
config EXT4_FS_SECURITY
bool "Ext4 Security Labels"
depends on EXT4_FS_XATTR
help
Security labels support alternative access control models
implemented by security modules like SELinux. This option
enables an extended attribute handler for file security
labels in the ext4 filesystem.
If you are not using a security module that requires using
extended attributes for file security labels, say N.
config EXT4_DEBUG
bool "EXT4 debugging support"
depends on EXT4_FS
help
Enables run-time debugging support for the ext4 filesystem.
If you select Y here, then you will be able to turn on debugging
with a command such as "echo 1 > /sys/kernel/debug/ext4/mballoc-debug"
config EXT4_FS_SNAPSHOT
bool "EXT4 snapshots (Experimental)"
depends on EXT4_FS && EXPERIMENTAL
default n
help
Built-in snapshots support for ext4.
Requires that the filesystem has the has_snapshot and exclude_bitmap
features and that block size is equal to system page size.
Snapshots are not supported with 64bit and meta_bg features and the
filesystem must be mounted with ordered data mode.
config EXT4_FS_SNAPSHOT_ROCOMPAT
bool "snapshot rocompat - enable rw mount"
depends on EXT4_FS_SNAPSHOT
default y
help
Enable readwrite mount of filesystem with has_snapshot feature only
if ext4 was compiled with snapshot support.
config EXT4_FS_SNAPSHOT_DEBUG
bool "snapshot debugging support"
depends on EXT4_FS_SNAPSHOT
depends on EXT4_DEBUG
default y
help
Control snapshot debug level via debugfs entry /ext4/snapshot-debug
and induce delay tests via debugfs entries /ext4/test-XXX-delay-msec.
config EXT4_FS_SNAPSHOT_HOOKS_JBD
bool "snapshot hooks - inside JBD hooks"
depends on EXT4_FS_SNAPSHOT
default y
help
Before every metadata buffer write, the journal API is called,
namely, one of the ext4_journal_get_XXX_access() functions.
We use these journal hooks to call the snapshot API, namely
ext4_snapshot_get_XXX_access(), to COW the metadata buffer before
it is modified for the first time.
config EXT4_FS_SNAPSHOT_HOOKS_BITMAP
bool "snapshot hooks - block bitmap access"
depends on EXT4_FS_SNAPSHOT
default y
help
The API ext4_handle_get_bitmap_access() is used instead of
ext4_journal_get_write_access(), before modifying a block bitmap
while allocating or deleting blocks. The bitmap access API is
used to initialize the COW bitmap for that group.
The old ext4_journal_get_undo_access() API was removed because it
is not being used in the code.
config EXT4_FS_SNAPSHOT_HOOKS_DELETE
bool "snapshot hooks - delete blocks"
depends on EXT4_FS_SNAPSHOT
default y
help
Before deleting file blocks in ext4_free_blocks(),
we call the snapshot API ext4_snapshot_get_delete_access(),
to optionally move the block to the snapshot file instead of
freeing them.
config EXT4_FS_SNAPSHOT_HOOKS_DATA
bool "snapshot hooks - move data blocks"
depends on EXT4_FS_SNAPSHOT
default y
help
Before every regular file data buffer write, the function
ext4_get_block() is called to map the buffer to disk. We add a
new function ext4_get_block_mow() which is called when we want to
snapshot the blocks. We use this hook to call the snapshot API
snapshot_get_move_access(), to optionally move the block
to the snapshot file.
config EXT4_FS_SNAPSHOT_HOOKS_DIO
bool "snapshot hooks - direct I/O"
depends on EXT4_FS_SNAPSHOT_HOOKS_DATA
default y
help
With indirect mapped files, direct I/O write is not allowed to
initialize holes, so stale data won't be exposed.
With snapshots, direct I/O write is not allowed to do move-on-write,
for the exact same reason.
config EXT4_FS_SNAPSHOT_HOOKS_EXTENT
bool "snapshot hooks - move extent file data blocks"
depends on EXT4_FS_SNAPSHOT_HOOKS_DATA
default y
help
Extent mapped file data is moved into snapshot in ext4_ext_map_blocks().
If a part of a extent is to be moved, the extent is splitted. Fragmentation
is light because of delayed-move-on-write.
config EXT4_FS_SNAPSHOT_FILE
bool "snapshot file"
depends on EXT4_FS_SNAPSHOT
default y
help
Ext4 snapshot implementation as a file inside the file system.
Snapshot files are marked with the snapfile flag and have special
read-only address space ops.
config EXT4_FS_SNAPCLONE_FILE
bool "snapclone file"
depends on EXT4_FS_SNAPSHOT
default y
help
Ext4 snapclone implementation as a file inside the file system.
Snapshot clones are marked with the snapclone flag and have special
address space ops supporting writable snapshot.
config EXT4_FS_SNAPSHOT_FILE_READ
bool "snapshot file - read through to block device"
depends on EXT4_FS_SNAPSHOT_FILE
default y
help
On active snapshot page read, the function ext4_snapshot_get_block()
is called to map the page to a disk block. If the page is not mapped
in the snapshot file a direct mapping to the block device is returned.
config EXT4_FS_SNAPSHOT_FILE_PERM
bool "snapshot file - permissions"
depends on EXT4_FS_SNAPSHOT_FILE
default y
help
Enforce snapshot file permissions.
Write, truncate and unlink of snapshot inodes is not allowed.
config EXT4_FS_SNAPSHOT_FILE_STORE
bool "snapshot file - store on disk"
depends on EXT4_FS_SNAPSHOT_FILE
default y
help
Snapshot inode is stored differently in memory and on disk.
During store and load of snapshot inode, some of the inode flags
and fields are converted.
config EXT4_FS_SNAPSHOT_FILE_HUGE
bool "snapshot file - increase maximum file size limit to 16TB"
depends on EXT4_FS_SNAPSHOT_FILE
default y
help
Files larger than 2TB use Ext4 huge_file flag to store i_blocks
in file system blocks units, so the upper limit on snapshot actual
size is increased from 512*2^32 = 2TB to 4K*2^32 = 16TB,
which is also the upper limit on file system size.
To map 2^32 logical blocks, 4 triple indirect blocks are used instead
of just one. The extra 3 triple indirect blocks are stored in-place
of direct blocks, which are not in use by snapshot files.
config EXT4_FS_SNAPSHOT_BLOCK
bool "snapshot block operations"
depends on EXT4_FS_SNAPSHOT_FILE
default y
help
Core API of special snapshot file block operations.
The argument @create to the function ext4_getblk()
is re-interpreted as a snapshot block command argument. The old
argument values 0(=read) and 1(=create) preserve the original
behavior of the function. The bit field h_cowing in the current
transaction handle is used to prevent COW recursions.
config EXT4_FS_SNAPSHOT_BLOCK_COW
bool "snapshot block operation - copy blocks to snapshot"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
Implementation of copying blocks into a snapshot file.
This mechanism is used to copy-on-write metadata blocks to snapshot.
config EXT4_FS_SNAPSHOT_BLOCK_MOVE
bool "snapshot block operation - move blocks to snapshot"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
Implementation of moving blocks into a snapshot file.
The move block command maps an allocated blocks to the snapshot file,
allocating only the indirect blocks when needed.
This mechanism is used to move-on-write data blocks to snapshot.
config EXT4_FS_SNAPSHOT_BLOCK_BITMAP
bool "snapshot block operation - copy block bitmap to snapshot"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
The snapshot copy of the file system block bitmap is called the COW
bitmap and it is used to check if a block was allocated at the time
that the snapshot was taken.
config EXT4_FS_SNAPSHOT_JOURNAL_ERROR
bool "snapshot journaled - record errors in journal"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
Ext4 error state is recorded in the journal super block and error
messages are recorder in free space after the journal super block.
These error messages are dislayed by fsck and cleared after the
errors were fixed.
config EXT4_FS_SNAPSHOT_JOURNAL_CREDITS
bool "snapshot journaled - increase transaction credits"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
Snapshot operations are journaled as part of the running transaction.
The amount of requested credits is multiplied with a factor, to ensure
that enough buffer credits are reserved in the running transaction.
The new field h_base_credits stored to original credits request and
the new filed u_user_credits counts the number of credits used by
non-COW operations. They are especially useful when exteding a large
transaction, which did not use the extra COW credits it requested.
In this case, only the missing extra credits are requested.
config EXT4_FS_SNAPSHOT_JOURNAL_RELEASE
bool "snapshot journaled - implement journal_release_buffer()"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
The API journal_release_buffer() is called to cancel a previous call
to journal_get_write_access() and to recall the used buffer credit.
Current implementation of journal_release_buffer() in JBD is empty,
since no buffer credits are used until the buffer is marked dirty.
However, since the resulting snapshot COW operation cannot be undone,
we try to extend the current transaction to compensate for the used
credits of the extra COW operation, so we don't run out of buffer
credits too soon.
config EXT4_FS_SNAPSHOT_JOURNAL_BYPASS
bool "snapshot journaled - bypass to save credits"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
Don't journal COW bitmap indirect blocks to save journal credits.
On very few COW operations (i.e., first block group access after
snapshot take), there may be up to 3 extra blocks allocated for the
active snapshot (i.e., COW bitmap block and up to 2 indirect blocks).
Taking these 2 indorect blocks into account on every COW operation
would further increase the transaction's COW credits factor.
Instead, we choose to pay a small performance penalty on these few
COW bitmap operations and wait until they are synced to disk.
config EXT4_FS_SNAPSHOT_JOURNAL_CACHE
bool "snapshot journaled - cache last COW tid in journal_head"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
Cache last COW transaction id in buffer's journal_head.
The cache suppresses COW tests until the transaction in committed.
By default, the running transaction is committed every 5 seconds
which implies an average COW cache expiry of 2.5 seconds.
Before taking a new snapshot, the journal is flushed to disk
and the current transaction in committed, so the COW cache is
invalidated (as it should be).
config EXT4_FS_SNAPSHOT_JOURNAL_TRACE
bool "snapshot journaled - trace COW/buffer credits"
depends on EXT4_FS_SNAPSHOT_BLOCK
depends on EXT4_FS_DEBUG
default y
help
Extra debug prints to trace snapshot usage of buffer credits.
config EXT4_FS_SNAPSHOT_LIST
bool "snapshot list support"
depends on EXT4_FS_SNAPSHOT_FILE
default y
help
Implementation of multiple incremental snapshots.
Snapshot inodes are chained on a list starting at the super block,
both on-disk and in-memory, similar to the orphan inodes.
Unlink and truncate of snapshot inodes on the list is not allowed,
so an inode can never be chained on both orphan and snapshot lists.
We make use of this fact to overload the in-memory inode field
ext4_inode_info.i_orphan for the chaining of snapshots.
config EXT4_FS_SNAPSHOT_LIST_READ
bool "snapshot list - read through to previous snapshot"
depends on EXT4_FS_SNAPSHOT_LIST
default y
help
On snapshot page read, the function ext4_get_block() is called
to map the page to a disk block. If the page is not mapped in the
snapshot file, the newer snapshots on the list are checked and the
oldest found mapping is returned. If the page is not mapped in any of
the newer snapshots, a direct mapping to the block device is returned.
config EXT4_FS_SNAPSHOT_RACE_BITMAP
bool "snapshot race conditions - concurrent COW bitmap operations"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
Wait for pending COW bitmap creations to complete.
When concurrent tasks try to COW buffers from the same block group
for the first time, the first task to reset the COW bitmap cache
is elected to create the new COW bitmap block. The rest of the tasks
wait (in msleep(1) loop), until the COW bitmap cache is uptodate.
The COWing task copies the bitmap block into the new COW bitmap block
and updates the COW bitmap cache with the new block number.
config EXT4_FS_SNAPSHOT_RACE_COW
bool "snapshot race conditions - concurrent COW operations"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
Wait for pending COW operations to complete.
When concurrent tasks try to COW the same buffer, the task that takes
the active snapshot i_data_sem is elected as the the COWing task.
The COWing task allocates a new snapshot block and creates a buffer
cache entry with ref_count=1 for that new block. It then locks the
new buffer and marks it with the buffer_new flag. The rest of the
tasks wait (in msleep(1) loop), until the buffer_new flag is cleared.
The COWing task copies the source buffer into the 'new' buffer,
unlocks it, clears the new_buffer flag and drops its reference count.
On active snapshot readpage, the buffer cache is checked.
If a 'new' buffer entry is found, the reader task waits until the
buffer_new flag is cleared and then copies the 'new' buffer directly
into the snapshot file page.
The sleep loop method was copied from LVM snapshot code, which does
the same thing to deal with these (rare) races without wait queues.
config EXT4_FS_SNAPSHOT_RACE_READ
bool "snapshot race conditions - tracked reads"
depends on EXT4_FS_SNAPSHOT_BLOCK
default y
help
Wait for pending read I/O requests to complete.
When a snapshot file readpage reads through to the block device,
the reading task increments the block tracked readers count.
Upon completion of the async read I/O request of the snapshot page,
the tracked readers count is decremented.
When a task is COWing a block with non-zero tracked readers count,
that task has to wait (in msleep(1) loop), until the block's tracked
readers count drops to zero, before the COW operation is completed.
After a pending COW operation has started, reader tasks have to wait
(again, in msleep(1) loop), until the pending COW operation is
completed, so the COWing task cannot be starved by reader tasks.
The sleep loop method was copied from LVM snapshot code, which does
the same thing to deal with these (rare) races without wait queues.
config EXT4_FS_SNAPSHOT_CTL
bool "snapshot control"
depends on EXT4_FS_SNAPSHOT_FILE
default y
help
Snapshot control with chsnap/lssnap.
Take/delete snapshot with chsnap +/-S.
Enable/disable snapshot with chsnap +/-n.
Show snapshot status with lssnap.
config EXT4_FS_SNAPSHOT_CTL_INIT
bool "snapshot control - init new snapshot"
depends on EXT4_FS_SNAPSHOT_CTL
default y
help
On snapshot create, a few special blocks (i.e., the super block and
group descriptors) are pre-allocated and on snapshot take, they are
copied under journal_lock_updates(). This is done to avoid the
recursion that would be caused by COWing these blocks after the
snapshot becomes active.
config EXT4_FS_SNAPSHOT_CTL_FIX
bool "snapshot control - fix new snapshot"
depends on EXT4_FS_SNAPSHOT_CTL_INIT
default y
help
On snapshot take, after copying the pre-allocated blocks, some are
fixed to make the snapshot image appear as a valid Ext4 file system.
The has_snapshot flags is cleared from the super block as well as
the last_snapshot field and all snapshot inodes are cleared
(to appear as empty inodes).
config EXT4_FS_SNAPSHOT_CTL_RESERVE
bool "snapshot control - reserve disk space for snapshot"
depends on EXT4_FS_SNAPSHOT_CTL
default y
help
Ensure there is enough disk space for snapshot file future use.
Reserve disk space on snapshot take based on file system overhead
size, number of directories and number of blocks/inodes in use.
When estimation is too low, we may reach out of space during COW,
which will result in journal abort and filesystem error.
config EXT4_FS_SNAPSHOT_CTL_DUMP
bool "snapshot control - dump snapshot file blocks map"
depends on EXT4_FS_SNAPSHOT_CTL
depends on EXT4_FS_DEBUG
default y
help
Use chattr -d to print the blocks map of a snapshot file.
Snapshot debugging should be enabled.
config EXT4_FS_SNAPSHOT_EXCLUDE_BITMAP
bool "snapshot exclude - the exclude bitmap"
depends on EXT4_FS_SNAPSHOT
default y
help
Mark all snapshot blocks excluded from COW (i.e., mark that
they do not need to be COWed). The excluded blocks appear as not
allocated inside the snapshot image (no snapshots of snapshot files).
Excluding snapshot file blocks is essential for efficient cleanup
of deleted snapshot files.
Excluding blocks is done by setting their bit in the exclude bitmap.
There is one exclude bitmap block per block group, which is allocated
on mkfs when setting the exclude_bitmap feature. The exclude bitmap
location is stored in the group descriptor.
The exclude_bitmap feature is backward compatible, but online resize
support with exclude_bitmap was not yet implemented.
config EXT4_FS_SNAPSHOT_CLEANUP
bool "snapshot cleanup"
depends on EXT4_FS_SNAPSHOT_LIST
depends on EXT4_FS_SNAPSHOT_EXCLUDE_BITMAP
default y
help
Cleanup snapshots list and reclaim unused blocks of deleted snapshots.
Oldest snapshot can be removed from list and its blocks can be freed.
Non-oldest snapshots have to be shrunk and merged before they can be
removed from the list. All snapshot blocks must be excluded in order
to properly shrink/merge deleted old snapshots.
config EXT4_FS_SNAPSHOT_CLEANUP_SHRINK
bool "snapshot cleanup - shrink deleted snapshots"
depends on EXT4_FS_SNAPSHOT_CLEANUP
default y
help
Free blocks of deleted snapshots, which are not in use by an older
non-deleted snapshot. Shrinking helps reclaiming disk space
while older snapshots are currently in use (enabled).
We modify the indirect inode truncate helper functions so that they
can be used by the snapshot cleanup functions to free blocks
selectively according to a COW bitmap buffer.
config EXT4_FS_SNAPSHOT_CLEANUP_MERGE
bool "snapshot cleanup - merge shrunk snapshots"
depends on EXT4_FS_SNAPSHOT_CLEANUP_SHRINK
default y
help
Move blocks of deleted and shrunk snapshots to an older non-deleted
and disabled snapshot. Merging helps removing snapshots from list
while older snapshots are not currently in use (disabled).