Skip to content

Commit 4cdad80

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: set replay flag for retries of write command
Similar to the rest of the commands, this is a change to add replay flags on retry. This one does not add a back-off, considering that we may want to flush a write ASAP to the server. Considering that this will be a flush of cached pages, the retrans value is also not honoured. Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 4f1fffa commit 4cdad80

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

fs/smb/client/cifsglob.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,7 @@ struct cifs_writedata {
15061506
struct smbd_mr *mr;
15071507
#endif
15081508
struct cifs_credits credits;
1509+
bool replay;
15091510
};
15101511

15111512
/*

fs/smb/client/file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,6 +3300,7 @@ cifs_resend_wdata(struct cifs_writedata *wdata, struct list_head *wdata_list,
33003300
if (wdata->cfile->invalidHandle)
33013301
rc = -EAGAIN;
33023302
else {
3303+
wdata->replay = true;
33033304
#ifdef CONFIG_CIFS_SMB_DIRECT
33043305
if (wdata->mr) {
33053306
wdata->mr->need_invalidate = true;

fs/smb/client/smb2pdu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4771,7 +4771,7 @@ smb2_async_writev(struct cifs_writedata *wdata,
47714771
struct cifs_io_parms *io_parms = NULL;
47724772
int credit_request;
47734773

4774-
if (!wdata->server)
4774+
if (!wdata->server || wdata->replay)
47754775
server = wdata->server = cifs_pick_channel(tcon->ses);
47764776

47774777
/*
@@ -4856,6 +4856,8 @@ smb2_async_writev(struct cifs_writedata *wdata,
48564856
rqst.rq_nvec = 1;
48574857
rqst.rq_iter = wdata->iter;
48584858
rqst.rq_iter_size = iov_iter_count(&rqst.rq_iter);
4859+
if (wdata->replay)
4860+
smb2_set_replay(server, &rqst);
48594861
#ifdef CONFIG_CIFS_SMB_DIRECT
48604862
if (wdata->mr)
48614863
iov[0].iov_len += sizeof(struct smbd_buffer_descriptor_v1);

0 commit comments

Comments
 (0)