Don't run mount.zfs(8) helper for automounting snapshot
The last commit which makes mount.zfs(8) to call 'zfs_mount_at' apparently caused it to trigger an automount for the snapshot directory. When the helper was invoked as a result of a snapshot automount, an infinite recursion will occur. Since the need of invoking user mode mount(8) for automounting was to overcome that the 'vfs_kern_mount' being GPL-only, just run mount(8) without the mount.zfs(8) helper by adding option '-i'. Signed-off-by: WHR <whr@rivoreo.one>
This commit is contained in:
parent
b50ae96744
commit
d3b568f0ac
|
@ -1101,8 +1101,8 @@ zfsctl_snapshot_mount(struct path *path, int flags)
|
||||||
zfsvfs_t *snap_zfsvfs;
|
zfsvfs_t *snap_zfsvfs;
|
||||||
zfs_snapentry_t *se;
|
zfs_snapentry_t *se;
|
||||||
char *full_name, *full_path;
|
char *full_name, *full_path;
|
||||||
char *argv[] = { "/usr/bin/env", "mount", "-t", "zfs", "-n", NULL, NULL,
|
char *argv[] = { "/usr/bin/env", "mount", "-i", "-t", "zfs", "-n",
|
||||||
NULL };
|
NULL, NULL, NULL };
|
||||||
char *envp[] = { NULL };
|
char *envp[] = { NULL };
|
||||||
int error;
|
int error;
|
||||||
struct path spath;
|
struct path spath;
|
||||||
|
@ -1153,8 +1153,8 @@ zfsctl_snapshot_mount(struct path *path, int flags)
|
||||||
* value from call_usermodehelper() will be (exitcode << 8 + signal).
|
* value from call_usermodehelper() will be (exitcode << 8 + signal).
|
||||||
*/
|
*/
|
||||||
dprintf("mount; name=%s path=%s\n", full_name, full_path);
|
dprintf("mount; name=%s path=%s\n", full_name, full_path);
|
||||||
argv[5] = full_name;
|
argv[6] = full_name;
|
||||||
argv[6] = full_path;
|
argv[7] = full_path;
|
||||||
error = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
|
error = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
|
||||||
if (error) {
|
if (error) {
|
||||||
if (!(error & MOUNT_BUSY << 8)) {
|
if (!(error & MOUNT_BUSY << 8)) {
|
||||||
|
|
Loading…
Reference in New Issue