Signed-off-by: Yan, Zheng <zyan@redhat.com>
void MDCache::flush_dentry(const string& path, Context *fin)
{
+ if (is_readonly()) {
+ dout(10) << __func__ << ": read-only FS" << dendl;
+ fin->complete(-EROFS);
+ return;
+ }
dout(10) << "flush_dentry " << path << dendl;
MDRequestRef mdr = request_start_internal(CEPH_MDS_OP_FLUSH);
filepath fp(path.c_str());
Mutex::Locker l(mds_lock);
+ if (mdcache->is_readonly()) {
+ dout(5) << __func__ << ": read-only FS" << dendl;
+ return -EROFS;
+ }
+
// I need to seal off the current segment, and then mark all previous segments
// for expiry
mdlog->start_new_segment();