07 Mar, 2007
4 commits
-
Provide a module param "pool_mode" for sunrpc.ko which allows a sysadmin to
choose the mode for mapping NFS thread service pools to CPUs. Values are:auto choose a mapping mode heuristically
global (default, same as the pre-2.6.19 code) a single global pool
percpu one pool per CPU
pernode one pool per NUMA nodeNote that since 2.6.19 the hardcoded behaviour has been "auto", this patch
makes the default "global".The pool mode can be changed after boot/modprobe using /sys, if the NFS and
lockd services have been shut down. A useful side effect of this change is to
fix a small memory leak when unloading the module.Signed-off-by: Greg Banks
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
When the last thread of nfsd exits, it shuts down all related sockets. It
currently uses svc_close_socket to do this, but that only is immediately
effective if the socket is not SK_BUSY.If the socket is busy - i.e. if a request has arrived that has not yet been
processes - svc_close_socket is not effective and the shutdown process spins.So create a new svc_force_close_socket which removes the SK_BUSY flag is set
and then calls svc_close_socket.Also change some open-codes loops in svc_destroy to use
list_for_each_entry_safe.Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
They don't really save that much, and aren't worth the hassle.
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The sunrpc server code needs to know the source and destination address for
UDP packets so it can reply properly. It currently copies code out of the
network stack to pick the pieces out of the skb. This is ugly and causes
compile problems with the IPv6 stuff.So, rip that out and use recv_msg instead. This is a much cleaner interface,
but has a slight cost in that the checksum is now checked before the copy, so
we don't benefit from doing both at the same time. This can probably be
fixed.Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
21 Feb, 2007
2 commits
-
We frequently need the maximum number of possible processors in order to
allocate arrays for all processors. So far this was done using
highest_possible_processor_id(). However, we do need the number of
processors not the highest id. Moreover the number was so far dynamically
calculated on each invokation. The number of possible processors does not
change when the system is running. We can therefore calculate that number
once.Signed-off-by: Christoph Lameter
Cc: Frederik Deweerdt
Cc: Neil Brown
Cc: Trond Myklebust
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
highest_possible_node_id() is currently used to calculate the last possible
node idso that the network subsystem can figure out how to size per node
arrays.I think having the ability to determine the maximum amount of nodes in a
system at runtime is useful but then we should name this entry
correspondingly, it should return the number of node_ids, and the the value
needs to be setup only once on bootup. The node_possible_map does not
change after bootup.This patch introduces nr_node_ids and replaces the use of
highest_possible_node_id(). nr_node_ids is calculated on bootup when the
page allocators pagesets are initialized.[deweerdt@free.fr: fix oops]
Signed-off-by: Christoph Lameter
Cc: Neil Brown
Cc: Trond Myklebust
Signed-off-by: Frederik Deweerdt
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
15 Feb, 2007
5 commits
-
The semantic effect of insert_at_head is that it would allow new registered
sysctl entries to override existing sysctl entries of the same name. Which is
pain for caching and the proc interface never implemented.I have done an audit and discovered that none of the current users of
register_sysctl care as (excpet for directories) they do not register
duplicate sysctl entries.So this patch simply removes the support for overriding existing entries in
the sys_sysctl interface since no one uses it or cares and it makes future
enhancments harder.Signed-off-by: Eric W. Biederman
Acked-by: Ralf Baechle
Acked-by: Martin Schwidefsky
Cc: Russell King
Cc: David Howells
Cc: "Luck, Tony"
Cc: Ralf Baechle
Cc: Paul Mackerras
Cc: Martin Schwidefsky
Cc: Andi Kleen
Cc: Jens Axboe
Cc: Corey Minyard
Cc: Neil Brown
Cc: "John W. Linville"
Cc: James Bottomley
Cc: Jan Kara
Cc: Trond Myklebust
Cc: Mark Fasheh
Cc: David Chinner
Cc: "David S. Miller"
Cc: Patrick McHardy
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
We don't need this to prevent module unload races so remove the unnecessary
code.Signed-off-by: Eric W. Biederman
Cc: Trond Myklebust
Cc: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Because the sunrpc sysctls don't conflict with any other sysctls the setting
the insert at head flag to register_sysctl has no semantic meaning.Signed-off-by: Eric W. Biederman
Cc: Trond Myklebust
Cc: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there. Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm. I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).Signed-off-by: Tim Schmielau
Acked-by: Russell King
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
AUTH_UNIX authentication (the standard with NFS) has a limit of 16 groups ids.
This causes problems for people in more than 16 groups.So allow the server to map a uid into a list of group ids based on local
knowledge rather depending on the (possibly truncated) list from the client.If there is no process on the server responding to upcalls, the gidlist in the
request will still be used.Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Feb, 2007
17 commits
-
Conflicts:
net/sunrpc/auth_gss/gss_krb5_crypto.c
net/sunrpc/auth_gss/gss_spkm3_token.c
net/sunrpc/clnt.cMerge with mainline and fix conflicts.
-
RFC3530 section 3.1.1 states an NFSv4 client MUST NOT send a request
twice on the same connection unless it is the NULL procedure. Section
3.1.1 suggests that the client should disconnect and reconnect if it
wants to retry a request.Implement this by adding an rpc_clnt flag that an ULP can use to
specify that the underlying transport should be disconnected on a
major timeout. The NFSv4 client asserts this new flag, and requests
no retries after a minor retransmit timeout.Note that disconnecting on a retransmit is in general not safe to do
if the RPC client does not reuse the TCP port number when reconnecting.See http://bugzilla.linux-nfs.org/show_bug.cgi?id=6
Signed-off-by: Chuck Lever
Signed-off-by: Trond Myklebust -
Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.Signed-off-by: Arjan van de Ven
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Replace existing svc_create_socket() API to allow callers to pass addresses
larger than a sockaddr_in.Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add support for IPv6 addresses in the RPC server's UDP receive path.
[akpm@linux-foundation.org: cleanups]
Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Modify svc_tcp_accept to support connecting on IPv6 sockets.
Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The only reason svcsock.c looks at a sockaddr's port is to check whether the
remote peer is connecting from a privileged port. Refactor this check to hide
processing that is specific to address format.Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
CMSG_DATA comes in different sizes, depending on address family.
[akpm@linux-foundation.org: remove unneeded do/while (0)]
Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The rq_daddr field must support larger addresses.
Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Expand the rq_addr field to allow it to contain larger addresses.
Specifically, we replace a 'sockaddr_in' with a 'sockaddr_storage', then
everywhere the 'sockaddr_in' was referenced, we use instead an accessor
function (svc_addr_in) which safely casts the _storage to _in.Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Sockaddr_storage will allow us to store arbitrary socket addresses in the
svc_deferred_req struct.Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
There are loads of places where the RPC server assumes that the rq_addr fields
contains an IPv4 address. Top among these are error and debugging messages
that display the server's IP address.Let's refactor the address printing into a separate function that's smart
enough to figure out the difference between IPv4 and IPv6 addresses.Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Clean-up: msg_name and msg_namelen are not used by sock_recvmsg, so don't
bother to set them in svc_recvfrom.Signed-off-by: Chuck Lever
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The remote peer's address won't change after the socket has been accepted. We
don't need to call ->getname on every incoming request.Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Rather than calling svc_sock_enqueue at the end of svc_setup_socket, we now
call it (via svc_sock_recieved) after calling svc_setup_socket at each call
site.We do this because a subsequent patch will insert some code between the two
calls at one call site.Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Sometimes we need to create an RPC service but not register it with the local
portmapper. NFSv4 delegation callback, for example.Change the svc_makesock() API to allow optionally creating temporary or
permanent sockets, optionally registering with the local portmapper, and make
it return the ephemeral port of the new socket.Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Currently in the RPC server, registering with the local portmapper and
creating "permanent" sockets are tied together. Expand the internal APIs to
allow these two socket characteristics to be separately specified.This will be externalized in the next patch.
Signed-off-by: Chuck Lever
Cc: Aurelien Charbon
Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Feb, 2007
1 commit
-
Signed-off-by: YOSHIFUJI Hideaki
Signed-off-by: David S. Miller
10 Feb, 2007
1 commit
-
If you lose this race, it can iput a socket inode twice and you get a BUG
in fs/inode.cWhen I added the option for user-space to close a socket, I added some
cruft to svc_delete_socket so that I could call that function when closing
a socket per user-space request.This was the wrong thing to do. I should have just set SK_CLOSE and let
normal mechanisms do the work.Not only wrong, but buggy. The locking is all wrong and it openned up a
race where-by a socket could be closed twice.So this patch:
Introduces svc_close_socket which sets SK_CLOSE then either leave
the close up to a thread, or calls svc_delete_socket if it can
get SK_BUSY.Adds a bias to sk_busy which is removed when SK_DEAD is set,
This avoid races around shutting down the socket.Changes several 'spin_lock' to 'spin_lock_bh' where the _bh
was missing.Bugzilla-url: http://bugzilla.kernel.org/show_bug.cgi?id=7916
Signed-off-by: Neil Brown
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Feb, 2007
5 commits
-
Currently only root can trigger a referral automount because only root
can access rpc_pipefs directories. Enabling read access to non-root
should be harmless (they can still not access the pipes themselves)
and will suffice to fix this problem.Signed-off-by: Trond Myklebust
-
The tk_pid field is an unsigned short. The proper print format specifier for
that type is %5u, not %4d.Also clean up some miscellaneous print formatting nits.
Signed-off-by: Chuck Lever
Signed-off-by: Trond Myklebust -
The tk_pid field is an unsigned short. The proper print format specifier for
that type is %5u, not %4d.Also clean up some miscellaneous print formatting nits.
Signed-off-by: Chuck Lever
Signed-off-by: Trond Myklebust -
The error values are already propagated through task->tk_status, and
none of the callers check one without checking the other, so we can
drop the return value.Signed-off-by: Trond Myklebust
-
rpc_run_task is guaranteed to always call ->rpc_release.
Signed-off-by: Trond Myklebust
31 Jan, 2007
1 commit
-
Also remove {NFSD,RPC}_PARANOIA as having the defines doesn't really add
anything.The printks covered by RPC_PARANOIA were triggered by badly formatted
packets and so should be ratelimited.Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
27 Jan, 2007
2 commits
-
NFSd assumes that largest number of pages that will be needed for a
request+response is 2+N where N pages is the size of the largest permitted
read/write request. The '2' are 1 for the non-data part of the request, and 1
for the non-data part of the reply.However, when a read request is not page-aligned, and we choose to use
->sendfile to send it directly from the page cache, we may need N+1 pages to
hold the whole reply. This can overflow and array and cause an Oops.This patch increases size of the array for holding pages by one and makes sure
that entry is NULL when it is not in use.Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Due to silly typos, if the nfs versions are explicitly set, no NFSACL versions
get enabled.Also improve an error message that would have made this bug a little easier to
find.Signed-off-by: Neil Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
25 Jan, 2007
1 commit
-
Fix the Oops in http://bugzilla.linux-nfs.org/show_bug.cgi?id=138
We shouldn't be calling rpc_release_task() for tasks that are not active.Signed-off-by: Trond Myklebust
Signed-off-by: Linus Torvalds
23 Dec, 2006
1 commit
-
Return error and prevent from loading module when gss_mech_register()
failed.Cc: Andy Adamson
Cc: J. Bruce Fields
Acked-by: Trond Myklebust
Signed-off-by: Akinobu Mita
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds