Skip to content

Commit bfc1155

Browse files
Paulo Alcantarasmfrench
authored andcommitted
smb: client: fix return value of parse_dfs_referrals()
Return -ENOENT in parse_dfs_referrals() when server returns no targets for a referral request as specified in MS-DFSC 3.1.5.4.3 Receiving a Root Referral Response or Link Referral Response: > If the referral request is successful, but the NumberOfReferrals > field in the referral header (as specified in section 2.2.4) is > 0, the DFS server could not find suitable targets to return to > the client. In this case, the client MUST fail the original I/O > operation with STATUS_OBJECT_PATH_NOT_FOUND. Signed-off-by: Paulo Alcantara (Red Hat) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 5433c62 commit bfc1155

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

fs/smb/client/misc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,9 +909,9 @@ parse_dfs_referrals(struct get_dfs_referral_rsp *rsp, u32 rsp_size,
909909
*num_of_nodes = le16_to_cpu(rsp->NumberOfReferrals);
910910

911911
if (*num_of_nodes < 1) {
912-
cifs_dbg(VFS, "num_referrals: must be at least > 0, but we get num_referrals = %d\n",
913-
*num_of_nodes);
914-
rc = -EINVAL;
912+
cifs_dbg(VFS | ONCE, "%s: [path=%s] num_referrals must be at least > 0, but we got %d\n",
913+
__func__, searchName, *num_of_nodes);
914+
rc = -ENOENT;
915915
goto parse_DFS_referrals_exit;
916916
}
917917

fs/smb/client/smb2ops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,9 +3007,9 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses,
30073007
num_of_nodes, target_nodes,
30083008
nls_codepage, remap, search_name,
30093009
true /* is_unicode */);
3010-
if (rc) {
3011-
cifs_tcon_dbg(VFS, "parse error in %s rc=%d\n", __func__, rc);
3012-
goto out;
3010+
if (rc && rc != -ENOENT) {
3011+
cifs_tcon_dbg(VFS, "%s: failed to parse DFS referral %s: %d\n",
3012+
__func__, search_name, rc);
30133013
}
30143014

30153015
out:

0 commit comments

Comments
 (0)