Whamcloud - gitweb
Add a minor check to the punch call.
authoradilger <adilger>
Fri, 18 Oct 2002 07:34:23 +0000 (07:34 +0000)
committeradilger <adilger>
Fri, 18 Oct 2002 07:34:23 +0000 (07:34 +0000)
lustre/ost/ost_handler.c

index 541e3e1..4ea6dea 100644 (file)
@@ -166,6 +166,10 @@ static int ost_punch(struct ptlrpc_request *req)
 
         body = lustre_msg_buf(req->rq_reqmsg, 0);
 
+        if (!(body->oa.o_valid & OBD_MD_FLSIZE) ||
+            !(body->oa.o_valid & OBD_MD_FLBLOCKS))
+                RETURN(-EINVAL);
+
         rc = lustre_pack_msg(1, &size, NULL, &req->rq_replen, &req->rq_repmsg);
         if (rc)
                 RETURN(rc);