public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.15 01/20] fs/ntfs3: Fix work with fragmented xattr
@ 2022-08-25  1:36 Sasha Levin
  2022-08-25  1:36 ` [PATCH AUTOSEL 5.15 02/20] ASoC: sh: rz-ssi: Improve error handling in rz_ssi_probe() error path Sasha Levin
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: Sasha Levin @ 2022-08-25  1:36 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Konstantin Komarov, Sasha Levin, ntfs3

From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>

[ Upstream commit 42f86b1226a42bfc79a7125af435432ad4680a32 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/ntfs3/xattr.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index 0968565ff2ca..fa9f42e50503 100644
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -118,7 +118,7 @@ static int ntfs_read_ea(struct ntfs_inode *ni, struct EA_FULL **ea,
 
 		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)
 			err = ntfs_read_run_nb(sbi, &run, 0, ea_p, size, NULL);
 		run_close(&run);
@@ -443,6 +443,11 @@ static noinline int ntfs_set_ea(struct inode *inode, const char *name,
 		/* Delete xattr, ATTR_EA */
 		ni_remove_attr_le(ni, attr, mi, le);
 	} 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);
 		if (err)
 			goto out;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-08-25  1:43 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-25  1:36 [PATCH AUTOSEL 5.15 01/20] fs/ntfs3: Fix work with fragmented xattr Sasha Levin
2022-08-25  1:36 ` [PATCH AUTOSEL 5.15 02/20] ASoC: sh: rz-ssi: Improve error handling in rz_ssi_probe() error path Sasha Levin
2022-08-25  1:36 ` [PATCH AUTOSEL 5.15 03/20] drm/amd/display: Avoid MPC infinite loop Sasha Levin
2022-08-25  1:36 ` [PATCH AUTOSEL 5.15 04/20] drm/amd/display: Fix HDMI VSIF V3 incorrect issue Sasha Levin
2022-08-25  1:36 ` [PATCH AUTOSEL 5.15 05/20] drm/amd/display: For stereo keep "FLIP_ANY_FRAME" Sasha Levin
2022-08-25  1:36 ` [PATCH AUTOSEL 5.15 06/20] drm/amd/display: clear optc underflow before turn off odm clock Sasha Levin
2022-08-25  1:36 ` [PATCH AUTOSEL 5.15 07/20] ksmbd: return STATUS_BAD_NETWORK_NAME error status if share is not configured Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 08/20] neigh: fix possible DoS due to net iface start/stop loop Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 09/20] s390/hypfs: avoid error message under KVM Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 10/20] ksmbd: don't remove dos attribute xattr on O_TRUNC open Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 11/20] drm/amd/pm: add missing ->fini_microcode interface for Sienna Cichlid Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 12/20] drm/amd/display: Fix pixel clock programming Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 13/20] drm/amdgpu: Increase tlb flush timeout for sriov Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 14/20] drm/amd/display: avoid doing vm_init multiple time Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 15/20] netfilter: conntrack: NF_CONNTRACK_PROCFS should no longer default to y Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 16/20] testing: selftests: nft_flowtable.sh: use random netns names Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 17/20] btrfs: move lockdep class helpers to locking.c Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 18/20] btrfs: fix lockdep splat with reloc root extent buffers Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 19/20] btrfs: tree-checker: check for overlapping extent items Sasha Levin
2022-08-25  1:37 ` [PATCH AUTOSEL 5.15 20/20] ftrace: Fix NULL pointer dereference in is_ftrace_trampoline when ftrace is dead Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox