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
nexedi
linux
Commits
faeff83f
Commit
faeff83f
authored
Oct 12, 2015
by
Guoqing Jiang
Committed by
Goldwyn Rodrigues
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
md-cluster: make other members of cluster_msg is handled by little endian funcs
Signed-off-by:
Guoqing Jiang
<
gqjiang@suse.com
>
parent
d216711b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
drivers/md/md-cluster.c
drivers/md/md-cluster.c
+14
-10
No files found.
drivers/md/md-cluster.c
View file @
faeff83f
...
...
@@ -418,7 +418,7 @@ static void process_add_new_disk(struct mddev *mddev, struct cluster_msg *cmsg)
len
=
snprintf
(
disk_uuid
,
64
,
"DEVICE_UUID="
);
sprintf
(
disk_uuid
+
len
,
"%pU"
,
cmsg
->
uuid
);
snprintf
(
raid_slot
,
16
,
"RAID_DISK=%d"
,
cmsg
->
raid_slot
);
snprintf
(
raid_slot
,
16
,
"RAID_DISK=%d"
,
le32_to_cpu
(
cmsg
->
raid_slot
)
);
pr_info
(
"%s:%d Sending kobject change with %s and %s
\n
"
,
__func__
,
__LINE__
,
disk_uuid
,
raid_slot
);
init_completion
(
&
cinfo
->
newdisk_completion
);
set_bit
(
MD_CLUSTER_WAITING_FOR_NEWDISK
,
&
cinfo
->
state
);
...
...
@@ -438,22 +438,26 @@ static void process_metadata_update(struct mddev *mddev, struct cluster_msg *msg
static
void
process_remove_disk
(
struct
mddev
*
mddev
,
struct
cluster_msg
*
msg
)
{
struct
md_rdev
*
rdev
=
md_find_rdev_nr_rcu
(
mddev
,
msg
->
raid_slot
);
struct
md_rdev
*
rdev
=
md_find_rdev_nr_rcu
(
mddev
,
le32_to_cpu
(
msg
->
raid_slot
));
if
(
rdev
)
md_kick_rdev_from_array
(
rdev
);
else
pr_warn
(
"%s: %d Could not find disk(%d) to REMOVE
\n
"
,
__func__
,
__LINE__
,
msg
->
raid_slot
);
pr_warn
(
"%s: %d Could not find disk(%d) to REMOVE
\n
"
,
__func__
,
__LINE__
,
le32_to_cpu
(
msg
->
raid_slot
));
}
static
void
process_readd_disk
(
struct
mddev
*
mddev
,
struct
cluster_msg
*
msg
)
{
struct
md_rdev
*
rdev
=
md_find_rdev_nr_rcu
(
mddev
,
msg
->
raid_slot
);
struct
md_rdev
*
rdev
=
md_find_rdev_nr_rcu
(
mddev
,
le32_to_cpu
(
msg
->
raid_slot
));
if
(
rdev
&&
test_bit
(
Faulty
,
&
rdev
->
flags
))
clear_bit
(
Faulty
,
&
rdev
->
flags
);
else
pr_warn
(
"%s: %d Could not find disk(%d) which is faulty"
,
__func__
,
__LINE__
,
msg
->
raid_slot
);
pr_warn
(
"%s: %d Could not find disk(%d) which is faulty"
,
__func__
,
__LINE__
,
le32_to_cpu
(
msg
->
raid_slot
));
}
static
void
process_recvd_msg
(
struct
mddev
*
mddev
,
struct
cluster_msg
*
msg
)
...
...
@@ -936,7 +940,7 @@ static int add_new_disk(struct mddev *mddev, struct md_rdev *rdev)
memset
(
&
cmsg
,
0
,
sizeof
(
cmsg
));
cmsg
.
type
=
cpu_to_le32
(
NEWDISK
);
memcpy
(
cmsg
.
uuid
,
uuid
,
16
);
cmsg
.
raid_slot
=
rdev
->
desc_nr
;
cmsg
.
raid_slot
=
cpu_to_le32
(
rdev
->
desc_nr
)
;
lock_comm
(
cinfo
);
ret
=
__sendmsg
(
cinfo
,
&
cmsg
);
if
(
ret
)
...
...
@@ -979,8 +983,8 @@ static int remove_disk(struct mddev *mddev, struct md_rdev *rdev)
{
struct
cluster_msg
cmsg
;
struct
md_cluster_info
*
cinfo
=
mddev
->
cluster_info
;
cmsg
.
type
=
REMOVE
;
cmsg
.
raid_slot
=
rdev
->
desc_nr
;
cmsg
.
type
=
cpu_to_le32
(
REMOVE
)
;
cmsg
.
raid_slot
=
cpu_to_le32
(
rdev
->
desc_nr
)
;
return
__sendmsg
(
cinfo
,
&
cmsg
);
}
...
...
@@ -992,8 +996,8 @@ static int gather_bitmaps(struct md_rdev *rdev)
struct
mddev
*
mddev
=
rdev
->
mddev
;
struct
md_cluster_info
*
cinfo
=
mddev
->
cluster_info
;
cmsg
.
type
=
RE_ADD
;
cmsg
.
raid_slot
=
rdev
->
desc_nr
;
cmsg
.
type
=
cpu_to_le32
(
RE_ADD
)
;
cmsg
.
raid_slot
=
cpu_to_le32
(
rdev
->
desc_nr
)
;
err
=
sendmsg
(
cinfo
,
&
cmsg
);
if
(
err
)
goto
out
;
...
...
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