]> www.infradead.org Git - users/jedix/linux-maple.git/commit
evm: stop avoidably reading i_writecount in evm_file_release
authorMateusz Guzik <mjguzik@gmail.com>
Tue, 6 Aug 2024 13:36:07 +0000 (15:36 +0200)
committerMimi Zohar <zohar@linux.ibm.com>
Thu, 10 Oct 2024 02:49:40 +0000 (22:49 -0400)
commit699ae6241920b0fa837fa57e61f7d5b0e2e65b58
treeb99ff2c7fe9901af26c9381c16689731432170e6
parent923168a0631bc42fffd55087b337b1b6c54dcff5
evm: stop avoidably reading i_writecount in evm_file_release

The EVM_NEW_FILE flag is unset if the file already existed at the time
of open and this can be checked without looking at i_writecount.

Not accessing it reduces traffic on the cacheline during parallel open
of the same file and drop the evm_file_release routine from second place
to bottom of the profile.

Fixes: 75a323e604fc ("evm: Make it independent from 'integrity' LSM")
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com>
Cc: stable@vger.kernel.org # 6.9+
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/evm/evm_main.c