From: "Aurélien Aptel" <aaptel@suse.com>
To: Ronnie Sahlberg <lsahlber@redhat.com>,
linux-cifs <linux-cifs@vger.kernel.org>
Cc: Steve French <smfrench@gmail.com>, Ronnie Sahlberg <lsahlber@redhat.com>
Subject: Re: [PATCH] cifs: fix panic in smb2_reconnect
Date: Mon, 03 Jun 2019 12:00:47 +0200 [thread overview]
Message-ID: <87sgsrounk.fsf@suse.com> (raw)
In-Reply-To: <20190603073138.25211-1-lsahlber@redhat.com>
Ronnie Sahlberg <lsahlber@redhat.com> writes:
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index 565b60b62f4d..c4f3e2403b58 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -3116,6 +3116,7 @@ void smb2_reconnect_server(struct work_struct *work)
I would add a comment here. Something like:
/* IPC has the same lifetime as its session and uses its
refcount */
> if (ses->tcon_ipc && ses->tcon_ipc->need_reconnect) {
> list_add_tail(&ses->tcon_ipc->rlist, &tmp_list);
> tcon_exist = true;
> + ses->ses_count++;
> }
> }
> /*
> @@ -3134,6 +3135,8 @@ void smb2_reconnect_server(struct work_struct *work)
> else
> resched = true;
> list_del_init(&tcon->rlist);
> + if (tcon->ipc)
> + cifs_put_smb_ses(tcon->ses);
> cifs_put_tcon(tcon);
Since cifs_put_tcon() is a noop on IPC this looks correct but I think an
putting it in an "else" would make the logic clearer.
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)
next prev parent reply other threads:[~2019-06-03 10:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-03 7:31 [PATCH] cifs: fix panic in smb2_reconnect Ronnie Sahlberg
2019-06-03 10:00 ` Aurélien Aptel [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-06-05 0:15 Ronnie Sahlberg
2019-06-05 0:21 ` Steve French
2019-06-11 23:52 ` Pavel Shilovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sgsrounk.fsf@suse.com \
--to=aaptel@suse.com \
--cc=linux-cifs@vger.kernel.org \
--cc=lsahlber@redhat.com \
--cc=smfrench@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.