diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2016-01-18 21:23:03 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-02-12 09:14:49 -0500 |
commit | 96da09192cda57a356467bd7c91a3641a2e78490 (patch) | |
tree | 7b9e18344074d9bf9c1d71fd6fb0670922937283 /fs/btrfs/disk-io.c | |
parent | 8dcddfa048de637c8bbfa20ffd22757aeab7c604 (diff) |
btrfs: Introduce new mount option to disable tree log replay
Introduce a new mount option "nologreplay" to co-operate with "ro" mount
option to get real readonly mount, like "norecovery" in ext* and xfs.
Since the new parse_options() need to check new flags at remount time,
so add a new parameter for parse_options().
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Tested-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index c0363626c5da..18541dc4ec0b 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -2750,7 +2750,7 @@ int open_ctree(struct super_block *sb, | |||
2750 | */ | 2750 | */ |
2751 | fs_info->compress_type = BTRFS_COMPRESS_ZLIB; | 2751 | fs_info->compress_type = BTRFS_COMPRESS_ZLIB; |
2752 | 2752 | ||
2753 | ret = btrfs_parse_options(tree_root, options); | 2753 | ret = btrfs_parse_options(tree_root, options, sb->s_flags); |
2754 | if (ret) { | 2754 | if (ret) { |
2755 | err = ret; | 2755 | err = ret; |
2756 | goto fail_alloc; | 2756 | goto fail_alloc; |
@@ -3029,8 +3029,9 @@ retry_root_backup: | |||
3029 | if (ret) | 3029 | if (ret) |
3030 | goto fail_trans_kthread; | 3030 | goto fail_trans_kthread; |
3031 | 3031 | ||
3032 | /* do not make disk changes in broken FS */ | 3032 | /* do not make disk changes in broken FS or nologreplay is given */ |
3033 | if (btrfs_super_log_root(disk_super) != 0) { | 3033 | if (btrfs_super_log_root(disk_super) != 0 && |
3034 | !btrfs_test_opt(tree_root, NOLOGREPLAY)) { | ||
3034 | ret = btrfs_replay_log(fs_info, fs_devices); | 3035 | ret = btrfs_replay_log(fs_info, fs_devices); |
3035 | if (ret) { | 3036 | if (ret) { |
3036 | err = ret; | 3037 | err = ret; |