diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-01-21 10:04:03 +0800 |
---|---|---|
committer | Yan, Zheng <zheng.z.yan@intel.com> | 2013-01-29 10:17:36 +0800 |
commit | 9a0cfcc56d24b91cf22f04d91b756261c1b4e410 (patch) | |
tree | d53f86bed633b0b8d1dedb192e51ae6e82fa51ca | |
parent | 0cf5e4e55ddf32d5087b39ab06961b22db5d6b5a (diff) | |
download | ceph-9a0cfcc56d24b91cf22f04d91b756261c1b4e410.tar.gz |
mds: don't journal opened non-auth inode
If we journal opened non-auth inode, during journal replay, the corresponding
entry will add non-auth objects to the cache. But the MDS does not journal all
subsequent modifications (rmdir,rename) to these non-auth objects, so the code
that manages cache and subtree may get confused. Besides non-auth objects will
be trimmed at the resolve stage.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
-rw-r--r-- | src/mds/Locker.cc | 2 | ||||
-rw-r--r-- | src/mds/Migrator.cc | 2 | ||||
-rw-r--r-- | src/mds/Server.cc | 3 | ||||
-rw-r--r-- | src/mds/journal.cc | 2 |
4 files changed, 7 insertions, 2 deletions
diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 8847db69339..aac9cf30a47 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -2141,6 +2141,8 @@ void Locker::adjust_cap_wanted(Capability *cap, int wanted, int issue_seq) } CInode *cur = cap->get_inode(); + if (!cur->is_auth()) + return; if (cap->wanted() == 0) { if (cur->item_open_file.is_on_list() && !cur->is_any_caps_wanted()) { diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index bda8035bb4f..453cfafef43 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -1093,6 +1093,8 @@ void Migrator::finish_export_inode(CInode *in, utime_t now, list<Context*>& fini in->clear_dirty_rstat(); + in->item_open_file.remove_myself(); + // waiters in->take_waiting(CInode::WAIT_ANY_MASK, finished); diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 2b5c9e53bad..7a459324283 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2549,7 +2549,8 @@ void Server::handle_client_open(MDRequest *mdr) mds->locker->check_inode_max_size(cur); // make sure this inode gets into the journal - if (!cur->item_open_file.is_on_list() && cur->last == CEPH_NOSNAP) { + if (cur->is_auth() && cur->last == CEPH_NOSNAP && + !cur->item_open_file.is_on_list()) { LogSegment *ls = mds->mdlog->get_current_segment(); EOpen *le = new EOpen(mds->mdlog); mdlog->start_entry(le); diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 429608ad036..ff09e15d9f8 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -145,7 +145,7 @@ void LogSegment::try_to_expire(MDS *mds, C_GatherBuilder &gather_bld) CInode *in = *p; assert(in->last == CEPH_NOSNAP); ++p; - if (in->is_any_caps()) { + if (in->is_auth() && in->is_any_caps()) { if (in->is_any_caps_wanted()) { dout(20) << "try_to_expire requeueing open file " << *in << dendl; if (!le) { |