cifs: unbreak TCP session reuse
Subsystems (2)
PATCH 1/1 cifs: unbreak TCP session reuse
From: Rabin Vincent <[email protected]>
adfeb3e0 ("cifs: Make echo interval tunable") added a comparison of vol->echo_interval to server->echo_interval as a criterium to match_server(), but:
(1) A default value is set for server->echo_interval but not for vol->echo_interval, meaning these can never match if the echo_interval option is not specified.
(2) vol->echo_interval is in seconds but server->echo_interval is in jiffies, meaning these can never match even if the echo_interval option is specified.
This broke TCP session reuse since match_server() can never return 1. Fix it.
--- fs/cifs/connect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/cifs/connect.c +3 -1
@@ -1228,6 +1228,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, vol->ops = &smb1_operations; vol->vals = &smb1_values; + vol->echo_interval =SMB_ECHO_INTERVAL_DEFAULT ; +if (!mountdata) goto cifs_parse_mount_err;
@@ -2049,7 +2051,7 @@ static int match_server(struct TCP_Server_Info *server, struct smb_vol *vol)if (!match_security (server, vol))return 0 ; -if (server->echo_interval != vol->echo_interval) +if (server->echo_interval != vol->echo_interval *HZ )return 0 ;return 1 ;
Signature · 1 line
2.1.4
A message that is not in the archive (sent off-list or not yet received): 1468913145-23353-1-git-send-email-rabin.vincent-VrBV9hrLPhE@public.gmane.org
Sachin Prabhu
Acked-byQuoted 16 lines · Rabin Vincent
From: Rabin Vincent <[email protected]>
adfeb3e0("cifs: Make echo interval tunable") added a comparison ofvol->echo_intervaltoserver->echo_intervalas a criterium tomatch_server(), but:(1) A default value is set for
server->echo_intervalbut not forvol->echo_interval, meaning these can never match if theecho_interval
option is not specified.(2)
vol->echo_intervalis in seconds butserver->echo_intervalis in jiffies, meaning these can never match even if theecho_intervaloption
is specified.
Quoted 5 lines
This broke TCP session reuse since
match_server()can never return 1. Fix it.Fixes adfeb3e0 ("cifs: Make echo interval tunable")Signed-off-by Rabin Vincent <[email protected]>
Nice catch
Quoted 28 lines
---
fs/cifs/connect.c | 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)fs/cifs/connect.c +0
-0@@ -1228,6 +1228,8 @@ cifs_parse_mount_options(const char *mountdata,const char *devname, vol->ops = &smb1_operations; vol->vals = &smb1_values;fs/cifs/connect.c +2
-0+ vol->echo_interval =SMB_ECHO_INTERVAL_DEFAULT ; +if (!mountdata)
gotocifs_parse_mount_err;fs/cifs/connect.c +0
-0@@ -2049,7 +2051,7 @@ static int match_server(struct TCP_Server_Info *server, struct smb_vol *vol) if (!match_security(server, vol)) return 0;fs/cifs/connect.c +1
-1-if (server->echo_interval != vol->echo_interval) +if (server->echo_interval != vol->echo_interval *HZ )return 0;
return 1;
A message that is not in the archive (sent off-list or not yet received): CAH2r5mtJo4frMK8zb+x9c_27ijryB7zKgVA08C+C5dehme5RsA@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): CAH2r5mtJo4frMK8zb+x9c_27ijryB7zKgVA08C+C5dehme5RsA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Steve French
AppliedPATCH 1/1 cifs: unbreak TCP session reuse
merged into cifs-2.6.git and added cc: stable
Quoted 61 lines · Sachin Prabhu
Quoted 16 lines · Rabin Vincent
From: Rabin Vincent <[email protected]>
adfeb3e0("cifs: Make echo interval tunable") added a comparison ofvol->echo_intervaltoserver->echo_intervalas a criterium tomatch_server(), but:(1) A default value is set for
server->echo_intervalbut not forvol->echo_interval, meaning these can never match if theecho_interval
option is not specified.(2)
vol->echo_intervalis in seconds butserver->echo_intervalis in jiffies, meaning these can never match even if theecho_interval
option
is specified.Quoted 5 lines
This broke TCP session reuse since
match_server()can never return 1. Fix it.Fixes adfeb3e0 ("cifs: Make echo interval tunable")Signed-off-by Rabin Vincent <[email protected]>Nice catch
Acked-by Sachin Prabhu <[email protected]>Quoted 27 lines
--- fs/cifs/connect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)fs/cifs/connect.c +3
-1@@ -1228,6 +1228,8 @@ cifs_parse_mount_options(const char *mountdata,const char *devname, vol->ops = &smb1_operations; vol->vals = &smb1_values; + vol->echo_interval =SMB_ECHO_INTERVAL_DEFAULT ; +if (!mountdata) goto cifs_parse_mount_err;@@ -2049,7 +2051,7 @@ static int match_server(struct TCP_Server_Info *server, struct smb_vol *vol)if (!match_security (server, vol))return 0 ; -if (server->echo_interval != vol->echo_interval) +if (server->echo_interval != vol->echo_interval *HZ )return 0 ;Quoted 1 line
return 1;--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 10 lines
Thanks, Steve -- Thanks, Steve
2016-07-19 10:25 GMT+03:00 Rabin Vincent <[email protected]>:
Quoted 48 lines
From: Rabin Vincent <[email protected]>
adfeb3e0("cifs: Make echo interval tunable") added a comparison ofvol->echo_intervaltoserver->echo_intervalas a criterium tomatch_server(), but:(1) A default value is set for
server->echo_intervalbut not forvol->echo_interval, meaning these can never match if theecho_intervaloption is not specified.(2)
vol->echo_intervalis in seconds butserver->echo_intervalis in jiffies, meaning these can never match even if theecho_intervaloption is specified.This broke TCP session reuse since
match_server()can never return 1. Fix it.Fixes adfeb3e0 ("cifs: Make echo interval tunable")Signed-off-by Rabin Vincent <[email protected]>--- fs/cifs/connect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)fs/cifs/connect.c +3
-2@@ -1228,6 +1228,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, vol->ops = &smb1_operations; vol->vals = &smb1_values; + vol->echo_interval =SMB_ECHO_INTERVAL_DEFAULT ; +if (!mountdata) goto cifs_parse_mount_err;@@ -2049,7 +2051,7 @@ static int match_server(struct TCP_Server_Info *server, struct smb_vol *vol)if (!match_security (server, vol))return 0 ; -if (server->echo_interval != vol->echo_interval) +if (server->echo_interval != vol->echo_interval *HZ )return 0 ;return 1 ; --2.1.4
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Looks good. I applied it and it works as expected.
Signature · 2 lines
Best regards, Pavel Shilovsky