Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3ca54671
Commit
3ca54671
authored
Apr 01, 2003
by
Steve French
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix readdir on empty directories to only issue one network search
parent
5225e3b5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
fs/cifs/cifsglob.h
fs/cifs/cifsglob.h
+6
-5
fs/cifs/file.c
fs/cifs/file.c
+13
-3
No files found.
fs/cifs/cifsglob.h
View file @
3ca54671
...
...
@@ -199,7 +199,7 @@ struct cifsLockInfo {
struct
cifsFileInfo
{
struct
list_head
tlist
;
/* pointer to next fid owned by tcon */
struct
list_head
flist
;
/* next fid (file instance) for this inode */
unsigned
int
uid
;
/* allows
you to find
which FileInfo structure */
unsigned
int
uid
;
/* allows
finding
which FileInfo structure */
__u32
pid
;
/* process id who opened file */
__u16
netfid
;
/* file id from remote */
/* BB add lock scope info here if needed */
;
...
...
@@ -207,6 +207,7 @@ struct cifsFileInfo {
struct
file
*
pfile
;
/* needed for writepage */
int
endOfSearch
:
1
;
/* we have reached end of search */
int
closePend
:
1
;
/* file is marked to close */
int
emptyDir
:
1
;
char
*
search_resume_name
;
unsigned
int
resume_name_length
;
__u32
resume_key
;
...
...
fs/cifs/file.c
View file @
3ca54671
...
...
@@ -1109,7 +1109,15 @@ cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
/* fallthrough */
case
2
:
if
(
file
->
private_data
!=
NULL
)
{
cFYI
(
1
,(
"Search rewinding on %s"
,
full_path
));
cifsFile
=
(
struct
cifsFileInfo
*
)
file
->
private_data
;
if
(
cifsFile
->
endOfSearch
)
{
if
(
cifsFile
->
emptyDir
)
{
cFYI
(
1
,
(
"End of search, empty dir"
));
rc
=
0
;
break
;
}
}
else
CIFSFindClose
(
xid
,
pTcon
,
cifsFile
->
netfid
);
if
(
cifsFile
->
search_resume_name
)
{
kfree
(
cifsFile
->
search_resume_name
);
...
...
@@ -1261,10 +1269,12 @@ cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
(
FILE_DIRECTORY_INFO
*
)
((
char
*
)
pfindData
+
le32_to_cpu
(
pfindData
->
NextEntryOffset
));
/* BB also should check to make sure that pointer is not beyond the end of the SMB */
/* if(pfindData > lastFindData) rc = -EIO
l
; break; */
/* if(pfindData > lastFindData) rc = -EIO; break; */
}
/* end for loop */
if
((
findParms
.
EndofSearch
!=
0
)
&&
cifsFile
)
{
cifsFile
->
endOfSearch
=
TRUE
;
if
(
findParms
.
SearchCount
==
2
)
cifsFile
->
emptyDir
=
TRUE
;
}
}
else
{
if
(
cifsFile
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment