btrfsprogs/0006-Btrfs-progs-fsck-clear-out-log-tree-in-repair-mode.patch

69 lines
2.0 KiB
Diff
Raw Normal View History

Accepting request 232435 from home:dsterba:branches:filesystems - update to upstream 3.14.1 - mkfs: - fix TRIM detection - do not zero-out end of device unconditionally - no crash with --features option - fsck: - clear log tree in repair mode - check reloc roots - btrfs - reworked space reporting (bnc#873106) - btrfs fi usage - new command - btrfs dev usage - new command - btrfs fi df - enhanced output with GlobalReserve - Removed patches: * 0001-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch - Added patches: * 0001-Btrfs-progs-fix-check-to-test-trim-support.patch * 0002-Btrfs-progs-fsck-fix-double-free-memory-crash.patch * 0003-Btrfs-progs-mkfs-Remove-zero_end-1-since-it-has-been.patch * 0004-btrfs-progs-fix-wrong-max-system-array-size-check-in.patch * 0005-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch * 0006-Btrfs-progs-fsck-clear-out-log-tree-in-repair-mode.patch * 0007-Btrfs-progs-fsck-avoid-pinning-same-block-several-ti.patch * 0008-Btrfs-progs-fsck-add-ability-to-check-reloc-roots.patch * 0009-btrfs-progs-prevent-close_root-if-the-root-to-close-.patch * 0010-btrfs-progs-fix-mkfs.btrfs-segfault-with-features-op.patch * 0011-btrfs-progs-Enhance-the-command-btrfs-filesystem-df.patch * 0012-btrfs-progs-Add-helpers-functions-to-handle-the-prin.patch * 0013-btrfs-progs-Add-command-btrfs-filesystem-disk-usage.patch * 0014-btrfs-progs-Add-btrfs-device-disk-usage-command.patch * 0015-btrfs-progs-cleanup-dead-return-after-usage-for-fi-d.patch * 0016-btrfs-progs-Fix-memleak-in-get_raid56_used.patch * 0017-Btrfs-progs-fi-usage-free-memory-if-realloc-fails.patch * 0018-btrfs-progs-read-global-reserve-size-from-space-info.patch * 0019-btrfs-progs-add-original-df-and-rename-disk_usage-to.patch * 0020-btrfs-progs-move-device-usage-to-cmds-device-more-cl.patch * 0021-btrfs-progs-check-if-we-can-t-get-info-from-ioctls-d.patch * 0022-btrfs-progs-zero-out-structures-before-calling-ioctl.patch * 0023-btrfs-progs-print-B-for-bytes.patch * 0024-btrfs-progs-Print-more-info-about-device-sizes.patch * 0025-btrfs-progs-compare-unallocated-space-against-the-co.patch * 0026-btrfs-progs-add-section-of-overall-filesystem-usage.patch * 0027-btrfs-progs-cleanup-filesystem-device-usage-code.patch * 0028-btrfs-progs-extend-pretty-printers-with-unit-mode.patch * 0029-btrfs-progs-replace-df_pretty_sizes-with-pretty_size.patch * 0030-btrfs-progs-clean-up-return-codes-and-paths.patch * 0031-btrfs-progs-move-global-reserve-to-overall-summary.patch OBS-URL: https://build.opensuse.org/request/show/232435 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=156
2014-05-02 16:21:40 +02:00
From 3ecff1d8f1eaa5e0d065c439cf72032dd01da751 Mon Sep 17 00:00:00 2001
From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Date: Thu, 24 Apr 2014 11:19:16 +0800
Subject: [PATCH 13/42] Btrfs-progs: fsck: clear out log tree in repair mode
Repair mode will commit transaction which will make us
fail to load log tree anymore.
Give a warning to common users, if they really want to
coninue, we will clear out log tree.
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
cmds-check.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
Accepting request 246571 from home:dsterba:branches:filesystems - version 3.16 - show-super: skip unrecognized sb, add option to force - debug-tree: print tree by id - mkfs: new option to specify UUID - receive: new option to limit number of errors - check: new option to verify quotas - check: reduced memory requirements - check: new option to print extent sharing - restore: check length before decompression - restore: more error handling - balance: new filter 'limit' - recover: allow to read all sb copies - restore: option to loop during restoring - mkfs: drop experimental notice - btrfstune: new option to force dangerous changes - documentation updates - Deleted patches (upstream): * 0001-btrfs-progs-doc-fix-symlink-target-for-btrfsck.8.patch * 0200-btrfs-progs-print-qgroup-excl-as-unsigned.patch * 0201-btrfs-progs-import-ulist.patch * 0202-btrfs-progs-add-quota-group-verify-code.patch * 0203-btrfs-progs-show-extent-state-for-a-subvolume.patch * 0204-btrfs-progs-ignore-orphaned-qgroups-by-default.patch * btrfs-progs-canonicalize-pathnames-for-device-commands - Refreshed patches: * 0006-Btrfs-progs-fsck-clear-out-log-tree-in-repair-mode.patch * 0011-btrfs-progs-Enhance-the-command-btrfs-filesystem-df.patch * 0012-btrfs-progs-Add-helpers-functions-to-handle-the-prin.patch * 0013-btrfs-progs-Add-command-btrfs-filesystem-disk-usage.patch * 0028-btrfs-progs-extend-pretty-printers-with-unit-mode.patch * 0164-btrfs-progs-convert-set-label-or-copy-from-origin.patch OBS-URL: https://build.opensuse.org/request/show/246571 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=167
2014-08-26 20:51:30 +02:00
Index: btrfs-progs-v3.16/cmds-check.c
===================================================================
--- btrfs-progs-v3.16.orig/cmds-check.c
+++ btrfs-progs-v3.16/cmds-check.c
@@ -6538,6 +6538,22 @@ out:
Accepting request 232435 from home:dsterba:branches:filesystems - update to upstream 3.14.1 - mkfs: - fix TRIM detection - do not zero-out end of device unconditionally - no crash with --features option - fsck: - clear log tree in repair mode - check reloc roots - btrfs - reworked space reporting (bnc#873106) - btrfs fi usage - new command - btrfs dev usage - new command - btrfs fi df - enhanced output with GlobalReserve - Removed patches: * 0001-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch - Added patches: * 0001-Btrfs-progs-fix-check-to-test-trim-support.patch * 0002-Btrfs-progs-fsck-fix-double-free-memory-crash.patch * 0003-Btrfs-progs-mkfs-Remove-zero_end-1-since-it-has-been.patch * 0004-btrfs-progs-fix-wrong-max-system-array-size-check-in.patch * 0005-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch * 0006-Btrfs-progs-fsck-clear-out-log-tree-in-repair-mode.patch * 0007-Btrfs-progs-fsck-avoid-pinning-same-block-several-ti.patch * 0008-Btrfs-progs-fsck-add-ability-to-check-reloc-roots.patch * 0009-btrfs-progs-prevent-close_root-if-the-root-to-close-.patch * 0010-btrfs-progs-fix-mkfs.btrfs-segfault-with-features-op.patch * 0011-btrfs-progs-Enhance-the-command-btrfs-filesystem-df.patch * 0012-btrfs-progs-Add-helpers-functions-to-handle-the-prin.patch * 0013-btrfs-progs-Add-command-btrfs-filesystem-disk-usage.patch * 0014-btrfs-progs-Add-btrfs-device-disk-usage-command.patch * 0015-btrfs-progs-cleanup-dead-return-after-usage-for-fi-d.patch * 0016-btrfs-progs-Fix-memleak-in-get_raid56_used.patch * 0017-Btrfs-progs-fi-usage-free-memory-if-realloc-fails.patch * 0018-btrfs-progs-read-global-reserve-size-from-space-info.patch * 0019-btrfs-progs-add-original-df-and-rename-disk_usage-to.patch * 0020-btrfs-progs-move-device-usage-to-cmds-device-more-cl.patch * 0021-btrfs-progs-check-if-we-can-t-get-info-from-ioctls-d.patch * 0022-btrfs-progs-zero-out-structures-before-calling-ioctl.patch * 0023-btrfs-progs-print-B-for-bytes.patch * 0024-btrfs-progs-Print-more-info-about-device-sizes.patch * 0025-btrfs-progs-compare-unallocated-space-against-the-co.patch * 0026-btrfs-progs-add-section-of-overall-filesystem-usage.patch * 0027-btrfs-progs-cleanup-filesystem-device-usage-code.patch * 0028-btrfs-progs-extend-pretty-printers-with-unit-mode.patch * 0029-btrfs-progs-replace-df_pretty_sizes-with-pretty_size.patch * 0030-btrfs-progs-clean-up-return-codes-and-paths.patch * 0031-btrfs-progs-move-global-reserve-to-overall-summary.patch OBS-URL: https://build.opensuse.org/request/show/232435 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=156
2014-05-02 16:21:40 +02:00
return ret;
}
+static int zero_log_tree(struct btrfs_root *root)
+{
+ struct btrfs_trans_handle *trans;
+ int ret;
+
+ trans = btrfs_start_transaction(root, 1);
+ if (IS_ERR(trans)) {
+ ret = PTR_ERR(trans);
+ return ret;
+ }
+ btrfs_set_super_log_root(root->fs_info->super_copy, 0);
+ btrfs_set_super_log_root_level(root->fs_info->super_copy, 0);
+ ret = btrfs_commit_transaction(trans, root);
+ return ret;
+}
+
static struct option long_options[] = {
{ "super", 1, NULL, 's' },
{ "repair", 0, NULL, 0 },
Accepting request 246571 from home:dsterba:branches:filesystems - version 3.16 - show-super: skip unrecognized sb, add option to force - debug-tree: print tree by id - mkfs: new option to specify UUID - receive: new option to limit number of errors - check: new option to verify quotas - check: reduced memory requirements - check: new option to print extent sharing - restore: check length before decompression - restore: more error handling - balance: new filter 'limit' - recover: allow to read all sb copies - restore: option to loop during restoring - mkfs: drop experimental notice - btrfstune: new option to force dangerous changes - documentation updates - Deleted patches (upstream): * 0001-btrfs-progs-doc-fix-symlink-target-for-btrfsck.8.patch * 0200-btrfs-progs-print-qgroup-excl-as-unsigned.patch * 0201-btrfs-progs-import-ulist.patch * 0202-btrfs-progs-add-quota-group-verify-code.patch * 0203-btrfs-progs-show-extent-state-for-a-subvolume.patch * 0204-btrfs-progs-ignore-orphaned-qgroups-by-default.patch * btrfs-progs-canonicalize-pathnames-for-device-commands - Refreshed patches: * 0006-Btrfs-progs-fsck-clear-out-log-tree-in-repair-mode.patch * 0011-btrfs-progs-Enhance-the-command-btrfs-filesystem-df.patch * 0012-btrfs-progs-Add-helpers-functions-to-handle-the-prin.patch * 0013-btrfs-progs-Add-command-btrfs-filesystem-disk-usage.patch * 0028-btrfs-progs-extend-pretty-printers-with-unit-mode.patch * 0164-btrfs-progs-convert-set-label-or-copy-from-origin.patch OBS-URL: https://build.opensuse.org/request/show/246571 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=167
2014-08-26 20:51:30 +02:00
@@ -6657,6 +6673,23 @@ int cmd_check(int argc, char **argv)
Accepting request 232435 from home:dsterba:branches:filesystems - update to upstream 3.14.1 - mkfs: - fix TRIM detection - do not zero-out end of device unconditionally - no crash with --features option - fsck: - clear log tree in repair mode - check reloc roots - btrfs - reworked space reporting (bnc#873106) - btrfs fi usage - new command - btrfs dev usage - new command - btrfs fi df - enhanced output with GlobalReserve - Removed patches: * 0001-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch - Added patches: * 0001-Btrfs-progs-fix-check-to-test-trim-support.patch * 0002-Btrfs-progs-fsck-fix-double-free-memory-crash.patch * 0003-Btrfs-progs-mkfs-Remove-zero_end-1-since-it-has-been.patch * 0004-btrfs-progs-fix-wrong-max-system-array-size-check-in.patch * 0005-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch * 0006-Btrfs-progs-fsck-clear-out-log-tree-in-repair-mode.patch * 0007-Btrfs-progs-fsck-avoid-pinning-same-block-several-ti.patch * 0008-Btrfs-progs-fsck-add-ability-to-check-reloc-roots.patch * 0009-btrfs-progs-prevent-close_root-if-the-root-to-close-.patch * 0010-btrfs-progs-fix-mkfs.btrfs-segfault-with-features-op.patch * 0011-btrfs-progs-Enhance-the-command-btrfs-filesystem-df.patch * 0012-btrfs-progs-Add-helpers-functions-to-handle-the-prin.patch * 0013-btrfs-progs-Add-command-btrfs-filesystem-disk-usage.patch * 0014-btrfs-progs-Add-btrfs-device-disk-usage-command.patch * 0015-btrfs-progs-cleanup-dead-return-after-usage-for-fi-d.patch * 0016-btrfs-progs-Fix-memleak-in-get_raid56_used.patch * 0017-Btrfs-progs-fi-usage-free-memory-if-realloc-fails.patch * 0018-btrfs-progs-read-global-reserve-size-from-space-info.patch * 0019-btrfs-progs-add-original-df-and-rename-disk_usage-to.patch * 0020-btrfs-progs-move-device-usage-to-cmds-device-more-cl.patch * 0021-btrfs-progs-check-if-we-can-t-get-info-from-ioctls-d.patch * 0022-btrfs-progs-zero-out-structures-before-calling-ioctl.patch * 0023-btrfs-progs-print-B-for-bytes.patch * 0024-btrfs-progs-Print-more-info-about-device-sizes.patch * 0025-btrfs-progs-compare-unallocated-space-against-the-co.patch * 0026-btrfs-progs-add-section-of-overall-filesystem-usage.patch * 0027-btrfs-progs-cleanup-filesystem-device-usage-code.patch * 0028-btrfs-progs-extend-pretty-printers-with-unit-mode.patch * 0029-btrfs-progs-replace-df_pretty_sizes-with-pretty_size.patch * 0030-btrfs-progs-clean-up-return-codes-and-paths.patch * 0031-btrfs-progs-move-global-reserve-to-overall-summary.patch OBS-URL: https://build.opensuse.org/request/show/232435 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=156
2014-05-02 16:21:40 +02:00
}
root = info->fs_root;
+ /*
+ * repair mode will force us to commit transaction which
+ * will make us fail to load log tree when mounting.
+ */
+ if (repair && btrfs_super_log_root(info->super_copy)) {
+ ret = ask_user("repair mode will force to clear out log tree, Are you sure?");
+ if (!ret) {
+ ret = 1;
+ goto close_out;
+ }
+ ret = zero_log_tree(root);
+ if (ret) {
+ fprintf(stderr, "fail to zero log tree\n");
+ goto close_out;
+ }
+ }
+
uuid_unparse(info->super_copy->fsid, uuidbuf);
Accepting request 246571 from home:dsterba:branches:filesystems - version 3.16 - show-super: skip unrecognized sb, add option to force - debug-tree: print tree by id - mkfs: new option to specify UUID - receive: new option to limit number of errors - check: new option to verify quotas - check: reduced memory requirements - check: new option to print extent sharing - restore: check length before decompression - restore: more error handling - balance: new filter 'limit' - recover: allow to read all sb copies - restore: option to loop during restoring - mkfs: drop experimental notice - btrfstune: new option to force dangerous changes - documentation updates - Deleted patches (upstream): * 0001-btrfs-progs-doc-fix-symlink-target-for-btrfsck.8.patch * 0200-btrfs-progs-print-qgroup-excl-as-unsigned.patch * 0201-btrfs-progs-import-ulist.patch * 0202-btrfs-progs-add-quota-group-verify-code.patch * 0203-btrfs-progs-show-extent-state-for-a-subvolume.patch * 0204-btrfs-progs-ignore-orphaned-qgroups-by-default.patch * btrfs-progs-canonicalize-pathnames-for-device-commands - Refreshed patches: * 0006-Btrfs-progs-fsck-clear-out-log-tree-in-repair-mode.patch * 0011-btrfs-progs-Enhance-the-command-btrfs-filesystem-df.patch * 0012-btrfs-progs-Add-helpers-functions-to-handle-the-prin.patch * 0013-btrfs-progs-Add-command-btrfs-filesystem-disk-usage.patch * 0028-btrfs-progs-extend-pretty-printers-with-unit-mode.patch * 0164-btrfs-progs-convert-set-label-or-copy-from-origin.patch OBS-URL: https://build.opensuse.org/request/show/246571 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=167
2014-08-26 20:51:30 +02:00
if (qgroup_report) {
printf("Print quota groups for %s\nUUID: %s\n", argv[optind],