]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vfs: increment iversion when a file is truncated
authorDmitry Kasatkin <dmitry.kasatkin@intel.com>
Thu, 13 Sep 2012 00:58:24 +0000 (10:58 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 18 Sep 2012 06:04:11 +0000 (16:04 +1000)
commitdcb138121691ead1682d7228662509d211d9d673
treece8555cf6ebd5b9594d64e4d47b62fb8b130dba5
parent9731cde4be1e810e0138f9ab8d1c592af58dea32
vfs: increment iversion when a file is truncated

When a file is truncated with truncate()/ftruncate() and then closed,
iversion is not updated.  This patch uses ATTR_SIZE flag as an indication
to increment iversion.

Mimi said:

On fput(), i_version is used to detect and flag files that have changed
and need to be re-measured in the IMA measurement policy.  When a file
is truncated with truncate()/ftruncate() and then closed, i_version is
not updated.  As a result, although the file has changed, it will not be
re-measured and added to the IMA measurement list on subsequent access.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Acked-by: Mimi Zohar <zohar@us.ibm.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/attr.c