From patchwork Fri Apr 10 13:01:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6195301 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 45AD8BF4A6 for ; Fri, 10 Apr 2015 13:01:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C1772035B for ; Fri, 10 Apr 2015 13:01:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 818FF203F4 for ; Fri, 10 Apr 2015 13:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932378AbbDJNBj (ORCPT ); Fri, 10 Apr 2015 09:01:39 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:34710 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932497AbbDJNBa (ORCPT ); Fri, 10 Apr 2015 09:01:30 -0400 Received: by pdbqa5 with SMTP id qa5so22169120pdb.1; Fri, 10 Apr 2015 06:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=SsZ6rCAh9ZKoLhqnfklsSYzkVorK48l4NQ/3cJldEts=; b=HeF7tef1712mz92pUBgc943+ZDJy5c7QiTJ6yuf83Bc2ETq4zWjwTex0yhJvD/2MWW 93JgTB7lCK/3pSxIXnd1m0dbsnwsyf66Up6FVIvZh0Uawzu6Niu7EisXgHCEmIE557ii uzHkdIcRejDkhwvXT2c65eXJw/7o3GYRu/o0k9opIxETBxjsZSkxA6QIJn1GunSjBt64 7Qm+QO3iS8W6jVjcirPKO1Gj0WOFy62vjPBqhs7XBJu1ZGumtPTTwIS58asnJxIa60Xf K7FWAMbnh7jMULvso/W//1h96v/fJoQ3QBge+r6pMVKMuQDciK6txT3LvGlRlXtoXxqm YUkA== X-Received: by 10.70.131.227 with SMTP id op3mr2601024pdb.12.1428670889796; Fri, 10 Apr 2015 06:01:29 -0700 (PDT) Received: from [192.168.99.9] ([104.143.41.79]) by mx.google.com with ESMTPSA id z6sm2246661pdm.78.2015.04.10.06.01.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Apr 2015 06:01:28 -0700 (PDT) Message-ID: <5527C9A0.6030502@gmail.com> Date: Fri, 10 Apr 2015 21:01:20 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: David Howells CC: linux-fsdevel@vger.kernel.org, "linux-nfs@vger.kernel.org" , kinglongmee@gmail.com Subject: [PATCH] fscache: put reference of parent's usage and n_children Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If netfs exist, fscache must put the reference of parent's usage and n_children, otherwise, never be decreased. Signed-off-by: Kinglong Mee --- fs/fscache/netfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/fscache/netfs.c b/fs/fscache/netfs.c index 6d941f5..b16afba 100644 --- a/fs/fscache/netfs.c +++ b/fs/fscache/netfs.c @@ -71,8 +71,7 @@ already_registered: up_write(&fscache_addremove_sem); if (ret < 0) { - netfs->primary_index->parent = NULL; - __fscache_cookie_put(netfs->primary_index); + fscache_relinquish_cookie(netfs->primary_index, 0); netfs->primary_index = NULL; }