]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ecryptfs: keep the lower iattr contained in truncate_upper
authorChristoph Hellwig <hch@lst.de>
Wed, 8 Apr 2026 06:06:42 +0000 (08:06 +0200)
committerTyler Hicks <code@tyhicks.com>
Wed, 8 Apr 2026 23:54:03 +0000 (18:54 -0500)
commite836ec1819b0cc50e0b45a53b0bdce6c596f0207
tree4f08e709ed007676eb87d8833fa51bcbc93c80a7
parent5d1f0e8cd9482ddb5318f765f7ca508ce707cf83
ecryptfs: keep the lower iattr contained in truncate_upper

Currently the two callers of truncate_upper handle passing information
very differently.  ecryptfs_truncate passes a zeroed lower_ia and expects
truncate_upper to fill it in from the upper ia created just for that,
while ecryptfs_setattr passes a fully initialized lower_ia copied from
the upper one.  Both of them then call notify_change on the lower_ia.

Switch to only passing the upper ia, and derive the lower ia from it
inside truncate_upper, and call notify_change inside the function itself.
Because the old name is misleading now, rename the resulting function to
__ecryptfs_truncate as it deals with both the lower and upper inodes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Tyler Hicks <code@tyhicks.com>
fs/ecryptfs/inode.c