Skip to content

Commit ce09f8d

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: new mount option called retrans
We have several places in the code where we treat the error -EAGAIN very differently. Some code retry for arbitrary number of times. Introducing this new mount option named "retrans", so that all these handlers of -EAGAIN can retry a fixed number of times. This applies only to soft mounts. Signed-off-by: Shyam Prasad N <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 49fe25c commit ce09f8d

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

fs/smb/client/cifsfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
681681
seq_printf(s, ",rasize=%u", cifs_sb->ctx->rasize);
682682
if (tcon->ses->server->min_offload)
683683
seq_printf(s, ",esize=%u", tcon->ses->server->min_offload);
684+
if (tcon->ses->server->retrans)
685+
seq_printf(s, ",retrans=%u", tcon->ses->server->retrans);
684686
seq_printf(s, ",echo_interval=%lu",
685687
tcon->ses->server->echo_interval / HZ);
686688

fs/smb/client/cifsglob.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,7 @@ struct TCP_Server_Info {
753753
unsigned int max_read;
754754
unsigned int max_write;
755755
unsigned int min_offload;
756+
unsigned int retrans;
756757
__le16 compress_algorithm;
757758
__u16 signing_algorithm;
758759
__le16 cipher_type;

fs/smb/client/connect.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,9 @@ static int match_server(struct TCP_Server_Info *server,
15741574
if (server->min_offload != ctx->min_offload)
15751575
return 0;
15761576

1577+
if (server->retrans != ctx->retrans)
1578+
return 0;
1579+
15771580
return 1;
15781581
}
15791582

@@ -1798,6 +1801,7 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,
17981801
goto out_err_crypto_release;
17991802
}
18001803
tcp_ses->min_offload = ctx->min_offload;
1804+
tcp_ses->retrans = ctx->retrans;
18011805
/*
18021806
* at this point we are the only ones with the pointer
18031807
* to the struct since the kernel thread not created yet

fs/smb/client/fs_context.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = {
139139
fsparam_u32("dir_mode", Opt_dirmode),
140140
fsparam_u32("port", Opt_port),
141141
fsparam_u32("min_enc_offload", Opt_min_enc_offload),
142+
fsparam_u32("retrans", Opt_retrans),
142143
fsparam_u32("esize", Opt_min_enc_offload),
143144
fsparam_u32("bsize", Opt_blocksize),
144145
fsparam_u32("rasize", Opt_rasize),
@@ -1064,6 +1065,9 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
10641065
case Opt_min_enc_offload:
10651066
ctx->min_offload = result.uint_32;
10661067
break;
1068+
case Opt_retrans:
1069+
ctx->retrans = result.uint_32;
1070+
break;
10671071
case Opt_blocksize:
10681072
/*
10691073
* inode blocksize realistically should never need to be
@@ -1619,6 +1623,8 @@ int smb3_init_fs_context(struct fs_context *fc)
16191623
ctx->backupuid_specified = false; /* no backup intent for a user */
16201624
ctx->backupgid_specified = false; /* no backup intent for a group */
16211625

1626+
ctx->retrans = 1;
1627+
16221628
/*
16231629
* short int override_uid = -1;
16241630
* short int override_gid = -1;

fs/smb/client/fs_context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ enum cifs_param {
118118
Opt_file_mode,
119119
Opt_dirmode,
120120
Opt_min_enc_offload,
121+
Opt_retrans,
121122
Opt_blocksize,
122123
Opt_rasize,
123124
Opt_rsize,
@@ -245,6 +246,7 @@ struct smb3_fs_context {
245246
unsigned int rsize;
246247
unsigned int wsize;
247248
unsigned int min_offload;
249+
unsigned int retrans;
248250
bool sockopt_tcp_nodelay:1;
249251
/* attribute cache timemout for files and directories in jiffies */
250252
unsigned long acregmax;

0 commit comments

Comments
 (0)