OSDN Git Service

smb: client: improve DFS mount check
authorPaulo Alcantara <pc@manguebit.com>
Wed, 28 Jun 2023 00:24:50 +0000 (21:24 -0300)
committerSteve French <stfrench@microsoft.com>
Wed, 28 Jun 2023 20:49:02 +0000 (15:49 -0500)
Some servers may return error codes from REQ_GET_DFS_REFERRAL requests
that are unexpected by the client, so to make it easier, assume
non-DFS mounts when the client can't get the initial DFS referral of
@ctx->UNC in dfs_mount_share().

Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/dfs.c

index dd06b8a..26d14dd 100644 (file)
@@ -264,8 +264,9 @@ int dfs_mount_share(struct cifs_mount_ctx *mnt_ctx, bool *isdfs)
        if (!nodfs) {
                rc = dfs_get_referral(mnt_ctx, ctx->UNC + 1, NULL, NULL);
                if (rc) {
-                       if (rc != -ENOENT && rc != -EOPNOTSUPP && rc != -EIO)
-                               return rc;
+                       cifs_dbg(FYI, "%s: no dfs referral for %s: %d\n",
+                                __func__, ctx->UNC + 1, rc);
+                       cifs_dbg(FYI, "%s: assuming non-dfs mount...\n", __func__);
                        nodfs = true;
                }
        }