diff options
author | Pavel Shilovsky <pshilov@microsoft.com> | 2019-01-29 21:15:11 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-03-06 01:10:04 +0100 |
commit | fe768d51c832ebde70a83221b0633dc7bc9640a6 (patch) | |
tree | 06304ab7a40e0372eb79a3af3014e59c4eadc4d0 /fs/cifs/cifssmb.c | |
parent | CIFS: Move open file handling to writepages (diff) | |
download | linux-fe768d51c832ebde70a83221b0633dc7bc9640a6.tar.xz linux-fe768d51c832ebde70a83221b0633dc7bc9640a6.zip |
CIFS: Return error code when getting file handle for writeback
Now we just return NULL cifsFileInfo pointer in cases we didn't find
or couldn't reopen a file. This hides errors from cifs_reopen_file()
especially retryable errors which should be handled appropriately.
Create new cifs_get_writable_file() routine that returns error codes
from cifs_reopen_file() and use it in the writeback codepath.
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index f9a37e951dd8..f43747c062a7 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -2126,10 +2126,13 @@ cifs_writev_requeue(struct cifs_writedata *wdata) wdata2->tailsz = tailsz; wdata2->bytes = cur_len; - wdata2->cfile = find_writable_file(CIFS_I(inode), false); + rc = cifs_get_writable_file(CIFS_I(inode), false, + &wdata2->cfile); if (!wdata2->cfile) { - cifs_dbg(VFS, "No writable handle to retry writepages\n"); - rc = -EBADF; + cifs_dbg(VFS, "No writable handle to retry writepages rc=%d\n", + rc); + if (!is_retryable_error(rc)) + rc = -EBADF; } else { wdata2->pid = wdata2->cfile->pid; rc = server->ops->async_writev(wdata2, |