提交 66ac9fe7 编写于 作者: D David Sterba

btrfs: add check to sysfs handler of label

Add a sanity check for the fs_info as we will dereference it, similar to
what the 'store features' handler does.
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 ee611138
......@@ -377,6 +377,9 @@ static ssize_t btrfs_label_store(struct kobject *kobj,
struct btrfs_fs_info *fs_info = to_fs_info(kobj);
size_t p_len;
if (!fs_info)
return -EPERM;
if (fs_info->sb->s_flags & MS_RDONLY)
return -EROFS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册