<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/lockd/svclock.c, branch linux-2.6.28.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-02-17T17:28:51Z</updated>
<entry>
<title>lockd: fix regression in lockd's handling of blocked locks</title>
<updated>2009-02-17T17:28:51Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2009-02-04T22:35:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=489a11f8d0e81f0422752bddf3826543d243952e'/>
<id>urn:sha1:489a11f8d0e81f0422752bddf3826543d243952e</id>
<content type='text'>
commit 9d9b87c1218be78ddecbc85ec3bb91c79c1d56ab upstream.

If a client requests a blocking lock, is denied, then requests it again,
then here in nlmsvc_lock() we will call vfs_lock_file() without FL_SLEEP
set, because we've already queued a block and don't need the locks code
to do it again.

But that means vfs_lock_file() will return -EAGAIN instead of
FILE_LOCK_DENIED.  So we still need to translate that -EAGAIN return
into a nlm_lck_blocked error in this case, and put ourselves back on
lockd's block list.

The bug was introduced by bde74e4bc64415b1 "locks: add special return
value for asynchronous locks".

Thanks to Frank van Maarseveen for the report; his original test
case was essentially

	for i in `seq 30`; do flock /nfsmount/foo sleep 10 &amp; done

Tested-by: Frank van Maarseveen &lt;frankvm@frankvm.com&gt;
Reported-by: Frank van Maarseveen &lt;frankvm@frankvm.com&gt;
Cc: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>lockd: reject reclaims outside the grace period</title>
<updated>2008-10-03T20:19:20Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2008-02-06T20:05:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d22b1cff099737f74f3ac5950094508b4cddec1e'/>
<id>urn:sha1:d22b1cff099737f74f3ac5950094508b4cddec1e</id>
<content type='text'>
The current lockd does not reject reclaims that arrive outside of the
grace period.

Accepting a reclaim means promising to the client that no conflicting
locks were granted since last it held the lock.  We can meet that
promise if we assume the only lockers are nfs clients, and that they are
sufficiently well-behaved to reclaim only locks that they held before,
and that only reclaim locks have been permitted so far.  Once we leave
the grace period (and start permitting non-reclaims), we can no longer
keep that promise.  So we must start rejecting reclaims at that point.

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>lockd: move grace period checks to common code</title>
<updated>2008-10-03T20:19:19Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2008-02-06T18:59:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b2b5028905226f85075a408b1118857c9aa48bb3'/>
<id>urn:sha1:b2b5028905226f85075a408b1118857c9aa48bb3</id>
<content type='text'>
Do all the grace period checks in svclock.c.  This simplifies the code a
bit, and will ease some later changes.

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>locks: add special return value for asynchronous locks</title>
<updated>2008-07-25T17:53:47Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2008-07-25T08:48:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bde74e4bc64415b142e556a34d295a52a1b7da9d'/>
<id>urn:sha1:bde74e4bc64415b142e556a34d295a52a1b7da9d</id>
<content type='text'>
Use a special error value FILE_LOCK_DEFERRED to mean that a locking
operation returned asynchronously.  This is returned by

  posix_lock_file() for sleeping locks to mean that the lock has been
  queued on the block list, and will be woken up when it might become
  available and needs to be retried (either fl_lmops-&gt;fl_notify() is
  called or fl_wait is woken up).

  f_op-&gt;lock() to mean either the above, or that the filesystem will
  call back with fl_lmops-&gt;fl_grant() when the result of the locking
  operation is known.  The filesystem can do this for sleeping as well
  as non-sleeping locks.

This is to make sure, that return values of -EAGAIN and -EINPROGRESS by
filesystems are not mistaken to mean an asynchronous locking.

This also makes error handling in fs/locks.c and lockd/svclock.c slightly
cleaner.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Cc: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Cc: Matthew Wilcox &lt;matthew@wil.cx&gt;
Cc: David Teigland &lt;teigland@redhat.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-2.6.27' of git://linux-nfs.org/~bfields/linux</title>
<updated>2008-07-21T04:21:46Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2008-07-21T04:21:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14b395e35d1afdd8019d11b92e28041fad591b71'/>
<id>urn:sha1:14b395e35d1afdd8019d11b92e28041fad591b71</id>
<content type='text'>
* 'for-2.6.27' of git://linux-nfs.org/~bfields/linux: (51 commits)
  nfsd: nfs4xdr.c do-while is not a compound statement
  nfsd: Use C99 initializers in fs/nfsd/nfs4xdr.c
  lockd: Pass "struct sockaddr *" to new failover-by-IP function
  lockd: get host reference in nlmsvc_create_block() instead of callers
  lockd: minor svclock.c style fixes
  lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_lock
  lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_testlock
  lockd: nlm_release_host() checks for NULL, caller needn't
  file lock: reorder struct file_lock to save space on 64 bit builds
  nfsd: take file and mnt write in nfs4_upgrade_open
  nfsd: document open share bit tracking
  nfsd: tabulate nfs4 xdr encoding functions
  nfsd: dprint operation names
  svcrdma: Change WR context get/put to use the kmem cache
  svcrdma: Create a kmem cache for the WR contexts
  svcrdma: Add flush_scheduled_work to module exit function
  svcrdma: Limit ORD based on client's advertised IRD
  svcrdma: Remove unused wait q from svcrdma_xprt structure
  svcrdma: Remove unneeded spin locks from __svc_rdma_free
  svcrdma: Add dma map count and WARN_ON
  ...
</content>
</entry>
<entry>
<title>SUNRPC: Remove the BKL from the callback functions</title>
<updated>2008-07-15T22:10:57Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2008-06-11T17:37:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a86dc496b764ebb1431677b38eab45310e5a2ad4'/>
<id>urn:sha1:a86dc496b764ebb1431677b38eab45310e5a2ad4</id>
<content type='text'>
Push it into those callback functions that actually need it.

Note that all the NFS operations use their own locking, so don't need the
BKL. Ditto for the rpcbind client.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>lockd: get host reference in nlmsvc_create_block() instead of callers</title>
<updated>2008-07-15T19:40:25Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2008-07-15T19:05:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=560de0e65904db392e1c443c4bf5ee750573336b'/>
<id>urn:sha1:560de0e65904db392e1c443c4bf5ee750573336b</id>
<content type='text'>
It may not be obvious (till you look at the definition of
nlm_alloc_call()) that a function like nlmsvc_create_block() should
consume a reference on success or failure, so I find it clearer if it
takes the reference it needs itself.

And both callers already do this immediately before the call anyway.

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>lockd: minor svclock.c style fixes</title>
<updated>2008-07-15T19:28:43Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2008-07-15T18:38:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d7bbbbacc5202eaabbc232681cc325b22a73eeb'/>
<id>urn:sha1:6d7bbbbacc5202eaabbc232681cc325b22a73eeb</id>
<content type='text'>
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_lock</title>
<updated>2008-07-15T18:53:33Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2008-07-15T18:26:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6cde4de80773497d8333985b135f472eda870904'/>
<id>urn:sha1:6cde4de80773497d8333985b135f472eda870904</id>
<content type='text'>
nlmsvc_lock calls nlmsvc_lookup_host to find a nlm_host struct. The
callers of this function, however, call nlmsvc_retrieve_args or
nlm4svc_retrieve_args, which also return a nlm_host struct.

Change nlmsvc_lock to take a host arg instead of calling
nlmsvc_lookup_host itself and change the callers to pass a pointer to
the nlm_host they've already found.

Since nlmsvc_testlock() now just uses the caller's reference, we no
longer need to get or release it.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_testlock</title>
<updated>2008-07-15T18:26:52Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2008-07-15T18:06:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8f920d5e29f86d3425a68e1c3bc264d1f6f55112'/>
<id>urn:sha1:8f920d5e29f86d3425a68e1c3bc264d1f6f55112</id>
<content type='text'>
nlmsvc_testlock calls nlmsvc_lookup_host to find a nlm_host struct. The
callers of this functions, however, call nlmsvc_retrieve_args or
nlm4svc_retrieve_args, which also return a nlm_host struct.

Change nlmsvc_testlock to take a host arg instead of calling
nlmsvc_lookup_host itself and change the callers to pass a pointer to
the nlm_host they've already found.

We take a reference to host in the place where nlmsvc_testlock()
previous did a new lookup, so the reference counting is unchanged from
before.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
</feed>
