From patchwork Wed Apr 10 19:36:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 2423011 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 43CCF3FCA5 for ; Wed, 10 Apr 2013 19:36:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762176Ab3DJTgz (ORCPT ); Wed, 10 Apr 2013 15:36:55 -0400 Received: from mail-gh0-f170.google.com ([209.85.160.170]:60588 "EHLO mail-gh0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752182Ab3DJTgy (ORCPT ); Wed, 10 Apr 2013 15:36:54 -0400 Received: by mail-gh0-f170.google.com with SMTP id z2so125959ghb.15 for ; Wed, 10 Apr 2013 12:36:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=MF7tkoTLxE20tJlhCzpr9VdRHFqlnqb+7ah3/zgtOGk=; b=QUzQmgUsgQw5v32zg5AqGkLVAlcxIPgOJfcwzQOFQnjkcRZkv7KofuW63dyXijbvMB HEL5gi4dUVnYd33Rrx/sCdrPg7021BEFpPfri+wWhA9V9E4F/fzXw4CgHJshtSuCvyus o1deyBDReIsYLQfFYJijsONxSANEdmAVYua1Ywpr9fm6XvEOVWbO2IGzZoFJ6UFGcB2x XIXoeQG0kWAddw5MMIA1Vti8WUeDE4hUwlUnM4NA8gVy3OVz0RFVjTl6ecYYyc12MAvc 4v/23tyCH32qlTmle4x1e5ZFYeUveO0PLmDRau22pUax+i1bA13BxIWJy9PLPrKki9I7 UQkA== X-Received: by 10.236.69.65 with SMTP id m41mr2181179yhd.47.1365622614004; Wed, 10 Apr 2013 12:36:54 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-107-015-113-143.nc.res.rr.com. [107.15.113.143]) by mx.google.com with ESMTPS id x33sm1727448yhn.18.2013.04.10.12.36.52 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 10 Apr 2013 12:36:52 -0700 (PDT) From: Jeff Layton To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH] nfs: remove unnecessary check for NULL inode->i_flock from nfs_delegation_claim_locks Date: Wed, 10 Apr 2013 15:36:48 -0400 Message-Id: <1365622608-21015-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.11.7 X-Gm-Message-State: ALoCoQltMJFUGOHt/ddnfuEwnUU228XaBsuhnS3O9IUtesZ5VqSlfbIQcrTXNpuDP50w5basW3ni Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org The second check was added in commit 65b62a29 but it will never be true. Signed-off-by: Jeff Layton --- fs/nfs/delegation.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index f30bd1e..57db324 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -71,10 +71,8 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_ int status = 0; if (inode->i_flock == NULL) - return 0; - - if (inode->i_flock == NULL) goto out; + /* Protect inode->i_flock using the file locks lock */ lock_flocks(); for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {