From patchwork Thu Nov 9 16:07:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 10051195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0ECFE6057F for ; Thu, 9 Nov 2017 16:07:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3ECF2AF74 for ; Thu, 9 Nov 2017 16:07:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E88372AF76; Thu, 9 Nov 2017 16:07:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB0EE2AF75 for ; Thu, 9 Nov 2017 16:07:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752625AbdKIQH3 (ORCPT ); Thu, 9 Nov 2017 11:07:29 -0500 Received: from fieldses.org ([173.255.197.46]:52356 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311AbdKIQH3 (ORCPT ); Thu, 9 Nov 2017 11:07:29 -0500 Received: by fieldses.org (Postfix, from userid 2815) id DC5D1C5A; Thu, 9 Nov 2017 11:07:28 -0500 (EST) Date: Thu, 9 Nov 2017 11:07:28 -0500 From: "J. Bruce Fields" To: Naofumi Honda Cc: linux-nfs@vger.kernel.org, jlayton@redhat.com Subject: Re: [Bug 197817] "Panic: unable to handle kernel page request" in posix_unblock_lock() called from nfs4_laundromat() Message-ID: <20171109160728.GI8773@fieldses.org> References: <1911104.BiqBl0Bicc@nausicaa> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1911104.BiqBl0Bicc@nausicaa> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Nov 09, 2017 at 10:08:28AM +0900, Naofumi Honda wrote: > Dear Developers: > > > https://bugzilla.kernel.org/show_bug.cgi?id=197817 > > > > --- Comment #1 from bfields@fieldses.org --- > > Yes, I think you're right. > > > > Would it be possible for you to submit a patch to fix that typo in those two > > places? (Just mail it to me at bfields@fieldses.org, cc: to > > linux-nfs@vger.kernel.org). > > > > OK, I have attached the patch. Thanks for the investigation and the fix! For future reference, we prefer patches to be inline with the email message (not attached), and prefer them in "unified" format. But for a one-off patch I can fix it up myself; applied as follows. --b. commit c26806a20fa3 Author: Naofumi Honda Date: Thu Nov 9 10:57:16 2017 -0500 nfsd: fix panic in posix_unblock_lock called from nfs4_laundromat From kernel 4.9, my two nfsv4 servers sometimes suffer from "panic: unable to handle kernel page request" in posix_unblock_lock() called from nfs4_laundromat(). These panics diseappear if we revert the commit "nfsd: add a LRU list for blocked locks". The cause appears to be a typo in nfs4_laundromat(), which is also present in nfs4_state_shutdown_net(). Cc: stable@vger.kernel.org Fixes: 7919d0a27f1e "nfsd: add a LRU list for blocked locks" Cc: jlayton@redhat.com Signed-off-by: J. Bruce Fields Reviewed-by: Jeff Layton --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 923243369bbc..b99830ab63aa 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4791,7 +4791,7 @@ nfs4_laundromat(struct nfsd_net *nn) spin_unlock(&nn->blocked_locks_lock); while (!list_empty(&reaplist)) { - nbl = list_first_entry(&nn->blocked_locks_lru, + nbl = list_first_entry(&reaplist, struct nfsd4_blocked_lock, nbl_lru); list_del_init(&nbl->nbl_lru); posix_unblock_lock(&nbl->nbl_lock); @@ -7260,7 +7260,7 @@ nfs4_state_shutdown_net(struct net *net) spin_unlock(&nn->blocked_locks_lock); while (!list_empty(&reaplist)) { - nbl = list_first_entry(&nn->blocked_locks_lru, + nbl = list_first_entry(&reaplist, struct nfsd4_blocked_lock, nbl_lru); list_del_init(&nbl->nbl_lru); posix_unblock_lock(&nbl->nbl_lock);