Skip to content

Commit

Permalink
CIFS: Do not consider -ENODATA as stat failure for reads
Browse files Browse the repository at this point in the history
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 <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
  • Loading branch information
Pavel Shilovsky authored and Steve French committed Jan 29, 2019
1 parent 8e6e72a commit 082aaa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cifs/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3241,7 +3241,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,
Expand Down

0 comments on commit 082aaa8

Please sign in to comment.