From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Staubach Subject: Re: [PATCH] fix posix lock on NFS Date: Tue, 03 Jan 2006 14:39:24 -0500 Message-ID: <43BAD2EC.2030807@redhat.com> References: <20051222.132454.1025208517.masano@tnes.nec.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: trond.myklebust@fys.uio.no, matthew@wil.cx, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from mx1.redhat.com ([66.187.233.31]:17292 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S932465AbWACTja (ORCPT ); Tue, 3 Jan 2006 14:39:30 -0500 To: ASANO Masahiro In-Reply-To: <20051222.132454.1025208517.masano@tnes.nec.co.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org ASANO Masahiro wrote: >--- > >--- linux-2.6.15-rc6/fs/nfs/file.c.orig 2005-12-21 21:30:14.000000000 +0900 >+++ linux-2.6.15-rc6/fs/nfs/file.c 2005-12-21 21:42:16.000000000 +0900 >@@ -524,7 +524,8 @@ static int nfs_lock(struct file *filp, i > return -EINVAL; > > /* No mandatory locks over NFS */ >- if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) >+ if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID && >+ fl->fl_type != F_UNLCK) > return -ENOLCK; > > if (IS_GETLK(cmd)) > Just out of curiosity, what is this if() statement intended to protect? For locking purposes, why would the client care if the file has the mandatory lock bits set? Thanx... ps