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
1c841a96
Commit
1c841a96
authored
Mar 24, 2015
by
Yan, Zheng
Committed by
Ilya Dryomov
Apr 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph: cleanup unsafe requests when reconnecting is denied
Signed-off-by:
Yan, Zheng
<
zyan@redhat.com
>
parent
a9f6eb61
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
fs/ceph/mds_client.c
fs/ceph/mds_client.c
+28
-0
No files found.
fs/ceph/mds_client.c
View file @
1c841a96
...
@@ -1021,6 +1021,33 @@ static void cleanup_cap_releases(struct ceph_mds_session *session)
...
@@ -1021,6 +1021,33 @@ static void cleanup_cap_releases(struct ceph_mds_session *session)
spin_unlock
(
&
session
->
s_cap_lock
);
spin_unlock
(
&
session
->
s_cap_lock
);
}
}
static
void
cleanup_session_requests
(
struct
ceph_mds_client
*
mdsc
,
struct
ceph_mds_session
*
session
)
{
struct
ceph_mds_request
*
req
;
struct
rb_node
*
p
;
dout
(
"cleanup_session_requests mds%d
\n
"
,
session
->
s_mds
);
mutex_lock
(
&
mdsc
->
mutex
);
while
(
!
list_empty
(
&
session
->
s_unsafe
))
{
req
=
list_first_entry
(
&
session
->
s_unsafe
,
struct
ceph_mds_request
,
r_unsafe_item
);
list_del_init
(
&
req
->
r_unsafe_item
);
pr_info
(
" dropping unsafe request %llu
\n
"
,
req
->
r_tid
);
__unregister_request
(
mdsc
,
req
);
}
/* zero r_attempts, so kick_requests() will re-send requests */
p
=
rb_first
(
&
mdsc
->
request_tree
);
while
(
p
)
{
req
=
rb_entry
(
p
,
struct
ceph_mds_request
,
r_node
);
p
=
rb_next
(
p
);
if
(
req
->
r_session
&&
req
->
r_session
->
s_mds
==
session
->
s_mds
)
req
->
r_attempts
=
0
;
}
mutex_unlock
(
&
mdsc
->
mutex
);
}
/*
/*
* Helper to safely iterate over all caps associated with a session, with
* Helper to safely iterate over all caps associated with a session, with
* special care taken to handle a racing __ceph_remove_cap().
* special care taken to handle a racing __ceph_remove_cap().
...
@@ -2589,6 +2616,7 @@ static void handle_session(struct ceph_mds_session *session,
...
@@ -2589,6 +2616,7 @@ static void handle_session(struct ceph_mds_session *session,
case
CEPH_SESSION_CLOSE
:
case
CEPH_SESSION_CLOSE
:
if
(
session
->
s_state
==
CEPH_MDS_SESSION_RECONNECTING
)
if
(
session
->
s_state
==
CEPH_MDS_SESSION_RECONNECTING
)
pr_info
(
"mds%d reconnect denied
\n
"
,
session
->
s_mds
);
pr_info
(
"mds%d reconnect denied
\n
"
,
session
->
s_mds
);
cleanup_session_requests
(
mdsc
,
session
);
remove_session_caps
(
session
);
remove_session_caps
(
session
);
wake
=
2
;
/* for good measure */
wake
=
2
;
/* for good measure */
wake_up_all
(
&
mdsc
->
session_close_wq
);
wake_up_all
(
&
mdsc
->
session_close_wq
);
...
...
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