CInode *root; // root inode
CInode *myin; // .ceph/mds%d dir
+ bool readonly;
+ void set_readonly() { readonly = true; }
+
CInode *strays[NUM_STRAY]; // my stray dir
int stray_index;
void advance_stray() {
stray_index = (stray_index+1)%NUM_STRAY;
}
+ bool is_readonly() { return readonly; }
+
DecayRate decayrate;
// we shouldn't be waiting on anyone.
assert(mdr->more()->waiting_on_slave.empty());
+
+ if (req->get_op() & CEPH_MDS_OP_WRITE) {
+ if (mdcache->is_readonly()) {
+ dout(10) << " read-only FS" << dendl;
+ respond_to_request(mdr, -EROFS);
+ return;
+ }
+ }
switch (req->get_op()) {
case CEPH_MDS_OP_LOOKUPHASH:
respond_to_request(mdr, -EINVAL);
return;
}
+
+ if ((cmode & CEPH_FILE_MODE_WR) && mdcache->is_readonly()) {
+ dout(7) << "read-only FS" << dendl;
+ respond_to_request(mdr, -EROFS);
+ }
set<SimpleLock*> rdlocks, wrlocks, xlocks;
CInode *cur = rdlock_path_pin_ref(mdr, 0, rdlocks, need_auth);