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
c582fee9
Commit
c582fee9
authored
Apr 22, 2004
by
Nathan Scott
Committed by
Christoph Hellwig
Apr 22, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] Fix a very hard-to-hit, small-block-size only corruption.
SGI Modid: xfs-linux:xfs-kern:168987a
parent
eef2c071
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
fs/xfs/linux/xfs_buf.c
fs/xfs/linux/xfs_buf.c
+19
-13
No files found.
fs/xfs/linux/xfs_buf.c
View file @
c582fee9
...
@@ -364,16 +364,16 @@ _pagebuf_lookup_pages(
...
@@ -364,16 +364,16 @@ _pagebuf_lookup_pages(
uint
flags
)
uint
flags
)
{
{
struct
address_space
*
mapping
=
bp
->
pb_target
->
pbr_mapping
;
struct
address_space
*
mapping
=
bp
->
pb_target
->
pbr_mapping
;
unsigned
int
sectorshift
=
bp
->
pb_target
->
pbr_sshift
;
size_t
blocksize
=
bp
->
pb_target
->
pbr_bsize
;
size_t
blocksize
=
bp
->
pb_target
->
pbr_bsize
;
size_t
size
=
bp
->
pb_count_desired
,
nbytes
;
size_t
size
=
bp
->
pb_count_desired
;
size_t
offset
=
bp
->
pb_
offset
;
size_t
nbytes
,
offset
;
int
gfp_mask
=
pb_to_gfp
(
flags
);
int
gfp_mask
=
pb_to_gfp
(
flags
);
unsigned
short
page_count
,
i
;
unsigned
short
page_count
,
i
;
pgoff_t
first
;
pgoff_t
first
;
loff_t
end
;
loff_t
end
;
int
error
;
int
error
;
first
=
(
bp
->
pb_file_offset
-
bp
->
pb_offset
)
>>
PAGE_CACHE_SHIFT
;
end
=
bp
->
pb_file_offset
+
bp
->
pb_buffer_length
;
end
=
bp
->
pb_file_offset
+
bp
->
pb_buffer_length
;
page_count
=
page_buf_btoc
(
end
)
-
page_buf_btoct
(
bp
->
pb_file_offset
);
page_count
=
page_buf_btoc
(
end
)
-
page_buf_btoct
(
bp
->
pb_file_offset
);
...
@@ -381,6 +381,9 @@ _pagebuf_lookup_pages(
...
@@ -381,6 +381,9 @@ _pagebuf_lookup_pages(
if
(
unlikely
(
error
))
if
(
unlikely
(
error
))
return
error
;
return
error
;
offset
=
bp
->
pb_offset
;
first
=
bp
->
pb_file_offset
>>
PAGE_CACHE_SHIFT
;
for
(
i
=
0
;
i
<
bp
->
pb_page_count
;
i
++
)
{
for
(
i
=
0
;
i
<
bp
->
pb_page_count
;
i
++
)
{
struct
page
*
page
;
struct
page
*
page
;
uint
retries
=
0
;
uint
retries
=
0
;
...
@@ -421,18 +424,17 @@ _pagebuf_lookup_pages(
...
@@ -421,18 +424,17 @@ _pagebuf_lookup_pages(
if
(
flags
&
PBF_READ
)
if
(
flags
&
PBF_READ
)
bp
->
pb_locked
=
1
;
bp
->
pb_locked
=
1
;
}
else
if
(
!
PagePrivate
(
page
))
{
}
else
if
(
!
PagePrivate
(
page
))
{
uint
sectorshift
=
bp
->
pb_target
->
pbr_sshift
;
unsigned
long
j
,
range
;
ulong
range
,
i
;
/*
/*
* In this case page->private holds a bitmap
* In this case page->private holds a bitmap
* of uptodate sectors within the page
* of uptodate sectors within the page
*/
*/
range
=
(
offset
+
nbytes
)
>>
sectorshift
;
range
=
(
offset
+
nbytes
)
>>
sectorshift
;
for
(
i
=
offset
>>
sectorshift
;
i
<
range
;
i
++
)
for
(
j
=
offset
>>
sectorshift
;
j
<
range
;
j
++
)
if
(
!
test_bit
(
i
,
&
page
->
private
))
if
(
!
test_bit
(
j
,
&
page
->
private
))
break
;
break
;
if
(
i
==
range
)
if
(
j
==
range
)
page_count
++
;
page_count
++
;
}
}
}
}
...
@@ -445,12 +447,16 @@ _pagebuf_lookup_pages(
...
@@ -445,12 +447,16 @@ _pagebuf_lookup_pages(
unlock_page
(
bp
->
pb_pages
[
i
]);
unlock_page
(
bp
->
pb_pages
[
i
]);
}
}
bp
->
pb_flags
&=
~
PBF_NONE
;
bp
->
pb_flags
|=
(
_PBF_PAGECACHE
|
_PBF_MEM_ALLOCATED
);
bp
->
pb_flags
|=
(
_PBF_PAGECACHE
|
_PBF_MEM_ALLOCATED
);
/* if some pages aren't uptodate mark that in the buffer */
if
(
page_count
)
{
/* if we have any uptodate pages, mark that in the buffer */
bp
->
pb_flags
&=
~
PBF_NONE
;
/* if some pages aren't uptodate, mark that in the buffer */
if
(
page_count
!=
bp
->
pb_page_count
)
if
(
page_count
!=
bp
->
pb_page_count
)
bp
->
pb_flags
|=
PBF_PARTIAL
;
bp
->
pb_flags
|=
PBF_PARTIAL
;
}
PB_TRACE
(
bp
,
"lookup_pages"
,
(
long
)
page_count
);
PB_TRACE
(
bp
,
"lookup_pages"
,
(
long
)
page_count
);
return
error
;
return
error
;
...
@@ -1269,7 +1275,7 @@ bio_end_io_pagebuf(
...
@@ -1269,7 +1275,7 @@ bio_end_io_pagebuf(
}
else
if
(
blocksize
==
PAGE_CACHE_SIZE
)
{
}
else
if
(
blocksize
==
PAGE_CACHE_SIZE
)
{
SetPageUptodate
(
page
);
SetPageUptodate
(
page
);
}
else
if
(
!
PagePrivate
(
page
))
{
}
else
if
(
!
PagePrivate
(
page
))
{
unsigned
int
j
,
range
;
unsigned
long
j
,
range
;
ASSERT
(
blocksize
<
PAGE_CACHE_SIZE
);
ASSERT
(
blocksize
<
PAGE_CACHE_SIZE
);
range
=
(
bvec
->
bv_offset
+
bvec
->
bv_len
)
>>
sectorshift
;
range
=
(
bvec
->
bv_offset
+
bvec
->
bv_len
)
>>
sectorshift
;
...
...
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