automount: ack automount requests even when already mounted
authorAnchor Cat <githubanchorcat@anchor.net.au>
Wed, 10 May 2017 11:23:58 +0000 (21:23 +1000)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 12 Feb 2024 15:37:43 +0000 (16:37 +0100)
commitdcf176ce9d6486d80c1bd2395f9c72966bc2a17a
tree5ebfbbf3ec9fd46288b17192bd93f4fa76933149
parent1e7f59e9d378a9218b53fe433b9a1287b9f2ae02
automount: ack automount requests even when already mounted

If a process accesses an autofs filesystem while systemd is in the
middle of starting the mount unit on top of it, it is possible for the
autofs_ptype_missing_direct request from the kernel to be received after
the mount unit has been fully started:

  systemd forks and execs mount             ...
            ...                     access autofs, blocks
  mount exits                               ...
  systemd receives SIGCHLD                  ...
            ...                     kernel sends request
  systemd receives request                  ...

systemd needs to respond to this request, otherwise the kernel will
continue to block access to the mount point.

Cherry-picked from https://github.com/systemd/systemd/commit/e7d54bf58789545a9eb0b3964233defa0b007318
Change-Id: Ibacc2c0ffee32846321864987324763214648732
(cherry picked from commit 5ccd5b2efc60d9f775a812878528f06b01189da5)
src/core/automount.c