From patchwork Sun Nov 28 21:04:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Vlasov X-Patchwork-Id: 362532 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oASLAas7015994 for ; Sun, 28 Nov 2010 21:10:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985Ab0K1VKe (ORCPT ); Sun, 28 Nov 2010 16:10:34 -0500 Received: from vint.altlinux.org ([194.107.17.35]:34628 "EHLO vint.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751961Ab0K1VKe (ORCPT ); Sun, 28 Nov 2010 16:10:34 -0500 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 28 Nov 2010 21:10:37 +0000 (UTC) X-Greylist: delayed 387 seconds by postgrey-1.27 at vger.kernel.org; Sun, 28 Nov 2010 16:10:33 EST Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38]) by vint.altlinux.org (Postfix) with ESMTP id 2E371226C006; Sun, 28 Nov 2010 21:04:05 +0000 (UTC) Received: by imap.altlinux.org (Postfix, from userid 617) id 1B1B03F75036; Mon, 29 Nov 2010 00:04:04 +0300 (MSK) From: Sergey Vlasov To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Morozov , Sergey Vlasov , Subject: [PATCH] NFS: Fix fcntl F_GETLK not reporting some conflicts Date: Mon, 29 Nov 2010 00:04:05 +0300 Message-Id: <1290978245-14415-1-git-send-email-vsu@altlinux.ru> X-Mailer: git-send-email 1.7.3.2 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 60677f9..7bf029e 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -693,6 +693,7 @@ do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) { struct inode *inode = filp->f_mapping->host; int status = 0; + unsigned int saved_type = fl->fl_type; /* Try local locking first */ posix_test_lock(filp, fl); @@ -700,6 +701,7 @@ do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) /* found a conflict */ goto out; } + fl->fl_type = saved_type; if (nfs_have_delegation(inode, FMODE_READ)) goto out_noconflict;