Skip to content

Commit bd2f0b4

Browse files
committed
cifs: returning mount parm processing errors correctly
During additional testing of the updated cifs.ko with the new mount API support, we found a few additional cases where we were logging errors, but not returning them to the user. For example: a) invalid security mechanisms b) invalid cache options c) unsupported rdma d) invalid smb dialect requested Fixes: 24e0a1e ("cifs: switch to new mount api") Acked-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent c9b8cd6 commit bd2f0b4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/cifs/fs_context.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static int smb3_fs_context_validate(struct fs_context *fc)
533533

534534
if (ctx->rdma && ctx->vals->protocol_id < SMB30_PROT_ID) {
535535
cifs_dbg(VFS, "SMB Direct requires Version >=3.0\n");
536-
return -1;
536+
return -EOPNOTSUPP;
537537
}
538538

539539
#ifndef CONFIG_KEYS
@@ -556,7 +556,7 @@ static int smb3_fs_context_validate(struct fs_context *fc)
556556
/* make sure UNC has a share name */
557557
if (strlen(ctx->UNC) < 3 || !strchr(ctx->UNC + 3, '\\')) {
558558
cifs_dbg(VFS, "Malformed UNC. Unable to find share name.\n");
559-
return -1;
559+
return -ENOENT;
560560
}
561561

562562
if (!ctx->got_ip) {
@@ -570,7 +570,7 @@ static int smb3_fs_context_validate(struct fs_context *fc)
570570
if (!cifs_convert_address((struct sockaddr *)&ctx->dstaddr,
571571
&ctx->UNC[2], len)) {
572572
pr_err("Unable to determine destination address\n");
573-
return -1;
573+
return -EHOSTUNREACH;
574574
}
575575
}
576576

@@ -1265,7 +1265,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
12651265
return 0;
12661266

12671267
cifs_parse_mount_err:
1268-
return 1;
1268+
return -EINVAL;
12691269
}
12701270

12711271
int smb3_init_fs_context(struct fs_context *fc)

0 commit comments

Comments
 (0)