Re: [PATCH 5/7] ecryptfs: sanitize struct iattr handling in truncate_upper

Christoph Hellwig <[email protected]> Mon, 6 Apr 2026 08:27:13 +0200
Newsgroups org.kernel.vger.ecryptfs,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
On Mon, Apr 06, 2026 at 01:22:53AM -0500, Tyler Hicks wrote:
> Err... that was a bad suggestion. upper_size should be a loff_t but, now
> that I'm at the end of the patch series review, I see that's essentially
> the signature of ecryptfs_truncate() but I'm still not understanding why
> we're sticking the upper inode size into the lower_ia.

Because that's what the existing setattr path already does by doing a
memcpy of the upper ia.  We can explicitly pass it as a separate
argument, but I'm not really sure that clarifies things as all other
information gets passed in lower_ia.  I could add a big comment explaining
all this if it helps?  It took me some time to figure out, so I might as
well share that with the world.