summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-11-28 21:19:37 -0800
committerSage Weil <sage@inktank.com>2012-11-29 17:21:45 -0800
commitf0c2920e02e17d4c236c7fcfcd82d5a82c655fc7 (patch)
treeed3985d27aa9c4f5379159019b38f80babd0a735
parent41ef9bbbe87c5a6137a16f33a29eec4612b4980a (diff)
downloadceph-f0c2920e02e17d4c236c7fcfcd82d5a82c655fc7.tar.gz
mds: be explicit about MDRequest killed state
Set the killed flag and use that instead of inferring things from the session xlist. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/mds/MDCache.cc10
-rw-r--r--src/mds/Mutation.h5
2 files changed, 8 insertions, 7 deletions
diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index 2ab85808e7e..5f0ba16defd 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -7488,12 +7488,11 @@ void MDCache::request_forward(MDRequest *mdr, int who, int port)
void MDCache::dispatch_request(MDRequest *mdr)
{
+ if (mdr->killed) {
+ dout(10) << "request " << *mdr << " was killed" << dendl;
+ return;
+ }
if (mdr->client_request) {
- if (!mdr->reqid.name.is_mds() &&
- !mdr->item_session_request.is_on_list()) {
- dout(10) << "request " << *mdr << " is canceled" << dendl;
- return;
- }
mds->server->dispatch_client_request(mdr);
} else if (mdr->slave_request) {
mds->server->dispatch_slave_request(mdr);
@@ -7605,6 +7604,7 @@ void MDCache::request_cleanup(MDRequest *mdr)
void MDCache::request_kill(MDRequest *mdr)
{
+ mdr->killed = true;
if (!mdr->committing) {
dout(10) << "request_kill " << *mdr << dendl;
request_cleanup(mdr);
diff --git a/src/mds/Mutation.h b/src/mds/Mutation.h
index ca5ee963a91..cba6223864e 100644
--- a/src/mds/Mutation.h
+++ b/src/mds/Mutation.h
@@ -67,6 +67,7 @@ struct Mutation {
bool done_locking;
bool committing;
bool aborted;
+ bool killed;
// for applying projected inode changes
list<CInode*> projected_inodes;
@@ -81,13 +82,13 @@ struct Mutation {
ls(0),
slave_to_mds(-1),
locking(NULL),
- done_locking(false), committing(false), aborted(false) { }
+ done_locking(false), committing(false), aborted(false), killed(false) { }
Mutation(metareqid_t ri, __u32 att=0, int slave_to=-1)
: reqid(ri), attempt(att),
ls(0),
slave_to_mds(slave_to),
locking(NULL),
- done_locking(false), committing(false), aborted(false) { }
+ done_locking(false), committing(false), aborted(false), killed(false) { }
virtual ~Mutation() {
assert(locking == NULL);
assert(pins.empty());