From patchwork Wed Aug 6 20:32:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 4688521 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1CA76C0338 for ; Wed, 6 Aug 2014 20:38:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43C8F20170 for ; Wed, 6 Aug 2014 20:38:55 +0000 (UTC) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5697920136 for ; Wed, 6 Aug 2014 20:38:54 +0000 (UTC) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s76Kci7p025440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 6 Aug 2014 20:38:45 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s76KchkF018568 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Aug 2014 20:38:43 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1XF7sn-0003ot-Jp; Wed, 06 Aug 2014 13:32:25 -0700 Received: from acsinet21.oracle.com ([141.146.126.237]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1XF7sU-0003no-Sa for ocfs2-devel@oss.oracle.com; Wed, 06 Aug 2014 13:32:07 -0700 Received: from aserp1060.oracle.com (aserp1060.oracle.com [141.146.126.71]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s76KW44e029557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Aug 2014 20:32:04 GMT Received: from aserp2030.oracle.com (aserp2030.oracle.com [141.146.126.74]) by aserp1060.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s76KW4WA023120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 6 Aug 2014 20:32:04 GMT Received: from pps.filterd (aserp2030.oracle.com [127.0.0.1]) by aserp2030.oracle.com (8.14.7/8.14.7) with SMTP id s76KVqpX029266 for ; Wed, 6 Aug 2014 20:32:04 GMT Received: from mail-oa0-f73.google.com (mail-oa0-f73.google.com [209.85.219.73]) by aserp2030.oracle.com with ESMTP id 1nknwckg6c-1 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 06 Aug 2014 20:32:03 +0000 Received: by mail-oa0-f73.google.com with SMTP id g18so578941oah.4 for ; Wed, 06 Aug 2014 13:32:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=z6dxi36XCZ/rC8MBr7DW/SMpN+DRdTqt5IV2xZA3ilM=; b=WSKbvgwZJwQNzwg3xMlay0YyLQLWUGBzqOQTKs8h5nDz33s6I0t14Rnyo1GZj5DJdp Ez7ZvNfIJZX4hi4NhpRjd7qsdWmB43dZo5eitHhnGWiVWIJnn4WJhonGSM/3v8oulFlw u1JyWopamQE6w+Rwzb6CAkCLp06tu9xEszqpj++s5iHHH5iDCnIa6tZMf20TFpzLpvAo RLLM7G4v2or+Rbbev8q9HVKTSInwyed9I6A59K6NM8f9BD4VnDT7uAvinx8WmhTKRj0t a/AI1Y8xKmpOKu9l4LKCfT4OszI7b+CNpWC/eJhKe5vI/ibaWqpQb3bp8L9JkKYGV2Oe 5G+g== X-Gm-Message-State: ALoCoQn0sKlsr8I52Fy2+/wQ+f0LaPzwfvII15MV4GoVUjCc1AcxScmJSgcdIYqR/QI8YqY/9mRh X-Received: by 10.43.153.196 with SMTP id lb4mr7773477icc.2.1407357123182; Wed, 06 Aug 2014 13:32:03 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id l23si140767yhg.1.2014.08.06.13.32.03 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Aug 2014 13:32:03 -0700 (PDT) Received: from akpm3.mtv.corp.google.com (akpm3.mtv.corp.google.com [172.17.131.127]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 013FB5A4586; Wed, 6 Aug 2014 13:32:03 -0700 (PDT) Received: by akpm3.mtv.corp.google.com (Postfix, from userid 25780) id B6CB71A0536; Wed, 6 Aug 2014 13:32:02 -0700 (PDT) Date: Wed, 06 Aug 2014 13:32:02 -0700 From: akpm@linux-foundation.org To: jlbec@evilplan.org, mfasheh@suse.com, ocfs2-devel@oss.oracle.com, akpm@linux-foundation.org, xuejiufei@huawei.com Message-ID: <53e290c2.UrOYpRJudvt5Qabp%akpm@linux-foundation.org> User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5600 definitions=7522 signatures=670497 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=2 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1408060245 Subject: [Ocfs2-devel] [patch 02/10] ocfs2: free inode when i_count becomes zero X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Xue jiufei Subject: ocfs2: free inode when i_count becomes zero Disk inode deletion may be heavily delayed when one node unlink a file after the same dentry is freed on another node(say N1) because of memory shrink but inode is left in memory. This inode can only be freed while N1 doing the orphan scan work. However, N1 may skip orphan scan for several times because other nodes may do the work earlier. In our tests, it may take 1 hour on 4 nodes cluster and this will cause bad user experience. So we think the inode should be freed when i_count becomes zero to avoid such circumstances. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: joyce.xue Cc: Mark Fasheh Cc: Joel Becker Signed-off-by: Andrew Morton --- fs/ocfs2/inode.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff -puN fs/ocfs2/inode.c~ocfs2-free-inode-when-i_count-becomes-zero fs/ocfs2/inode.c --- a/fs/ocfs2/inode.c~ocfs2-free-inode-when-i_count-becomes-zero +++ a/fs/ocfs2/inode.c @@ -1192,17 +1192,9 @@ void ocfs2_evict_inode(struct inode *ino int ocfs2_drop_inode(struct inode *inode) { struct ocfs2_inode_info *oi = OCFS2_I(inode); - int res; - trace_ocfs2_drop_inode((unsigned long long)oi->ip_blkno, inode->i_nlink, oi->ip_flags); - - if (oi->ip_flags & OCFS2_INODE_MAYBE_ORPHANED) - res = 1; - else - res = generic_drop_inode(inode); - - return res; + return 1; } /*