Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
1d41c216
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1d41c216
编写于
11月 02, 2016
作者:
N
NeilBrown
提交者:
Shaohua Li
11月 07, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
md/raid1: change printk() to pr_*()
Signed-off-by:
N
NeilBrown
<
neilb@suse.com
>
Signed-off-by:
N
Shaohua Li
<
shli@fb.com
>
上级
76603884
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
58 deletion
+41
-58
drivers/md/raid1.c
drivers/md/raid1.c
+41
-58
未找到文件。
drivers/md/raid1.c
浏览文件 @
1d41c216
...
...
@@ -347,13 +347,10 @@ static void raid1_end_read_request(struct bio *bio)
* oops, read error:
*/
char
b
[
BDEVNAME_SIZE
];
printk_ratelimited
(
KERN_ERR
"md/raid1:%s: %s: "
"rescheduling sector %llu
\n
"
,
mdname
(
conf
->
mddev
),
bdevname
(
rdev
->
bdev
,
b
),
(
unsigned
long
long
)
r1_bio
->
sector
);
pr_err_ratelimited
(
"md/raid1:%s: %s: rescheduling sector %llu
\n
"
,
mdname
(
conf
->
mddev
),
bdevname
(
rdev
->
bdev
,
b
),
(
unsigned
long
long
)
r1_bio
->
sector
);
set_bit
(
R1BIO_ReadError
,
&
r1_bio
->
state
);
reschedule_retry
(
r1_bio
);
/* don't drop the reference on read_disk yet */
...
...
@@ -1461,34 +1458,33 @@ static void raid1_error(struct mddev *mddev, struct md_rdev *rdev)
set_bit
(
MD_RECOVERY_INTR
,
&
mddev
->
recovery
);
set_mask_bits
(
&
mddev
->
flags
,
0
,
BIT
(
MD_CHANGE_DEVS
)
|
BIT
(
MD_CHANGE_PENDING
));
printk
(
KERN_ALERT
"md/raid1:%s: Disk failure on %s, disabling device.
\n
"
"md/raid1:%s: Operation continuing on %d devices.
\n
"
,
mdname
(
mddev
),
bdevname
(
rdev
->
bdev
,
b
),
mdname
(
mddev
),
conf
->
raid_disks
-
mddev
->
degraded
);
pr_crit
(
"md/raid1:%s: Disk failure on %s, disabling device.
\n
"
"md/raid1:%s: Operation continuing on %d devices.
\n
"
,
mdname
(
mddev
),
bdevname
(
rdev
->
bdev
,
b
),
mdname
(
mddev
),
conf
->
raid_disks
-
mddev
->
degraded
);
}
static
void
print_conf
(
struct
r1conf
*
conf
)
{
int
i
;
pr
intk
(
KERN_DEBUG
"RAID1 conf printout:
\n
"
);
pr
_debug
(
"RAID1 conf printout:
\n
"
);
if
(
!
conf
)
{
pr
intk
(
KERN_DEBUG
"(!conf)
\n
"
);
pr
_debug
(
"(!conf)
\n
"
);
return
;
}
pr
intk
(
KERN_DEBUG
" --- wd:%d rd:%d
\n
"
,
conf
->
raid_disks
-
conf
->
mddev
->
degraded
,
conf
->
raid_disks
);
pr
_debug
(
" --- wd:%d rd:%d
\n
"
,
conf
->
raid_disks
-
conf
->
mddev
->
degraded
,
conf
->
raid_disks
);
rcu_read_lock
();
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
{
char
b
[
BDEVNAME_SIZE
];
struct
md_rdev
*
rdev
=
rcu_dereference
(
conf
->
mirrors
[
i
].
rdev
);
if
(
rdev
)
pr
intk
(
KERN_DEBUG
" disk %d, wo:%d, o:%d, dev:%s
\n
"
,
i
,
!
test_bit
(
In_sync
,
&
rdev
->
flags
),
!
test_bit
(
Faulty
,
&
rdev
->
flags
),
bdevname
(
rdev
->
bdev
,
b
));
pr
_debug
(
" disk %d, wo:%d, o:%d, dev:%s
\n
"
,
i
,
!
test_bit
(
In_sync
,
&
rdev
->
flags
),
!
test_bit
(
Faulty
,
&
rdev
->
flags
),
bdevname
(
rdev
->
bdev
,
b
));
}
rcu_read_unlock
();
}
...
...
@@ -1825,11 +1821,10 @@ static int fix_sync_read_error(struct r1bio *r1_bio)
* work just disable and interrupt the recovery.
* Don't fail devices as that won't really help.
*/
printk
(
KERN_ALERT
"md/raid1:%s: %s: unrecoverable I/O read error"
" for block %llu
\n
"
,
mdname
(
mddev
),
bdevname
(
bio
->
bi_bdev
,
b
),
(
unsigned
long
long
)
r1_bio
->
sector
);
pr_crit_ratelimited
(
"md/raid1:%s: %s: unrecoverable I/O read error for block %llu
\n
"
,
mdname
(
mddev
),
bdevname
(
bio
->
bi_bdev
,
b
),
(
unsigned
long
long
)
r1_bio
->
sector
);
for
(
d
=
0
;
d
<
conf
->
raid_disks
*
2
;
d
++
)
{
rdev
=
conf
->
mirrors
[
d
].
rdev
;
if
(
!
rdev
||
test_bit
(
Faulty
,
&
rdev
->
flags
))
...
...
@@ -2122,13 +2117,11 @@ static void fix_read_error(struct r1conf *conf, int read_disk,
if
(
r1_sync_page_io
(
rdev
,
sect
,
s
,
conf
->
tmppage
,
READ
))
{
atomic_add
(
s
,
&
rdev
->
corrected_errors
);
printk
(
KERN_INFO
"md/raid1:%s: read error corrected "
"(%d sectors at %llu on %s)
\n
"
,
mdname
(
mddev
),
s
,
(
unsigned
long
long
)(
sect
+
rdev
->
data_offset
),
bdevname
(
rdev
->
bdev
,
b
));
pr_info
(
"md/raid1:%s: read error corrected (%d sectors at %llu on %s)
\n
"
,
mdname
(
mddev
),
s
,
(
unsigned
long
long
)(
sect
+
rdev
->
data_offset
),
bdevname
(
rdev
->
bdev
,
b
));
}
rdev_dec_pending
(
rdev
,
mddev
);
}
else
...
...
@@ -2317,9 +2310,8 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
read_more:
disk
=
read_balance
(
conf
,
r1_bio
,
&
max_sectors
);
if
(
disk
==
-
1
)
{
printk
(
KERN_ALERT
"md/raid1:%s: %s: unrecoverable I/O"
" read error for block %llu
\n
"
,
mdname
(
mddev
),
b
,
(
unsigned
long
long
)
r1_bio
->
sector
);
pr_crit_ratelimited
(
"md/raid1:%s: %s: unrecoverable I/O read error for block %llu
\n
"
,
mdname
(
mddev
),
b
,
(
unsigned
long
long
)
r1_bio
->
sector
);
raid_end_bio_io
(
r1_bio
);
}
else
{
const
unsigned
long
do_sync
...
...
@@ -2330,12 +2322,10 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
max_sectors
);
r1_bio
->
bios
[
r1_bio
->
read_disk
]
=
bio
;
rdev
=
conf
->
mirrors
[
disk
].
rdev
;
printk_ratelimited
(
KERN_ERR
"md/raid1:%s: redirecting sector %llu"
" to other mirror: %s
\n
"
,
mdname
(
mddev
),
(
unsigned
long
long
)
r1_bio
->
sector
,
bdevname
(
rdev
->
bdev
,
b
));
pr_info_ratelimited
(
"md/raid1:%s: redirecting sector %llu to other mirror: %s
\n
"
,
mdname
(
mddev
),
(
unsigned
long
long
)
r1_bio
->
sector
,
bdevname
(
rdev
->
bdev
,
b
));
bio
->
bi_iter
.
bi_sector
=
r1_bio
->
sector
+
rdev
->
data_offset
;
bio
->
bi_bdev
=
rdev
->
bdev
;
bio
->
bi_end_io
=
raid1_end_read_request
;
...
...
@@ -2875,12 +2865,8 @@ static struct r1conf *setup_conf(struct mddev *mddev)
err
=
-
ENOMEM
;
conf
->
thread
=
md_register_thread
(
raid1d
,
mddev
,
"raid1"
);
if
(
!
conf
->
thread
)
{
printk
(
KERN_ERR
"md/raid1:%s: couldn't allocate thread
\n
"
,
mdname
(
mddev
));
if
(
!
conf
->
thread
)
goto
abort
;
}
return
conf
;
...
...
@@ -2905,13 +2891,13 @@ static int raid1_run(struct mddev *mddev)
bool
discard_supported
=
false
;
if
(
mddev
->
level
!=
1
)
{
pr
intk
(
KERN_ERR
"md/raid1:%s: raid level not set to mirroring (%d)
\n
"
,
mdname
(
mddev
),
mddev
->
level
);
pr
_warn
(
"md/raid1:%s: raid level not set to mirroring (%d)
\n
"
,
mdname
(
mddev
),
mddev
->
level
);
return
-
EIO
;
}
if
(
mddev
->
reshape_position
!=
MaxSector
)
{
pr
intk
(
KERN_ERR
"md/raid1:%s: reshape_position set but not supported
\n
"
,
mdname
(
mddev
));
pr
_warn
(
"md/raid1:%s: reshape_position set but not supported
\n
"
,
mdname
(
mddev
));
return
-
EIO
;
}
/*
...
...
@@ -2950,11 +2936,9 @@ static int raid1_run(struct mddev *mddev)
mddev
->
recovery_cp
=
MaxSector
;
if
(
mddev
->
recovery_cp
!=
MaxSector
)
printk
(
KERN_NOTICE
"md/raid1:%s: not clean"
" -- starting background reconstruction
\n
"
,
mdname
(
mddev
));
printk
(
KERN_INFO
"md/raid1:%s: active with %d out of %d mirrors
\n
"
,
pr_info
(
"md/raid1:%s: not clean -- starting background reconstruction
\n
"
,
mdname
(
mddev
));
pr_info
(
"md/raid1:%s: active with %d out of %d mirrors
\n
"
,
mdname
(
mddev
),
mddev
->
raid_disks
-
mddev
->
degraded
,
mddev
->
raid_disks
);
...
...
@@ -3107,9 +3091,8 @@ static int raid1_reshape(struct mddev *mddev)
rdev
->
raid_disk
=
d2
;
sysfs_unlink_rdev
(
mddev
,
rdev
);
if
(
sysfs_link_rdev
(
mddev
,
rdev
))
printk
(
KERN_WARNING
"md/raid1:%s: cannot register rd%d
\n
"
,
mdname
(
mddev
),
rdev
->
raid_disk
);
pr_warn
(
"md/raid1:%s: cannot register rd%d
\n
"
,
mdname
(
mddev
),
rdev
->
raid_disk
);
}
if
(
rdev
)
newmirrors
[
d2
++
].
rdev
=
rdev
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录