From owner-freebsd-questions@FreeBSD.ORG Sat Jan 14 01:25:36 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A40EF1065672 for ; Sat, 14 Jan 2012 01:25:36 +0000 (UTC) (envelope-from elon@emmi.physik-pool.tu-berlin.de) Received: from mail.tu-berlin.de (mail.tu-berlin.de [130.149.7.33]) by mx1.freebsd.org (Postfix) with ESMTP id 5D6798FC12 for ; Sat, 14 Jan 2012 01:25:36 +0000 (UTC) X-tubIT-Incoming-IP: 130.149.58.163 Received: from mail.physik-pool.tu-berlin.de ([130.149.58.163] helo=mail.physik.tu-berlin.de) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp for id 1RlsND-0006BB-Ex; Sat, 14 Jan 2012 02:25:35 +0100 Received: from emmi.physik-pool.tu-berlin.de (emmi.physik-pool.tu-berlin.de [130.149.58.146]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.physik.tu-berlin.de (Postfix) with ESMTPS id 7F9FA11404; Sat, 14 Jan 2012 02:25:32 +0100 (CET) Received: (from elon@localhost) by emmi.physik-pool.tu-berlin.de (8.14.4/8.14.4/Submit) id q0E1PW03023884; Sat, 14 Jan 2012 02:25:32 +0100 (CET) (envelope-from elon) Date: Sat, 14 Jan 2012 02:25:32 +0100 From: Leon =?iso-8859-15?Q?Me=DFner?= To: freebsd-questions@freebsd.org, l.messner@physik.tu-berlin.de Message-ID: <20120114012532.GA15012@emmi.physik-pool.tu-berlin.de> Mail-Followup-To: freebsd-questions@freebsd.org, l.messner@physik.tu-berlin.de References: <20120112163757.GA4174@emmi.physik-pool.tu-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20120112163757.GA4174@emmi.physik-pool.tu-berlin.de> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: NFSv4 and file locking X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 01:25:36 -0000 On Thu, Jan 12, 2012 at 05:37:57PM +0100, Leon Meßner wrote: > Hi, > > Does anyone know what you have to do to get locking working under NFSv4? > I tried the following: > > # mount_nfs -o nfsv4,sec=sys ip.nfsv4:/nfstest /mnt/test > # mount | grep ip.nfsv4 > ip.nfsv4:/nfstest on /mnt/test (newnfs) > # kldstat | grep nfs > 6 2 0xffffffff8103f000 1015f nfscommon.ko > 9 1 0xffffffff81054000 3008f nfscl.ko > # cd /mnt/test > # lockf testlockfile ls > lockf: cannot open testlockfile: Operation not supported Looks like lockf is the wrong tool for this job. I tried the NFSv4 lock testing suite from [1] and this worked flawlessly. I don't know if this test actually does what it claims to do but as i couldn't find any freebsd specific testing tool this will probably suffice. Thanks, Leon [1] http://nfsv4.bullopensource.org/tools/tests_index.php (see locks robustness)