mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
fs/ntfs3: Fix work with fragmented xattr
In some cases xattr is too fragmented, so we need to load it before writing. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
b3e048720d
commit
42f86b1226
@ -118,7 +118,7 @@ static int ntfs_read_ea(struct ntfs_inode *ni, struct EA_FULL **ea,
|
|||||||
|
|
||||||
run_init(&run);
|
run_init(&run);
|
||||||
|
|
||||||
err = attr_load_runs(attr_ea, ni, &run, NULL);
|
err = attr_load_runs_range(ni, ATTR_EA, NULL, 0, &run, 0, size);
|
||||||
if (!err)
|
if (!err)
|
||||||
err = ntfs_read_run_nb(sbi, &run, 0, ea_p, size, NULL);
|
err = ntfs_read_run_nb(sbi, &run, 0, ea_p, size, NULL);
|
||||||
run_close(&run);
|
run_close(&run);
|
||||||
@ -444,6 +444,11 @@ static noinline int ntfs_set_ea(struct inode *inode, const char *name,
|
|||||||
/* Delete xattr, ATTR_EA */
|
/* Delete xattr, ATTR_EA */
|
||||||
ni_remove_attr_le(ni, attr, mi, le);
|
ni_remove_attr_le(ni, attr, mi, le);
|
||||||
} else if (attr->non_res) {
|
} else if (attr->non_res) {
|
||||||
|
err = attr_load_runs_range(ni, ATTR_EA, NULL, 0, &ea_run, 0,
|
||||||
|
size);
|
||||||
|
if (err)
|
||||||
|
goto out;
|
||||||
|
|
||||||
err = ntfs_sb_write_run(sbi, &ea_run, 0, ea_all, size, 0);
|
err = ntfs_sb_write_run(sbi, &ea_run, 0, ea_all, size, 0);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
Reference in New Issue
Block a user