diff options
author | Pavel Shilovsky <pshilov@microsoft.com> | 2019-01-08 20:15:28 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-01-11 14:14:40 +0100 |
commit | 9a66396f1857cc1de06f4f4771797315e1a4ea56 (patch) | |
tree | c7c71626e1e10264377066ca7f9b016e03d4c210 /fs/cifs/inode.c | |
parent | CIFS: Move credit processing to mid callbacks for SMB3 (diff) | |
download | linux-9a66396f1857cc1de06f4f4771797315e1a4ea56.tar.xz linux-9a66396f1857cc1de06f4f4771797315e1a4ea56.zip |
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/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 13fb59aadebc..478003644916 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -2257,6 +2257,11 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) * the flush returns error? */ rc = filemap_write_and_wait(inode->i_mapping); + if (is_interrupt_error(rc)) { + rc = -ERESTARTSYS; + goto out; + } + mapping_set_error(inode->i_mapping, rc); rc = 0; @@ -2400,6 +2405,11 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) * the flush returns error? */ rc = filemap_write_and_wait(inode->i_mapping); + if (is_interrupt_error(rc)) { + rc = -ERESTARTSYS; + goto cifs_setattr_exit; + } + mapping_set_error(inode->i_mapping, rc); rc = 0; |