From: Anand Jain Date: Wed, 30 Jul 2014 12:04:10 +0000 (+0800) Subject: btrfs: sysfs label interface should check for read only FS X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=79aec2b80db1089f983d60e4a22cb95d8b939844;p=openwrt%2Fstaging%2Fblogic.git btrfs: sysfs label interface should check for read only FS Not sure how this escaped many eyes so far Signed-off-by: Anand Jain Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index e6a5e7d82f42..b2e7bb4393f6 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -377,6 +377,9 @@ static ssize_t btrfs_label_store(struct kobject *kobj, int ret; size_t p_len; + if (fs_info->sb->s_flags & MS_RDONLY) + return -EROFS; + /* * p_len is the len until the first occurrence of either * '\n' or '\0'