summaryrefslogtreecommitdiffstats
path: root/src/messages/MDentryLink.h
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2012-12-08 15:43:32 +0100
committerSage Weil <sage@inktank.com>2012-12-24 05:01:12 +0100
commit0002546205a46306433b3c85b079bbb64fb45f09 (patch)
treebb52a298a5052712c9ea7c252cfc9334136d529e /src/messages/MDentryLink.h
parentmds: fix file existing check in Server::handle_client_openc() (diff)
downloadceph-0002546205a46306433b3c85b079bbb64fb45f09.tar.xz
ceph-0002546205a46306433b3c85b079bbb64fb45f09.zip
mds: fix race between send_dentry_link() and cache expire
MDentryLink message can race with cache expire, When it arrives at the target MDS, it's possible there is no corresponding dentry in the cache. If this race happens, we should expire the replica inode encoded in the MDentryLink message. But to expire an inode, the MDS need to know which subtree does the inode belong to, so modify the MDentryLink message to include this information. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'src/messages/MDentryLink.h')
-rw-r--r--src/messages/MDentryLink.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/messages/MDentryLink.h b/src/messages/MDentryLink.h
index ed02bc20e6b..b351532799b 100644
--- a/src/messages/MDentryLink.h
+++ b/src/messages/MDentryLink.h
@@ -17,11 +17,13 @@
#define CEPH_MDENTRYLINK_H
class MDentryLink : public Message {
+ dirfrag_t subtree;
dirfrag_t dirfrag;
string dn;
bool is_primary;
public:
+ dirfrag_t get_subtree() { return subtree; }
dirfrag_t get_dirfrag() { return dirfrag; }
string& get_dn() { return dn; }
bool get_is_primary() { return is_primary; }
@@ -30,8 +32,9 @@ class MDentryLink : public Message {
MDentryLink() :
Message(MSG_MDS_DENTRYLINK) { }
- MDentryLink(dirfrag_t df, string& n, bool p) :
+ MDentryLink(dirfrag_t r, dirfrag_t df, string& n, bool p) :
Message(MSG_MDS_DENTRYLINK),
+ subtree(r),
dirfrag(df),
dn(n),
is_primary(p) {}
@@ -46,12 +49,14 @@ public:
void decode_payload() {
bufferlist::iterator p = payload.begin();
+ ::decode(subtree, p);
::decode(dirfrag, p);
::decode(dn, p);
::decode(is_primary, p);
::decode(bl, p);
}
void encode_payload(uint64_t features) {
+ ::encode(subtree, payload);
::encode(dirfrag, payload);
::encode(dn, payload);
::encode(is_primary, payload);