diff options
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index f65cdec042e4..6abd1445c983 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -363,28 +363,29 @@ sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) | |||
363 | { | 363 | { |
364 | int rc = 0; | 364 | int rc = 0; |
365 | 365 | ||
366 | spin_lock(&GlobalMid_Lock); | 366 | cFYI(1, "%s: cmd=%d mid=%d state=%d", __func__, mid->command, |
367 | mid->mid, mid->midState); | ||
367 | 368 | ||
368 | if (mid->resp_buf) { | 369 | spin_lock(&GlobalMid_Lock); |
370 | switch (mid->midState) { | ||
371 | case MID_RESPONSE_RECEIVED: | ||
369 | spin_unlock(&GlobalMid_Lock); | 372 | spin_unlock(&GlobalMid_Lock); |
370 | return rc; | 373 | return rc; |
371 | } | 374 | case MID_REQUEST_SUBMITTED: |
372 | 375 | /* socket is going down, reject all calls */ | |
373 | cERROR(1, "No response to cmd %d mid %d", mid->command, mid->mid); | 376 | if (server->tcpStatus == CifsExiting) { |
374 | if (mid->midState == MID_REQUEST_SUBMITTED) { | 377 | cERROR(1, "%s: canceling mid=%d cmd=0x%x state=%d", |
375 | if (server->tcpStatus == CifsExiting) | 378 | __func__, mid->mid, mid->command, mid->midState); |
376 | rc = -EHOSTDOWN; | 379 | rc = -EHOSTDOWN; |
377 | else | 380 | break; |
378 | mid->midState = MID_RETRY_NEEDED; | ||
379 | } | ||
380 | |||
381 | if (rc != -EHOSTDOWN) { | ||
382 | if (mid->midState == MID_RETRY_NEEDED) { | ||
383 | rc = -EAGAIN; | ||
384 | cFYI(1, "marking request for retry"); | ||
385 | } else { | ||
386 | rc = -EIO; | ||
387 | } | 381 | } |
382 | case MID_RETRY_NEEDED: | ||
383 | rc = -EAGAIN; | ||
384 | break; | ||
385 | default: | ||
386 | cERROR(1, "%s: invalid mid state mid=%d state=%d", __func__, | ||
387 | mid->mid, mid->midState); | ||
388 | rc = -EIO; | ||
388 | } | 389 | } |
389 | spin_unlock(&GlobalMid_Lock); | 390 | spin_unlock(&GlobalMid_Lock); |
390 | 391 | ||