From patchwork Fri Dec 13 10:03:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 3339491 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1DF23C0D4A for ; Fri, 13 Dec 2013 10:03:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58A2F206EA for ; Fri, 13 Dec 2013 10:03:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D504206E9 for ; Fri, 13 Dec 2013 10:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752278Ab3LMKDr (ORCPT ); Fri, 13 Dec 2013 05:03:47 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:39597 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752269Ab3LMKDq (ORCPT ); Fri, 13 Dec 2013 05:03:46 -0500 Received: by mail-ee0-f46.google.com with SMTP id d49so757698eek.19 for ; Fri, 13 Dec 2013 02:03:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bl+wgshjHhfDDIDRPE9USF3h3MrU406BXN2/SHhmJI8=; b=TZxw8zRKC4vXFrXdJICWDDOwta4EGSl6LGnQ/Dta0/H7Zmdn+E+sby9PSqpvHZ3q3t h9m65M8l4XT2B3va8zNGPfIwWvLzLqJt+7P3URhY2DVP6BE3NT45FT7IXeWpuAxJq1uo 7w/Jyv6PHiYzGRa5SmElCOti8DvaAqySUmUrbOeoalBKnPM+USAIeFOhH0eKpCc1QfxU yt7UTGkvRmls+7PrfTtVvPB5SMxb7K6iBBfVL2EpaHpegVOBUHh75B3nGhjtf0jf/Ydy dAPS6fPDtlXZRhYo2z2j/2IOziypxvdhtVsTkHuTedz3FSLNTLjmyneymuyPAK+heiJn DkXg== X-Received: by 10.15.82.8 with SMTP id z8mr1874482eey.25.1386929025623; Fri, 13 Dec 2013 02:03:45 -0800 (PST) Received: from localhost.il.tonian.com (bzq-79-181-130-207.red.bezeqint.net. [79.181.130.207]) by mx.google.com with ESMTPSA id n1sm4894901eep.20.2013.12.13.02.03.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Dec 2013 02:03:44 -0800 (PST) From: Benny Halevy To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org, Benny Halevy Subject: [PATCH 1/2] nfsd4: break from inner lookup loop in nfsd4_release_lockowner on first match Date: Fri, 13 Dec 2013 12:03:40 +0200 Message-Id: <1386929020-12578-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <52AADAF6.40700@primarydata.com> References: <52AADAF6.40700@primarydata.com> 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_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Otherwise the lockowner may by added to "matches" more than once. Signed-off-by: Benny Halevy --- fs/nfsd/nfs4state.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 0874998..84007b6 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4660,6 +4660,7 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, if (check_for_locks(stp->st_file, lo)) goto out; list_add(&lo->lo_list, &matches); + break; } } /* Clients probably won't expect us to return with some (but not all)