linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] Btrfs-progs: fsck: only allow partial opening under repair mode
@ 2014-05-28 11:20 Wang Shilong
  2014-05-28 11:20 ` [PATCH 2/4] Btrfs-progs: fsck: disallow partial opening if critical roots corrupted Wang Shilong
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Wang Shilong @ 2014-05-28 11:20 UTC (permalink / raw)
  To: linux-btrfs

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
 cmds-check.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/cmds-check.c b/cmds-check.c
index db7df80..0e4e042 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -6810,8 +6810,7 @@ int cmd_check(int argc, char **argv)
 	int option_index = 0;
 	int init_csum_tree = 0;
 	int qgroup_report = 0;
-	enum btrfs_open_ctree_flags ctree_flags =
-		OPEN_CTREE_PARTIAL | OPEN_CTREE_EXCLUSIVE;
+	enum btrfs_open_ctree_flags ctree_flags = OPEN_CTREE_EXCLUSIVE;
 
 	while(1) {
 		int c;
@@ -6877,6 +6876,10 @@ int cmd_check(int argc, char **argv)
 		goto err_out;
 	}
 
+	/* only allow partial opening under repair mode */
+	if (repair)
+		ctree_flags |= OPEN_CTREE_PARTIAL;
+
 	info = open_ctree_fs_info(argv[optind], bytenr, 0, ctree_flags);
 	if (!info) {
 		fprintf(stderr, "Couldn't open file system\n");
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-10-06  1:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-28 11:20 [PATCH 1/4] Btrfs-progs: fsck: only allow partial opening under repair mode Wang Shilong
2014-05-28 11:20 ` [PATCH 2/4] Btrfs-progs: fsck: disallow partial opening if critical roots corrupted Wang Shilong
2014-10-06  1:16   ` Qu Wenruo
2014-05-28 11:20 ` [PATCH 3/4] Btrfs-progs: fsck: deal with corrupted csum root Wang Shilong
2014-05-28 11:20 ` [PATCH 4/4] Btrfs-progs: fsck: fix wrong check for btrfs_read_fs_root() Wang Shilong
2014-05-28 13:56 ` [PATCH 1/4] Btrfs-progs: fsck: only allow partial opening under repair mode Eric Sandeen
2014-05-28 14:10   ` Shilong Wang
2014-05-28 15:10     ` Eric Sandeen
2014-06-02 16:06 ` David Sterba

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).