]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: return ENOSPC for non-mds if full flag is set in osdmap
authorSage Weil <sage@newdream.net>
Sat, 11 Dec 2010 21:58:47 +0000 (13:58 -0800)
committerSage Weil <sage@newdream.net>
Sat, 11 Dec 2010 21:58:47 +0000 (13:58 -0800)
Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSD.cc

index 42437fc8ad5c3d45c9885ba180ab360fff1877ed..bdd4c3d109990f391ac6e56c5881a4b335efb777 100644 (file)
@@ -4860,6 +4860,14 @@ void OSD::handle_op(MOSDOp *op)
 
   // pg must be same-ish...
   if (op->may_write()) {
+    // full?
+    if (osdmap->test_flag(CEPH_OSDMAP_FULL) &&
+       !op->get_source().is_mds()) {  // FIXME: we'll exclude mds writes for now.
+      reply_op_error(op, -ENOSPC);
+      pg->unlock();
+      return;
+    }
+
     if (op->get_snapid() != CEPH_NOSNAP) {
       reply_op_error(op, -EINVAL);
       pg->unlock();