summaryrefslogtreecommitdiff
path: root/src/mds/MDCache.cc
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-10-11 15:13:22 +0800
committerYan, Zheng <zheng.z.yan@intel.com>2013-10-11 17:13:11 +0800
commiteb381ffc8db14f13a7c5e3528a109bf89a7c5b31 (patch)
treebbbcb291d6419ae533239f3d8ae549fd811ff8bf /src/mds/MDCache.cc
parentcb9ebd6f363fb571ecb770eab9ab1313cb407108 (diff)
downloadceph-wip-filerecover.tar.gz
mds: don't decrease file size when recovering filewip-filerecover
Otherwise we may truncate sparse file to wrong size Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'src/mds/MDCache.cc')
-rw-r--r--src/mds/MDCache.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index 9dc1229fbb9..c83bfcc7154 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -5787,21 +5787,15 @@ void MDCache::do_file_recover()
dout(10) << "do_file_recover skipping " << in->inode.size
<< " " << *in << dendl;
in->state_clear(CInode::STATE_RECOVERING);
+ mds->locker->eval(in, CEPH_LOCK_IFILE);
in->auth_unpin(this);
- if (in->filelock.is_stable()) {
- bool need_issue = false;
- mds->locker->eval(&in->filelock, &need_issue);
- if (in->is_head() && need_issue)
- mds->locker->issue_caps(in);
- } else
- mds->locker->eval_gather(&in->filelock);
}
}
}
void MDCache::_recovered(CInode *in, int r, uint64_t size, utime_t mtime)
{
- dout(10) << "_recovered r=" << r << " size=" << in->inode.size << " mtime=" << in->inode.mtime
+ dout(10) << "_recovered r=" << r << " size=" << size << " mtime=" << mtime
<< " for " << *in << dendl;
if (r != 0) {
@@ -5823,6 +5817,7 @@ void MDCache::_recovered(CInode *in, int r, uint64_t size, utime_t mtime)
} else {
// journal
mds->locker->check_inode_max_size(in, true, true, size, false, 0, mtime);
+ mds->locker->eval(in, CEPH_LOCK_IFILE);
in->auth_unpin(this);
}