From patchwork Sat Aug 2 14:45:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4665201 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 95EBFC0338 for ; Sat, 2 Aug 2014 14:45:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AF58200E9 for ; Sat, 2 Aug 2014 14:45:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7357C200DF for ; Sat, 2 Aug 2014 14:45:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754629AbaHBOpr (ORCPT ); Sat, 2 Aug 2014 10:45:47 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:33275 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753062AbaHBOpq (ORCPT ); Sat, 2 Aug 2014 10:45:46 -0400 Received: by mail-pd0-f176.google.com with SMTP id y10so7175352pdj.7 for ; Sat, 02 Aug 2014 07:45:45 -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 :references:in-reply-to:content-type:content-transfer-encoding; bh=7/iD2hDkgCXRd0LWH2EzOxaWG38q/M/L9KT0XFlwKbE=; b=l802BWGFIIJwnxDZZFjmimy4liLolwShzpmMhaN3vvwJNmpg0A03Q8KuFTK0xI8gZg ujwi8vXzVyPVouLZZgfYuRhq/ZAd5vCdPAV4Qr+LbKKalf3ve/JY7RIBNA56eGjv15wO SNqIlDRyG1MdTIqZZCdXDgzadilJZ86ReDGfX9a8sc1tXU9GbeThpDgsuDDKwJ+AMtdy ue+fnjUreRThYatDIcyZlBX5lbjMsXIjgDs+KWphAP9cQYZdCDZrVIvq3CyN5YU45kvp 0pD71FjWIKvBuQWWTSP7PHHEKQgJZaKAYF6gqCPWp9imA2a5kjWKjpnV+hpl8xtA007K u+fQ== X-Received: by 10.70.51.8 with SMTP id g8mr4615327pdo.98.1406990744990; Sat, 02 Aug 2014 07:45:44 -0700 (PDT) Received: from [192.168.0.100] ([118.117.104.54]) by mx.google.com with ESMTPSA id y1sm11967713pbw.87.2014.08.02.07.45.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Aug 2014 07:45:43 -0700 (PDT) Message-ID: <53DCF97D.3000605@gmail.com> Date: Sat, 02 Aug 2014 22:45:17 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: "J. Bruce Fields" CC: Linux NFS Mailing List , NeilBrown , jlayton@redhat.com, Trond Myklebust , linux-fsdevel@vger.kernel.org Subject: [PATCH] fs/locks.c: Copy fl_lmops to conflock for nfsd using References: <53BAAAC5.9000106@gmail.com> In-Reply-To: <53BAAAC5.9000106@gmail.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=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 Commit d5b9026a67 ([PATCH] knfsd: locks: flag NFSv4-owned locks) using fl_lmops field in file_lock for checking nfsd4 lockowner. But, commit 1a747ee0cc (locks: don't call ->copy_lock methods on return of conflicting locks) causes the fl_lmops of conflock for nfsd4_lock always be NULL. Also, commit 0996905f93 (lockd: posix_test_lock() should not call locks_copy_lock()) caused the fl_lmops of conflock for nfsd4_lockt always be NULL too. So that, nfsd4 lockowner for it always be NULL too. This patch re-coping the fl_lmops to conflock. Signed-off-by: Kinglong Mee --- fs/locks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 717fbc4..cc1219a 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -279,7 +279,7 @@ void __locks_copy_lock(struct file_lock *new, const struct file_lock *fl) new->fl_start = fl->fl_start; new->fl_end = fl->fl_end; new->fl_ops = NULL; - new->fl_lmops = NULL; + new->fl_lmops = fl->fl_lmops; } EXPORT_SYMBOL(__locks_copy_lock); @@ -290,7 +290,6 @@ void locks_copy_lock(struct file_lock *new, struct file_lock *fl) __locks_copy_lock(new, fl); new->fl_file = fl->fl_file; new->fl_ops = fl->fl_ops; - new->fl_lmops = fl->fl_lmops; locks_copy_private(new, fl); }