<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/sunrpc/cache.h, branch v2.6.16.45</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.16.45</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.16.45'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2005-09-07T23:57:25Z</updated>
<entry>
<title>[PATCH] sunrpc: cache_register can use wrong module reference</title>
<updated>2005-09-07T23:57:25Z</updated>
<author>
<name>Bruce Allan</name>
<email>bwa@us.ibm.com</email>
</author>
<published>2005-09-06T22:17:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f35279d3f713e5c97b98cbdbf47d98f79942c11f'/>
<id>urn:sha1:f35279d3f713e5c97b98cbdbf47d98f79942c11f</id>
<content type='text'>
When registering an RPC cache, cache_register() always sets the owner as the
sunrpc module.  However, there are RPC caches owned by other modules.  With
the incorrect owner setting, the real owning module can be removed potentially
with an open reference to the cache from userspace.

For example, if one were to stop the nfs server and unmount the nfsd
filesystem, the nfsd module could be removed eventhough rpc.idmapd had
references to the idtoname and nametoid caches (i.e.
/proc/net/rpc/nfs4.&lt;cachename&gt;/channel is still open).  This resulted in a
system panic on one of our machines when attempting to restart the nfs
services after reloading the nfsd module.

The following patch adds a 'struct module *owner' field in struct
cache_detail.  The owner is further assigned to the struct proc_dir_entry
in cache_register() so that the module cannot be unloaded while user-space
daemons have an open reference on the associated file under /proc.

Signed-off-by: Bruce Allan &lt;bwa@us.ibm.com&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Cc: Neil Brown &lt;neilb@cse.unsw.edu.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] nfsd: discard CACHE_HASHED flag, keeping information in refcount instead.</title>
<updated>2005-03-05T01:15:09Z</updated>
<author>
<name>Neil Brown</name>
<email>neilb@cse.unsw.edu.au</email>
</author>
<published>2005-03-05T01:15:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ba15d6aa95ae689b083a133a3689ff95f4c47321'/>
<id>urn:sha1:ba15d6aa95ae689b083a133a3689ff95f4c47321</id>
<content type='text'>
This patch should fix a problem that has been experienced on at-least one
busy NFS server, but it has not had lots of testing yet.  If -mm could provide
that .....

The rpc auth cache currently differentiates between a reference due to
being in a hash chain (signalled by CACHE_HASHED flag) and any other
reference (counted in refcnt).

This is an artificial difference due to an historical accident, and it
makes cache_put unsafe.

This patch removes the distinction so now existance in a hash chain is
counted just like any other reference.  Thus a race window in cache_put is
closed.

Signed-off-by: Neil Brown &lt;neilb@cse.unsw.edu.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[SUNRPC]: Staticize, kill unused functions, and remove unneeded exports.</title>
<updated>2004-12-27T10:29:36Z</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@stusta.de</email>
</author>
<published>2004-12-27T10:29:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4d9caa15d23cc2891c4509b8337935ab4c2cab40'/>
<id>urn:sha1:4d9caa15d23cc2891c4509b8337935ab4c2cab40</id>
<content type='text'>
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>[PATCH] nfsd: simplify auth_domain_lookup</title>
<updated>2004-08-23T06:00:59Z</updated>
<author>
<name>Neil Brown</name>
<email>neilb@cse.unsw.edu.au</email>
</author>
<published>2004-08-23T06:00:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=086aa2c5b81b0bf6af86a136f295bca6aad70680'/>
<id>urn:sha1:086aa2c5b81b0bf6af86a136f295bca6aad70680</id>
<content type='text'>
The interface between the auth_domain and the cache code is messy; the
auth_domain code is the only real user of the full 11-argument
DefineCacheLookup, and does weird stuff with it (like passing in through one
of the arguments a bit of code with a conditional return).

We could further parametrize DefineCacheLookup, but I think it's already too
complicated.

My solution is to just ignore DefineCacheLookup and write the
auth_domain_lookup function from scratch.  It's actually a pretty short
function (much simpler than DefineCacheLookup itself), and it's much easier to
read this short function than it is to read some special-cased
DefineCacheLookup to verify that it does what it says it does....

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Signed-off-by: Neil Brown &lt;neilb@cse.unsw.edu.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] nfsd: make cache_init initialize reference count to 1</title>
<updated>2004-08-23T06:00:47Z</updated>
<author>
<name>Neil Brown</name>
<email>neilb@cse.unsw.edu.au</email>
</author>
<published>2004-08-23T06:00:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0be5edbc2e0626ec327a29ee9555fd93f6332dc4'/>
<id>urn:sha1:0be5edbc2e0626ec327a29ee9555fd93f6332dc4</id>
<content type='text'>
Presumably anyone creating a new cache entry is going to want a reference on
that cache; and indeed every caller of cache_init increments the reference
count immediately afterwards.  So may as well make cache_init set an initial
reference count of 1.

Also, note that cache_init initializes the flags; callers don't need to.

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Signed-off-by: Neil Brown &lt;neilb@cse.unsw.edu.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Prevent scary warnings from knfsd</title>
<updated>2004-05-25T01:36:31Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2004-05-25T01:36:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ed8d9961f3c411b5b3ab2a673e66bfc01827a46b'/>
<id>urn:sha1:ed8d9961f3c411b5b3ab2a673e66bfc01827a46b</id>
<content type='text'>
From: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;

The kernel currently prints:

 nfsd: nobody listening for auth.unix.ip upcall; has some daemon not been started?

on every bootup, during initscripts.

Neil Brown &lt;neilb@cse.unsw.edu.au&gt; says:

  It was part of the recent set of idmapper patches.  Bruce wanted the admin
  to get a warning when the idmapper daemon wasn't running.  I thought the
  same warning should apply to any daemon that responded to upcalls.

  In the case of auth.unix.ip it isn't strictly necessary for a daemon to be
  running (for comparability with 2.4).

  You can get rid of the warning by doing:

    mount -t nfsd nfsd /proc/fs/nfs

  before mountd is started (init scripts should start doing this I hope, but
  distributions don't tend to use the init script from nfs-utils, so it is
  hard to push it).  This will trigger mountd to listen on auth.unix.ip and
  others.


That's a hassle, so Bruce's patch limits the warning purely to the new
idmapper cache.  It provides a callback in the cache_detail that individual
caches can use to log messages when upcalls fail because a userspace daemon
not running.  Implement this method for the idmapping caches.
</content>
</entry>
<entry>
<title>[PATCH] kNFSd: Add a warning when upcalls fail,</title>
<updated>2004-05-19T09:41:00Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2004-05-19T09:41:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=eeb6f17bd6b7eb4826da599e38cd9108c9b6aba5'/>
<id>urn:sha1:eeb6f17bd6b7eb4826da599e38cd9108c9b6aba5</id>
<content type='text'>
From: NeilBrown &lt;neilb@cse.unsw.edu.au&gt;

From: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;

To help the user diagnose problems caused by user-level daemons not running.
</content>
</entry>
<entry>
<title>[PATCH] kNFSd: Make sure CACHE_NEGATIVE is cleared when a cache entry is updates.</title>
<updated>2004-05-19T09:39:35Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2004-05-19T09:39:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=00979a9fd0c7f162d5c2c262425936bf4788ded0'/>
<id>urn:sha1:00979a9fd0c7f162d5c2c262425936bf4788ded0</id>
<content type='text'>
From: NeilBrown &lt;neilb@cse.unsw.edu.au&gt;

This is important for update-in-place caches which may change from being
negative to posative.

Thanks to "J.  Bruce Fields" &lt;bfields@fieldses.org&gt; and Olaf Kirch
&lt;okir@suse.de&gt;
</content>
</entry>
<entry>
<title>[PATCH] kNFSd: Allow sunrpc/svc cache init function to modify the "key"</title>
<updated>2004-02-18T12:50:28Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2004-02-18T12:50:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9417bd876933c8d72662f15379c1e79721bbf86c'/>
<id>urn:sha1:9417bd876933c8d72662f15379c1e79721bbf86c</id>
<content type='text'>
From: NeilBrown &lt;neilb@cse.unsw.edu.au&gt;

When adding a item to a sunrpc/svc cache that contains kmalloced data it is
usefully to move the malloced data out of the key object into the new cache
object rather than copying (as then we would need to cope with kmalloc
failure and such).  This means modifying the original.

If the kmalloced data forms part of the key, then we must not move the data
out until after the key isn't needed any more.  So this patch moves the
call to "INIT" on a new item (which fills in the key) to *after* the item
has been found (or not), and also makes sure we only call the HASH function
once.

Thanks to "J.  Bruce Fields" &lt;bfields@fieldses.org&gt;

also

 1/ remove unnecessary assignment
 2/ fix comments that lag behind implementation.
</content>
</entry>
<entry>
<title>[PATCH] NFS/RPC modprobe -r sunrpc causes an oops</title>
<updated>2004-01-20T11:17:23Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2004-01-20T11:17:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d54eb7239f5dcc41157ad80d2e186f68ed1e54a0'/>
<id>urn:sha1:d54eb7239f5dcc41157ad80d2e186f68ed1e54a0</id>
<content type='text'>
From: Steve Dickson &lt;SteveD@redhat.com&gt;

Here is a patch for the 2.6.1 kernel that fixes an oops that occurs when
the sunrpc module is unloaded.

The problem was the RPC cache_register() call was not saving entry pointers
to the procfs entries it was creating.  So when it came time to dismantle
the entires, a BUG_ON() was tripped in remove_proc_entry() since the tree
was not broken down completely.

(acked by neilb)
</content>
</entry>
</feed>
