]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: mark fc as ineligible using an handle in ext4_xattr_set()
authorLuis Henriques (SUSE) <luis.henriques@linux.dev>
Mon, 23 Sep 2024 10:49:09 +0000 (11:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:38 +0000 (15:11 +0200)
commitaab0032d416edc77953328423afb5fe21d1b4c0c
treeb1df39485da75c1d76d8176b33c9757aca80af26
parentb4eff7c777dfddcdd76c58136a8df318641228cb
ext4: mark fc as ineligible using an handle in ext4_xattr_set()

commit 04e6ce8f06d161399e5afde3df5dcfa9455b4952 upstream.

Calling ext4_fc_mark_ineligible() with a NULL handle is racy and may result
in a fast-commit being done before the filesystem is effectively marked as
ineligible.  This patch moves the call to this function so that an handle
can be used.  If a transaction fails to start, then there's not point in
trying to mark the filesystem as ineligible, and an error will eventually be
returned to user-space.

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240923104909.18342-3-luis.henriques@linux.dev
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/xattr.c