From: David Sterba Date: Tue, 19 Nov 2013 12:36:21 +0000 (+0100) Subject: btrfs: replace BUG in can_modify_feature X-Git-Tag: v3.14-rc2~3^2~124 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc37bb04201217b7acb11213e16cb5530c30da8f;p=profile%2Fcommon%2Fkernel-common.git 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: David Sterba Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 8fdc052..b535285 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -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)