From: Pavel Shilovsky Date: Fri, 18 Jan 2019 23:54:34 +0000 (-0800) Subject: CIFS: Do not consider -ENODATA as stat failure for reads X-Git-Tag: rel_imx_4.19.35_1.1.0~6913 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=e9d56f920bb26eee1a1e574463e7a1fea5a1164e;p=linux.git CIFS: Do not consider -ENODATA as stat failure for reads commit 082aaa8700415f6471ec9c5ef0c8307ca214989a upstream. When doing reads beyound the end of a file the server returns 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 Signed-off-by: Steve French CC: Stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index f5a8139f61c0..8a01e89ff827 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3127,7 +3127,7 @@ smb2_readv_callback(struct mid_q_entry *mid) rdata->mr = NULL; } #endif - if (rdata->result) { + if (rdata->result && rdata->result != -ENODATA) { cifs_stats_fail_inc(tcon, SMB2_READ_HE); trace_smb3_read_err(0 /* xid */, rdata->cfile->fid.persistent_fid,