From 813a4af70e2f768708ecc4a76c6fa3eecc7a7471 Mon Sep 17 00:00:00 2001 From: Chunwei Chen Date: Fri, 11 Dec 2015 15:24:34 -0800 Subject: [PATCH] Fix snapshot automount race cause EREMOTE When a concorrent mount finishes just before calling to zfsctl_snapshot_ismounted, if we return EISDIR, the VFS will return with EREMOTE. We should instead just return 0, so VFS may retry and would likely notice the dentry is alreadly mounted. This will be inline with when usermode helper return EBUSY. Signed-off-by: Chunwei Chen Signed-off-by: Brian Behlendorf --- module/zfs/zfs_ctldir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c index 1b62b51f8f..0bfbd75434 100644 --- a/module/zfs/zfs_ctldir.c +++ b/module/zfs/zfs_ctldir.c @@ -1094,7 +1094,7 @@ zfsctl_snapshot_mount(struct path *path, int flags) * The snapshot may be manually mounted as many times as desired. */ if (zfsctl_snapshot_ismounted(full_name)) { - error = SET_ERROR(EISDIR); + error = 0; goto error; }