<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/lockd/svclock.c, branch linux-2.6.24.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.24.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.24.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2007-10-09T19:38:26Z</updated>
<entry>
<title>NLM: Fix a memory leak in nlmsvc_testlock</title>
<updated>2007-10-09T19:38:26Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2007-10-09T15:04:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6d85430424d44e946e0946bfaad607115510989'/>
<id>urn:sha1:a6d85430424d44e946e0946bfaad607115510989</id>
<content type='text'>
The recent fix for a circular lock dependency unfortunately introduced a
potential memory leak in the event where the call to nlmsvc_lookup_host
fails for some reason.

Thanks to Roel Kluin for spotting this.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>NLM: Fix a circular lock dependency in lockd</title>
<updated>2007-09-26T16:22:04Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2007-09-25T19:55:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=255129d1e9ca0ed3d69d5517fae3e03d7ab4b806'/>
<id>urn:sha1:255129d1e9ca0ed3d69d5517fae3e03d7ab4b806</id>
<content type='text'>
The problem is that the garbage collector for the 'host' structures
nlm_gc_hosts(), holds nlm_host_mutex while calling down to
nlmsvc_mark_resources, which, eventually takes the file-&gt;f_mutex.

We cannot therefore call nlmsvc_lookup_host() from within
nlmsvc_create_block, since the caller will already hold file-&gt;f_mutex, so
the attempt to grab nlm_host_mutex may deadlock.

Fix the problem by calling nlmsvc_lookup_host() outside the file-&gt;f_mutex.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockd and nfsd endianness annotation fixes</title>
<updated>2007-07-26T18:11:56Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2007-07-26T16:33:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca5c8cde93d65db3139604ca6b91bf8ff3f775e2'/>
<id>urn:sha1:ca5c8cde93d65db3139604ca6b91bf8ff3f775e2</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockd: add code to handle deferred lock requests</title>
<updated>2007-05-07T00:38:50Z</updated>
<author>
<name>Marc Eshel</name>
</author>
<published>2006-11-28T21:27:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a8322b2b02071b0c7ac37a28357b93e6362f13e'/>
<id>urn:sha1:1a8322b2b02071b0c7ac37a28357b93e6362f13e</id>
<content type='text'>
Rewrite nlmsvc_lock() to use the asynchronous interface.

As with testlock, we answer nlm requests in nlmsvc_lock by first looking up
the block and then using the results we find in the block if B_QUEUED is
set, and calling vfs_lock_file() otherwise.

If this a new lock request and we get -EINPROGRESS return on a non-blocking
request then we defer the request.

Also modify nlmsvc_unlock() to call the filesystem method if appropriate.

Signed-off-by: Marc Eshel &lt;eshel@almaden.ibm.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>lockd: always preallocate block in nlmsvc_lock()</title>
<updated>2007-05-07T00:38:50Z</updated>
<author>
<name>Marc Eshel</name>
</author>
<published>2006-12-06T04:48:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f812048020282fdfa9b72a6cf539c33b6df1fd07'/>
<id>urn:sha1:f812048020282fdfa9b72a6cf539c33b6df1fd07</id>
<content type='text'>
Normally we could skip ever having to allocate a block in the case where
the client asks for a non-blocking lock, or asks for a blocking lock that
succeeds immediately.

However we're going to want to always look up a block first in order to
check whether we're revisiting a deferred lock call, and to be prepared to
handle the case where the filesystem returns -EINPROGRESS--in that case we
want to make sure the lock we've given the filesystem is the one embedded
in the block that we'll use to track the deferred request.

Signed-off-by: Marc Eshel &lt;eshel@almaden.ibm.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>lockd: handle test_lock deferrals</title>
<updated>2007-05-07T00:38:50Z</updated>
<author>
<name>Marc Eshel</name>
</author>
<published>2006-11-28T21:27:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5ea0d75037b93baa453b4d326c6319968fe91cea'/>
<id>urn:sha1:5ea0d75037b93baa453b4d326c6319968fe91cea</id>
<content type='text'>
Rewrite nlmsvc_testlock() to use the new asynchronous interface: instead of
immediately doing a posix_test_lock(), we first look for a matching block.
If the subsequent test_lock returns anything other than -EINPROGRESS, we
then remove the block we've found and return the results.

If it returns -EINPROGRESS, then we defer the lock request.

In the case where the block we find in the first step has B_QUEUED set,
we bypass the vfs_test_lock entirely, instead using the block to decide how
to respond:
	with nlm_lck_denied if B_TIMED_OUT is set.
	with nlm_granted if B_GOT_CALLBACK is set.
	by dropping if neither B_TIMED_OUT nor B_GOT_CALLBACK is set

Signed-off-by: Marc Eshel &lt;eshel@almaden.ibm.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>lockd: pass cookie in nlmsvc_testlock</title>
<updated>2007-05-07T00:38:50Z</updated>
<author>
<name>Marc Eshel</name>
</author>
<published>2006-11-28T21:27:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=85f3f1b3f7a6197b51a2ab98d927517df730214c'/>
<id>urn:sha1:85f3f1b3f7a6197b51a2ab98d927517df730214c</id>
<content type='text'>
Change NLM internal interface to pass more information for test lock; we
need this to make sure the cookie information is pushed down to the place
where we do request deferral, which is handled for testlock by the
following patch.

Signed-off-by: Marc Eshel &lt;eshel@almaden.ibm.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>lockd: handle fl_grant callbacks</title>
<updated>2007-05-07T00:38:50Z</updated>
<author>
<name>Marc Eshel</name>
</author>
<published>2006-11-28T21:26:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e4ac9d93515b27fd7635332d73eae3192ed5d4e'/>
<id>urn:sha1:0e4ac9d93515b27fd7635332d73eae3192ed5d4e</id>
<content type='text'>
Add code to handle file system callback when the lock is finally granted.

Signed-off-by: Marc Eshel &lt;eshel@almaden.ibm.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>lockd: save lock state on deferral</title>
<updated>2007-05-07T00:38:50Z</updated>
<author>
<name>Marc Eshel</name>
</author>
<published>2006-11-28T21:26:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b36f412ab6f2e5b64af9832b20eb7ef67d025b4'/>
<id>urn:sha1:2b36f412ab6f2e5b64af9832b20eb7ef67d025b4</id>
<content type='text'>
We need to keep some state for a pending asynchronous lock request, so this
patch adds that state to struct nlm_block.

This also adds a function which defers the request, by calling
rqstp-&gt;rq_chandle.defer and storing the resulting deferred request in a
nlm_block structure which we insert into lockd's global block list.  That
new function isn't called yet, so it's dead code until a later patch.

Signed-off-by: Marc Eshel &lt;eshel@almaden.ibm.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>locks: allow {vfs,posix}_lock_file to return conflicting lock</title>
<updated>2007-05-06T23:23:24Z</updated>
<author>
<name>Marc Eshel</name>
</author>
<published>2007-01-18T21:15:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=150b393456e5a23513cace286a019e87151e47f0'/>
<id>urn:sha1:150b393456e5a23513cace286a019e87151e47f0</id>
<content type='text'>
The nfsv4 protocol's lock operation, in the case of a conflict, returns
information about the conflicting lock.

It's unclear how clients can use this, so for now we're not going so far as to
add a filesystem method that can return a conflicting lock, but we may as well
return something in the local case when it's easy to.

Signed-off-by: Marc Eshel &lt;eshel@almaden.ibm.com&gt;
Signed-off-by: "J. Bruce Fields" &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
</feed>
