summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-01-23 18:43:31 +0100
committerDavid Sterba <dsterba@suse.com>2016-05-06 15:22:49 +0200
commitee6111386a1b304f8bf589d36810d53e3b27ee20 (patch)
tree4127f2c27dd326e7a1d817bb8ecf925fd5b632aa /fs/btrfs
parente6c11f9a462e9ef4876d5e1539a6c06eded4c793 (diff)
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/sysfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 539e7b5e3f86..6a6bb600b1ff 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -120,6 +120,9 @@ static ssize_t btrfs_feature_attr_store(struct kobject *kobj,
if (!fs_info)
return -EPERM;
+ if (fs_info->sb->s_flags & MS_RDONLY)
+ return -EROFS;
+
ret = kstrtoul(skip_spaces(buf), 0, &val);
if (ret)
return ret;