Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
2705ca79
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看板
提交
2705ca79
编写于
1月 12, 2010
作者:
J
Jens Axboe
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-jens' of
http://git.drbd.org/linux-2.6-drbd
into for-linus
上级
23978161
2ebccd71
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
40 addition
and
22 deletion
+40
-22
drivers/block/drbd/drbd_int.h
drivers/block/drbd/drbd_int.h
+3
-4
drivers/block/drbd/drbd_nl.c
drivers/block/drbd/drbd_nl.c
+11
-6
drivers/block/drbd/drbd_receiver.c
drivers/block/drbd/drbd_receiver.c
+24
-11
include/linux/drbd.h
include/linux/drbd.h
+1
-1
include/linux/drbd_nl.h
include/linux/drbd_nl.h
+1
-0
未找到文件。
drivers/block/drbd/drbd_int.h
浏览文件 @
2705ca79
...
...
@@ -1275,7 +1275,7 @@ struct bm_extent {
#if DRBD_MAX_SECTORS_BM < DRBD_MAX_SECTORS_32
#define DRBD_MAX_SECTORS DRBD_MAX_SECTORS_BM
#define DRBD_MAX_SECTORS_FLEX DRBD_MAX_SECTORS_BM
#elif !defined(CONFIG_LBD) && BITS_PER_LONG == 32
#elif !defined(CONFIG_LBD
AF
) && BITS_PER_LONG == 32
#define DRBD_MAX_SECTORS DRBD_MAX_SECTORS_32
#define DRBD_MAX_SECTORS_FLEX DRBD_MAX_SECTORS_32
#else
...
...
@@ -1371,10 +1371,9 @@ extern int is_valid_ar_handle(struct drbd_request *, sector_t);
extern
void
drbd_suspend_io
(
struct
drbd_conf
*
mdev
);
extern
void
drbd_resume_io
(
struct
drbd_conf
*
mdev
);
extern
char
*
ppsize
(
char
*
buf
,
unsigned
long
long
size
);
extern
sector_t
drbd_new_dev_size
(
struct
drbd_conf
*
,
struct
drbd_backing_dev
*
);
extern
sector_t
drbd_new_dev_size
(
struct
drbd_conf
*
,
struct
drbd_backing_dev
*
,
int
);
enum
determine_dev_size
{
dev_size_error
=
-
1
,
unchanged
=
0
,
shrunk
=
1
,
grew
=
2
};
extern
enum
determine_dev_size
drbd_determin_dev_size
(
struct
drbd_conf
*
)
__must_hold
(
local
);
extern
enum
determine_dev_size
drbd_determin_dev_size
(
struct
drbd_conf
*
,
int
force
)
__must_hold
(
local
);
extern
void
resync_after_online_grow
(
struct
drbd_conf
*
);
extern
void
drbd_setup_queue_param
(
struct
drbd_conf
*
mdev
,
unsigned
int
)
__must_hold
(
local
);
extern
int
drbd_set_role
(
struct
drbd_conf
*
mdev
,
enum
drbd_role
new_role
,
...
...
drivers/block/drbd/drbd_nl.c
浏览文件 @
2705ca79
...
...
@@ -510,7 +510,7 @@ void drbd_resume_io(struct drbd_conf *mdev)
* Returns 0 on success, negative return values indicate errors.
* You should call drbd_md_sync() after calling this function.
*/
enum
determine_dev_size
drbd_determin_dev_size
(
struct
drbd_conf
*
mdev
)
__must_hold
(
local
)
enum
determine_dev_size
drbd_determin_dev_size
(
struct
drbd_conf
*
mdev
,
int
force
)
__must_hold
(
local
)
{
sector_t
prev_first_sect
,
prev_size
;
/* previous meta location */
sector_t
la_size
;
...
...
@@ -541,7 +541,7 @@ enum determine_dev_size drbd_determin_dev_size(struct drbd_conf *mdev) __must_ho
/* TODO: should only be some assert here, not (re)init... */
drbd_md_set_sector_offsets
(
mdev
,
mdev
->
ldev
);
size
=
drbd_new_dev_size
(
mdev
,
mdev
->
ldev
);
size
=
drbd_new_dev_size
(
mdev
,
mdev
->
ldev
,
force
);
if
(
drbd_get_capacity
(
mdev
->
this_bdev
)
!=
size
||
drbd_bm_capacity
(
mdev
)
!=
size
)
{
...
...
@@ -596,7 +596,7 @@ enum determine_dev_size drbd_determin_dev_size(struct drbd_conf *mdev) __must_ho
}
sector_t
drbd_new_dev_size
(
struct
drbd_conf
*
mdev
,
struct
drbd_backing_dev
*
bdev
)
drbd_new_dev_size
(
struct
drbd_conf
*
mdev
,
struct
drbd_backing_dev
*
bdev
,
int
assume_peer_has_space
)
{
sector_t
p_size
=
mdev
->
p_size
;
/* partner's disk size. */
sector_t
la_size
=
bdev
->
md
.
la_size_sect
;
/* last agreed size. */
...
...
@@ -606,6 +606,11 @@ drbd_new_dev_size(struct drbd_conf *mdev, struct drbd_backing_dev *bdev)
m_size
=
drbd_get_max_capacity
(
bdev
);
if
(
mdev
->
state
.
conn
<
C_CONNECTED
&&
assume_peer_has_space
)
{
dev_warn
(
DEV
,
"Resize while not connected was forced by the user!
\n
"
);
p_size
=
m_size
;
}
if
(
p_size
&&
m_size
)
{
size
=
min_t
(
sector_t
,
p_size
,
m_size
);
}
else
{
...
...
@@ -965,7 +970,7 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp
/* Prevent shrinking of consistent devices ! */
if
(
drbd_md_test_flag
(
nbc
,
MDF_CONSISTENT
)
&&
drbd_new_dev_size
(
mdev
,
nbc
)
<
nbc
->
md
.
la_size_sect
)
{
drbd_new_dev_size
(
mdev
,
nbc
,
0
)
<
nbc
->
md
.
la_size_sect
)
{
dev_warn
(
DEV
,
"refusing to truncate a consistent device
\n
"
);
retcode
=
ERR_DISK_TO_SMALL
;
goto
force_diskless_dec
;
...
...
@@ -1052,7 +1057,7 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp
!
drbd_md_test_flag
(
mdev
->
ldev
,
MDF_CONNECTED_IND
))
set_bit
(
USE_DEGR_WFC_T
,
&
mdev
->
flags
);
dd
=
drbd_determin_dev_size
(
mdev
);
dd
=
drbd_determin_dev_size
(
mdev
,
0
);
if
(
dd
==
dev_size_error
)
{
retcode
=
ERR_NOMEM_BITMAP
;
goto
force_diskless_dec
;
...
...
@@ -1504,7 +1509,7 @@ static int drbd_nl_resize(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
}
mdev
->
ldev
->
dc
.
disk_size
=
(
sector_t
)
rs
.
resize_size
;
dd
=
drbd_determin_dev_size
(
mdev
);
dd
=
drbd_determin_dev_size
(
mdev
,
rs
.
resize_force
);
drbd_md_sync
(
mdev
);
put_ldev
(
mdev
);
if
(
dd
==
dev_size_error
)
{
...
...
drivers/block/drbd/drbd_receiver.c
浏览文件 @
2705ca79
...
...
@@ -878,9 +878,13 @@ static int drbd_connect(struct drbd_conf *mdev)
if
(
mdev
->
cram_hmac_tfm
)
{
/* drbd_request_state(mdev, NS(conn, WFAuth)); */
if
(
!
drbd_do_auth
(
mdev
))
{
switch
(
drbd_do_auth
(
mdev
))
{
case
-
1
:
dev_err
(
DEV
,
"Authentication of peer failed
\n
"
);
return
-
1
;
case
0
:
dev_err
(
DEV
,
"Authentication of peer failed, trying again.
\n
"
);
return
0
;
}
}
...
...
@@ -2866,7 +2870,7 @@ static int receive_sizes(struct drbd_conf *mdev, struct p_header *h)
/* Never shrink a device with usable data during connect.
But allow online shrinking if we are connected. */
if
(
drbd_new_dev_size
(
mdev
,
mdev
->
ldev
)
<
if
(
drbd_new_dev_size
(
mdev
,
mdev
->
ldev
,
0
)
<
drbd_get_capacity
(
mdev
->
this_bdev
)
&&
mdev
->
state
.
disk
>=
D_OUTDATED
&&
mdev
->
state
.
conn
<
C_CONNECTED
)
{
...
...
@@ -2881,7 +2885,7 @@ static int receive_sizes(struct drbd_conf *mdev, struct p_header *h)
#undef min_not_zero
if
(
get_ldev
(
mdev
))
{
dd
=
drbd_determin_dev_size
(
mdev
);
dd
=
drbd_determin_dev_size
(
mdev
,
0
);
put_ldev
(
mdev
);
if
(
dd
==
dev_size_error
)
return
FALSE
;
...
...
@@ -3831,10 +3835,17 @@ static int drbd_do_auth(struct drbd_conf *mdev)
{
dev_err
(
DEV
,
"This kernel was build without CONFIG_CRYPTO_HMAC.
\n
"
);
dev_err
(
DEV
,
"You need to disable 'cram-hmac-alg' in drbd.conf.
\n
"
);
return
0
;
return
-
1
;
}
#else
#define CHALLENGE_LEN 64
/* Return value:
1 - auth succeeded,
0 - failed, try again (network error),
-1 - auth failed, don't try again.
*/
static
int
drbd_do_auth
(
struct
drbd_conf
*
mdev
)
{
char
my_challenge
[
CHALLENGE_LEN
];
/* 64 Bytes... */
...
...
@@ -3855,7 +3866,7 @@ static int drbd_do_auth(struct drbd_conf *mdev)
(
u8
*
)
mdev
->
net_conf
->
shared_secret
,
key_len
);
if
(
rv
)
{
dev_err
(
DEV
,
"crypto_hash_setkey() failed with %d
\n
"
,
rv
);
rv
=
0
;
rv
=
-
1
;
goto
fail
;
}
...
...
@@ -3878,14 +3889,14 @@ static int drbd_do_auth(struct drbd_conf *mdev)
if
(
p
.
length
>
CHALLENGE_LEN
*
2
)
{
dev_err
(
DEV
,
"expected AuthChallenge payload too big.
\n
"
);
rv
=
0
;
rv
=
-
1
;
goto
fail
;
}
peers_ch
=
kmalloc
(
p
.
length
,
GFP_NOIO
);
if
(
peers_ch
==
NULL
)
{
dev_err
(
DEV
,
"kmalloc of peers_ch failed
\n
"
);
rv
=
0
;
rv
=
-
1
;
goto
fail
;
}
...
...
@@ -3901,7 +3912,7 @@ static int drbd_do_auth(struct drbd_conf *mdev)
response
=
kmalloc
(
resp_size
,
GFP_NOIO
);
if
(
response
==
NULL
)
{
dev_err
(
DEV
,
"kmalloc of response failed
\n
"
);
rv
=
0
;
rv
=
-
1
;
goto
fail
;
}
...
...
@@ -3911,7 +3922,7 @@ static int drbd_do_auth(struct drbd_conf *mdev)
rv
=
crypto_hash_digest
(
&
desc
,
&
sg
,
sg
.
length
,
response
);
if
(
rv
)
{
dev_err
(
DEV
,
"crypto_hash_digest() failed with %d
\n
"
,
rv
);
rv
=
0
;
rv
=
-
1
;
goto
fail
;
}
...
...
@@ -3947,7 +3958,7 @@ static int drbd_do_auth(struct drbd_conf *mdev)
right_response
=
kmalloc
(
resp_size
,
GFP_NOIO
);
if
(
right_response
==
NULL
)
{
dev_err
(
DEV
,
"kmalloc of right_response failed
\n
"
);
rv
=
0
;
rv
=
-
1
;
goto
fail
;
}
...
...
@@ -3956,7 +3967,7 @@ static int drbd_do_auth(struct drbd_conf *mdev)
rv
=
crypto_hash_digest
(
&
desc
,
&
sg
,
sg
.
length
,
right_response
);
if
(
rv
)
{
dev_err
(
DEV
,
"crypto_hash_digest() failed with %d
\n
"
,
rv
);
rv
=
0
;
rv
=
-
1
;
goto
fail
;
}
...
...
@@ -3965,6 +3976,8 @@ static int drbd_do_auth(struct drbd_conf *mdev)
if
(
rv
)
dev_info
(
DEV
,
"Peer authenticated using %d bytes of '%s' HMAC
\n
"
,
resp_size
,
mdev
->
net_conf
->
cram_hmac_alg
);
else
rv
=
-
1
;
fail:
kfree
(
peers_ch
);
...
...
include/linux/drbd.h
浏览文件 @
2705ca79
...
...
@@ -53,7 +53,7 @@
extern
const
char
*
drbd_buildtag
(
void
);
#define REL_VERSION "8.3.
6
"
#define REL_VERSION "8.3.
7
"
#define API_VERSION 88
#define PRO_VERSION_MIN 86
#define PRO_VERSION_MAX 91
...
...
include/linux/drbd_nl.h
浏览文件 @
2705ca79
...
...
@@ -69,6 +69,7 @@ NL_PACKET(disconnect, 6, )
NL_PACKET
(
resize
,
7
,
NL_INT64
(
29
,
T_MAY_IGNORE
,
resize_size
)
NL_BIT
(
68
,
T_MAY_IGNORE
,
resize_force
)
)
NL_PACKET
(
syncer_conf
,
8
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录