Commit 64cc377b authored by Shyam Prasad N's avatar Shyam Prasad N Committed by Steve French

cifs: helper function to check replayable error codes

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: default avatarShyam Prasad N <sprasad@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent a68106a6
...@@ -367,6 +367,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, ...@@ -367,6 +367,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
atomic_inc(&tcon->num_remote_opens); atomic_inc(&tcon->num_remote_opens);
} }
kfree(utf16_path); kfree(utf16_path);
return rc; return rc;
} }
......
...@@ -1830,6 +1830,13 @@ static inline bool is_retryable_error(int error) ...@@ -1830,6 +1830,13 @@ static inline bool is_retryable_error(int error)
return false; return false;
} }
static inline bool is_replayable_error(int error)
{
if (error == -EAGAIN || error == -ECONNABORTED)
return true;
return false;
}
/* cifs_get_writable_file() flags */ /* cifs_get_writable_file() flags */
#define FIND_WR_ANY 0 #define FIND_WR_ANY 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment