CIFS: Fix SMB2 readdir error handling
SMB2 servers indicates the end of a directory search with STATUS_NO_MORE_FILE error code that is not processed now. This causes generic/257 xfstest to fail. Fix this by triggering the end of search by this error code in SMB2_query_directory. Also when negotiating CIFS protocol we tell the server to close the search automatically at the end and there is no need to do it itself. In the case of SMB2 protocol, we need to close it explicitly - separate close directory checks for different protocols. Cc: <stable@vger.kernel.org> Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
This commit is contained in:

committed by
Steve French

parent
18f39e7be0
commit
52755808d4
@@ -762,7 +762,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
|
||||
|
||||
cifs_dbg(FYI, "Freeing private data in close dir\n");
|
||||
spin_lock(&cifs_file_list_lock);
|
||||
if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) {
|
||||
if (server->ops->dir_needs_close(cfile)) {
|
||||
cfile->invalidHandle = true;
|
||||
spin_unlock(&cifs_file_list_lock);
|
||||
if (server->ops->close_dir)
|
||||
|
Reference in New Issue
Block a user