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
7d4ce133
Commit
7d4ce133
authored
Feb 10, 2004
by
Nathan Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] Fix data loss when writing into unwritten extents while memory is being reclaimed.
SGI Modid: xfs-linux:xfs-kern:166324a
parent
6fd1e845
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
18 deletions
+10
-18
fs/xfs/linux/xfs_aops.c
fs/xfs/linux/xfs_aops.c
+10
-18
No files found.
fs/xfs/linux/xfs_aops.c
View file @
7d4ce133
...
...
@@ -724,7 +724,7 @@ page_state_convert(
iomp
=
match_offset_to_mapping
(
page
,
&
iomap
,
p_offset
);
}
if
(
iomp
)
{
if
(
iomp
&&
startio
)
{
if
(
!
bh
->
b_end_io
)
{
err
=
map_unwritten
(
inode
,
page
,
head
,
bh
,
p_offset
,
...
...
@@ -734,13 +734,7 @@ page_state_convert(
goto
error
;
}
}
if
(
startio
)
{
bh_arr
[
cnt
++
]
=
bh
;
}
else
{
set_buffer_dirty
(
bh
);
unlock_buffer
(
bh
);
mark_buffer_dirty
(
bh
);
}
bh_arr
[
cnt
++
]
=
bh
;
page_dirty
=
0
;
}
/*
...
...
@@ -886,9 +880,9 @@ linvfs_get_block_core(
loff_t
delta
;
/* For unwritten extents do not report a disk address on
* the read case.
* the read case
(treat as if we're reading into a hole)
.
*/
if
(
create
||
((
iomap
.
iomap_flags
&
IOMAP_UNWRITTEN
)
==
0
))
{
if
(
create
||
!
(
iomap
.
iomap_flags
&
IOMAP_UNWRITTEN
))
{
delta
=
offset
-
iomap
.
iomap_offset
;
delta
>>=
inode
->
i_blkbits
;
...
...
@@ -899,12 +893,9 @@ linvfs_get_block_core(
bh_result
->
b_bdev
=
iomap
.
iomap_target
->
pbr_bdev
;
set_buffer_mapped
(
bh_result
);
}
if
(
iomap
.
iomap_flags
&
IOMAP_UNWRITTEN
)
{
if
(
create
)
{
if
(
direct
)
bh_result
->
b_private
=
inode
;
set_buffer_mapped
(
bh_result
);
}
if
(
create
&&
(
iomap
.
iomap_flags
&
IOMAP_UNWRITTEN
))
{
if
(
direct
)
bh_result
->
b_private
=
inode
;
set_buffer_unwritten
(
bh_result
);
set_buffer_delay
(
bh_result
);
}
...
...
@@ -1173,7 +1164,7 @@ linvfs_release_page(
int
gfp_mask
)
{
struct
inode
*
inode
=
page
->
mapping
->
host
;
int
delalloc
,
unmapped
,
unwritten
;
int
d
irty
,
d
elalloc
,
unmapped
,
unwritten
;
count_page_state
(
page
,
&
delalloc
,
&
unmapped
,
&
unwritten
);
if
(
!
delalloc
&&
!
unwritten
)
...
...
@@ -1194,7 +1185,8 @@ linvfs_release_page(
* Never need to allocate space here - we will always
* come back to writepage in that case.
*/
if
(
page_state_convert
(
inode
,
page
,
0
,
0
)
==
0
)
dirty
=
page_state_convert
(
inode
,
page
,
0
,
0
);
if
(
dirty
==
0
&&
!
unwritten
)
goto
free_buffers
;
return
0
;
...
...
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