@@ -4601,16 +4601,8 @@ smb2_readv_callback(struct mid_q_entry *mid)
rdata->got_bytes);
if (rdata->result == -ENODATA) {
- /* We may have got an EOF error because fallocate
- * failed to enlarge the file.
- */
- if (rdata->subreq.start + rdata->subreq.transferred < rdata->subreq.rreq->i_size)
- rdata->result = 0;
- if (rdata->subreq.start + rdata->subreq.transferred + rdata->got_bytes >=
- ictx->remote_i_size) {
- __set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);
- rdata->result = 0;
- }
+ __set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);
+ rdata->result = 0;
} else {
if (rdata->got_bytes < rdata->actual_len &&
rdata->subreq.start + rdata->subreq.transferred + rdata->got_bytes ==
Fix smb2_readv_callback() to always take -ENODATA as indicating we hit EOF and to always set the NETFS_SREQ_HIT_EOF flag rather than only doing it under some circumstances. Fixes: 942ad91e2956 ("netfs, cifs: Fix handling of short DIO read") Signed-off-by: David Howells <dhowells@redhat.com> cc: Steve French <sfrench@samba.org> cc: Paulo Alcantara <pc@manguebit.com> cc: Jeff Layton <jlayton@kernel.org> cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/smb/client/smb2pdu.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)