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
nexedi
linux
Commits
40474c44
Commit
40474c44
authored
May 24, 2004
by
Steve French
Committed by
Steve French
May 24, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check for close pending and invalid file struct on writing out page
parent
ec9b2be0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
fs/cifs/CHANGES
fs/cifs/CHANGES
+2
-1
fs/cifs/file.c
fs/cifs/file.c
+14
-1
No files found.
fs/cifs/CHANGES
View file @
40474c44
Version 1.16
------------
Fix incorrect file size in file handle based setattr on big endian hardware.
Fix oops in build_path_from_dentry when out of memory.
Fix oops in build_path_from_dentry when out of memory. Add checks for invalid
and closing file structs in writepage/partialpagewrite
Version 1.15
------------
...
...
fs/cifs/file.c
View file @
40474c44
...
...
@@ -558,6 +558,9 @@ cifs_write(struct file * file, const char *write_data,
int
xid
,
long_op
;
struct
cifsFileInfo
*
open_file
;
if
(
file
->
f_dentry
==
NULL
)
return
-
EBADF
;
xid
=
GetXid
();
cifs_sb
=
CIFS_SB
(
file
->
f_dentry
->
d_sb
);
...
...
@@ -686,6 +689,8 @@ cifs_partialpagewrite(struct page *page,unsigned from, unsigned to)
read_lock
(
&
GlobalSMBSeslock
);
list_for_each_safe
(
tmp
,
tmp1
,
&
cifsInode
->
openFileList
)
{
open_file
=
list_entry
(
tmp
,
struct
cifsFileInfo
,
flist
);
if
(
open_file
->
closePend
)
continue
;
/* We check if file is open for writing first */
if
((
open_file
->
pfile
)
&&
((
open_file
->
pfile
->
f_flags
&
O_RDWR
)
||
...
...
@@ -699,7 +704,15 @@ cifs_partialpagewrite(struct page *page,unsigned from, unsigned to)
if
((
bytes_written
>
0
)
&&
(
offset
))
{
rc
=
0
;
}
else
if
(
bytes_written
<
0
)
{
rc
=
bytes_written
;
if
(
rc
==
-
EBADF
)
{
/* have seen a case in which
kernel seemed to have closed/freed a file
even with writes active so we might as well
see if there are other file structs to try
for the same inode before giving up */
continue
;
}
else
rc
=
bytes_written
;
}
break
;
/* now that we found a valid file handle
and tried to write to it we are done, no
...
...
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