]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: EINVAL on truncate to huge object size
authorSage Weil <sage@newdream.net>
Wed, 30 Nov 2011 01:17:25 +0000 (17:17 -0800)
committerSage Weil <sage@newdream.net>
Mon, 19 Dec 2011 22:02:10 +0000 (14:02 -0800)
Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/ReplicatedPG.cc

index 7b2dd8a1a45da85bbb72d01602874ec27f4c8dd3..e431f1a4dede14d493098a56029f4ebbf4a58c08 100644 (file)
@@ -1699,7 +1699,11 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
       // falling through
 
     case CEPH_OSD_OP_TRUNCATE:
-      { // truncate
+      if (op.extent.truncate_size > (1ULL << 63)) {
+       dout(10) << " truncate to huge size probably a client bug" << dendl;
+       result = -EINVAL;
+      } else {
+       // truncate
        if (!obs.exists) {
          dout(10) << " object dne, truncate is a no-op" << dendl;
          break;