mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
cifs: helper function to check replayable error codes
[ Upstream commit 64cc377b76
]
The code to check for replay is not just -EAGAIN. In some
cases, the send request or receive response may result in
network errors, which we're now mapping to -ECONNABORTED.
This change introduces a helper function which checks
if the error returned in one of the above two errors.
And all checks for replays will now use this helper.
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c09de6bb3a
commit
f642fcf3f7
2 changed files with 8 additions and 0 deletions
|
@ -367,6 +367,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
|
|||
atomic_inc(&tcon->num_remote_opens);
|
||||
}
|
||||
kfree(utf16_path);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
@ -1820,6 +1820,13 @@ static inline bool is_retryable_error(int error)
|
|||
return false;
|
||||
}
|
||||
|
||||
static inline bool is_replayable_error(int error)
|
||||
{
|
||||
if (error == -EAGAIN || error == -ECONNABORTED)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* cifs_get_writable_file() flags */
|
||||
#define FIND_WR_ANY 0
|
||||
|
|
Loading…
Reference in a new issue