Commit cc37bb04 authored by David Sterba's avatar David Sterba Committed by Chris Mason

btrfs: replace BUG in can_modify_feature

We don't need to crash hard here, it's just reading a sysfs file. The
values considered in switch are from a fixed set, the default case
should not happen at all.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 43d87fa2
...@@ -75,7 +75,9 @@ static int can_modify_feature(struct btrfs_feature_attr *fa) ...@@ -75,7 +75,9 @@ static int can_modify_feature(struct btrfs_feature_attr *fa)
clear = BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR; clear = BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR;
break; break;
default: default:
BUG(); printk(KERN_WARNING "btrfs: sysfs: unknown feature set %d\n",
fa->feature_set);
return 0;
} }
if (set & fa->feature_bit) if (set & fa->feature_bit)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment