stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Julian Schroeder <jumaco@amazon.com>
Cc: stable@vger.kernel.org
Subject: Re: [PATCH] nfsd: destroy percpu stats counters after reply cache #5.11.0-rc5
Date: Thu, 26 May 2022 14:09:17 +0200	[thread overview]
Message-ID: <Yo9t7Whg/XGa/jmb@kroah.com> (raw)
In-Reply-To: <20220523211152.GB23843@dev-dsk-jumaco-1e-78723413.us-east-1.amazon.com>

On Mon, May 23, 2022 at 09:11:52PM +0000, Julian Schroeder wrote:
> From: Julian Schroeder <jumaco@amazon.com>
> Date: Fri, 20 May 2022 18:33:27 +0000
> Subject: [PATCH] nfsd: destroy percpu stats counters after reply cache
>  shutdown
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> Upon nfsd shutdown any pending DRC cache is freed. DRC cache use is
> tracked via a percpu counter. In the current code the percpu counter
> is destroyed before. If any pending cache is still present,
> percpu_counter_add is called with a percpu counter==NULL. This causes
> a kernel crash.
> The solution is to destroy the percpu counter after the cache is freed.
> Fixes: e567b98ce9a4b (“nfsd: protect concurrent access to nfsd stats counters”)
> Signed-off-by: Julian Schroeder <jumaco@amazon.com>
> ---
>  fs/nfsd/nfscache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
> index 0b3f12aa37ff..7da88bdc0d6c 100644
> --- a/fs/nfsd/nfscache.c
> +++ b/fs/nfsd/nfscache.c
> @@ -206,7 +206,6 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
>         struct svc_cacherep     *rp;
>         unsigned int i;
>  
> -       nfsd_reply_cache_stats_destroy(nn);
>         unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
>  
>         for (i = 0; i < nn->drc_hashsize; i++) {
> @@ -217,6 +216,7 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
>                                                                         rp, nn);
>                 }
>         }
> +       nfsd_reply_cache_stats_destroy(nn);
>  
>         kvfree(nn->drc_hashtbl);
>         nn->drc_hashtbl = NULL;
> -- 
> 2.32.0
> 

What is the git commit id of this in Linus's tree?

And this patch is totally damaged with whitespace and can not be applied
at all :(

Please fix it up and submit it again.

thanks,

greg k-h

  reply	other threads:[~2022-05-26 12:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23 21:11 [PATCH] nfsd: destroy percpu stats counters after reply cache #5.11.0-rc5 Julian Schroeder
2022-05-26 12:09 ` Greg KH [this message]
2022-05-27 19:39   ` Schroeder, Julian
2022-05-28 10:44     ` Greg KH
2022-05-28 13:41   ` Schroeder, Julian
2022-05-28 14:05     ` Greg KH
2022-05-29 12:57       ` Schroeder, Julian
2022-05-30  6:18         ` Greg KH

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=Yo9t7Whg/XGa/jmb@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jumaco@amazon.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).