Commit e52dce61 authored by Konstantin Komarov's avatar Konstantin Komarov

fs/ntfs3: Do not allow to change label if volume is read-only

Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent d27e202b
......@@ -497,7 +497,12 @@ static ssize_t ntfs3_label_write(struct file *file, const char __user *buffer,
int err;
struct super_block *sb = pde_data(file_inode(file));
ssize_t ret = count;
u8 *label = kmalloc(count, GFP_NOFS);
u8 *label;
if (sb_rdonly(sb))
return -EROFS;
label = kmalloc(count, GFP_NOFS);
if (!label)
return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment