From patchwork Wed Aug 10 18:46:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9273579 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 06E74600CA for ; Wed, 10 Aug 2016 18:49:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAC622810E for ; Wed, 10 Aug 2016 18:49:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DED9F2841A; Wed, 10 Aug 2016 18:49:12 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 4B91D2810E for ; Wed, 10 Aug 2016 18:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752208AbcHJSsj (ORCPT ); Wed, 10 Aug 2016 14:48:39 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:9507 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753724AbcHJSsc (ORCPT ); Wed, 10 Aug 2016 14:48:32 -0400 Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7AIkEAE014452; Wed, 10 Aug 2016 11:47:51 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=subject : to : references : cc : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=FeS6TerP02FWMkSY1MrV/PVPWXAzGmg/h6o8p+PJ9eM=; b=LU4t0wPHp4Kaz8FAyJ6eKcPeN+jWpGB0TtruB2hZrEOVhahs0hBcVmfvHXFTLSlVDTRX sE+3MI3i6UHNA231okYYu9LNe+OZvZJXBF2kh/FSDlvzVmwxckuEm6vskwFtRt7vUg/G 29KgICDYnKup67Mo5yXTVo6wfA8KkI5P0Qw= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 24qebef4hr-20 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 10 Aug 2016 11:47:45 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.17) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 10 Aug 2016 11:46:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=se1ar73Sb/CpWuOkS97AKBocXNpl/XwXa6za/MZ/GuU=; b=JxN2R8fufiHP8jlpSs0vcAwZ3I1MhKGyuAld0v/v2NrDwnPQmkW05T7U9tkfPst0Ap2qdrt8C20r9it4HOjjOeCkbEKioAI1UaXriyFHnUsUhXsoxzkmxP1lmOxAMlOPm2u0OWJaWULJfbL4dObAHeWoIR6WX0TnJeZPFJO8SDM= Received: from localhost.localdomain (107.15.72.49) by DM5PR15MB1321.namprd15.prod.outlook.com (10.173.210.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Wed, 10 Aug 2016 18:46:29 +0000 Subject: Re: [lkp] [nfsd] b44061d0b9: BUG: Dentry ffff880027d7c540{i=1846f, n=0a} still in use (1) [unmount of btrfs vda] To: Linus Torvalds References: <20160810053947.GG21941@yexl-desktop> CC: kernel test robot , Al Viro , Chris Mason , David Sterba , "J. Bruce Fields" , LKML , LKP , linux-btrfs , Linux NFS Mailing List From: Josef Bacik Message-ID: Date: Wed, 10 Aug 2016 14:46:27 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [107.15.72.49] X-ClientProxiedBy: DM3PR14CA0036.namprd14.prod.outlook.com (10.164.193.174) To DM5PR15MB1321.namprd15.prod.outlook.com (10.173.210.11) X-MS-Office365-Filtering-Correlation-Id: 1252c222-29c4-4602-2817-08d3c14ea4b3 X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1321; 2:O1P/VM1bQl7Btm2/IvvlhW7OqYm+DaNjJP2xZ/FPllKQMUBJSNh9hkxIyZMGXWuZ7wuC0W8KInNMOs7mdMzE0V5JsE5qtrUUSMeCoPS4DUnEVrBJBtD/NR4gNxMlFbON/ImTx/8x3eFpS4HPp2d+KI+8tvYB4OjjonRCjDTwhEUHDZXvpRIgex2knDcszoN0; 3:+gWMx11Xw/2gLZ6a91aVGtcHK4vZDfxAjil+wudlpZFhP0NXKPfPnGXHoAhvzuRONX4aW7sIaMMOfHcwNPzrcbQzZRTQu8MhPFigsVlKW7awM5iCCIaBWZeylTo9GX7h X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM5PR15MB1321; X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1321; 25:xQF0IqaL7BgXeWDpyU/Ra9qIeZoXSL6ty8pVCJ16ywnF3u2DWuHPf8xgoqug+aKjWCuVcx2MGogSNd84vLpHJqy2pN/gYiznF7wwJDv7R3YcP77R1kqBXGInSVFviBozYbLCB5vJYX/C8fIr8HcwhtXL/JMoiCvwlLQuwSEVg0sqVSVwklUVj2YCrovWGs9s8yvTTmxs9e/O0lTtEBltNK/Y1HhzkXBm+TITV2V3+mX4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ex0fEHATueW/PJvELqWsWDHcLHd8jQzn/TiZ49+PwlnlVh8NXanW6xHXX505ZTsVdwNyrN5WONtr11bQ4c/JkiIcQLVz/608Is2cY6WuqkkvdS+TRDJKVTCe3Qq8LmQzlLc85n1YH48zBuTTBmY2jMC+1AZoSeL/Vi5IDhZyp+CpNP3mN+Utpm1SqV/ZcNXshwLq33gKo+aWaY2jni4A51P2ibQiur1VbICqiZm6oW5nxKsdvpNsWC/HcG5ZXUq9xxowJIouwmKJcwpY1T6BFjpwUKo8VxafN+1HWICW8gJl40ypitofI X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040168)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:DM5PR15MB1321; BCL:0; PCL:0; RULEID:; SRVR:DM5PR15MB1321; X-Forefront-PRVS: 0030839EEE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(199003)(24454002)(189002)(377454003)(4326007)(81156014)(68736007)(4001350100001)(86362001)(81166006)(50466002)(42186005)(83506001)(19580405001)(97736004)(2950100001)(230700001)(19580395003)(31696002)(23676002)(8676002)(106356001)(575784001)(36756003)(105586002)(33646002)(31686004)(2906002)(65956001)(76176999)(6116002)(77096005)(7736002)(3846002)(110136002)(305945005)(7846002)(586003)(66066001)(101416001)(50986999)(64126003)(93886004)(47776003)(65806001)(54356999)(189998001)(92566002)(65826006)(15760500001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR15MB1321; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjE1TUIxMzIxOzIzOkV1b0l6ZnFMMGttSTJtVHN0L2dwdThEYk9T?= =?utf-8?B?WlJxOHNBSnd3WTVt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2OzY+5kShkBjy5w= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2016 18:46:29.3207 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1321 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-10_15:, , signatures=0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 08/10/2016 02:25 PM, Linus Torvalds wrote: > On Wed, Aug 10, 2016 at 11:22 AM, Josef Bacik wrote: >> On 08/10/2016 02:06 PM, Linus Torvalds wrote: >>> >>> More information in the original email on lkml. >> >> I'm not subscribed to lkml and for some reason I can't find the original >> email in any of the lkml/linux-nfs archives. Could you forward more of the >> details? > > Done. > So my naive fix would be something like this From: Josef Bacik Date: Wed, 10 Aug 2016 14:43:08 -0400 Subject: [PATCH] nfsd: fix dentry refcounting problem b44061d0b9 introduced a dentry ref counting bug, previously we were grabbing one ref to dchild in nfsd_create(), but with the creation of nfsd_create_locked() we have a ref for dchild from the lookup in nfsd_create(), and then another ref in nfsd_create_locked(). The ref from the lookup in nfsd_create() is never dropped and results in dentries still in use at unmount. Signed-off-by: Josef Bacik Reviewed-by: Jeff Layton --- fs/nfsd/vfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index ba944123..ff476e6 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1252,10 +1252,13 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, if (IS_ERR(dchild)) return nfserrno(host_err); err = fh_compose(resfhp, fhp->fh_export, dchild, fhp); - if (err) { - dput(dchild); + /* + * We unconditionally drop our ref to dchild as fh_compose will have + * already grabbed its own ref for it. + */ + dput(dchild); + if (err) return err; - } return nfsd_create_locked(rqstp, fhp, fname, flen, iap, type, rdev, resfhp); }