From patchwork Wed Mar 7 17:00:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mkrtchyan, Tigran" X-Patchwork-Id: 10264487 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 D94AE602C8 for ; Wed, 7 Mar 2018 17:00:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C75EC2973D for ; Wed, 7 Mar 2018 17:00:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB7F329740; Wed, 7 Mar 2018 17:00: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=-5.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, HK_RANDOM_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 A986D29740 for ; Wed, 7 Mar 2018 17:00:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933756AbeCGRAa (ORCPT ); Wed, 7 Mar 2018 12:00:30 -0500 Received: from smtp-o-1.desy.de ([131.169.56.154]:39277 "EHLO smtp-o-1.desy.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933487AbeCGRA3 (ORCPT ); Wed, 7 Mar 2018 12:00:29 -0500 X-Clacks-Overhead: GNU Terry Pratchett DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-o-1.desy.de 37BE3280486 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=desy.de; s=default; t=1520442028; bh=4o0YmT7/Pb2fp7IjYaoL9yHWcK8cgozsHT402QOjqQA=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=U/Idm4ONISM3qdcARaFCJKRsCG8bV5z4pefBPp3X0fpIll34bCeac8TUC0CmY2J1f kmRpnzN67M95r5bNeMwqYYUuGxgV+IHO340TseRtqOx68lSzEZ/oC84MbpIkjzVSOM JMaDzhJT/khkPdlyQGn3z8Qdg0X/cISUGIyxuD8c= Received: from smtp-map-1.desy.de (smtp-map-1.desy.de [131.169.56.66]) by smtp-o-1.desy.de (DESY-O-1) with ESMTP id 37BE3280486 for ; Wed, 7 Mar 2018 18:00:28 +0100 (CET) X-Virus-Scanned: amavisd-new at desy.de Received: from z-mbx-2.desy.de (z-mbx-2.desy.de [131.169.55.140]) by smtp-intra-3.desy.de (DESY-INTRA-3) with ESMTP id 4104815B4; Wed, 7 Mar 2018 18:00:23 +0100 (MET) Date: Wed, 7 Mar 2018 18:00:23 +0100 (CET) From: "Mkrtchyan, Tigran" To: Christoph Hellwig Cc: linux-nfs , Trond Myklebust Message-ID: <2006405521.11212710.1520442023186.JavaMail.zimbra@desy.de> In-Reply-To: <20180307064756.GA15922@infradead.org> References: <1569515727.10818617.1520288819283.JavaMail.zimbra@desy.de> <20180307064756.GA15922@infradead.org> Subject: Re: Kernel ops with flexfiles MIME-Version: 1.0 X-Mailer: Zimbra 8.7.11_GA_1854 (ZimbraWebClient - FF58 (Linux)/8.7.11_GA_1854) Thread-Topic: Kernel ops with flexfiles Thread-Index: DJGwpo6ckZ3MR3XyLvEZSVC6zj3lLw== 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 After some digging I found that the number of increments and decrements for lo->plh_refcoun't doesn't match. While the number of pnfs_get_layout_hdr matches to the number of pnfs_put_layout_hdr calls, pnfs_layout_remove_lseg does yet another decrement. Something like this fixes the issue: Or may be we don't need refcount_dec(&lo->plh_refcount) at all. Can someone comment on it? Thanks, Tigran. ----- Original Message ----- > From: "Christoph Hellwig" > To: "Tigran Mkrtchyan" > Cc: "linux-nfs" , "Trond Myklebust" > Sent: Wednesday, March 7, 2018 7:47:56 AM > Subject: Re: Kernel ops with flexfiles > FYI, I see very similar issues with blocklayout, also caused by the > refcount changes. But I didn't really didn't have any time to dig > into it yet. > -- > 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 --- 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/nfs/pnfs.c b/fs/nfs/pnfs.c index c13e826614b5..a7b01cd87e6a 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -490,7 +490,7 @@ pnfs_layout_remove_lseg(struct pnfs_layout_hdr *lo, WARN_ON(test_bit(NFS_LSEG_VALID, &lseg->pls_flags)); list_del_init(&lseg->pls_list); /* Matched by pnfs_get_layout_hdr in pnfs_layout_insert_lseg */ - refcount_dec(&lo->plh_refcount); + refcount_dec_not_one(&lo->plh_refcount); if (test_bit(NFS_LSEG_LAYOUTRETURN, &lseg->pls_flags)) return; if (list_empty(&lo->plh_segs) &&