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
5faf153e
Commit
5faf153e
authored
Jun 15, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't call file_pos_write() if vfs_{read,write}{,v}() fails
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
13f8e981
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
fs/read_write.c
fs/read_write.c
+12
-6
No files found.
fs/read_write.c
View file @
5faf153e
...
...
@@ -477,7 +477,8 @@ SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
if
(
f
.
file
)
{
loff_t
pos
=
file_pos_read
(
f
.
file
);
ret
=
vfs_read
(
f
.
file
,
buf
,
count
,
&
pos
);
file_pos_write
(
f
.
file
,
pos
);
if
(
ret
>=
0
)
file_pos_write
(
f
.
file
,
pos
);
fdput
(
f
);
}
return
ret
;
...
...
@@ -492,7 +493,8 @@ SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf,
if
(
f
.
file
)
{
loff_t
pos
=
file_pos_read
(
f
.
file
);
ret
=
vfs_write
(
f
.
file
,
buf
,
count
,
&
pos
);
file_pos_write
(
f
.
file
,
pos
);
if
(
ret
>=
0
)
file_pos_write
(
f
.
file
,
pos
);
fdput
(
f
);
}
...
...
@@ -780,7 +782,8 @@ SYSCALL_DEFINE3(readv, unsigned long, fd, const struct iovec __user *, vec,
if
(
f
.
file
)
{
loff_t
pos
=
file_pos_read
(
f
.
file
);
ret
=
vfs_readv
(
f
.
file
,
vec
,
vlen
,
&
pos
);
file_pos_write
(
f
.
file
,
pos
);
if
(
ret
>=
0
)
file_pos_write
(
f
.
file
,
pos
);
fdput
(
f
);
}
...
...
@@ -799,7 +802,8 @@ SYSCALL_DEFINE3(writev, unsigned long, fd, const struct iovec __user *, vec,
if
(
f
.
file
)
{
loff_t
pos
=
file_pos_read
(
f
.
file
);
ret
=
vfs_writev
(
f
.
file
,
vec
,
vlen
,
&
pos
);
file_pos_write
(
f
.
file
,
pos
);
if
(
ret
>=
0
)
file_pos_write
(
f
.
file
,
pos
);
fdput
(
f
);
}
...
...
@@ -959,7 +963,8 @@ COMPAT_SYSCALL_DEFINE3(readv, unsigned long, fd,
return
-
EBADF
;
pos
=
f
.
file
->
f_pos
;
ret
=
compat_readv
(
f
.
file
,
vec
,
vlen
,
&
pos
);
f
.
file
->
f_pos
=
pos
;
if
(
ret
>=
0
)
f
.
file
->
f_pos
=
pos
;
fdput
(
f
);
return
ret
;
}
...
...
@@ -1025,7 +1030,8 @@ COMPAT_SYSCALL_DEFINE3(writev, unsigned long, fd,
return
-
EBADF
;
pos
=
f
.
file
->
f_pos
;
ret
=
compat_writev
(
f
.
file
,
vec
,
vlen
,
&
pos
);
f
.
file
->
f_pos
=
pos
;
if
(
ret
>=
0
)
f
.
file
->
f_pos
=
pos
;
fdput
(
f
);
return
ret
;
}
...
...
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