Whamcloud - gitweb
LU-6401 uapi: fix up lustre_ostid.h and lustre_fid.h
[fs/lustre-release.git] / lustre / obdecho / echo.c
index 5d60b18..de7fd77 100644 (file)
@@ -137,7 +137,11 @@ static int echo_create(const struct lu_env *env, struct obd_export *exp,
         }
 
        ostid_set_seq_echo(&oa->o_oi);
-       ostid_set_id(&oa->o_oi, echo_next_id(obd));
+       if (ostid_set_id(&oa->o_oi, echo_next_id(obd))) {
+               CERROR("Bad %llu to set " DOSTID "\n",
+                      echo_next_id(obd), POSTID(&oa->o_oi));
+               return -EINVAL;
+       }
        oa->o_valid = OBD_MD_FLID;
 
        return 0;
@@ -189,7 +193,11 @@ static int echo_getattr(const struct lu_env *env, struct obd_export *exp,
 
        obdo_cpy_md(oa, &obd->u.echo.eo_oa, oa->o_valid);
        ostid_set_seq_echo(&oa->o_oi);
-       ostid_set_id(&oa->o_oi, id);
+       if (ostid_set_id(&oa->o_oi, id)) {
+               CERROR("Bad %llu to set " DOSTID "\n",
+                      id, POSTID(&oa->o_oi));
+               RETURN(-EINVAL);
+       }
 
        RETURN(0);
 }