18 Dec, 2012
2 commits
-
Note the stateid is hashed early on in init_stid(), but isn't currently
being unhashed on error paths.Signed-off-by: J. Bruce Fields
-
To ensure ordering of read data with any following operations, turn off
zero copy if the read is not the final operation in the compound.Signed-off-by: J. Bruce Fields
11 Dec, 2012
2 commits
-
I honestly have no idea where I got 129 from, but it's a much bigger
value than the actual buffer size (INET6_ADDRSTRLEN).Signed-off-by: Bryan Schumaker
Signed-off-by: J. Bruce Fields -
This patch makes main step in NFSd containerisation.
There could be different approaches to how to make NFSd able to handle
incoming RPC request from different network namespaces. The two main
options are:1) Share NFSd kthreads betwween all network namespaces.
2) Create separated pool of threads for each namespace.While first approach looks more flexible, second one is simpler and
non-racy. This patch implements the second option.To make it possible to allocate separate pools of threads, we have to
make it possible to allocate separate NFSd service structures per net.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields
04 Dec, 2012
1 commit
-
Fix nfsd4_lockt and release_lockowner to lookup the referenced client,
so that it can renew it, or correctly return "expired", as appropriate.Also share some code while we're here.
Reported-by: Frank Filz
Signed-off-by: J. Bruce Fields
03 Dec, 2012
8 commits
-
Write the client's ip address to any state file and all appropriate
state for that client will be forgotten.Signed-off-by: Bryan Schumaker
Signed-off-by: J. Bruce Fields -
I also log basic information that I can figure out about the type of
state (such as number of locks for each client IP address). This can be
useful for checking that state was actually dropped and later for
checking if the client was able to recover.Signed-off-by: Bryan Schumaker
Signed-off-by: J. Bruce Fields -
The eventual goal is to forget state based on ip address, so it makes
sense to call this function in a for-each-client loop until the correct
amount of state is forgotten. I also use this patch as an opportunity
to rename the forget function from "func()" to "forget()".Signed-off-by: Bryan Schumaker
Signed-off-by: J. Bruce Fields -
Once I have a client, I can easily use its delegation list rather than
searching the file hash table for delegations to remove.Signed-off-by: Bryan Schumaker
Signed-off-by: J. Bruce Fields -
Using "forget_n_state()" forces me to implement the code needed to
forget a specific client's openowners.Signed-off-by: Bryan Schumaker
Signed-off-by: J. Bruce Fields -
I use the new "forget_n_state()" function to iterate through each client
first when searching for locks. This may slow down forgetting locks a
little bit, but it implements most of the code needed to forget a
specified client's locks.Signed-off-by: Bryan Schumaker
Signed-off-by: J. Bruce Fields -
I added in a generic for-each loop that takes a pass over the client_lru
list for the current net namespace and calls some function. The next few
patches will update other operations to use this function as well. A value
of 0 still means "forget everything that is found".Signed-off-by: Bryan Schumaker
Signed-off-by: J. Bruce Fields -
Each function touches state in some way, so getting the lock earlier
can help simplify code.Signed-off-by: Bryan Schumaker
Signed-off-by: J. Bruce Fields
29 Nov, 2012
1 commit
-
There were only a small number of functions in this file and since they
all affect stored state I think it makes sense to put them in state.h
instead. I also dropped most static inline declarations since there are
no callers when fault injection is not enabled.Signed-off-by: Bryan Schumaker
Signed-off-by: J. Bruce Fields
28 Nov, 2012
8 commits
-
Grace time is a part of NFSv4 state engine, which is constructed per network
namespace.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
Lease time is a part of NFSv4 state engine, which is constructed per network
namespace.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
Split NFSv4 state init and shutdown into two different calls: per-net one and
generic one.
Per-net cwinit/shutdown pair have to be called for any namespace, generic pair
- only once on NSFd kthreads start and shutdown respectively.Refresh of diff-nfsd-call-state-init-twice
Signed-off-by: J. Bruce Fields
-
This patch renames nfs4_state_start_net() into nfs4_state_create_net(), where
get_net() now performed.
Also it introduces new nfs4_state_start_net(), which is now responsible for
state creation and initializing all per-net data and which is now called from
nfs4_state_start().Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This patch renames __nfs4_state_shutdown_net() into nfs4_state_shutdown_net(),
__nfs4_state_shutdown() into nfs4_state_shutdown_net() and moves all network
related shutdown operations to nfs4_state_shutdown_net().Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
NFSv4 delegations are stored in global list. But they are nfs4_client
dependent, which is network namespace aware already.
State shutdown and laundromat are done per network namespace as well.
So, delegations unhash have to be done in network namespace context.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This lock protects the client lru list and session hash table, which are
allocated per network namespace already.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
Protection of __nfs4_state_shutdown() with nfs4_lock_state() looks redundant.
This function is called by the last NFSd thread on it's exit and state lock
protects actually two functions (del_recall_lru is protected by recall_lock):
1) nfsd4_client_tracking_exit
2) __nfs4_state_shutdown_net"nfsd4_client_tracking_exit" doesn't require state lock protection, because it's
state can be modified only by tracker callbacks.
Here a re they:
1) create: is called only from nfsd4_proc_compound.
2) remove: is called from either nfsd4_proc_compound or nfs4_laundromat.
3) check: is called only from nfsd4_proc_compound.
4) grace_done; called only from nfs4_laundromat.nfsd4_proc_compound is called onll by NFSd kthread, which is exiting right
now.
nfs4_laundromat is called by laundry_wq. But laundromat_work was canceled
already."__nfs4_state_shutdown_net" also doesn't require state lock protection,
because all NFSd kthreads are dead, and no race can happen with NFSd start,
because "nfsd_up" flag is still set.
Moreover, all Nfsd shutdown is protected with global nfsd_mutex.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields
26 Nov, 2012
1 commit
-
Linus has pointed out that indiscriminate use of BUG's can make it
harder to diagnose bugs because they can bring a machine down, often
before we manage to get any useful debugging information to the logs.
(Consider, for example, a BUG() that fires in a workqueue, or while
holding a spinlock).Most of these BUG's won't do much more than kill an nfsd thread, but it
would still probably be safer to get out the warning without dying.There's still more of this to do in nfsd/.
Signed-off-by: J. Bruce Fields
15 Nov, 2012
16 commits
-
This patch moves laundromat_work to nfsd per-net context, thus allowing to run
multiple laundries.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
Passing net context looks as overkill.
Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This patch replaces init_net by SVC_NET(), where possible and also passes
proper context to nested functions where required.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This list holds nfs4 clients (open) stateowner queue for last close replay,
which are network namespace aware. So let's make this list per network
namespace too.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This list holds nfs4 clients queue for lease renewal, which are network
namespace aware. So let's make this list per network namespace too.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This hash holds established sessions state and closely associated with
nfs4_clients info, which are network namespace aware. So let's make it
allocated per network namespace too.Note: this hash can be allocated in per-net operations. But it looks
better to allocate it on nfsd state start and thus don't waste resources
if server is not running.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This hash holds file lock owners and closely associated with nfs4_clients info,
which are network namespace aware. So let's make it allocated per network
namespace too.Note: this hash can be allocated in per-net operations. But it looks
better to allocate it on nfsd state start and thus don't waste resources
if server is not running.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This hash holds open owner state and closely associated with nfs4_clients
info, which are network namespace aware. So let's make it allocated per
network namespace too.Note: this hash can be allocated in per-net operations. But it looks
better to allocate it on nfsd state start and thus don't waste resources
if server is not running.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This hash holds nfs4_clients info, which are network namespace aware.
So let's make it allocated per network namespace.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This hash holds nfs4_clients info, which are network namespace aware.
So let's make it allocated per network namespace.Note: this hash can be allocated in per-net operations. But it looks
better to allocate it on nfsd state start and thus don't waste resources
if server is not running.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This tree holds nfs4_clients info, which are network namespace aware.
So let's make it per network namespace.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This hash holds nfs4_clients info, which are network namespace aware.
So let's make it allocated per network namespace.Note: this hash can be allocated in per-net operations. But it looks
better to allocate it on nfsd state start and thus don't waste resources
if server is not running.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
This hash holds nfs4_clients info, which are network namespace aware.
So let's make it allocated per network namespace.Note: this hash is used only by legacy tracker. So let's allocate hash in
tracker init.Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
And use it's net where possible.
Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
Signed-off-by: Stanislav Kinsbursky
Signed-off-by: J. Bruce Fields -
Signed-off-by: J. Bruce Fields
13 Nov, 2012
1 commit
-
Remove the cl_recdir field from the nfs4_client struct. Instead, just
compute it on the fly when and if it's needed, which is now only when
the legacy client tracking code is in effect.The error handling in the legacy client tracker is also changed to
handle the case where md5 is unavailable. In that case, we'll warn
the admin with a KERN_ERR message and disable the client tracking.Signed-off-by: Jeff Layton
Signed-off-by: J. Bruce Fields