Reply with -EROFS to write commands in readonly mode
parent
762bd42096
commit
ce78454215
10
osd.cpp
10
osd.cpp
|
@ -453,6 +453,16 @@ void osd_t::exec_op(osd_op_t *cur_op)
|
||||||
finish_op(cur_op, -EINVAL);
|
finish_op(cur_op, -EINVAL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (readonly &&
|
||||||
|
cur_op->req.hdr.opcode != OSD_OP_SECONDARY_READ &&
|
||||||
|
cur_op->req.hdr.opcode != OSD_OP_SECONDARY_LIST &&
|
||||||
|
cur_op->req.hdr.opcode != OSD_OP_READ &&
|
||||||
|
cur_op->req.hdr.opcode != OSD_OP_SHOW_CONFIG)
|
||||||
|
{
|
||||||
|
// Readonly mode
|
||||||
|
finish_op(cur_op, -EROFS);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (cur_op->req.hdr.opcode == OSD_OP_TEST_SYNC_STAB_ALL)
|
if (cur_op->req.hdr.opcode == OSD_OP_TEST_SYNC_STAB_ALL)
|
||||||
{
|
{
|
||||||
exec_sync_stab_all(cur_op);
|
exec_sync_stab_all(cur_op);
|
||||||
|
|
Loading…
Reference in New Issue