APPLIED: eCryptfs: Handle failed metadata read in lookup
On 03/01/2012 09:52 AM, Colin King wrote:
From: Colin Ian King<email@example.com>
When failing to read the lower file's crypto metadata during a lookup,
eCryptfs must continue on without throwing an error. For example, there
may be a plaintext file in the lower mount point that the user wants to
delete through the eCryptfs mount.
If an error is encountered while reading the metadata in lookup(), the
eCryptfs inode's size could be incorrect. We must be sure to reread the
plaintext inode size from the metadata when performing an open() or
setattr(). The metadata is already being read in those paths, so this
adds minimal performance overhead.
This patch is a backport by Tim Gardner that was SRU'd back in 20 Jul 2011
but wasn't tested and so was reverted as part of the SRU process. I'm
sending back to the list again as I think it should be included.
without this patch, the file as garbage at the end of the, file. With
the fix, the file contains just the expected data with no garbage at
I've also got a suitable test working for the ecryptfs test suite
which I hope will be included fairly shortly.
Tim Gardner (1):
eCryptfs: Handle failed metadata read in lookup