Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 0/3] btrfs: Introduce new rescue= mount options
@ 2019-01-21  6:27 Qu Wenruo
  2019-01-21  6:27 ` [PATCH v2 1/3] btrfs: Remove "recovery" mount option Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Qu Wenruo @ 2019-01-21  6:27 UTC (permalink / raw)
  To: linux-btrfs

This patchset can be fetched from github:
https://github.com/adam900710/linux/tree/rescue_options

There are quite some btrfs extent tree corruption report in the mail
list.
Since btrfs will do mount time block group item search, one corrupted
leaf containing block group item will prevent the whole fs to be
mounted.

This patchset will try to address the problem by introducing a new mount
option, "rescue=skip_bg", as a last-resort rescue.
Of course this option will have a lot of restriction to prevent further
screwing up the fs, including:
- Permanent RO
  No remount rw is allowed

- No dirty log
  Either clean the log or use rescue=no_log_replay mount option

This "rescue=skip_bg" has some advantage compared to user space tool
like "btrfs-restore":
- Unified recovery tool
  User can use any tool they're familiar with, as long as the kernel
  doesn't panic.

- More info for subvolume.
  "btrfs subv list" can word now!


Although, move the following mount options to "rescue=" mount option:
- nologreplay
  to rescue=no_log_replay

- usebackuproot
  to rescue=use_backup_root

Old options are still available for compatibility purpose, but they are
deprecated in favor of new 'rescue=' super option.

Also different rescue sub options can be separated by ':', like:
"rescue=no_log_replay:skip_bg:use_backup_root".

The separation character is chosen by:
- No conflicts with existing character
  Especially no conflict with ','.

- No extra escaping/quota
  Original plan is ';', but since it'll be interpreted by bash, it's
  changed to current ':'.

Changelog:
v2:
- Introduce 'rescue=' super option.
- Rename original 'usebackuproot' and 'nologreplay'.
  It at least makes my vim spell check happier.
- Remove 'recovery' mount option.
  As its successor is now deprecated, not need to keep the predecessor.

Qu Wenruo (3):
  btrfs: Remove "recovery" mount option
  btrfs: Introduce "rescue=" mount option
  btrfs: Introduce new mount option to skip block group items scan

 fs/btrfs/ctree.h       |  1 +
 fs/btrfs/disk-io.c     | 29 +++++++++++--
 fs/btrfs/extent-tree.c | 59 ++++++++++++++++++++++++++
 fs/btrfs/super.c       | 96 ++++++++++++++++++++++++++++++++++++------
 fs/btrfs/volumes.c     |  7 +++
 5 files changed, 176 insertions(+), 16 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH v2 0/3] btrfs: Introduce new rescue= mount options
@ 2019-01-21  7:35 Qu Wenruo
  2019-01-21  7:35 ` [PATCH v2 3/3] btrfs: Introduce new mount option to skip block group items scan Qu Wenruo
  0 siblings, 1 reply; 5+ messages in thread
From: Qu Wenruo @ 2019-01-21  7:35 UTC (permalink / raw)
  To: linux-btrfs

This patchset can be fetched from github:
https://github.com/adam900710/linux/tree/rescue_options

There are quite some btrfs extent tree corruption report in the mail
list.
Since btrfs will do mount time block group item search, one corrupted
leaf containing block group item will prevent the whole fs to be
mounted.

This patchset will try to address the problem by introducing a new mount
option, "rescue=skip_bg", as a last-resort rescue.
Of course this option will have a lot of restriction to prevent further
screwing up the fs, including:
- Permanent RO
  No remount rw is allowed

- No dirty log
  Either clean the log or use rescue=no_log_replay mount option

This "rescue=skip_bg" has some advantage compared to user space tool
like "btrfs-restore":
- Unified recovery tool
  User can use any tool they're familiar with, as long as the kernel
  doesn't panic.

- More info for subvolume.
  "btrfs subv list" can word now!


Although, move the following mount options to "rescue=" mount option:
- nologreplay
  to rescue=no_log_replay

- usebackuproot
  to rescue=use_backup_root

Old options are still available for compatibility purpose, but they are
deprecated in favor of new 'rescue=' super option.

Also different rescue sub options can be separated by ':', like:
"rescue=no_log_replay:skip_bg:use_backup_root".

The separation character is chosen by:
- No conflicts with existing character
  Especially no conflict with ','.

- No extra escaping/quota
  Original plan is ';', but since it'll be interpreted by bash, it's
  changed to current ':'.

Changelog:
v2:
- Introduce 'rescue=' super option.
- Rename original 'usebackuproot' and 'nologreplay'.
  It at least makes my vim spell check happier.
- Remove 'recovery' mount option.
  As its successor is now deprecated, not need to keep the predecessor.

Qu Wenruo (3):
  btrfs: Remove "recovery" mount option
  btrfs: Introduce "rescue=" mount option
  btrfs: Introduce new mount option to skip block group items scan

 fs/btrfs/ctree.h       |  1 +
 fs/btrfs/disk-io.c     | 29 +++++++++++--
 fs/btrfs/extent-tree.c | 59 ++++++++++++++++++++++++++
 fs/btrfs/super.c       | 96 ++++++++++++++++++++++++++++++++++++------
 fs/btrfs/volumes.c     |  7 +++
 5 files changed, 176 insertions(+), 16 deletions(-)

-- 
2.20.1


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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-21  6:27 [PATCH v2 0/3] btrfs: Introduce new rescue= mount options Qu Wenruo
2019-01-21  6:27 ` [PATCH v2 1/3] btrfs: Remove "recovery" mount option Qu Wenruo
2019-01-21  6:27 ` [PATCH v2 2/3] btrfs: Introduce "rescue=" " Qu Wenruo
2019-01-21  6:27 ` [PATCH v2 3/3] btrfs: Introduce new mount option to skip block group items scan Qu Wenruo
2019-01-21  7:35 [PATCH v2 0/3] btrfs: Introduce new rescue= mount options Qu Wenruo
2019-01-21  7:35 ` [PATCH v2 3/3] btrfs: Introduce new mount option to skip block group items scan Qu Wenruo

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox