Fwd: [PATCH] cifs: unbreak TCP session reuse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



merged into cifs-2.6.git and added cc: stable

On Tue, Jul 19, 2016 at 7:33 AM, Sachin Prabhu <sprabhu@xxxxxxxxxx> wrote:
>
> On Tue, 2016-07-19 at 09:25 +0200, Rabin Vincent wrote:
> > From: Rabin Vincent <rabinv@xxxxxxxx>
> >
> > 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.
> >
> > Fixes: adfeb3e0 ("cifs: Make echo interval tunable")
> > Signed-off-by: Rabin Vincent <rabinv@xxxxxxxx>
>
> Nice catch
>
> Acked-by: Sachin Prabhu <sprabhu@xxxxxxxxxx>
>
> > ---
> >  fs/cifs/connect.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> > index 7d2b15c..eb24653 100644
> > --- a/fs/cifs/connect.c
> > +++ b/fs/cifs/connect.c
> > @@ -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;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html




-- 
Thanks,

Steve



-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux