]> git.karo-electronics.de Git - karo-tx-linux.git/commit
eCryptfs: Add getattr function
authorTyler Hicks <tyhicks@linux.vnet.ibm.com>
Wed, 4 Nov 2009 08:48:01 +0000 (02:48 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Feb 2010 15:37:58 +0000 (07:37 -0800)
commit081312e8c147a85df0f37dcc45d7e2fbaf79dfb2
tree054e53eed16628f3927a93808973b458dac39532
parentbe6520201bc0c80ec869ec035607ace48a5f78c4
eCryptfs: Add getattr function

commit f8f484d1b6677dd5cd5e7e605db747e8c30bbd47 upstream.

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/390833

Reported-by: Dominic Sacré <dominic.sacre@gmx.de>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Cc: Tim Gardner <timg@tpi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ecryptfs/inode.c