[08/15] CIFS: Do not consider -ENODATA as stat failure for reads
diff mbox series

Message ID 1548277845-6746-9-git-send-email-pshilov@microsoft.com
State New
Headers show
  • Improve credits handling on reconnects
Related show

Commit Message

Pavel Shilovsky Jan. 23, 2019, 9:10 p.m. UTC
When doing reads beyound the end of the file the server returned
error STATUS_END_OF_FILE error which is mapped to -ENODATA.
Currently we report it as a failure which confuses read stats.
Change it to not consider -ENODATA as failure for stat purposes.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
 fs/cifs/smb2pdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 6d2901b..291f290 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -3209,7 +3209,7 @@  smb2_readv_callback(struct mid_q_entry *mid)
 		rdata->mr = NULL;
-	if (rdata->result)
+	if (rdata->result && rdata->result != -ENODATA)
 		cifs_stats_fail_inc(tcon, SMB2_READ_HE);
 	queue_work(cifsiod_wq, &rdata->work);