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 <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Chunwei Chen 2015-12-11 15:24:34 -08:00 committed by Brian Behlendorf
parent 5ed27c572c
commit 1997660170

View File

@ -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;
}