diff options
| author | Simon Weber <simon.weber.39@gmail.com> | 2026-02-07 10:53:03 +0100 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-03-27 23:30:25 -0400 |
| commit | b1d682f1990c19fb1d5b97d13266210457092bcd (patch) | |
| tree | 9548b028ad84b70528477a6f9c52f5176c4650be /include/asm-um/git@git.tavy.me:linux.git | |
| parent | ed9356a30e59c7cc3198e7fc46cfedf3767b9b17 (diff) | |
ext4: fix journal credit check when setting fscrypt context
Fix an issue arising when ext4 features has_journal, ea_inode, and encrypt
are activated simultaneously, leading to ENOSPC when creating an encrypted
file.
Fix by passing XATTR_CREATE flag to xattr_set_handle function if a handle
is specified, i.e., when the function is called in the control flow of
creating a new inode. This aligns the number of jbd2 credits set_handle
checks for with the number allocated for creating a new inode.
ext4_set_context must not be called with a non-null handle (fs_data) if
fscrypt context xattr is not guaranteed to not exist yet. The only other
usage of this function currently is when handling the ioctl
FS_IOC_SET_ENCRYPTION_POLICY, which calls it with fs_data=NULL.
Fixes: c1a5d5f6ab21eb7e ("ext4: improve journal credit handling in set xattr paths")
Co-developed-by: Anthony Durrer <anthonydev@fastmail.com>
Signed-off-by: Anthony Durrer <anthonydev@fastmail.com>
Signed-off-by: Simon Weber <simon.weber.39@gmail.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Link: https://patch.msgid.link/20260207100148.724275-4-simon.weber.39@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Diffstat (limited to 'include/asm-um/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
