summaryrefslogtreecommitdiff
path: root/fs/udf
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2022-12-21 17:53:28 +0100
committerJan Kara <jack@suse.cz>2023-01-09 10:39:53 +0100
commitb316c443b4e85f67e34807e11ca90049d6f6a098 (patch)
tree62816e9b9ea69718376f6959fae2d726abf04874 /fs/udf
parente57191a8d40086537d505241a8ee49d8b62ce1d6 (diff)
udf: Keep i_lenExtents consistent with the total length of extents
When rounding the last extent to blocksize in inode_getblk() we forgot to update also i_lenExtents to match the new extent length. This inconsistency can later confuse some assertion checks. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 000ce37e6e1e..31965c3798f2 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -677,6 +677,9 @@ static sector_t inode_getblk(struct inode *inode, sector_t block,
elen = EXT_RECORDED_ALLOCATED |
((elen + inode->i_sb->s_blocksize - 1) &
~(inode->i_sb->s_blocksize - 1));
+ iinfo->i_lenExtents =
+ ALIGN(iinfo->i_lenExtents,
+ inode->i_sb->s_blocksize);
udf_write_aext(inode, &cur_epos, &eloc, elen, 1);
}
newblock = udf_get_lb_pblock(inode->i_sb, &eloc, offset);