diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2014-08-18 20:49:57 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-09 12:21:27 -0700 |
commit | 04ceeee9bb02eabbaaf14c0d0dc759caa60de230 (patch) | |
tree | 6aa46aa044715e903576d5ff16b82418de4e07f3 /fs/cifs/readdir.c | |
parent | 3a525e231651bb3c8fe7be16b8b83e78146740aa (diff) | |
download | kernel-common-04ceeee9bb02eabbaaf14c0d0dc759caa60de230.tar.gz kernel-common-04ceeee9bb02eabbaaf14c0d0dc759caa60de230.tar.bz2 kernel-common-04ceeee9bb02eabbaaf14c0d0dc759caa60de230.zip |
CIFS: Fix SMB2 readdir error handling
commit 52755808d4525f4d5b86d112d36ffc7a46f3fb48 upstream.
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.
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r-- | fs/cifs/readdir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 2bbf11b09214..b334a89d6a66 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c @@ -593,7 +593,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon, loff_t pos, /* close and restart search */ cifs_dbg(FYI, "search backing up - close and restart search\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) |