• Tyler Hicks's avatar
    eCryptfs: Add getattr function · f8f484d1
    Tyler Hicks authored
    The i_blocks field of an eCryptfs inode cannot be trusted, but
    generic_fillattr() uses it to instantiate the blocks field of a stat()
    syscall when a filesystem doesn't implement its own getattr().  Users
    have noticed that the output of du is incorrect on newly created files.
    
    This patch creates ecryptfs_getattr() which calls into the lower
    filesystem's getattr() so that eCryptfs can use its kstat.blocks value
    after calling generic_fillattr().  It is important to note that the
    block count includes the eCryptfs metadata stored in the beginning of
    the lower file plus any padding used to fill an extent before
    encryption.
    
    https://bugs.launchpad.net/ecryptfs/+bug/390833Reported-by: default avatarDominic Sacré <dominic.sacre@gmx.de>
    Signed-off-by: default avatarTyler Hicks <tyhicks@linux.vnet.ibm.com>
    f8f484d1
inode.c 34 KB