]> git.ipfire.org Git - thirdparty/systemd.git/commit
mount-util: avoid unnecessary mount_setattr() call in make_fsmount()
authorLennart Poettering <lennart@poettering.net>
Sat, 31 May 2025 05:58:30 +0000 (07:58 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 25 Jun 2025 12:36:10 +0000 (13:36 +0100)
commit77babb252d94e1e9e46f0cdb13d198bd1e4e5958
tree515202474c4867d01fd9ef5be2228a4d505ba31a
parentccbad62c42ab8e00b824aaa22036cc5cc65ab203
mount-util: avoid unnecessary mount_setattr() call in make_fsmount()

If .attr_set is zero (and .att_clr, .propagation too), then there's no
point in calling mount_setattr().

Fixes: #37062
Note that this optimization is not precisely load-bearing anymore, since
3cc23a2c2345eb188551565349c89ec1fa8f650f got merged which removes the
only caller of make_fsmount() that might trigger it. But it's worth
fixing generic code anyway, in case it gets used like this later again.

(cherry picked from commit 249752d1ecd0f8e160d6e8633f71771b51db5a84)
src/shared/mount-util.c