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
04fff641
Commit
04fff641
authored
Aug 29, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simple_write_end(): don't zero in short copy into uptodate
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
92e50d2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
fs/libfs.c
fs/libfs.c
+8
-6
No files found.
fs/libfs.c
View file @
04fff641
...
@@ -465,6 +465,8 @@ EXPORT_SYMBOL(simple_write_begin);
...
@@ -465,6 +465,8 @@ EXPORT_SYMBOL(simple_write_begin);
* is not called, so a filesystem that actually does store data in .write_inode
* is not called, so a filesystem that actually does store data in .write_inode
* should extend on what's done here with a call to mark_inode_dirty() in the
* should extend on what's done here with a call to mark_inode_dirty() in the
* case that i_size has changed.
* case that i_size has changed.
*
* Use *ONLY* with simple_readpage()
*/
*/
int
simple_write_end
(
struct
file
*
file
,
struct
address_space
*
mapping
,
int
simple_write_end
(
struct
file
*
file
,
struct
address_space
*
mapping
,
loff_t
pos
,
unsigned
len
,
unsigned
copied
,
loff_t
pos
,
unsigned
len
,
unsigned
copied
,
...
@@ -474,14 +476,14 @@ int simple_write_end(struct file *file, struct address_space *mapping,
...
@@ -474,14 +476,14 @@ int simple_write_end(struct file *file, struct address_space *mapping,
loff_t
last_pos
=
pos
+
copied
;
loff_t
last_pos
=
pos
+
copied
;
/* zero the stale part of the page if we did a short copy */
/* zero the stale part of the page if we did a short copy */
if
(
copied
<
len
)
{
if
(
!
PageUptodate
(
page
))
{
unsigned
from
=
pos
&
(
PAGE_SIZE
-
1
);
if
(
copied
<
len
)
{
unsigned
from
=
pos
&
(
PAGE_SIZE
-
1
);
zero_user
(
page
,
from
+
copied
,
len
-
copied
);
}
if
(
!
PageUptodate
(
page
))
zero_user
(
page
,
from
+
copied
,
len
-
copied
);
}
SetPageUptodate
(
page
);
SetPageUptodate
(
page
);
}
/*
/*
* No need to use i_size_read() here, the i_size
* No need to use i_size_read() here, the i_size
* cannot change under us because we hold the i_mutex.
* cannot change under us because we hold the i_mutex.
...
...
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