CIFS: Do not count -ENODATA as failure for query directory
authorPavel Shilovsky <pshilov@microsoft.com>
Sat, 26 Jan 2019 20:21:32 +0000 (12:21 -0800)
committerSteve French <stfrench@microsoft.com>
Tue, 29 Jan 2019 23:24:53 +0000 (17:24 -0600)
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
fs/cifs/smb2pdu.c

index 4b5ab9c80cc3cfd3c7445895a9c9a7495c2d0351..d858dc04fdc37fe2157d89579d3e5e879e3012e4 100644 (file)
@@ -3845,8 +3845,8 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
                    rsp->sync_hdr.Status == STATUS_NO_MORE_FILES) {
                        srch_inf->endOfSearch = true;
                        rc = 0;
-               }
-               cifs_stats_fail_inc(tcon, SMB2_QUERY_DIRECTORY_HE);
+               } else
+                       cifs_stats_fail_inc(tcon, SMB2_QUERY_DIRECTORY_HE);
                goto qdir_exit;
        }