From patchwork Thu Feb 6 23:50:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 3598891 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 E6F20BF418 for ; Thu, 6 Feb 2014 23:50:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C9082012F for ; Thu, 6 Feb 2014 23:50:52 +0000 (UTC) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3985520120 for ; Thu, 6 Feb 2014 23:50:51 +0000 (UTC) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s16NohHC030448 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Feb 2014 23:50:43 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s16NogjA029999 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Feb 2014 23:50:42 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WBYiQ-00007d-63; Thu, 06 Feb 2014 15:50:42 -0800 Received: from acsinet21.oracle.com ([141.146.126.237]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WBYiG-000079-8M for ocfs2-devel@oss.oracle.com; Thu, 06 Feb 2014 15:50:32 -0800 Received: from aserp1020.oracle.com (aserp1020.oracle.com [141.146.126.67]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s16NoVDg008511 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Feb 2014 23:50:31 GMT Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) by aserp1020.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s16NoVis018375 for ; Thu, 6 Feb 2014 23:50:31 GMT Received: from akpm3.mtv.corp.google.com (unknown [216.239.45.95]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A00A47FE; Thu, 6 Feb 2014 23:50:30 +0000 (UTC) Date: Thu, 6 Feb 2014 15:50:29 -0800 From: Andrew Morton To: Mark Fasheh Message-Id: <20140206155029.b7275670913c34ef6bc9a530@linux-foundation.org> In-Reply-To: <20140206234253.GR24361@wotan.suse.de> References: <20140124204709.85C895A4203@corp2gmr1-2.hot.corp.google.com> <20140206234253.GR24361@wotan.suse.de> X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=140.211.169.12 ct-class=T2 ct-vol1=0 ct-vol2=4 ct-vol3=4 ct-risk=50 ct-spam1=67 ct-spam2=0 ct-bulk=87 rcpts=1 size=1198 X-SPF-Info: PASS::mail.linuxfoundation.org X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=X/lrdgje c=1 sm=1 tr=0 a=5MPDoNpceV4HFXFrvkM3CQ==:117 a=5MPDoNpceV4HFXFrvkM3CQ==:17 a=-VHXzisnSzEA:10 a=NEiEQogP1MkA:10 a=kj9zAlcOel0A:10 a=Z4Rwk6OoAAAA:8 a=1XWaLZrsAAAA:8 a=ag1SF4gXAAAA:8 a=WwbTc5SLcxoA:10 a=i0EeH86SAAAA:8 a=PX 7Xzcb1CfXgYmGY6qUA:9 a=CjuIK1q_8ugA:10 a=0kPLrQdw3YYA:10 a=jbrJJM5MRmoA:10 a=hPjdaMEvmhQA:10 X-Sendmail-CT-Classification: not spam X-Sendmail-CT-RefID: str=0001.0A010201.52F41FC7.004A:SCFSTAT19734153, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 Cc: ocfs2-devel@oss.oracle.com Subject: Re: [Ocfs2-devel] [patch 09/11] ocfs2: llseek requires ocfs2 inode lock for the file in SEEK_END 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: acsinet22.oracle.com [141.146.126.238] X-Spam-Status: No, score=-4.7 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 On Thu, 6 Feb 2014 15:42:53 -0800 Mark Fasheh wrote: > On Fri, Jan 24, 2014 at 12:47:09PM -0800, akpm@linux-foundation.org wrote: > > From: Jensen > > Subject: ocfs2: llseek requires ocfs2 inode lock for the file in SEEK_END > > > > llseek requires ocfs2 inode lock for updating the file size in SEEK_END. > > because the file size maybe update on another node. > > > > This bug can be reproduce the following scenario: at first, we dd a test > > fileA, the file size is 10k. > > Basically, you want to amke SEEK_END cluster-aware. This patch would be the > right way to do it. Sunil was worried about the performance impact. Correctness beats performance, but some quantitative testing would be useful? > Reviewed-by: Mark Fasheh I suppose we should fix the bug it added. --- a/fs/ocfs2/file.c~ocfs2-llseek-requires-ocfs2-inode-lock-for-the-file-in-seek_end-fix +++ a/fs/ocfs2/file.c @@ -2631,6 +2631,7 @@ static loff_t ocfs2_file_llseek(struct f */ ret = ocfs2_inode_lock(inode, NULL, 0); if (ret < 0) { + ocfs2_inode_unlock(inode, 0); mlog_errno(ret); goto out; }