* [PATCH v2 00/11] btrfs: Add missing pairing mount options.
@ 2014-01-03 6:10 Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 01/11] btrfs: Add "barrier" option to support "-o remount,barrier" Qu Wenruo
` (12 more replies)
0 siblings, 13 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Some options should be paired to support triggering different functions
when remounting.
This patchset add these missing pairing mount options.
changelog:
v1: Initial commit with only barrier option
v2: Add other missing pairing options
Qu Wenruo (11):
btrfs: Add "barrier" option to support "-o remount,barrier"
btrfs: Add noautodefrag mount option.
btrfs: Add nocheck_int mount option.
btrfs: Add nodiscard mount option.
btrfs: Add noenospc_debug mount option.
btrfs: Add noflushoncommit mount option.
btrfs: Add noinode_cache mount option.
btrfs: Add acl mount option.
btrfs: Add datacow mount option.
btrfs: Add datasum mount option.
btrfs: Add treelog mount option.
Documentation/filesystems/btrfs.txt | 56 ++++++++++++++++++----------
fs/btrfs/super.c | 74 ++++++++++++++++++++++++++++++++++++-
2 files changed, 110 insertions(+), 20 deletions(-)
--
1.8.5.2
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 01/11] btrfs: Add "barrier" option to support "-o remount,barrier"
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 8:44 ` Mike Fleetwood
2014-01-03 6:10 ` [PATCH v2 02/11] btrfs: Add noautodefrag mount option Qu Wenruo
` (11 subsequent siblings)
12 siblings, 1 reply; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Btrfs can be remounted without barrier, but there is no "barrier" option
so nobody can remount btrfs back with barrier on. Only umount and
mount again can re-enable barrier.(Quite awkward)
Also the mount options in the document is also changed slightly for the
further pairing options changes.
Reported-by: Daniel Blueman <daniel@quora.org>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: David Sterba <dsterba@suse.cz>
---
changelog:
v1: Add barrier option
v2: Change the document style to fit pairing options better
---
Documentation/filesystems/btrfs.txt | 13 +++++++------
fs/btrfs/super.c | 8 +++++++-
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index 5dd282d..2d2e016 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -38,7 +38,7 @@ Mount Options
=============
When mounting a btrfs filesystem, the following option are accepted.
-Unless otherwise specified, all options default to off.
+Options with (*) are default options and will not show in the mount options.
alloc_start=<bytes>
Debugging option to force all block allocations above a certain
@@ -138,12 +138,13 @@ Unless otherwise specified, all options default to off.
Disable support for Posix Access Control Lists (ACLs). See the
acl(5) manual page for more information about ACLs.
+ barrier(*)
nobarrier
- Disables the use of block layer write barriers. Write barriers ensure
- that certain IOs make it through the device cache and are on persistent
- storage. If used on a device with a volatile (non-battery-backed)
- write-back cache, this option will lead to filesystem corruption on a
- system crash or power loss.
+ Disable/enable the use of block layer write barriers. Write barriers
+ ensure that certain IOs make it through the device cache and are on
+ persistent storage. If used on a device with a volatile
+ (non-battery-backed) write-back cache, this option will lead to
+ filesystem corruption on a system crash or power loss.
nodatacow
Disable data copy-on-write for newly created files. Implies nodatasum,
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index e9c13fb..fe9d8a6 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -323,7 +323,7 @@ enum {
Opt_no_space_cache, Opt_recovery, Opt_skip_balance,
Opt_check_integrity, Opt_check_integrity_including_extent_data,
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
- Opt_commit_interval,
+ Opt_commit_interval, Opt_barrier,
Opt_err,
};
@@ -335,6 +335,7 @@ static match_table_t tokens = {
{Opt_nodatasum, "nodatasum"},
{Opt_nodatacow, "nodatacow"},
{Opt_nobarrier, "nobarrier"},
+ {Opt_barrier, "barrier"},
{Opt_max_inline, "max_inline=%s"},
{Opt_alloc_start, "alloc_start=%s"},
{Opt_thread_pool, "thread_pool=%d"},
@@ -494,6 +495,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
btrfs_clear_opt(info->mount_opt, SSD);
btrfs_clear_opt(info->mount_opt, SSD_SPREAD);
break;
+ case Opt_barrier:
+ if (btrfs_test_opt(root, NOBARRIER))
+ btrfs_info(root->fs_info, "turning on barriers");
+ btrfs_clear_opt(info->mount_opt, NOBARRIER);
+ break;
case Opt_nobarrier:
btrfs_info(root->fs_info, "turning off barriers");
btrfs_set_opt(info->mount_opt, NOBARRIER);
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 02/11] btrfs: Add noautodefrag mount option.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 01/11] btrfs: Add "barrier" option to support "-o remount,barrier" Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 03/11] btrfs: Add nocheck_int " Qu Wenruo
` (10 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Btrfs has autodefrag mount option but no pairing noautodefrag option,
which makes it impossible to disable autodefrag without umount.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
changelog:
v2: Add noauitodefrag mount option
---
Documentation/filesystems/btrfs.txt | 8 +++++---
fs/btrfs/super.c | 8 +++++++-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index 2d2e016..65e885f 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -46,10 +46,12 @@ Options with (*) are default options and will not show in the mount options.
bytes, optionally with a K, M, or G suffix, case insensitive.
Default is 1MB.
+ noautodefrag(*)
autodefrag
- Detect small random writes into files and queue them up for the
- defrag process. Works best for small files; Not well suited for
- large database workloads.
+ Disable/enable auto defragmentation.
+ Auto defragmentation detects small random writes into files and queue
+ them up for the defrag process. Works best for small files;
+ Not well suited for large database workloads.
check_int
check_int_data
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index fe9d8a6..c65f696 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -323,7 +323,7 @@ enum {
Opt_no_space_cache, Opt_recovery, Opt_skip_balance,
Opt_check_integrity, Opt_check_integrity_including_extent_data,
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
- Opt_commit_interval, Opt_barrier,
+ Opt_commit_interval, Opt_barrier, Opt_nodefrag,
Opt_err,
};
@@ -357,6 +357,7 @@ static match_table_t tokens = {
{Opt_enospc_debug, "enospc_debug"},
{Opt_subvolrootid, "subvolrootid=%d"},
{Opt_defrag, "autodefrag"},
+ {Opt_nodefrag, "noautodefrag"},
{Opt_inode_cache, "inode_cache"},
{Opt_no_space_cache, "nospace_cache"},
{Opt_recovery, "recovery"},
@@ -602,6 +603,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
btrfs_info(root->fs_info, "enabling auto defrag");
btrfs_set_opt(info->mount_opt, AUTO_DEFRAG);
break;
+ case Opt_nodefrag:
+ if (btrfs_test_opt(root, AUTO_DEFRAG))
+ btrfs_info(root->fs_info, "disabling auto defrag");
+ btrfs_clear_opt(info->mount_opt, AUTO_DEFRAG);
+ break;
case Opt_recovery:
btrfs_info(root->fs_info, "enabling auto recovery");
btrfs_set_opt(info->mount_opt, RECOVERY);
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 03/11] btrfs: Add nocheck_int mount option.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 01/11] btrfs: Add "barrier" option to support "-o remount,barrier" Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 02/11] btrfs: Add noautodefrag mount option Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 17:13 ` David Sterba
2014-01-03 6:10 ` [PATCH v2 04/11] btrfs: Add nodiscard " Qu Wenruo
` (9 subsequent siblings)
12 siblings, 1 reply; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Add nocheck_int mount option to disable integrity check with
remount option.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
changelog:
v2: add nocheck_int mount option
---
Documentation/filesystems/btrfs.txt | 3 +++
fs/btrfs/super.c | 15 ++++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index 65e885f..aab54e9 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -53,6 +53,7 @@ Options with (*) are default options and will not show in the mount options.
them up for the defrag process. Works best for small files;
Not well suited for large database workloads.
+ nocheck_int(*)
check_int
check_int_data
check_int_print_mask=<value>
@@ -70,6 +71,8 @@ Options with (*) are default options and will not show in the mount options.
as defined in fs/btrfs/check-integrity.c, to control the integrity
checker module behavior.
+ nocheck_int disables all the debug options above.
+
See comments at the top of fs/btrfs/check-integrity.c for more info.
commit=<seconds>
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index c65f696..b408d05 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -323,7 +323,7 @@ enum {
Opt_no_space_cache, Opt_recovery, Opt_skip_balance,
Opt_check_integrity, Opt_check_integrity_including_extent_data,
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
- Opt_commit_interval, Opt_barrier, Opt_nodefrag,
+ Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nocheck_integrity,
Opt_err,
};
@@ -363,6 +363,7 @@ static match_table_t tokens = {
{Opt_recovery, "recovery"},
{Opt_skip_balance, "skip_balance"},
{Opt_check_integrity, "check_int"},
+ {Opt_nocheck_integrity, "nocheck_int"},
{Opt_check_integrity_including_extent_data, "check_int_data"},
{Opt_check_integrity_print_mask, "check_int_print_mask=%d"},
{Opt_rescan_uuid_tree, "rescan_uuid_tree"},
@@ -616,6 +617,17 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
btrfs_set_opt(info->mount_opt, SKIP_BALANCE);
break;
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
+ case Opt_nocheck_integrity:
+ if (btrfs_test_opt(root, CHECK_INTEGRITY) ||
+ btrfs_test_opt(root,
+ CHECK_INTEGRITY_INCLUDING_EXTENT_DATA) ||
+ info->check_integrity_print_mask != 0)
+ btrfs_info(root->fs_info, "disabling any integrity check");
+ btrfs_clear_opt(info->mount_opt, CHECK_INTEGRITY);
+ btrfs_clear_opt(info->mount_opt,
+ CHECK_INTEGRITY_INCLUDING_EXTENT_DATA);
+ info->check_integrity_print_mask = 0;
+ break;
case Opt_check_integrity_including_extent_data:
btrfs_info(root->fs_info,
"enabling check integrity including extent data");
@@ -641,6 +653,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
}
break;
#else
+ case Opt_nocheck_integrity:
case Opt_check_integrity_including_extent_data:
case Opt_check_integrity:
case Opt_check_integrity_print_mask:
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 04/11] btrfs: Add nodiscard mount option.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
` (2 preceding siblings ...)
2014-01-03 6:10 ` [PATCH v2 03/11] btrfs: Add nocheck_int " Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 05/11] btrfs: Add noenospc_debug " Qu Wenruo
` (8 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Add nodiscard mount option to disable discard with remount option.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
changelog:
v2: Add nodiscard mount option.
---
Documentation/filesystems/btrfs.txt | 7 +++++--
fs/btrfs/super.c | 5 +++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index aab54e9..344e67f 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -101,9 +101,12 @@ Options with (*) are default options and will not show in the mount options.
can be avoided. Especially useful when trying to mount a multi-device
setup as root. May be specified multiple times for multiple devices.
+ nodiscard(*)
discard
- Issue frequent commands to let the block device reclaim space freed by
- the filesystem. This is useful for SSD devices, thinly provisioned
+ Disable/enable discard mount option.
+ Discard issues frequent commands to let the block device reclaim space
+ freed by the filesystem.
+ This is useful for SSD devices, thinly provisioned
LUNs and virtual machine images, but may have a significant
performance impact. (The fstrim command is also available to
initiate batch trims from userspace).
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index b408d05..3ab11d4 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -324,6 +324,7 @@ enum {
Opt_check_integrity, Opt_check_integrity_including_extent_data,
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nocheck_integrity,
+ Opt_nodiscard,
Opt_err,
};
@@ -351,6 +352,7 @@ static match_table_t tokens = {
{Opt_flushoncommit, "flushoncommit"},
{Opt_ratio, "metadata_ratio=%d"},
{Opt_discard, "discard"},
+ {Opt_nodiscard, "nodiscard"},
{Opt_space_cache, "space_cache"},
{Opt_clear_cache, "clear_cache"},
{Opt_user_subvol_rm_allowed, "user_subvol_rm_allowed"},
@@ -576,6 +578,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
case Opt_discard:
btrfs_set_opt(info->mount_opt, DISCARD);
break;
+ case Opt_nodiscard:
+ btrfs_clear_opt(info->mount_opt, DISCARD);
+ break;
case Opt_space_cache:
btrfs_set_opt(info->mount_opt, SPACE_CACHE);
break;
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 05/11] btrfs: Add noenospc_debug mount option.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
` (3 preceding siblings ...)
2014-01-03 6:10 ` [PATCH v2 04/11] btrfs: Add nodiscard " Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 06/11] btrfs: Add noflushoncommit " Qu Wenruo
` (7 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Add noenospc_debug mount option to disable ENOSPC debug with
remount option.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
changelog:
v2: Add noenospc_debug mount option.
---
Documentation/filesystems/btrfs.txt | 3 ++-
fs/btrfs/super.c | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index 344e67f..14765e6 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -111,8 +111,9 @@ Options with (*) are default options and will not show in the mount options.
performance impact. (The fstrim command is also available to
initiate batch trims from userspace).
+ noenospc_debug(*)
enospc_debug
- Debugging option to be more verbose in some ENOSPC conditions.
+ Disable/enable debugging option to be more verbose in some ENOSPC conditions.
fatal_errors=<action>
Action to take when encountering a fatal error:
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 3ab11d4..fa9c698 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -324,7 +324,7 @@ enum {
Opt_check_integrity, Opt_check_integrity_including_extent_data,
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nocheck_integrity,
- Opt_nodiscard,
+ Opt_nodiscard, Opt_noenospc_debug,
Opt_err,
};
@@ -357,6 +357,7 @@ static match_table_t tokens = {
{Opt_clear_cache, "clear_cache"},
{Opt_user_subvol_rm_allowed, "user_subvol_rm_allowed"},
{Opt_enospc_debug, "enospc_debug"},
+ {Opt_noenospc_debug, "noenospc_debug"},
{Opt_subvolrootid, "subvolrootid=%d"},
{Opt_defrag, "autodefrag"},
{Opt_nodefrag, "noautodefrag"},
@@ -605,6 +606,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
case Opt_enospc_debug:
btrfs_set_opt(info->mount_opt, ENOSPC_DEBUG);
break;
+ case Opt_noenospc_debug:
+ btrfs_clear_opt(info->mount_opt, ENOSPC_DEBUG);
+ break;
case Opt_defrag:
btrfs_info(root->fs_info, "enabling auto defrag");
btrfs_set_opt(info->mount_opt, AUTO_DEFRAG);
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 06/11] btrfs: Add noflushoncommit mount option.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
` (4 preceding siblings ...)
2014-01-03 6:10 ` [PATCH v2 05/11] btrfs: Add noenospc_debug " Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 07/11] btrfs: Add noinode_cache " Qu Wenruo
` (6 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Add noflushoncommit mount option to disable flush on commit with
remount option.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
changelog:
v2: Add noflushoncommit mount option.
---
Documentation/filesystems/btrfs.txt | 1 +
fs/btrfs/super.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index 14765e6..516ed65 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -120,6 +120,7 @@ Options with (*) are default options and will not show in the mount options.
"bug" - BUG() on a fatal error. This is the default.
"panic" - panic() on a fatal error.
+ noflushoncommit(*)
flushoncommit
The 'flushoncommit' mount option forces any data dirtied by a write in a
prior transaction to commit as part of the current commit. This makes
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index fa9c698..c511239 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -324,7 +324,7 @@ enum {
Opt_check_integrity, Opt_check_integrity_including_extent_data,
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nocheck_integrity,
- Opt_nodiscard, Opt_noenospc_debug,
+ Opt_nodiscard, Opt_noenospc_debug, Opt_noflushoncommit,
Opt_err,
};
@@ -350,6 +350,7 @@ static match_table_t tokens = {
{Opt_noacl, "noacl"},
{Opt_notreelog, "notreelog"},
{Opt_flushoncommit, "flushoncommit"},
+ {Opt_noflushoncommit, "noflushoncommit"},
{Opt_ratio, "metadata_ratio=%d"},
{Opt_discard, "discard"},
{Opt_nodiscard, "nodiscard"},
@@ -563,6 +564,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
btrfs_info(root->fs_info, "turning on flush-on-commit");
btrfs_set_opt(info->mount_opt, FLUSHONCOMMIT);
break;
+ case Opt_noflushoncommit:
+ if (btrfs_test_opt(root, FLUSHONCOMMIT))
+ btrfs_info(root->fs_info, "turning off flush-on-commit");
+ btrfs_clear_opt(info->mount_opt, FLUSHONCOMMIT);
+ break;
case Opt_ratio:
ret = match_int(&args[0], &intarg);
if (ret) {
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 07/11] btrfs: Add noinode_cache mount option.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
` (5 preceding siblings ...)
2014-01-03 6:10 ` [PATCH v2 06/11] btrfs: Add noflushoncommit " Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 17:52 ` David Sterba
2014-01-03 6:10 ` [PATCH v2 08/11] btrfs: Add acl " Qu Wenruo
` (5 subsequent siblings)
12 siblings, 1 reply; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Add noinode_cache mount option to disable inode map cache with
remount option.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
changelog:
v2: Add noinode_cache mount option.
---
Documentation/filesystems/btrfs.txt | 6 ++++--
fs/btrfs/super.c | 7 +++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index 516ed65..ffb40f3 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -129,9 +129,11 @@ Options with (*) are default options and will not show in the mount options.
operations). This was previously the behavior only when a snapshot is
created.
+ noinode_cache(*)
inode_cache
- Enable free inode number caching. Defaults to off due to an overflow
- problem when the free space crcs don't fit inside a single page.
+ Disable/enable free inode number caching.
+ Defaults to off due to an overflow problem when the free space crcs
+ don't fit inside a single page.
max_inline=<bytes>
Specify the maximum amount of space, in bytes, that can be inlined in
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index c511239..16da3d1 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -325,6 +325,7 @@ enum {
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nocheck_integrity,
Opt_nodiscard, Opt_noenospc_debug, Opt_noflushoncommit,
+ Opt_noinode_cache,
Opt_err,
};
@@ -363,6 +364,7 @@ static match_table_t tokens = {
{Opt_defrag, "autodefrag"},
{Opt_nodefrag, "noautodefrag"},
{Opt_inode_cache, "inode_cache"},
+ {Opt_noinode_cache, "noinode_cache"},
{Opt_no_space_cache, "nospace_cache"},
{Opt_recovery, "recovery"},
{Opt_skip_balance, "skip_balance"},
@@ -602,6 +604,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
btrfs_info(root->fs_info, "enabling inode map caching");
btrfs_set_opt(info->mount_opt, INODE_MAP_CACHE);
break;
+ case Opt_noinode_cache:
+ if (btrfs_test_opt(root, INODE_MAP_CACHE))
+ btrfs_info(root->fs_info, "disabling inode map caching");
+ btrfs_clear_opt(info->mount_opt, INODE_MAP_CACHE);
+ break;
case Opt_clear_cache:
btrfs_info(root->fs_info, "force clearing of disk cache");
btrfs_set_opt(info->mount_opt, CLEAR_CACHE);
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 08/11] btrfs: Add acl mount option.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
` (6 preceding siblings ...)
2014-01-03 6:10 ` [PATCH v2 07/11] btrfs: Add noinode_cache " Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 09/11] btrfs: Add datacow " Qu Wenruo
` (4 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Add acl mount option to enable acl with remount option.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
changelog:
v2: Add acl mount option.
---
Documentation/filesystems/btrfs.txt | 3 ++-
fs/btrfs/super.c | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index ffb40f3..6f2de1b 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -146,8 +146,9 @@ Options with (*) are default options and will not show in the mount options.
Specify that 1 metadata chunk should be allocated after every <value>
data chunks. Off by default.
+ acl(*)
noacl
- Disable support for Posix Access Control Lists (ACLs). See the
+ Enable/disable support for Posix Access Control Lists (ACLs). See the
acl(5) manual page for more information about ACLs.
barrier(*)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 16da3d1..a5c25fd 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -325,7 +325,7 @@ enum {
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nocheck_integrity,
Opt_nodiscard, Opt_noenospc_debug, Opt_noflushoncommit,
- Opt_noinode_cache,
+ Opt_noinode_cache, Opt_acl,
Opt_err,
};
@@ -348,6 +348,7 @@ static match_table_t tokens = {
{Opt_ssd, "ssd"},
{Opt_ssd_spread, "ssd_spread"},
{Opt_nossd, "nossd"},
+ {Opt_acl, "acl"},
{Opt_noacl, "noacl"},
{Opt_notreelog, "notreelog"},
{Opt_flushoncommit, "flushoncommit"},
@@ -555,6 +556,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
goto out;
}
break;
+ case Opt_acl:
+ root->fs_info->sb->s_flags |= MS_POSIXACL;
+ break;
case Opt_noacl:
root->fs_info->sb->s_flags &= ~MS_POSIXACL;
break;
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 09/11] btrfs: Add datacow mount option.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
` (7 preceding siblings ...)
2014-01-03 6:10 ` [PATCH v2 08/11] btrfs: Add acl " Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 10/11] btrfs: Add datasum " Qu Wenruo
` (3 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Add datacow mount option to enable copy-on-write with
remount option.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
changelog:
v2: Add datacow mount option.
---
Documentation/filesystems/btrfs.txt | 5 +++--
fs/btrfs/super.c | 8 +++++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index 6f2de1b..48c1833 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -159,9 +159,10 @@ Options with (*) are default options and will not show in the mount options.
(non-battery-backed) write-back cache, this option will lead to
filesystem corruption on a system crash or power loss.
+ datacow(*)
nodatacow
- Disable data copy-on-write for newly created files. Implies nodatasum,
- and disables all compression.
+ Enable/disable data copy-on-write for newly created files.
+ Nodatacow implies nodatasum, and disables all compression.
nodatasum
Disable data checksumming for newly created files.
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index a5c25fd..cb4c90d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -325,7 +325,7 @@ enum {
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nocheck_integrity,
Opt_nodiscard, Opt_noenospc_debug, Opt_noflushoncommit,
- Opt_noinode_cache, Opt_acl,
+ Opt_noinode_cache, Opt_acl, Opt_datacow,
Opt_err,
};
@@ -336,6 +336,7 @@ static match_table_t tokens = {
{Opt_device, "device=%s"},
{Opt_nodatasum, "nodatasum"},
{Opt_nodatacow, "nodatacow"},
+ {Opt_datacow, "datacow"},
{Opt_nobarrier, "nobarrier"},
{Opt_barrier, "barrier"},
{Opt_max_inline, "max_inline=%s"},
@@ -449,6 +450,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
btrfs_set_opt(info->mount_opt, NODATACOW);
btrfs_set_opt(info->mount_opt, NODATASUM);
break;
+ case Opt_datacow:
+ if (btrfs_test_opt(root, NODATACOW))
+ btrfs_info(root->fs_info, "setting datacow");
+ btrfs_clear_opt(info->mount_opt, NODATACOW);
+ break;
case Opt_compress_force:
case Opt_compress_force_type:
compress_force = true;
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 10/11] btrfs: Add datasum mount option.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
` (8 preceding siblings ...)
2014-01-03 6:10 ` [PATCH v2 09/11] btrfs: Add datacow " Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 11/11] btrfs: Add treelog " Qu Wenruo
` (2 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Add datasum mount option to enable checksum with
remount option.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
changelog:
v2: Add datasum mount option.
---
Documentation/filesystems/btrfs.txt | 4 +++-
fs/btrfs/super.c | 11 ++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index 48c1833..480eeda 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -164,8 +164,10 @@ Options with (*) are default options and will not show in the mount options.
Enable/disable data copy-on-write for newly created files.
Nodatacow implies nodatasum, and disables all compression.
+ datasum(*)
nodatasum
- Disable data checksumming for newly created files.
+ Enable/disable data checksumming for newly created files.
+ Datasum implies datacow.
notreelog
Disable the tree logging used for fsync and O_SYNC writes.
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index cb4c90d..01ae900 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -325,7 +325,7 @@ enum {
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nocheck_integrity,
Opt_nodiscard, Opt_noenospc_debug, Opt_noflushoncommit,
- Opt_noinode_cache, Opt_acl, Opt_datacow,
+ Opt_noinode_cache, Opt_acl, Opt_datacow, Opt_datasum,
Opt_err,
};
@@ -335,6 +335,7 @@ static match_table_t tokens = {
{Opt_subvolid, "subvolid=%s"},
{Opt_device, "device=%s"},
{Opt_nodatasum, "nodatasum"},
+ {Opt_datasum, "datasum"},
{Opt_nodatacow, "nodatacow"},
{Opt_datacow, "datacow"},
{Opt_nobarrier, "nobarrier"},
@@ -437,6 +438,14 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
btrfs_info(root->fs_info, "setting nodatasum");
btrfs_set_opt(info->mount_opt, NODATASUM);
break;
+ case Opt_datasum:
+ if (btrfs_test_opt(root, NODATACOW))
+ btrfs_info(root->fs_info, "setting datasum, datacow enabled");
+ else
+ btrfs_info(root->fs_info, "setting datasum");
+ btrfs_clear_opt(info->mount_opt, NODATACOW);
+ btrfs_clear_opt(info->mount_opt, NODATASUM);
+ break;
case Opt_nodatacow:
if (!btrfs_test_opt(root, COMPRESS) ||
!btrfs_test_opt(root, FORCE_COMPRESS)) {
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 11/11] btrfs: Add treelog mount option.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
` (9 preceding siblings ...)
2014-01-03 6:10 ` [PATCH v2 10/11] btrfs: Add datasum " Qu Wenruo
@ 2014-01-03 6:10 ` Qu Wenruo
2014-01-03 17:52 ` [PATCH v2 00/11] btrfs: Add missing pairing mount options Eric Sandeen
2014-01-03 17:58 ` David Sterba
12 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 6:10 UTC (permalink / raw)
To: linux-btrfs
Add treelog mount option to enable tree log with
remount option.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
changelog:
v2: Add treelog mount option.
---
Documentation/filesystems/btrfs.txt | 3 ++-
fs/btrfs/super.c | 8 +++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
index 480eeda..96a4fbd 100644
--- a/Documentation/filesystems/btrfs.txt
+++ b/Documentation/filesystems/btrfs.txt
@@ -169,8 +169,9 @@ Options with (*) are default options and will not show in the mount options.
Enable/disable data checksumming for newly created files.
Datasum implies datacow.
+ treelog(*)
notreelog
- Disable the tree logging used for fsync and O_SYNC writes.
+ Enable/disable the tree logging used for fsync and O_SYNC writes.
recovery
Enable autorecovery attempts if a bad tree root is found at mount time.
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 01ae900..8efabee 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -325,7 +325,7 @@ enum {
Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nocheck_integrity,
Opt_nodiscard, Opt_noenospc_debug, Opt_noflushoncommit,
- Opt_noinode_cache, Opt_acl, Opt_datacow, Opt_datasum,
+ Opt_noinode_cache, Opt_acl, Opt_datacow, Opt_datasum, Opt_treelog,
Opt_err,
};
@@ -353,6 +353,7 @@ static match_table_t tokens = {
{Opt_acl, "acl"},
{Opt_noacl, "noacl"},
{Opt_notreelog, "notreelog"},
+ {Opt_treelog, "treelog"},
{Opt_flushoncommit, "flushoncommit"},
{Opt_noflushoncommit, "noflushoncommit"},
{Opt_ratio, "metadata_ratio=%d"},
@@ -581,6 +582,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
btrfs_info(root->fs_info, "disabling tree log");
btrfs_set_opt(info->mount_opt, NOTREELOG);
break;
+ case Opt_treelog:
+ if (btrfs_test_opt(root, NOTREELOG))
+ btrfs_info(root->fs_info, "enabling tree log");
+ btrfs_clear_opt(info->mount_opt, NOTREELOG);
+ break;
case Opt_flushoncommit:
btrfs_info(root->fs_info, "turning on flush-on-commit");
btrfs_set_opt(info->mount_opt, FLUSHONCOMMIT);
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH v2 01/11] btrfs: Add "barrier" option to support "-o remount,barrier"
2014-01-03 6:10 ` [PATCH v2 01/11] btrfs: Add "barrier" option to support "-o remount,barrier" Qu Wenruo
@ 2014-01-03 8:44 ` Mike Fleetwood
2014-01-03 9:20 ` Qu Wenruo
0 siblings, 1 reply; 22+ messages in thread
From: Mike Fleetwood @ 2014-01-03 8:44 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs, David Sterba
On 3 January 2014 06:10, Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
> Btrfs can be remounted without barrier, but there is no "barrier" option
> so nobody can remount btrfs back with barrier on. Only umount and
> mount again can re-enable barrier.(Quite awkward)
>
> Also the mount options in the document is also changed slightly for the
> further pairing options changes.
>
> Reported-by: Daniel Blueman <daniel@quora.org>
> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
> Cc: David Sterba <dsterba@suse.cz>
> ---
> changelog:
> v1: Add barrier option
> v2: Change the document style to fit pairing options better
> ---
> Documentation/filesystems/btrfs.txt | 13 +++++++------
> fs/btrfs/super.c | 8 +++++++-
> 2 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
> index 5dd282d..2d2e016 100644
> --- a/Documentation/filesystems/btrfs.txt
> +++ b/Documentation/filesystems/btrfs.txt
> @@ -38,7 +38,7 @@ Mount Options
> =============
>
> When mounting a btrfs filesystem, the following option are accepted.
> -Unless otherwise specified, all options default to off.
> +Options with (*) are default options and will not show in the mount options.
>
> alloc_start=<bytes>
> Debugging option to force all block allocations above a certain
> @@ -138,12 +138,13 @@ Unless otherwise specified, all options default to off.
> Disable support for Posix Access Control Lists (ACLs). See the
> acl(5) manual page for more information about ACLs.
>
> + barrier(*)
> nobarrier
> - Disables the use of block layer write barriers. Write barriers ensure
> - that certain IOs make it through the device cache and are on persistent
> - storage. If used on a device with a volatile (non-battery-backed)
> - write-back cache, this option will lead to filesystem corruption on a
> - system crash or power loss.
> + Disable/enable the use of block layer write barriers. Write barriers
Please use
"Enable/Disable ..."
to match order on the options barrier(*) then nobarrier immediately above.
> + ensure that certain IOs make it through the device cache and are on
> + persistent storage. If used on a device with a volatile
And:
"... If disabled on a device with a volatile"
to make more sense when both enable and disable options are listed.
> + (non-battery-backed) write-back cache, this option will lead to
> + filesystem corruption on a system crash or power loss.
>
> nodatacow
> Disable data copy-on-write for newly created files. Implies nodatasum,
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index e9c13fb..fe9d8a6 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -323,7 +323,7 @@ enum {
> Opt_no_space_cache, Opt_recovery, Opt_skip_balance,
> Opt_check_integrity, Opt_check_integrity_including_extent_data,
> Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
> - Opt_commit_interval,
> + Opt_commit_interval, Opt_barrier,
> Opt_err,
> };
>
> @@ -335,6 +335,7 @@ static match_table_t tokens = {
> {Opt_nodatasum, "nodatasum"},
> {Opt_nodatacow, "nodatacow"},
> {Opt_nobarrier, "nobarrier"},
> + {Opt_barrier, "barrier"},
> {Opt_max_inline, "max_inline=%s"},
> {Opt_alloc_start, "alloc_start=%s"},
> {Opt_thread_pool, "thread_pool=%d"},
> @@ -494,6 +495,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
> btrfs_clear_opt(info->mount_opt, SSD);
> btrfs_clear_opt(info->mount_opt, SSD_SPREAD);
> break;
> + case Opt_barrier:
> + if (btrfs_test_opt(root, NOBARRIER))
> + btrfs_info(root->fs_info, "turning on barriers");
> + btrfs_clear_opt(info->mount_opt, NOBARRIER);
> + break;
> case Opt_nobarrier:
> btrfs_info(root->fs_info, "turning off barriers");
> btrfs_set_opt(info->mount_opt, NOBARRIER);
> --
> 1.8.5.2
>
Thanks,
Mike
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 01/11] btrfs: Add "barrier" option to support "-o remount,barrier"
2014-01-03 8:44 ` Mike Fleetwood
@ 2014-01-03 9:20 ` Qu Wenruo
0 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-03 9:20 UTC (permalink / raw)
To: Mike Fleetwood; +Cc: linux-btrfs, David Sterba
On fri, 3 Jan 2014 08:44:30 +0000, Mike Fleetwood wrote:
> On 3 January 2014 06:10, Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
>> Btrfs can be remounted without barrier, but there is no "barrier" option
>> so nobody can remount btrfs back with barrier on. Only umount and
>> mount again can re-enable barrier.(Quite awkward)
>>
>> Also the mount options in the document is also changed slightly for the
>> further pairing options changes.
>>
>> Reported-by: Daniel Blueman <daniel@quora.org>
>> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
>> Cc: David Sterba <dsterba@suse.cz>
>> ---
>> changelog:
>> v1: Add barrier option
>> v2: Change the document style to fit pairing options better
>> ---
>> Documentation/filesystems/btrfs.txt | 13 +++++++------
>> fs/btrfs/super.c | 8 +++++++-
>> 2 files changed, 14 insertions(+), 7 deletions(-)
>>
>> diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt
>> index 5dd282d..2d2e016 100644
>> --- a/Documentation/filesystems/btrfs.txt
>> +++ b/Documentation/filesystems/btrfs.txt
>> @@ -38,7 +38,7 @@ Mount Options
>> =============
>>
>> When mounting a btrfs filesystem, the following option are accepted.
>> -Unless otherwise specified, all options default to off.
>> +Options with (*) are default options and will not show in the mount options.
>>
>> alloc_start=<bytes>
>> Debugging option to force all block allocations above a certain
>> @@ -138,12 +138,13 @@ Unless otherwise specified, all options default to off.
>> Disable support for Posix Access Control Lists (ACLs). See the
>> acl(5) manual page for more information about ACLs.
>>
>> + barrier(*)
>> nobarrier
>> - Disables the use of block layer write barriers. Write barriers ensure
>> - that certain IOs make it through the device cache and are on persistent
>> - storage. If used on a device with a volatile (non-battery-backed)
>> - write-back cache, this option will lead to filesystem corruption on a
>> - system crash or power loss.
>> + Disable/enable the use of block layer write barriers. Write barriers
> Please use
> "Enable/Disable ..."
> to match order on the options barrier(*) then nobarrier immediately above.
>
>> + ensure that certain IOs make it through the device cache and are on
>> + persistent storage. If used on a device with a volatile
> And:
> "... If disabled on a device with a volatile"
> to make more sense when both enable and disable options are listed.
Thanks for pointing out the problem.
I'll fix it soon.
Qu
>> + (non-battery-backed) write-back cache, this option will lead to
>> + filesystem corruption on a system crash or power loss.
>>
>> nodatacow
>> Disable data copy-on-write for newly created files. Implies nodatasum,
>> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
>> index e9c13fb..fe9d8a6 100644
>> --- a/fs/btrfs/super.c
>> +++ b/fs/btrfs/super.c
>> @@ -323,7 +323,7 @@ enum {
>> Opt_no_space_cache, Opt_recovery, Opt_skip_balance,
>> Opt_check_integrity, Opt_check_integrity_including_extent_data,
>> Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree,
>> - Opt_commit_interval,
>> + Opt_commit_interval, Opt_barrier,
>> Opt_err,
>> };
>>
>> @@ -335,6 +335,7 @@ static match_table_t tokens = {
>> {Opt_nodatasum, "nodatasum"},
>> {Opt_nodatacow, "nodatacow"},
>> {Opt_nobarrier, "nobarrier"},
>> + {Opt_barrier, "barrier"},
>> {Opt_max_inline, "max_inline=%s"},
>> {Opt_alloc_start, "alloc_start=%s"},
>> {Opt_thread_pool, "thread_pool=%d"},
>> @@ -494,6 +495,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
>> btrfs_clear_opt(info->mount_opt, SSD);
>> btrfs_clear_opt(info->mount_opt, SSD_SPREAD);
>> break;
>> + case Opt_barrier:
>> + if (btrfs_test_opt(root, NOBARRIER))
>> + btrfs_info(root->fs_info, "turning on barriers");
>> + btrfs_clear_opt(info->mount_opt, NOBARRIER);
>> + break;
>> case Opt_nobarrier:
>> btrfs_info(root->fs_info, "turning off barriers");
>> btrfs_set_opt(info->mount_opt, NOBARRIER);
>> --
>> 1.8.5.2
>>
> Thanks,
> Mike
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 03/11] btrfs: Add nocheck_int mount option.
2014-01-03 6:10 ` [PATCH v2 03/11] btrfs: Add nocheck_int " Qu Wenruo
@ 2014-01-03 17:13 ` David Sterba
2014-01-06 0:51 ` Qu Wenruo
0 siblings, 1 reply; 22+ messages in thread
From: David Sterba @ 2014-01-03 17:13 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs, sbehrens
On Fri, Jan 03, 2014 at 02:10:26PM +0800, Qu Wenruo wrote:
> Add nocheck_int mount option to disable integrity check with
> remount option.
>
> + nocheck_int disables all the debug options above.
I think this option is not needed, the integrity checker is a
deveoplment functionality and used by people who know what they're
doing. Besides this would need to clean up all the data structures that
the checker uses (see eg. btrfsic_unmount that's called only if the
mount option is used). I see little benefit compared to the amount of
work to make sure that disabling the checker functionality in the middle
works properly.
david
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 00/11] btrfs: Add missing pairing mount options.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
` (10 preceding siblings ...)
2014-01-03 6:10 ` [PATCH v2 11/11] btrfs: Add treelog " Qu Wenruo
@ 2014-01-03 17:52 ` Eric Sandeen
2014-01-06 0:58 ` Qu Wenruo
2014-01-03 17:58 ` David Sterba
12 siblings, 1 reply; 22+ messages in thread
From: Eric Sandeen @ 2014-01-03 17:52 UTC (permalink / raw)
To: Qu Wenruo, linux-btrfs
On 1/3/14, 12:10 AM, Qu Wenruo wrote:
> Some options should be paired to support triggering different functions
> when remounting.
>
> This patchset add these missing pairing mount options.
I think this really would benefit from a regression test which
ensures that every remount transition works properly...
Thanks,
-Eric
> changelog:
> v1: Initial commit with only barrier option
> v2: Add other missing pairing options
>
> Qu Wenruo (11):
> btrfs: Add "barrier" option to support "-o remount,barrier"
> btrfs: Add noautodefrag mount option.
> btrfs: Add nocheck_int mount option.
> btrfs: Add nodiscard mount option.
> btrfs: Add noenospc_debug mount option.
> btrfs: Add noflushoncommit mount option.
> btrfs: Add noinode_cache mount option.
> btrfs: Add acl mount option.
> btrfs: Add datacow mount option.
> btrfs: Add datasum mount option.
> btrfs: Add treelog mount option.
>
> Documentation/filesystems/btrfs.txt | 56 ++++++++++++++++++----------
> fs/btrfs/super.c | 74 ++++++++++++++++++++++++++++++++++++-
> 2 files changed, 110 insertions(+), 20 deletions(-)
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 07/11] btrfs: Add noinode_cache mount option.
2014-01-03 6:10 ` [PATCH v2 07/11] btrfs: Add noinode_cache " Qu Wenruo
@ 2014-01-03 17:52 ` David Sterba
2014-01-06 0:54 ` Qu Wenruo
0 siblings, 1 reply; 22+ messages in thread
From: David Sterba @ 2014-01-03 17:52 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs
On Fri, Jan 03, 2014 at 02:10:30PM +0800, Qu Wenruo wrote:
> Add noinode_cache mount option to disable inode map cache with
> remount option.
This looks almost safe, there's a sync_filesystem called before the
filesystem's remount handler, the transaction gets committed and flushes
all tha data related to inode_cache.
The caching thread keeps running, which is not a serious problem as
it'll finish at umount time, only consuming resources.
There's a window between sync_filesystem and successful remount when the
INODE_MAP_CACHE bit is set and the cache could be used to get a free ino,
then the INODE_MAP_CACHE is cleared but the ino cache remains is not
synced back to disk, normally called from transaction commit via
btrfs_unpin_free_ino. I haven't looked if something else blocks that to
happen.
I'd leave this patch out for now, it probably needs more code updates
than just unsetting the bit.
david
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 00/11] btrfs: Add missing pairing mount options.
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
` (11 preceding siblings ...)
2014-01-03 17:52 ` [PATCH v2 00/11] btrfs: Add missing pairing mount options Eric Sandeen
@ 2014-01-03 17:58 ` David Sterba
2014-01-06 1:01 ` Qu Wenruo
12 siblings, 1 reply; 22+ messages in thread
From: David Sterba @ 2014-01-03 17:58 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs
On Fri, Jan 03, 2014 at 02:10:23PM +0800, Qu Wenruo wrote:
> Some options should be paired to support triggering different functions
> when remounting.
> This patchset add these missing pairing mount options.
Thanks!
> btrfs: Add nocheck_int mount option.
> btrfs: Add noinode_cache mount option.
Commented separately, imho not to be merged in current state.
> btrfs: Add "barrier" option to support "-o remount,barrier"
> btrfs: Add noautodefrag mount option.
> btrfs: Add nodiscard mount option.
> btrfs: Add noenospc_debug mount option.
> btrfs: Add noflushoncommit mount option.
> btrfs: Add acl mount option.
> btrfs: Add datacow mount option.
> btrfs: Add datasum mount option.
> btrfs: Add treelog mount option.
All ok.
Reviewed-by: David Sterba <dsterba@suse.cz>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 03/11] btrfs: Add nocheck_int mount option.
2014-01-03 17:13 ` David Sterba
@ 2014-01-06 0:51 ` Qu Wenruo
0 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-06 0:51 UTC (permalink / raw)
To: dsterba, linux-btrfs, sbehrens
On Fri, 3 Jan 2014 18:13:08 +0100, David Sterba wrote:
> On Fri, Jan 03, 2014 at 02:10:26PM +0800, Qu Wenruo wrote:
>> Add nocheck_int mount option to disable integrity check with
>> remount option.
>>
>> + nocheck_int disables all the debug options above.
> I think this option is not needed, the integrity checker is a
> deveoplment functionality and used by people who know what they're
> doing. Besides this would need to clean up all the data structures that
> the checker uses (see eg. btrfsic_unmount that's called only if the
> mount option is used). I see little benefit compared to the amount of
> work to make sure that disabling the checker functionality in the middle
> works properly.
>
> david
>
That's right, since most people won't enable integrity check
until checking the all-yes config or running xfstests,
it's better not to add this option.
Qu
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 07/11] btrfs: Add noinode_cache mount option.
2014-01-03 17:52 ` David Sterba
@ 2014-01-06 0:54 ` Qu Wenruo
0 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-06 0:54 UTC (permalink / raw)
To: dsterba, linux-btrfs
On fri, 3 Jan 2014 18:52:44 +0100, David Sterba wrote:
> On Fri, Jan 03, 2014 at 02:10:30PM +0800, Qu Wenruo wrote:
>> Add noinode_cache mount option to disable inode map cache with
>> remount option.
> This looks almost safe, there's a sync_filesystem called before the
> filesystem's remount handler, the transaction gets committed and flushes
> all tha data related to inode_cache.
>
> The caching thread keeps running, which is not a serious problem as
> it'll finish at umount time, only consuming resources.
>
> There's a window between sync_filesystem and successful remount when the
> INODE_MAP_CACHE bit is set and the cache could be used to get a free ino,
> then the INODE_MAP_CACHE is cleared but the ino cache remains is not
> synced back to disk, normally called from transaction commit via
> btrfs_unpin_free_ino. I haven't looked if something else blocks that to
> happen.
>
> I'd leave this patch out for now, it probably needs more code updates
> than just unsetting the bit.
>
> david
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Thanks for pointing out the hidden problem.
I'll check the related source again to keep this behavior safe or
add new codes.
So in next patchset, the inode map cache option will not be included
and will be seperated to a new patch.
Qu
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 00/11] btrfs: Add missing pairing mount options.
2014-01-03 17:52 ` [PATCH v2 00/11] btrfs: Add missing pairing mount options Eric Sandeen
@ 2014-01-06 0:58 ` Qu Wenruo
0 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-06 0:58 UTC (permalink / raw)
To: Eric Sandeen, linux-btrfs
On fri, 03 Jan 2014 11:52:07 -0600, Eric Sandeen wrote:
> On 1/3/14, 12:10 AM, Qu Wenruo wrote:
>> Some options should be paired to support triggering different functions
>> when remounting.
>>
>> This patchset add these missing pairing mount options.
> I think this really would benefit from a regression test which
> ensures that every remount transition works properly...
>
> Thanks,
> -Eric
Xfstests test case for the remounting test is under development and will
submit soon.(for both generic and btrfs mount options)
As far as I tested, no problem occurs in my test environment but since
the IO pressure is low, a more heavier test case is needed though.
Qu
>
>> changelog:
>> v1: Initial commit with only barrier option
>> v2: Add other missing pairing options
>>
>> Qu Wenruo (11):
>> btrfs: Add "barrier" option to support "-o remount,barrier"
>> btrfs: Add noautodefrag mount option.
>> btrfs: Add nocheck_int mount option.
>> btrfs: Add nodiscard mount option.
>> btrfs: Add noenospc_debug mount option.
>> btrfs: Add noflushoncommit mount option.
>> btrfs: Add noinode_cache mount option.
>> btrfs: Add acl mount option.
>> btrfs: Add datacow mount option.
>> btrfs: Add datasum mount option.
>> btrfs: Add treelog mount option.
>>
>> Documentation/filesystems/btrfs.txt | 56 ++++++++++++++++++----------
>> fs/btrfs/super.c | 74 ++++++++++++++++++++++++++++++++++++-
>> 2 files changed, 110 insertions(+), 20 deletions(-)
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 00/11] btrfs: Add missing pairing mount options.
2014-01-03 17:58 ` David Sterba
@ 2014-01-06 1:01 ` Qu Wenruo
0 siblings, 0 replies; 22+ messages in thread
From: Qu Wenruo @ 2014-01-06 1:01 UTC (permalink / raw)
To: dsterba, linux-btrfs
On fri, 3 Jan 2014 18:58:28 +0100, David Sterba wrote:
> On Fri, Jan 03, 2014 at 02:10:23PM +0800, Qu Wenruo wrote:
>> Some options should be paired to support triggering different functions
>> when remounting.
>> This patchset add these missing pairing mount options.
> Thanks!
>
>> btrfs: Add nocheck_int mount option.
>> btrfs: Add noinode_cache mount option.
> Commented separately, imho not to be merged in current state.
>
>> btrfs: Add "barrier" option to support "-o remount,barrier"
>> btrfs: Add noautodefrag mount option.
>> btrfs: Add nodiscard mount option.
>> btrfs: Add noenospc_debug mount option.
>> btrfs: Add noflushoncommit mount option.
>> btrfs: Add acl mount option.
>> btrfs: Add datacow mount option.
>> btrfs: Add datasum mount option.
>> btrfs: Add treelog mount option.
> All ok.
>
> Reviewed-by: David Sterba <dsterba@suse.cz>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Thanks for your commenting.
nocheck_int and noinode_cache will be remove in next version,
and noinode_cache will be resent as a independent patch after more
investigation and tests.
Also remounting test case will be added to xfstest soon.
Qu
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2014-01-06 1:15 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-03 6:10 [PATCH v2 00/11] btrfs: Add missing pairing mount options Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 01/11] btrfs: Add "barrier" option to support "-o remount,barrier" Qu Wenruo
2014-01-03 8:44 ` Mike Fleetwood
2014-01-03 9:20 ` Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 02/11] btrfs: Add noautodefrag mount option Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 03/11] btrfs: Add nocheck_int " Qu Wenruo
2014-01-03 17:13 ` David Sterba
2014-01-06 0:51 ` Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 04/11] btrfs: Add nodiscard " Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 05/11] btrfs: Add noenospc_debug " Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 06/11] btrfs: Add noflushoncommit " Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 07/11] btrfs: Add noinode_cache " Qu Wenruo
2014-01-03 17:52 ` David Sterba
2014-01-06 0:54 ` Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 08/11] btrfs: Add acl " Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 09/11] btrfs: Add datacow " Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 10/11] btrfs: Add datasum " Qu Wenruo
2014-01-03 6:10 ` [PATCH v2 11/11] btrfs: Add treelog " Qu Wenruo
2014-01-03 17:52 ` [PATCH v2 00/11] btrfs: Add missing pairing mount options Eric Sandeen
2014-01-06 0:58 ` Qu Wenruo
2014-01-03 17:58 ` David Sterba
2014-01-06 1:01 ` Qu Wenruo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).