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
54519c5f
Commit
54519c5f
authored
Jun 06, 2014
by
Goldwyn Rodrigues
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lock bitmap while joining the cluster
Signed-off-by:
Goldwyn Rodrigues
<
rgoldwyn@suse.com
>
parent
b97e9257
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
drivers/md/md-cluster.c
drivers/md/md-cluster.c
+14
-0
No files found.
drivers/md/md-cluster.c
View file @
54519c5f
...
...
@@ -34,6 +34,7 @@ struct md_cluster_info {
struct
completion
completion
;
struct
dlm_lock_resource
*
sb_lock
;
struct
mutex
sb_mutex
;
struct
dlm_lock_resource
*
bitmap_lockres
;
};
static
void
sync_ast
(
void
*
arg
)
...
...
@@ -208,6 +209,18 @@ static int join(struct mddev *mddev, int nodes)
ret
=
-
ENOMEM
;
goto
err
;
}
pr_info
(
"md-cluster: Joined cluster %s slot %d
\n
"
,
str
,
cinfo
->
slot_number
);
snprintf
(
str
,
64
,
"bitmap%04d"
,
cinfo
->
slot_number
-
1
);
cinfo
->
bitmap_lockres
=
lockres_init
(
mddev
,
str
,
NULL
,
1
);
if
(
!
cinfo
->
bitmap_lockres
)
goto
err
;
if
(
dlm_lock_sync
(
cinfo
->
bitmap_lockres
,
DLM_LOCK_PW
))
{
pr_err
(
"Failed to get bitmap lock
\n
"
);
ret
=
-
EINVAL
;
goto
err
;
}
return
0
;
err:
if
(
cinfo
->
lockspace
)
...
...
@@ -225,6 +238,7 @@ static int leave(struct mddev *mddev)
if
(
!
cinfo
)
return
0
;
lockres_free
(
cinfo
->
sb_lock
);
lockres_free
(
cinfo
->
bitmap_lockres
);
dlm_release_lockspace
(
cinfo
->
lockspace
,
2
);
return
0
;
}
...
...
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