diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/callback_proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/callback_xdr.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4client.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4session.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4session.h | 13 | ||||
-rw-r--r-- | fs/nfs/nfs4state.c | 15 | ||||
-rw-r--r-- | fs/nfs/super.c | 2 |
8 files changed, 24 insertions, 20 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index a13d26ede254..0bc27684ebfa 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -414,7 +414,7 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args, | |||
414 | 414 | ||
415 | spin_lock(&tbl->slot_tbl_lock); | 415 | spin_lock(&tbl->slot_tbl_lock); |
416 | /* state manager is resetting the session */ | 416 | /* state manager is resetting the session */ |
417 | if (test_bit(NFS4_SESSION_DRAINING, &clp->cl_session->session_state)) { | 417 | if (test_bit(NFS4_SLOT_TBL_DRAINING, &tbl->slot_tbl_state)) { |
418 | spin_unlock(&tbl->slot_tbl_lock); | 418 | spin_unlock(&tbl->slot_tbl_lock); |
419 | status = htonl(NFS4ERR_DELAY); | 419 | status = htonl(NFS4ERR_DELAY); |
420 | /* Return NFS4ERR_BADSESSION if we're draining the session | 420 | /* Return NFS4ERR_BADSESSION if we're draining the session |
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 59461c957d9d..a35582c9d444 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c | |||
@@ -763,7 +763,7 @@ static void nfs4_callback_free_slot(struct nfs4_session *session) | |||
763 | * A single slot, so highest used slotid is either 0 or -1 | 763 | * A single slot, so highest used slotid is either 0 or -1 |
764 | */ | 764 | */ |
765 | tbl->highest_used_slotid = NFS4_NO_SLOT; | 765 | tbl->highest_used_slotid = NFS4_NO_SLOT; |
766 | nfs4_session_drain_complete(session, tbl); | 766 | nfs4_slot_tbl_drain_complete(tbl); |
767 | spin_unlock(&tbl->slot_tbl_lock); | 767 | spin_unlock(&tbl->slot_tbl_lock); |
768 | } | 768 | } |
769 | 769 | ||
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 947b0c908aa9..4cbad5d6b276 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c | |||
@@ -203,7 +203,7 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp, | |||
203 | __set_bit(NFS_CS_DISCRTRY, &clp->cl_flags); | 203 | __set_bit(NFS_CS_DISCRTRY, &clp->cl_flags); |
204 | error = nfs_create_rpc_client(clp, timeparms, RPC_AUTH_GSS_KRB5I); | 204 | error = nfs_create_rpc_client(clp, timeparms, RPC_AUTH_GSS_KRB5I); |
205 | if (error == -EINVAL) | 205 | if (error == -EINVAL) |
206 | error = nfs_create_rpc_client(clp, timeparms, RPC_AUTH_NULL); | 206 | error = nfs_create_rpc_client(clp, timeparms, RPC_AUTH_UNIX); |
207 | if (error < 0) | 207 | if (error < 0) |
208 | goto error; | 208 | goto error; |
209 | 209 | ||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 8fbc10054115..d7ba5616989c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -572,7 +572,7 @@ int nfs41_setup_sequence(struct nfs4_session *session, | |||
572 | task->tk_timeout = 0; | 572 | task->tk_timeout = 0; |
573 | 573 | ||
574 | spin_lock(&tbl->slot_tbl_lock); | 574 | spin_lock(&tbl->slot_tbl_lock); |
575 | if (test_bit(NFS4_SESSION_DRAINING, &session->session_state) && | 575 | if (test_bit(NFS4_SLOT_TBL_DRAINING, &tbl->slot_tbl_state) && |
576 | !args->sa_privileged) { | 576 | !args->sa_privileged) { |
577 | /* The state manager will wait until the slot table is empty */ | 577 | /* The state manager will wait until the slot table is empty */ |
578 | dprintk("%s session is draining\n", __func__); | 578 | dprintk("%s session is draining\n", __func__); |
@@ -1078,7 +1078,7 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata) | |||
1078 | struct nfs4_state *state = opendata->state; | 1078 | struct nfs4_state *state = opendata->state; |
1079 | struct nfs_inode *nfsi = NFS_I(state->inode); | 1079 | struct nfs_inode *nfsi = NFS_I(state->inode); |
1080 | struct nfs_delegation *delegation; | 1080 | struct nfs_delegation *delegation; |
1081 | int open_mode = opendata->o_arg.open_flags & (O_EXCL|O_TRUNC); | 1081 | int open_mode = opendata->o_arg.open_flags; |
1082 | fmode_t fmode = opendata->o_arg.fmode; | 1082 | fmode_t fmode = opendata->o_arg.fmode; |
1083 | nfs4_stateid stateid; | 1083 | nfs4_stateid stateid; |
1084 | int ret = -EAGAIN; | 1084 | int ret = -EAGAIN; |
diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c index ebda5f4a031b..c4e225e4a9af 100644 --- a/fs/nfs/nfs4session.c +++ b/fs/nfs/nfs4session.c | |||
@@ -73,7 +73,7 @@ void nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot) | |||
73 | tbl->highest_used_slotid = new_max; | 73 | tbl->highest_used_slotid = new_max; |
74 | else { | 74 | else { |
75 | tbl->highest_used_slotid = NFS4_NO_SLOT; | 75 | tbl->highest_used_slotid = NFS4_NO_SLOT; |
76 | nfs4_session_drain_complete(tbl->session, tbl); | 76 | nfs4_slot_tbl_drain_complete(tbl); |
77 | } | 77 | } |
78 | } | 78 | } |
79 | dprintk("%s: slotid %u highest_used_slotid %d\n", __func__, | 79 | dprintk("%s: slotid %u highest_used_slotid %d\n", __func__, |
@@ -226,7 +226,7 @@ static bool nfs41_assign_slot(struct rpc_task *task, void *pslot) | |||
226 | struct nfs4_slot *slot = pslot; | 226 | struct nfs4_slot *slot = pslot; |
227 | struct nfs4_slot_table *tbl = slot->table; | 227 | struct nfs4_slot_table *tbl = slot->table; |
228 | 228 | ||
229 | if (nfs4_session_draining(tbl->session) && !args->sa_privileged) | 229 | if (nfs4_slot_tbl_draining(tbl) && !args->sa_privileged) |
230 | return false; | 230 | return false; |
231 | slot->generation = tbl->generation; | 231 | slot->generation = tbl->generation; |
232 | args->sa_slot = slot; | 232 | args->sa_slot = slot; |
diff --git a/fs/nfs/nfs4session.h b/fs/nfs/nfs4session.h index 6f3cb39386d4..ff7d9f0f8a65 100644 --- a/fs/nfs/nfs4session.h +++ b/fs/nfs/nfs4session.h | |||
@@ -25,6 +25,10 @@ struct nfs4_slot { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | /* Sessions */ | 27 | /* Sessions */ |
28 | enum nfs4_slot_tbl_state { | ||
29 | NFS4_SLOT_TBL_DRAINING, | ||
30 | }; | ||
31 | |||
28 | #define SLOT_TABLE_SZ DIV_ROUND_UP(NFS4_MAX_SLOT_TABLE, 8*sizeof(long)) | 32 | #define SLOT_TABLE_SZ DIV_ROUND_UP(NFS4_MAX_SLOT_TABLE, 8*sizeof(long)) |
29 | struct nfs4_slot_table { | 33 | struct nfs4_slot_table { |
30 | struct nfs4_session *session; /* Parent session */ | 34 | struct nfs4_session *session; /* Parent session */ |
@@ -43,6 +47,7 @@ struct nfs4_slot_table { | |||
43 | unsigned long generation; /* Generation counter for | 47 | unsigned long generation; /* Generation counter for |
44 | target_highest_slotid */ | 48 | target_highest_slotid */ |
45 | struct completion complete; | 49 | struct completion complete; |
50 | unsigned long slot_tbl_state; | ||
46 | }; | 51 | }; |
47 | 52 | ||
48 | /* | 53 | /* |
@@ -68,7 +73,6 @@ struct nfs4_session { | |||
68 | 73 | ||
69 | enum nfs4_session_state { | 74 | enum nfs4_session_state { |
70 | NFS4_SESSION_INITING, | 75 | NFS4_SESSION_INITING, |
71 | NFS4_SESSION_DRAINING, | ||
72 | }; | 76 | }; |
73 | 77 | ||
74 | #if defined(CONFIG_NFS_V4_1) | 78 | #if defined(CONFIG_NFS_V4_1) |
@@ -88,12 +92,11 @@ extern void nfs4_destroy_session(struct nfs4_session *session); | |||
88 | extern int nfs4_init_session(struct nfs_server *server); | 92 | extern int nfs4_init_session(struct nfs_server *server); |
89 | extern int nfs4_init_ds_session(struct nfs_client *, unsigned long); | 93 | extern int nfs4_init_ds_session(struct nfs_client *, unsigned long); |
90 | 94 | ||
91 | extern void nfs4_session_drain_complete(struct nfs4_session *session, | 95 | extern void nfs4_slot_tbl_drain_complete(struct nfs4_slot_table *tbl); |
92 | struct nfs4_slot_table *tbl); | ||
93 | 96 | ||
94 | static inline bool nfs4_session_draining(struct nfs4_session *session) | 97 | static inline bool nfs4_slot_tbl_draining(struct nfs4_slot_table *tbl) |
95 | { | 98 | { |
96 | return !!test_bit(NFS4_SESSION_DRAINING, &session->session_state); | 99 | return !!test_bit(NFS4_SLOT_TBL_DRAINING, &tbl->slot_tbl_state); |
97 | } | 100 | } |
98 | 101 | ||
99 | bool nfs41_wake_and_assign_slot(struct nfs4_slot_table *tbl, | 102 | bool nfs41_wake_and_assign_slot(struct nfs4_slot_table *tbl, |
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 300d17d85c0e..1fab140764c4 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -241,7 +241,7 @@ static void nfs4_end_drain_session(struct nfs_client *clp) | |||
241 | if (ses == NULL) | 241 | if (ses == NULL) |
242 | return; | 242 | return; |
243 | tbl = &ses->fc_slot_table; | 243 | tbl = &ses->fc_slot_table; |
244 | if (test_and_clear_bit(NFS4_SESSION_DRAINING, &ses->session_state)) { | 244 | if (test_and_clear_bit(NFS4_SLOT_TBL_DRAINING, &tbl->slot_tbl_state)) { |
245 | spin_lock(&tbl->slot_tbl_lock); | 245 | spin_lock(&tbl->slot_tbl_lock); |
246 | nfs41_wake_slot_table(tbl); | 246 | nfs41_wake_slot_table(tbl); |
247 | spin_unlock(&tbl->slot_tbl_lock); | 247 | spin_unlock(&tbl->slot_tbl_lock); |
@@ -251,15 +251,15 @@ static void nfs4_end_drain_session(struct nfs_client *clp) | |||
251 | /* | 251 | /* |
252 | * Signal state manager thread if session fore channel is drained | 252 | * Signal state manager thread if session fore channel is drained |
253 | */ | 253 | */ |
254 | void nfs4_session_drain_complete(struct nfs4_session *session, | 254 | void nfs4_slot_tbl_drain_complete(struct nfs4_slot_table *tbl) |
255 | struct nfs4_slot_table *tbl) | ||
256 | { | 255 | { |
257 | if (nfs4_session_draining(session)) | 256 | if (nfs4_slot_tbl_draining(tbl)) |
258 | complete(&tbl->complete); | 257 | complete(&tbl->complete); |
259 | } | 258 | } |
260 | 259 | ||
261 | static int nfs4_wait_on_slot_tbl(struct nfs4_slot_table *tbl) | 260 | static int nfs4_drain_slot_tbl(struct nfs4_slot_table *tbl) |
262 | { | 261 | { |
262 | set_bit(NFS4_SLOT_TBL_DRAINING, &tbl->slot_tbl_state); | ||
263 | spin_lock(&tbl->slot_tbl_lock); | 263 | spin_lock(&tbl->slot_tbl_lock); |
264 | if (tbl->highest_used_slotid != NFS4_NO_SLOT) { | 264 | if (tbl->highest_used_slotid != NFS4_NO_SLOT) { |
265 | INIT_COMPLETION(tbl->complete); | 265 | INIT_COMPLETION(tbl->complete); |
@@ -275,13 +275,12 @@ static int nfs4_begin_drain_session(struct nfs_client *clp) | |||
275 | struct nfs4_session *ses = clp->cl_session; | 275 | struct nfs4_session *ses = clp->cl_session; |
276 | int ret = 0; | 276 | int ret = 0; |
277 | 277 | ||
278 | set_bit(NFS4_SESSION_DRAINING, &ses->session_state); | ||
279 | /* back channel */ | 278 | /* back channel */ |
280 | ret = nfs4_wait_on_slot_tbl(&ses->bc_slot_table); | 279 | ret = nfs4_drain_slot_tbl(&ses->bc_slot_table); |
281 | if (ret) | 280 | if (ret) |
282 | return ret; | 281 | return ret; |
283 | /* fore channel */ | 282 | /* fore channel */ |
284 | return nfs4_wait_on_slot_tbl(&ses->fc_slot_table); | 283 | return nfs4_drain_slot_tbl(&ses->fc_slot_table); |
285 | } | 284 | } |
286 | 285 | ||
287 | static void nfs41_finish_session_reset(struct nfs_client *clp) | 286 | static void nfs41_finish_session_reset(struct nfs_client *clp) |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index a366107a7331..2d7525fbcf25 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1942,6 +1942,7 @@ static int nfs23_validate_mount_data(void *options, | |||
1942 | args->namlen = data->namlen; | 1942 | args->namlen = data->namlen; |
1943 | args->bsize = data->bsize; | 1943 | args->bsize = data->bsize; |
1944 | 1944 | ||
1945 | args->auth_flavors[0] = RPC_AUTH_UNIX; | ||
1945 | if (data->flags & NFS_MOUNT_SECFLAVOUR) | 1946 | if (data->flags & NFS_MOUNT_SECFLAVOUR) |
1946 | args->auth_flavors[0] = data->pseudoflavor; | 1947 | args->auth_flavors[0] = data->pseudoflavor; |
1947 | if (!args->nfs_server.hostname) | 1948 | if (!args->nfs_server.hostname) |
@@ -2637,6 +2638,7 @@ static int nfs4_validate_mount_data(void *options, | |||
2637 | goto out_no_address; | 2638 | goto out_no_address; |
2638 | args->nfs_server.port = ntohs(((struct sockaddr_in *)sap)->sin_port); | 2639 | args->nfs_server.port = ntohs(((struct sockaddr_in *)sap)->sin_port); |
2639 | 2640 | ||
2641 | args->auth_flavors[0] = RPC_AUTH_UNIX; | ||
2640 | if (data->auth_flavourlen) { | 2642 | if (data->auth_flavourlen) { |
2641 | if (data->auth_flavourlen > 1) | 2643 | if (data->auth_flavourlen > 1) |
2642 | goto out_inval_auth; | 2644 | goto out_inval_auth; |