Skip to content

Commit 92941c7

Browse files
bharathsm-msSteve French
authored andcommitted
smb: fix bytes written value in /proc/fs/cifs/Stats
With recent netfs apis changes, the bytes written value was not getting updated in /proc/fs/cifs/Stats. Fix this by updating tcon->bytes in write operations. Fixes: 3ee1a1f ("cifs: Cut over to using netfslib") Signed-off-by: Bharath SM <bharathsm@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent e9f2517 commit 92941c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/smb/client/smb2pdu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4840,6 +4840,8 @@ smb2_writev_callback(struct mid_q_entry *mid)
48404840
if (written > wdata->subreq.len)
48414841
written &= 0xFFFF;
48424842

4843+
cifs_stats_bytes_written(tcon, written);
4844+
48434845
if (written < wdata->subreq.len)
48444846
wdata->result = -ENOSPC;
48454847
else
@@ -5156,6 +5158,7 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,
51565158
cifs_dbg(VFS, "Send error in write = %d\n", rc);
51575159
} else {
51585160
*nbytes = le32_to_cpu(rsp->DataLength);
5161+
cifs_stats_bytes_written(io_parms->tcon, *nbytes);
51595162
trace_smb3_write_done(0, 0, xid,
51605163
req->PersistentFileId,
51615164
io_parms->tcon->tid,

0 commit comments

Comments
 (0)