Skip to content

Commit

Permalink
btrfs: replace BUG in can_modify_feature
Browse files Browse the repository at this point in the history
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: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
David Sterba authored and Chris Mason committed Jan 28, 2014
1 parent 43d87fa commit cc37bb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/btrfs/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ static int can_modify_feature(struct btrfs_feature_attr *fa)
clear = BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR;
break;
default:
BUG();
printk(KERN_WARNING "btrfs: sysfs: unknown feature set %d\n",
fa->feature_set);
return 0;
}

if (set & fa->feature_bit)
Expand Down

0 comments on commit cc37bb0

Please sign in to comment.