ref counting for nfs41_root
very similar to the issue with nfs41_open_state, an abandoned upcall could outlive its mount. to prevent their nfs41_root from being freed, upcalls need to hold a reference until they're finished. this also keeps all of its clients/sessions/rpc connections alive Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
006bdfa47a
commit
bcc707d3b8
13 changed files with 57 additions and 4 deletions
|
|
@ -180,6 +180,7 @@ typedef struct __nfs41_upcall {
|
|||
/* store referenced pointers with the upcall for
|
||||
* automatic dereferencing on upcall_cleanup();
|
||||
* see upcall_root_ref() and upcall_open_state_ref() */
|
||||
nfs41_root *root_ref;
|
||||
nfs41_open_state *state_ref;
|
||||
} nfs41_upcall;
|
||||
|
||||
|
|
@ -222,6 +223,14 @@ void upcall_cleanup(
|
|||
IN nfs41_upcall *upcall);
|
||||
|
||||
|
||||
static __inline void upcall_root_ref(
|
||||
IN nfs41_upcall *upcall,
|
||||
IN nfs41_root *root)
|
||||
{
|
||||
nfs41_root_ref(root);
|
||||
upcall->root_ref = root;
|
||||
}
|
||||
|
||||
static __inline void upcall_open_state_ref(
|
||||
IN nfs41_upcall *upcall,
|
||||
IN nfs41_open_state *state)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue