Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
728131d8
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
728131d8
编写于
4月 09, 2008
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Add additional debugging for metadata checksum failures
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
cea9e445
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
55 addition
and
4 deletion
+55
-4
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+2
-1
fs/btrfs/extent_io.c
fs/btrfs/extent_io.c
+51
-3
fs/btrfs/extent_io.h
fs/btrfs/extent_io.h
+2
-0
未找到文件。
fs/btrfs/disk-io.c
浏览文件 @
728131d8
...
...
@@ -283,6 +283,7 @@ static int btree_releasepage(struct page *page, gfp_t gfp_flags)
map
=
&
BTRFS_I
(
page
->
mapping
->
host
)
->
extent_tree
;
ret
=
try_release_extent_mapping
(
map
,
tree
,
page
,
gfp_flags
);
if
(
ret
==
1
)
{
invalidate_extent_lru
(
tree
,
page_offset
(
page
),
PAGE_CACHE_SIZE
);
ClearPagePrivate
(
page
);
set_page_private
(
page
,
0
);
page_cache_release
(
page
);
...
...
@@ -376,7 +377,6 @@ int btrfs_verify_block_csum(struct btrfs_root *root,
buf
->
flags
|=
EXTENT_CSUM
;
return
0
;
}
lock_extent
(
io_tree
,
buf
->
start
,
end
,
GFP_NOFS
);
if
(
test_range_bit
(
io_tree
,
buf
->
start
,
end
,
EXTENT_CSUM
,
1
))
{
...
...
@@ -384,6 +384,7 @@ int btrfs_verify_block_csum(struct btrfs_root *root,
ret
=
0
;
goto
out_unlock
;
}
WARN_ON
(
buf
->
flags
&
EXTENT_CSUM
);
ret
=
csum_tree_block
(
root
,
buf
,
1
);
set_extent_bits
(
io_tree
,
buf
->
start
,
end
,
EXTENT_CSUM
,
GFP_NOFS
);
...
...
fs/btrfs/extent_io.c
浏览文件 @
728131d8
...
...
@@ -2592,6 +2592,33 @@ static inline struct page *extent_buffer_page(struct extent_buffer *eb,
return
p
;
}
int
invalidate_extent_lru
(
struct
extent_io_tree
*
tree
,
u64
start
,
unsigned
long
len
)
{
struct
list_head
*
lru
=
&
tree
->
buffer_lru
;
struct
list_head
*
cur
=
lru
->
next
;
struct
extent_buffer
*
eb
;
int
found
=
0
;
spin_lock
(
&
tree
->
lru_lock
);
if
(
list_empty
(
lru
))
goto
out
;
do
{
eb
=
list_entry
(
cur
,
struct
extent_buffer
,
lru
);
if
(
eb
->
start
<=
start
&&
eb
->
start
+
eb
->
len
>
start
)
{
eb
->
flags
&=
~
EXTENT_UPTODATE
;
}
if
(
eb
->
start
==
start
)
{
eb
->
flags
&=
~
EXTENT_CSUM
;
}
cur
=
cur
->
next
;
}
while
(
cur
!=
lru
);
out:
spin_unlock
(
&
tree
->
lru_lock
);
return
found
;
}
static
struct
extent_buffer
*
__alloc_extent_buffer
(
struct
extent_io_tree
*
tree
,
u64
start
,
unsigned
long
len
,
...
...
@@ -2909,10 +2936,32 @@ EXPORT_SYMBOL(set_extent_buffer_uptodate);
int
extent_buffer_uptodate
(
struct
extent_io_tree
*
tree
,
struct
extent_buffer
*
eb
)
{
int
ret
=
0
;
int
ret2
;
int
num_pages
;
int
i
;
struct
page
*
page
;
int
pg_uptodate
=
1
;
if
(
eb
->
flags
&
EXTENT_UPTODATE
)
return
1
;
return
test_range_bit
(
tree
,
eb
->
start
,
eb
->
start
+
eb
->
len
-
1
,
ret
=
1
;
ret2
=
test_range_bit
(
tree
,
eb
->
start
,
eb
->
start
+
eb
->
len
-
1
,
EXTENT_UPTODATE
,
1
);
num_pages
=
num_extent_pages
(
eb
->
start
,
eb
->
len
);
for
(
i
=
0
;
i
<
num_pages
;
i
++
)
{
page
=
extent_buffer_page
(
eb
,
i
);
if
(
!
PageUptodate
(
page
))
{
pg_uptodate
=
0
;
break
;
}
}
if
((
ret
||
ret2
)
&&
!
pg_uptodate
)
{
printk
(
"uptodate error2 eb %Lu ret %d ret2 %d pg_uptodate %d
\n
"
,
eb
->
start
,
ret
,
ret2
,
pg_uptodate
);
WARN_ON
(
1
);
}
return
(
ret
||
ret2
);
}
EXPORT_SYMBOL
(
extent_buffer_uptodate
);
...
...
@@ -2929,7 +2978,6 @@ int read_extent_buffer_pages(struct extent_io_tree *tree,
unsigned
long
num_pages
;
struct
bio
*
bio
=
NULL
;
if
(
eb
->
flags
&
EXTENT_UPTODATE
)
return
0
;
...
...
fs/btrfs/extent_io.h
浏览文件 @
728131d8
...
...
@@ -216,4 +216,6 @@ int map_private_extent_buffer(struct extent_buffer *eb, unsigned long offset,
unsigned
long
*
map_start
,
unsigned
long
*
map_len
,
int
km
);
void
unmap_extent_buffer
(
struct
extent_buffer
*
eb
,
char
*
token
,
int
km
);
int
invalidate_extent_lru
(
struct
extent_io_tree
*
tree
,
u64
start
,
unsigned
long
len
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录