diff options
author | Anand Jain <Anand.Jain@oracle.com> | 2014-07-30 08:04:10 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-17 16:38:01 -0400 |
commit | 79aec2b80db1089f983d60e4a22cb95d8b939844 (patch) | |
tree | af9e646054814b3f81be56e7e4393316376f1104 /fs | |
parent | 20ee0825ecec889afdf12f7c13b9dc3af0bb9f14 (diff) |
btrfs: sysfs label interface should check for read only FS
Not sure how this escaped many eyes so far
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/sysfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
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, | |||
377 | int ret; | 377 | int ret; |
378 | size_t p_len; | 378 | size_t p_len; |
379 | 379 | ||
380 | if (fs_info->sb->s_flags & MS_RDONLY) | ||
381 | return -EROFS; | ||
382 | |||
380 | /* | 383 | /* |
381 | * p_len is the len until the first occurrence of either | 384 | * p_len is the len until the first occurrence of either |
382 | * '\n' or '\0' | 385 | * '\n' or '\0' |