linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: Ronnie Sahlberg <lsahlber@redhat.com>
Cc: linux-cifs <linux-cifs@vger.kernel.org>, Stable <stable@vger.kernel.org>
Subject: Re: [PATCH] cifs: fix GlobalMid_Lock bug in cifs_reconnect
Date: Thu, 13 Jun 2019 22:57:16 -0500	[thread overview]
Message-ID: <CAH2r5muLjnEer+6Fn2ikLRF6BuK2F2qCzXTHS5Kakhbk7mS4Lg@mail.gmail.com> (raw)
In-Reply-To: <20190614030229.22375-1-lsahlber@redhat.com>

tentatively merged into cifs-2.6.git for-next and to the github tree

On Thu, Jun 13, 2019 at 10:02 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
>
> We can not hold the GlobalMid_Lock spinlock during the
> dfs processing in cifs_reconnect since it invokes things that may sleep
> and thus trigger :
>
> BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:23
>
> Thus we need to drop the spinlock during this code block.
>
> RHBZ: 1716743
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/connect.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 8c4121da624e..8dd6637a3cbb 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -476,6 +476,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
>         spin_lock(&GlobalMid_Lock);
>         server->nr_targets = 1;
>  #ifdef CONFIG_CIFS_DFS_UPCALL
> +       spin_unlock(&GlobalMid_Lock);
>         cifs_sb = find_super_by_tcp(server);
>         if (IS_ERR(cifs_sb)) {
>                 rc = PTR_ERR(cifs_sb);
> @@ -493,6 +494,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
>         }
>         cifs_dbg(FYI, "%s: will retry %d target(s)\n", __func__,
>                  server->nr_targets);
> +       spin_lock(&GlobalMid_Lock);
>  #endif
>         if (server->tcpStatus == CifsExiting) {
>                 /* the demux thread will exit normally
> --
> 2.13.6
>


-- 
Thanks,

Steve

  reply	other threads:[~2019-06-14  3:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  3:02 [PATCH] cifs: fix GlobalMid_Lock bug in cifs_reconnect Ronnie Sahlberg
2019-06-14  3:57 ` Steve French [this message]
2019-06-17 21:25   ` 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=CAH2r5muLjnEer+6Fn2ikLRF6BuK2F2qCzXTHS5Kakhbk7mS4Lg@mail.gmail.com \
    --to=smfrench@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=lsahlber@redhat.com \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).