Lines Matching +full:point +full:- +full:to +full:- +full:point
1 .. SPDX-License-Identifier: GPL-2.0
10 There is a problem with active restarts in autofs (that is to say
14 directory that is being managed in order to be able to issue control
15 operations. Using a file descriptor gives ioctl operations access to
20 mount itself which prevents us being able to use open(2) to obtain a
23 Currently autofs uses "umount -l" (lazy umount) to clear active mounts
25 needs to walk back up the mount tree to construct a path, such as
27 because the point from which the path is constructed has been detached
30 The actual problem with autofs is that it can't reconnect to existing
31 mounts. Immediately one thinks of just adding the ability to remount
43 /- /etc/auto.direct
61 mounts are triggered for each sub-directory key by the inode lookup
68 top of this mount point". Since these are always directories we can
69 use the follow_link inode operation to trigger the mount.
72 them multi-mount map entries).
94 to mount and umount all of the offsets as a single unit. Not really a
102 somewhat more detail to the implementation but it isn't needed for the
108 on the mount point for control operations. The references held by the
109 descriptor are accounted for in checks made to determine if a mount is
110 in use and is also used to access autofs file system information held
111 in the mount super block. So the use of a file handle needs to be
118 To be able to restart autofs leaving existing direct, indirect and
119 offset mounts in place we need to be able to obtain a file handle
121 implement an isolated operation it was decided to re-implement the
122 existing ioctl interface and add new operations to provide this
125 In addition, to be able to reconstruct a mount tree that has busy mounts,
126 the uid and gid of the last user that triggered the mount needs to be
129 has been added to retrieve them.
131 Since we're re-implementing the control interface, a couple of other
133 a mount or expire operation completes a status is returned to the
136 ENOENT so the re-implementation allows user space to send an actual
139 involves scanning /proc/mounts and since it needs to be done quite
141 in the mount table. An operation to lookup the mount status of a mount
142 point dentry (covered or not) has also been added.
146 using this system was attempted to evaluate its suitability and it was
147 found to be inadequate, in this case. The Generic Netlink system was
148 used for this as raw Netlink would lead to a significant increase in
151 replacement probably because its primary purpose in life is to be a
153 While it would be possible to work around this there is one concern
154 that lead to the decision to not use it. This is that the autofs
155 expire in the daemon has become far to complex because umount
156 candidates are enumerated, almost for no other reason than to "count"
157 the number of times to call the expire ioctl. This involves scanning
158 the mount table which has proved to be a big overhead for users with
159 large maps. The best way to improve this is try and get back to the
161 issued for a mount (file handle) we should continually call back to
163 appropriate status to the daemon. At the moment we just expire one
165 possibility for future development due to the requirements of the
174 All the ioctls use a common structure to pass the needed parameter
202 The ioctlfd field is a mount point file descriptor of an autofs mount
203 point. It is returned by the open call and is used by all calls except
204 the check for whether a given path is a mount point, where it may
205 optionally be used to check a specific mount corresponding to a given
206 mount point file descriptor, and when requesting the uid and gid of the
209 The union is used to communicate parameters and results of calls made
212 The path field is used to pass a path where it is needed and the size field
219 All of the ioctls perform a copy of this structure from user space to
220 kernel space and return -EINVAL if the size parameter is smaller than
221 the structure size itself, -ENOMEM if the kernel memory allocation fails
222 or -EFAULT if the copy itself fails. Other checks include a version check
224 mismatch results in a -EINVAL return. If the size field is greater than
225 the structure size then a path is assumed to be present and is checked to
226 ensure it begins with a "/" and is NULL terminated, otherwise -EINVAL is
230 not a valid descriptor or doesn't correspond to an autofs mount point
231 an error of -EBADF, -ENOTTY or -EINVAL (not an autofs descriptor) is
239 in autofs version 5.0.4 and later in file lib/dev-ioctl-lib.c of the
247 ------------------------
252 It returns 0 on success or the error -EINVAL if a version mismatch is
257 ------------------------------------------------------------------
261 with the ioctlfd field set to a valid autofs mount point descriptor
268 ----------------------------------------------------------
270 Obtain and release a file descriptor for an autofs managed mount point
273 as the devid field of struct args_openmount set to the device number of
276 autofs_dev_ioct with the ioctlfd field set to the descriptor obtained
280 completeness and to provide for a consistent user space implementation.
284 --------------------------------------------------------
286 Return mount and expire result status from user space to the kernel.
288 with the ioctlfd field set to the descriptor obtained from the open
290 to the wait queue token number, received by user space in the foregoing
291 mount or expire request. The status field of struct args_fail is set to
292 the errno of the operation. It is set to 0 on success.
296 ------------------------------
298 Set the pipe file descriptor used for kernel communication to the daemon.
300 to a existing mount we need to use this to tell the autofs mount about
301 the new kernel pipe descriptor. In order to protect mounts against
306 ioctlfd field set to the descriptor obtained from the open call and
307 the pipefd field of struct args_setpipefd set to descriptor of the pipe.
308 On success the call also sets the process group id used to identify the
309 controlling process (eg. the owning automount(8) daemon) to the process
314 ------------------------------
316 Make the autofs mount point catatonic. The autofs mount will no longer
321 ioctlfd field set to the descriptor obtained from the open call.
325 ----------------------------
327 Set the expire timeout for mounts within an autofs mount point.
330 ioctlfd field set to the descriptor obtained from the open call.
334 ------------------------------
336 Return the uid and gid of the last process to successfully trigger a the
340 field set to the mount point in question and the size field adjusted
344 When reconstructing an autofs mount tree with active mounts we need to
345 re-connect to mounts that may have used the original process uid and
347 This call provides the ability to obtain this uid and gid so they may be
352 ---------------------------
354 Issue an expire request to the kernel for an autofs mount. Typically
358 ioctlfd field set to the descriptor obtained from the open call. In
361 can be requested by setting the how field of struct args_expire to
363 expire candidates can be found the ioctl returns -1 with errno set to
366 This call causes the kernel module to check the mount corresponding
367 to the given ioctlfd for mounts that can be expired, issues an expire
368 request back to the daemon and waits for completion.
371 ------------------------------
373 Checks if an autofs mount point is in use.
376 ioctlfd field set to the descriptor obtained from the open call and
382 ---------------------------------
387 possible variations. Both use the path field set to the path of the mount
388 point to check and the size field adjusted appropriately. One uses the
389 ioctlfd field to identify a specific mount point to check while the other
391 set to an autofs mount type. The call returns 1 if this is a mount point
392 and sets out.devid field to the device number of the mount and out.magic
393 field to the relevant super block magic number (described below) or 0 if
399 the descriptor corresponds to is considered a mountpoint if it is itself
400 a mountpoint or contains a mount, such as a multi-mount without a root
401 mount. In this case we return 1 if the descriptor corresponds to a mount
402 point and also returns the super magic of the covering mount if there
405 If a path is supplied (and the ioctlfd field is set to -1) then the path
406 is looked up and is checked to see if it is the root of a mount. If a