OSDN Git Service

btrfs: add error messages to all unrecognized mount options
authorDavid Sterba <dsterba@suse.com>
Thu, 2 Jun 2022 21:57:17 +0000 (23:57 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Jun 2022 15:29:50 +0000 (17:29 +0200)
commite3a4167c880cf889f66887a152799df4d609dd21
treee67c60093c6e8b3b2ae8b9fba02aea13abf13833
parent0591f04036218d572d54349ea8c7914ad9c82b2b
btrfs: add error messages to all unrecognized mount options

Almost none of the errors stemming from a valid mount option but wrong
value prints a descriptive message which would help to identify why
mount failed. Like in the linked report:

  $ uname -r
  v4.19
  $ mount -o compress=zstd /dev/sdb /mnt
  mount: /mnt: wrong fs type, bad option, bad superblock on
  /dev/sdb, missing codepage or helper program, or other error.
  $ dmesg
  ...
  BTRFS error (device sdb): open_ctree failed

Errors caused by memory allocation failures are left out as it's not a
user error so reporting that would be confusing.

Link: https://lore.kernel.org/linux-btrfs/9c3fec36-fc61-3a33-4977-a7e207c3fa4e@gmx.de/
CC: stable@vger.kernel.org # 4.9+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/super.c