mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 21:03:32 +00:00
fs/ntfs3: Do not allow to change label if volume is read-only
[ Upstream commit e52dce610a
]
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
da05aa786c
commit
d408008a88
1 changed files with 6 additions and 1 deletions
|
@ -498,7 +498,12 @@ static ssize_t ntfs3_label_write(struct file *file, const char __user *buffer,
|
|||
struct super_block *sb = pde_data(file_inode(file));
|
||||
struct ntfs_sb_info *sbi = sb->s_fs_info;
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue