diff options
author | Pavel Shilovsky <pshilov@microsoft.com> | 2019-01-08 22:15:28 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-01-11 16:14:40 +0300 |
commit | 9a66396f1857cc1de06f4f4771797315e1a4ea56 (patch) | |
tree | c7c71626e1e10264377066ca7f9b016e03d4c210 /fs/cifs/cifsglob.h | |
parent | ee258d79159afed52ca9372aeb9c1a51e89b32ee (diff) | |
download | linux-9a66396f1857cc1de06f4f4771797315e1a4ea56.tar.xz |
CIFS: Fix error paths in writeback code
This patch aims to address writeback code problems related to error
paths. In particular it respects EINTR and related error codes and
stores and returns the first error occurred during writeback.
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Acked-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r-- | fs/cifs/cifsglob.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 770926877b7c..94dbdbe5be34 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -1575,6 +1575,25 @@ static inline void free_dfs_info_array(struct dfs_info3_param *param, kfree(param); } +static inline bool is_interrupt_error(int error) +{ + switch (error) { + case -EINTR: + case -ERESTARTSYS: + case -ERESTARTNOHAND: + case -ERESTARTNOINTR: + return true; + } + return false; +} + +static inline bool is_retryable_error(int error) +{ + if (is_interrupt_error(error) || error == -EAGAIN) + return true; + return false; +} + #define MID_FREE 0 #define MID_REQUEST_ALLOCATED 1 #define MID_REQUEST_SUBMITTED 2 |