From: Stephen Rothwell Subject: Re: open sleeps Date: Fri, 20 Jun 2008 10:20:03 +1000 Message-ID: <20080620102003.8dd1270c.sfr@canb.auug.org.au> References: <485AE866.6070206@vpac.org> <20080620095813.22fb518e.sfr@canb.auug.org.au> <485AF4BE.6090409@vpac.org> Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Fri__20_Jun_2008_10_20_03_+1000_1GJoMHYa0h012CzS" Cc: linux-fsdevel@vger.kernel.org To: Brian May Return-path: Received: from chilli.pcug.org.au ([203.10.76.44]:57911 "EHLO smtps.tip.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752074AbYFTAUM (ORCPT ); Thu, 19 Jun 2008 20:20:12 -0400 In-Reply-To: <485AF4BE.6090409@vpac.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --Signature=_Fri__20_Jun_2008_10_20_03_+1000_1GJoMHYa0h012CzS Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, 20 Jun 2008 10:07:26 +1000 Brian May wrote: > > Stephen Rothwell wrote: > > So, it would seem some other process has taken write leases on your > > files but does not release them in a timely manner. You can see the > > current leases in /proc/locks. > > =20 > What is a lease? Is this a kernel level thing or user level thing? Its what samba calls an oplock. Its like a kernel file lock but it blocks opens and notifies the holder (who is supposed to clean up and release the lease). If the lease is not released in 45 seconds (by default) then the kernel assumes that the holder is broken and breaks the lease and allows the open to proceed. > What is the format of /proc/locks? I assume the 4th field is PID, what=20 > is the next field? How do I work out what is locked? the format is: index: type status subtype pid major:minor:inode start end for leases, type is LEASE status is ACTIVE, BREAKING or BREAKER, subtype is UNLCK, READ or WRITE. If there is a "->" infromt of the type, then the process described by this line is blocked by the first line with the same index. You can see the inode number of a file using "ls -i". --=20 Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ --Signature=_Fri__20_Jun_2008_10_20_03_+1000_1GJoMHYa0h012CzS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkha97MACgkQTgG2atn1QN8xXgCfXct/R+ITrmmTLjAaUy4N+MIO PbYAoJjxpUDMmjVamF3G1lBkqW14mZD2 =GHdi -----END PGP SIGNATURE----- --Signature=_Fri__20_Jun_2008_10_20_03_+1000_1GJoMHYa0h012CzS--