btrfs: add read-only check to sysfs handler of features
We don't want to trigger the change on a read-only filesystem, similar to what the label handler does. Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
committed by
David Sterba
parent
e6c11f9a46
commit
ee6111386a
@@ -120,6 +120,9 @@ static ssize_t btrfs_feature_attr_store(struct kobject *kobj,
|
|||||||
if (!fs_info)
|
if (!fs_info)
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|
||||||
|
if (fs_info->sb->s_flags & MS_RDONLY)
|
||||||
|
return -EROFS;
|
||||||
|
|
||||||
ret = kstrtoul(skip_spaces(buf), 0, &val);
|
ret = kstrtoul(skip_spaces(buf), 0, &val);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user