]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vfs: increment iversion when a file is truncated
authorDmitry Kasatkin <dmitry.kasatkin@intel.com>
Tue, 14 Aug 2012 03:22:31 +0000 (13:22 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Sep 2012 05:08:27 +0000 (15:08 +1000)
commiteaa07d3916aa4e9a0ea076b68b2fe4f65d53a3a0
tree234130b5a0da694785033d331bfb831d644b43ae
parente6d65ea28ba397fe3b58a924d18c1c87cf770091
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