提交 c7a8cccc 编写于 作者: P Pavel Shilovsky 提交者: Xie XiuQi

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: NPavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 9fb30430
...@@ -3127,7 +3127,7 @@ smb2_readv_callback(struct mid_q_entry *mid) ...@@ -3127,7 +3127,7 @@ smb2_readv_callback(struct mid_q_entry *mid)
rdata->mr = NULL; rdata->mr = NULL;
} }
#endif #endif
if (rdata->result) { if (rdata->result && rdata->result != -ENODATA) {
cifs_stats_fail_inc(tcon, SMB2_READ_HE); cifs_stats_fail_inc(tcon, SMB2_READ_HE);
trace_smb3_read_err(0 /* xid */, trace_smb3_read_err(0 /* xid */,
rdata->cfile->fid.persistent_fid, rdata->cfile->fid.persistent_fid,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册