Skip to content

Commit 8c8f4d9

Browse files
committed
Add option none to zfs redundant_metadata property
Currently, additional/extra copies are created for metadata in addition to the redundancy provided by the pool(mirror/raidz/draid), due to this 2 times more space is utilized per inode and this decreases the total number of inodes that can be created in the filesystem. By setting redundant_metadata to none, no additional copies of metadata are created, hence can reduce the space consumed by the additional metadata copies and increase the total number of inodes that can be created in the filesystem. Reviewed-by: Dipak Ghosh <dipak.ghosh@hpe.com> Signed-off-by: Akash B <akash-b@hpe.com>
1 parent f371cc1 commit 8c8f4d9

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

include/sys/fs/zfs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,8 @@ typedef enum {
500500

501501
typedef enum {
502502
ZFS_REDUNDANT_METADATA_ALL,
503-
ZFS_REDUNDANT_METADATA_MOST
503+
ZFS_REDUNDANT_METADATA_MOST,
504+
ZFS_REDUNDANT_METADATA_NONE
504505
} zfs_redundant_metadata_type_t;
505506

506507
typedef enum {

man/man7/zfsprops.7

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ affects only files created afterward; existing files are unaffected.
14441444
.Pp
14451445
This property can also be referred to by its shortened column name,
14461446
.Sy recsize .
1447-
.It Sy redundant_metadata Ns = Ns Sy all Ns | Ns Sy most
1447+
.It Sy redundant_metadata Ns = Ns Sy all Ns | Ns Sy most Ns | Ns Sy none
14481448
Controls what types of metadata are stored redundantly.
14491449
ZFS stores an extra copy of metadata, so that if a single block is corrupted,
14501450
the amount of user data lost is limited.
@@ -1485,6 +1485,10 @@ of user data can be lost if a single on-disk block is corrupt.
14851485
The exact behavior of which metadata blocks are stored redundantly may change in
14861486
future releases.
14871487
.Pp
1488+
When set to
1489+
.Sy none ,
1490+
ZFS does not store any copies of metadata redundantly through this property.
1491+
.Pp
14881492
The default value is
14891493
.Sy all .
14901494
.It Sy refquota Ns = Ns Ar size Ns | Ns Sy none

module/zcommon/zfs_prop.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ zfs_prop_init(void)
369369
static const zprop_index_t redundant_metadata_table[] = {
370370
{ "all", ZFS_REDUNDANT_METADATA_ALL },
371371
{ "most", ZFS_REDUNDANT_METADATA_MOST },
372+
{ "none", ZFS_REDUNDANT_METADATA_NONE },
372373
{ NULL }
373374
};
374375

@@ -388,7 +389,7 @@ zfs_prop_init(void)
388389
zprop_register_index(ZFS_PROP_REDUNDANT_METADATA, "redundant_metadata",
389390
ZFS_REDUNDANT_METADATA_ALL,
390391
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
391-
"all | most", "REDUND_MD",
392+
"all | most | none", "REDUND_MD",
392393
redundant_metadata_table, sfeatures);
393394
zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD,
394395
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,

module/zfs/dmu_objset.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ redundant_metadata_changed_cb(void *arg, uint64_t newval)
287287
* Inheritance and range checking should have been done by now.
288288
*/
289289
ASSERT(newval == ZFS_REDUNDANT_METADATA_ALL ||
290-
newval == ZFS_REDUNDANT_METADATA_MOST);
290+
newval == ZFS_REDUNDANT_METADATA_MOST ||
291+
newval == ZFS_REDUNDANT_METADATA_NONE);
291292

292293
os->os_redundant_metadata = newval;
293294
}

0 commit comments

Comments
 (0)