diff options
author | David Sterba <dsterba@suse.com> | 2016-02-26 15:38:30 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-02-26 15:38:30 +0100 |
commit | 23c1a966f2525e71f895bf349a5ae9e5d7bdd67f (patch) | |
tree | cdbe7b2a556b4789c2c61b9dc1bffe864654edde /fs/btrfs/disk-io.c | |
parent | 67d605fec1d406f6a0272be39686801d389f59c9 (diff) | |
parent | fed8f166ebf3afb8b91a1fd73d706788e07a91ef (diff) |
Merge branch 'foreign/qu/norecovery-v7' into for-chris-4.6
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 40690e90beee..294c77729df3 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2751,7 +2751,7 @@ int open_ctree(struct super_block *sb, */ fs_info->compress_type = BTRFS_COMPRESS_ZLIB; - ret = btrfs_parse_options(tree_root, options); + ret = btrfs_parse_options(tree_root, options, sb->s_flags); if (ret) { err = ret; goto fail_alloc; @@ -3030,8 +3030,9 @@ retry_root_backup: if (ret) goto fail_trans_kthread; - /* do not make disk changes in broken FS */ - if (btrfs_super_log_root(disk_super) != 0) { + /* do not make disk changes in broken FS or nologreplay is given */ + if (btrfs_super_log_root(disk_super) != 0 && + !btrfs_test_opt(tree_root, NOLOGREPLAY)) { ret = btrfs_replay_log(fs_info, fs_devices); if (ret) { err = ret; @@ -3147,6 +3148,12 @@ retry_root_backup: fs_info->open = 1; + /* + * backuproot only affect mount behavior, and if open_ctree succeeded, + * no need to keep the flag + */ + btrfs_clear_opt(fs_info->mount_opt, USEBACKUPROOT); + return 0; fail_qgroup: @@ -3201,7 +3208,7 @@ fail: return err; recovery_tree_root: - if (!btrfs_test_opt(tree_root, RECOVERY)) + if (!btrfs_test_opt(tree_root, USEBACKUPROOT)) goto fail_tree_roots; free_root_pointers(fs_info, 0); |