]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vfs: increment iversion when a file is truncated
authorDmitry Kasatkin <dmitry.kasatkin@intel.com>
Fri, 12 Oct 2012 04:22:54 +0000 (15:22 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 16 Oct 2012 02:48:00 +0000 (13:48 +1100)
commit2b3658ed5f27db42dd5a3fb3da37cdb5fde27e0d
tree489b526ee874fbcc0c28e14342199d1d3d0957bd
parent901e4a0ffbc20d6391f0dec851e353603bd9cf1e
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