mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 12:25:18 +02:00
fs/ntfs3: Correct undo if ntfs_create_inode failed
[ Upstream commitf28d0866d8
] Clusters allocated for Extended Attributes, must be freed when rolling back inode creation. Fixes:82cae269cf
("fs/ntfs3: Add initialization of super block") Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
53173e3865
commit
d0c3ba56fb
|
@ -1652,7 +1652,9 @@ struct inode *ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
|
||||||
* The packed size of extended attribute is stored in direntry too.
|
* The packed size of extended attribute is stored in direntry too.
|
||||||
* 'fname' here points to inside new_de.
|
* 'fname' here points to inside new_de.
|
||||||
*/
|
*/
|
||||||
ntfs_save_wsl_perm(inode, &fname->dup.ea_size);
|
err = ntfs_save_wsl_perm(inode, &fname->dup.ea_size);
|
||||||
|
if (err)
|
||||||
|
goto out6;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* update ea_size in file_name attribute too.
|
* update ea_size in file_name attribute too.
|
||||||
|
@ -1694,6 +1696,12 @@ struct inode *ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
|
||||||
goto out2;
|
goto out2;
|
||||||
|
|
||||||
out6:
|
out6:
|
||||||
|
attr = ni_find_attr(ni, NULL, NULL, ATTR_EA, NULL, 0, NULL, NULL);
|
||||||
|
if (attr && attr->non_res) {
|
||||||
|
/* Delete ATTR_EA, if non-resident. */
|
||||||
|
attr_set_size(ni, ATTR_EA, NULL, 0, NULL, 0, NULL, false, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (rp_inserted)
|
if (rp_inserted)
|
||||||
ntfs_remove_reparse(sbi, IO_REPARSE_TAG_SYMLINK, &new_de->ref);
|
ntfs_remove_reparse(sbi, IO_REPARSE_TAG_SYMLINK, &new_de->ref);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user