diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2012-11-30 09:13:43 +0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-12-11 09:06:52 -0800 |
commit | 9a40ef013140994466fb7dc8833838a5aab75baa (patch) | |
tree | 7ee9b5f838aa97185639f60806e4047a22c48260 | |
parent | b9d717cd34aa642c18aa903458f9a4bf31989632 (diff) | |
download | ceph-9a40ef013140994466fb7dc8833838a5aab75baa.tar.gz |
mds: fix journaling issue regarding rstat accounting
Rename operation can call predirty_journal_parents() several times.
So a directory fragment's rstat can also be modified several times.
But only the first modification is journaled because EMetaBlob::add_dir()
does not update existing dirlump.
For example: when hanlding 'mv a/b/c a/c', Server::_rename_prepare may
first decrease directory a and b's nested files count by one, then
increases directory a's nested files count by one.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
-rw-r--r-- | src/mds/events/EMetaBlob.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mds/events/EMetaBlob.h b/src/mds/events/EMetaBlob.h index 9c281e9a048..116b70415c3 100644 --- a/src/mds/events/EMetaBlob.h +++ b/src/mds/events/EMetaBlob.h @@ -635,12 +635,12 @@ private: dirty, complete, isnew); } dirlump& add_dir(dirfrag_t df, fnode_t *pf, version_t pv, bool dirty, bool complete=false, bool isnew=false) { - if (lump_map.count(df) == 0) { + if (lump_map.count(df) == 0) lump_order.push_back(df); - lump_map[df].fnode = *pf; - lump_map[df].fnode.version = pv; - } + dirlump& l = lump_map[df]; + l.fnode = *pf; + l.fnode.version = pv; if (complete) l.mark_complete(); if (dirty) l.mark_dirty(); if (isnew) l.mark_new(); |