Commit 6f9202e 1 parent f4fd582 commit 6f9202e Copy full SHA for 6f9202e
File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -4560,7 +4560,7 @@ int smb2_query_dir(struct ksmbd_work *work)
4560
4560
int rc = 0 ;
4561
4561
char * srch_ptr = NULL ;
4562
4562
unsigned char srch_flag ;
4563
- int buffer_sz ;
4563
+ int buffer_sz , prev_num_scan = 0 ;
4564
4564
struct smb2_query_dir_private query_dir_private = {NULL , };
4565
4565
4566
4566
ksmbd_debug (SMB , "Received smb2 query directory request\n" );
@@ -4670,9 +4670,12 @@ int smb2_query_dir(struct ksmbd_work *work)
4670
4670
* the end of the directory and no file is matched with the search
4671
4671
* pattern.
4672
4672
*/
4673
- if (rc >= 0 && !d_info .num_entry && d_info .num_scan &&
4674
- d_info .out_buf_len > 0 )
4673
+ if (rc >= 0 && !d_info .num_entry &&
4674
+ (d_info .num_scan && d_info .num_scan != prev_num_scan ) &&
4675
+ d_info .out_buf_len > 0 ) {
4676
+ prev_num_scan = d_info .num_scan ;
4675
4677
goto again ;
4678
+ }
4676
4679
/*
4677
4680
* req->OutputBufferLength is too small to contain even one entry.
4678
4681
* In this case, it immediately returns OutputBufferLength 0 to client.
You can’t perform that action at this time.
0 commit comments