Skip to content

Commit 64cc377

Browse files
sprasad-microsoftSteve French
authored andcommitted
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: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent a68106a commit 64cc377

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

fs/smb/client/cached_dir.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
367367
atomic_inc(&tcon->num_remote_opens);
368368
}
369369
kfree(utf16_path);
370+
370371
return rc;
371372
}
372373

fs/smb/client/cifsglob.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,13 @@ static inline bool is_retryable_error(int error)
18301830
return false;
18311831
}
18321832

1833+
static inline bool is_replayable_error(int error)
1834+
{
1835+
if (error == -EAGAIN || error == -ECONNABORTED)
1836+
return true;
1837+
return false;
1838+
}
1839+
18331840

18341841
/* cifs_get_writable_file() flags */
18351842
#define FIND_WR_ANY 0

0 commit comments

Comments
 (0)