btrfs: introduce "rescue=" mount option
authorQu Wenruo <wqu@suse.com>
Thu, 4 Jun 2020 07:18:06 +0000 (15:18 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:22 +0000 (12:55 +0200)
commit74ef00185eb864252156022ff129b01549504175
treed4ab5d5e6afbd2d89d735c197934d3ea44730828
parenta89ef455dd2b59f476bdda4786cca54ed03cad14
btrfs: introduce "rescue=" mount option

This patch introduces a new "rescue=" mount option group for all mount
options for data recovery.

Different rescue sub options are seperated by ':'. E.g
"ro,rescue=nologreplay:usebackuproot".

The original plan was to use ';', but ';' needs to be escaped/quoted,
or it will be interpreted by bash, similar to '|'.

And obviously, user can specify rescue options one by one like:
"ro,rescue=nologreplay,rescue=usebackuproot".

The following mount options are converted to "rescue=", old mount
options are deprecated but still available for compatibility purpose:

- usebackuproot
  Now it's "rescue=usebackuproot"

- nologreplay
  Now it's "rescue=nologreplay"

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/super.c