]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
udf: Make sure i_lenExtents is uptodate on inode eviction
authorJan Kara <jack@suse.cz>
Wed, 7 May 2025 09:49:41 +0000 (11:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 May 2025 12:12:19 +0000 (14:12 +0200)
commit7722fba9f3bf0462a0fad7d47bf9903d989c741c
tree948a9c8bcb0bf4e91b773bee290a90118a23dd3b
parenta0302cb139185af4951824f015e4ab26bb8db66a
udf: Make sure i_lenExtents is uptodate on inode eviction

commit 55dd5b4db3bf04cf077a8d1712f6295d4517c337 upstream.

UDF maintains total length of all extents in i_lenExtents. Generally we
keep extent lengths (and thus i_lenExtents) block aligned because it
makes the file appending logic simpler. However the standard mandates
that the inode size must match the length of all extents and thus we
trim the last extent when closing the file. To catch possible bugs we
also verify that i_lenExtents matches i_size when evicting inode from
memory. Commit b405c1e58b73 ("udf: refactor udf_next_aext() to handle
error") however broke the code updating i_lenExtents and thus
udf_evict_inode() ended up spewing lots of errors about incorrectly
sized extents although the extents were actually sized properly. Fix the
updating of i_lenExtents to silence the errors.

Fixes: b405c1e58b73 ("udf: refactor udf_next_aext() to handle error")
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/udf/truncate.c