@@ -910,7 +910,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
if (cifsFYI) {
cifs_dbg(FYI, "%s: devname=%s flags=0x%x\n", __func__,
old_ctx->source, flags);
- } else {
+ } else if (!old_ctx->automount) {
cifs_info("Attempting to mount %s\n", old_ctx->source);
}
@@ -937,7 +937,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
rc = cifs_mount(cifs_sb, cifs_sb->ctx);
if (rc) {
- if (!(flags & SB_SILENT))
+ if (!(flags & SB_SILENT) && !old_ctx->automount)
cifs_dbg(VFS, "cifs_mount failed w/return code = %d\n",
rc);
root = ERR_PTR(rc);
@@ -3390,7 +3390,8 @@ int cifs_mount_get_session(struct cifs_mount_ctx *mnt_ctx)
ses = cifs_get_smb_ses(server, ctx);
if (IS_ERR(ses)) {
rc = PTR_ERR(ses);
- if (rc == -ENOKEY && ctx->sectype == Kerberos)
+ if (rc == -ENOKEY && ctx->sectype == Kerberos &&
+ !ctx->automount)
cifs_dbg(VFS, "Verify user has a krb5 ticket and keyutils is installed\n");
ses = NULL;
goto out;
@@ -263,11 +263,10 @@ static int update_fs_context_dstaddr(struct smb3_fs_context *ctx)
struct sockaddr *addr = (struct sockaddr *)&ctx->dstaddr;
int rc = 0;
- if (!ctx->nodfs && ctx->dfs_automount) {
+ if (!ctx->nodfs && ctx->automount && ctx->dfs_conn) {
rc = dns_resolve_server_name_to_ip(ctx->source, addr, NULL);
if (!rc)
cifs_set_port(addr, ctx->port);
- ctx->dfs_automount = false;
}
return rc;
}
@@ -282,7 +282,7 @@ struct smb3_fs_context {
bool witness:1; /* use witness protocol */
char *leaf_fullpath;
struct cifs_ses *dfs_root_ses;
- bool dfs_automount:1; /* set for dfs automount only */
+ bool automount:1; /* set for automounts */
enum cifs_reparse_type reparse_type;
bool dfs_conn:1; /* set for dfs mounts */
};
@@ -220,6 +220,7 @@ static struct vfsmount *cifs_do_automount(struct path *path)
tmp.leaf_fullpath = NULL;
tmp.UNC = tmp.prepath = NULL;
tmp.dfs_root_ses = NULL;
+ tmp.automount = true;
fs_context_set_ids(&tmp);
rc = smb3_fs_context_dup(ctx, &tmp);
@@ -240,9 +241,9 @@ static struct vfsmount *cifs_do_automount(struct path *path)
ctx->source = NULL;
goto out;
}
- ctx->dfs_automount = ctx->dfs_conn = is_dfs_mount(mntpt);
+ ctx->dfs_conn = is_dfs_mount(mntpt);
cifs_dbg(FYI, "%s: ctx: source=%s UNC=%s prepath=%s dfs_automount=%d\n",
- __func__, ctx->source, ctx->UNC, ctx->prepath, ctx->dfs_automount);
+ __func__, ctx->source, ctx->UNC, ctx->prepath, ctx->dfs_conn);
mnt = fc_mount(fc);
out:
Avoid logging info and expected errors when automounting DFS links and reparse mount points as a share might contain hundreds of them and the client would end up flooding dmesg. Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> --- fs/smb/client/cifsfs.c | 4 ++-- fs/smb/client/connect.c | 3 ++- fs/smb/client/dfs.c | 3 +-- fs/smb/client/fs_context.h | 2 +- fs/smb/client/namespace.c | 5 +++-- 5 files changed, 9 insertions(+), 8 deletions(-)