mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext
Do not try to insert attribute if there is no room in record. Reviewed-by: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
880301bb31
commit
ee9d4810aa
@ -953,6 +953,13 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Do not try to insert this attribute
|
||||
* if there is no room in record.
|
||||
*/
|
||||
if (le32_to_cpu(mi->mrec->used) + asize > sbi->record_size)
|
||||
continue;
|
||||
|
||||
/* Try to insert attribute into this subrecord. */
|
||||
attr = ni_ins_new_attr(ni, mi, le, type, name, name_len, asize,
|
||||
name_off, svcn, ins_le);
|
||||
|
Loading…
Reference in New Issue
Block a user