]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: make sure to init mount params before calling mount_is_extrinsic() (#5087)
authorFranck Bui <fbui@suse.com>
Mon, 16 Jan 2017 20:19:13 +0000 (21:19 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 16 Jan 2017 20:19:13 +0000 (15:19 -0500)
commit03b8cfede9ff3441b1ec8ff5cdf6876294846aa4
tree4c1f0aec25735f0a96b7219b86b3c5e765c20c20
parentfe0252e5b8180f7358eb3780cd19722b0f6c998c
core: make sure to init mount params before calling mount_is_extrinsic() (#5087)

When a new entry appears in /proc/self/mountinfo, mount_setup_unit()
allocated a new mount unit for it and starts initializing it.

mount_setup_unit() is also used to update a mount unit when a change happens in
/proc/self/mountinfo, for example a mountpoint can be remounted with additional
mount options.

This patch introduces 2 separate functions to deal with those 2 cases instead
of mount_setup_unit() dealing with both of them. The common code is small and
doing the split makes the code easier to read and less error prone if extended
later.

It also makes sure to initialize in both functions the mount parameters of the
mount unit before calling mount_is_extrinsic() since this function relies on
them.

Fixes: #4902
src/core/mount.c