ENTRY;
wobdo = object_update_param_get(update, 0, &size);
- if (IS_ERR(wobdo) || size != sizeof(*wobdo)) {
- CERROR("%s: obdo is NULL, invalid RPC: rc = %ld\n",
- tgt_name(tsi->tsi_tgt), PTR_ERR(wobdo));
- RETURN(PTR_ERR(wobdo));
+ if (IS_ERR(wobdo)) {
+ rc = PTR_ERR(wobdo);
+ CERROR("%s: obdo is NULL, invalid RPC: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), rc);
+ RETURN(rc);
+ }
+ if (size != sizeof(*wobdo)) {
+ rc = -EPROTO;
+ CERROR("%s: wrong size for obdo %zu != %zu, invalid RPC: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), size, sizeof(*wobdo), rc);
+ RETURN(rc);
}
if (req_capsule_req_need_swab(tsi->tsi_pill))
dof->dof_type = dt_mode_to_dft(attr->la_mode);
if (update->ou_params_count > 1) {
fid = object_update_param_get(update, 1, &size);
- if (IS_ERR(fid) || size != sizeof(*fid)) {
- CERROR("%s: invalid fid: rc = %ld\n",
- tgt_name(tsi->tsi_tgt), PTR_ERR(fid));
- RETURN(PTR_ERR(fid));
+ if (IS_ERR(fid)) {
+ rc = PTR_ERR(fid);
+ CERROR("%s: invalid fid: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), rc);
+ RETURN(rc);
+ }
+ if (size != sizeof(*fid)) {
+ rc = -EPROTO;
+ CERROR("%s: wrong size for fid %zu != %zu: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), size, sizeof(*fid), rc);
+ RETURN(rc);
}
if (req_capsule_req_need_swab(tsi->tsi_pill))
lustre_swab_lu_fid(fid);
ENTRY;
wobdo = object_update_param_get(update, 0, &size);
- if (IS_ERR(wobdo) || size != sizeof(*wobdo)) {
- CERROR("%s: empty obdo in the update: rc = %ld\n",
- tgt_name(tsi->tsi_tgt), PTR_ERR(wobdo));
- RETURN(PTR_ERR(wobdo));
+ if (IS_ERR(wobdo)) {
+ rc = PTR_ERR(wobdo);
+ CERROR("%s: empty obdo in the update: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), rc);
+ RETURN(rc);
+ }
+ if (size != sizeof(*wobdo)) {
+ rc = -EPROTO;
+ CERROR("%s: wrong size for obdo %zu != %zu in the update: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), size, sizeof(*wobdo), rc);
+ RETURN(rc);
}
attr->la_valid = 0;
lbuf->lb_len = buf_len;
tmp = object_update_param_get(update, 2, &size);
- if (IS_ERR(tmp) || size != sizeof(*tmp)) {
- CERROR("%s: emptry or wrong size %zu flag: rc = %ld\n",
- tgt_name(tsi->tsi_tgt), size, PTR_ERR(tmp));
- RETURN(PTR_ERR(tmp));
+ if (IS_ERR(tmp)) {
+ rc = PTR_ERR(tmp);
+ CERROR("%s: emptry flag: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), rc);
+ RETURN(rc);
+ }
+ if (size != sizeof(*tmp)) {
+ rc = -EPROTO;
+ CERROR("%s: wrong size for flag %zu != %zu: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), size, sizeof(*tmp), rc);
+ RETURN(rc);
}
if (req_capsule_req_need_swab(tsi->tsi_pill))
}
fid = object_update_param_get(update, 1, &size);
- if (IS_ERR(fid) || size != sizeof(*fid)) {
- CERROR("%s: invalid fid: rc = %ld\n",
- tgt_name(tsi->tsi_tgt), PTR_ERR(fid));
- RETURN(PTR_ERR(fid));
+ if (IS_ERR(fid)) {
+ rc = PTR_ERR(fid);
+ CERROR("%s: invalid fid: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), rc);
+ RETURN(rc);
+ }
+ if (size != sizeof(*fid)) {
+ rc = -EPROTO;
+ CERROR("%s: wrong size for fid %zu != %zu: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), size, sizeof(*fid), rc);
+ RETURN(rc);
}
if (req_capsule_req_need_swab(tsi->tsi_pill))
}
ptype = object_update_param_get(update, 2, &size);
- if (IS_ERR(ptype) || size != sizeof(*ptype)) {
- CERROR("%s: invalid type for index insert: rc = %ld\n",
- tgt_name(tsi->tsi_tgt), PTR_ERR(ptype));
- RETURN(PTR_ERR(ptype));
+ if (IS_ERR(ptype)) {
+ rc = PTR_ERR(ptype);
+ CERROR("%s: invalid type for index insert: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), rc);
+ RETURN(rc);
+ }
+ if (size != sizeof(*ptype)) {
+ rc = -EPROTO;
+ CERROR("%s: wrong size for index insert %zu != %zu: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), size, sizeof(*ptype), rc);
+ RETURN(rc);
}
if (req_capsule_req_need_swab(tsi->tsi_pill))
ENTRY;
buf = object_update_param_get(update, 0, &buf_len);
- if (IS_ERR(buf) || buf_len == 0) {
- CERROR("%s: empty buf for xattr set: rc = %ld\n",
- tgt_name(tsi->tsi_tgt), PTR_ERR(buf));
- RETURN(PTR_ERR(buf));
+ if (IS_ERR(buf)) {
+ rc = PTR_ERR(buf);
+ CERROR("%s: empty buf for xattr set: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), rc);
+ RETURN(rc);
+ }
+ if (buf_len == 0) {
+ rc = -EPROTO;
+ CERROR("%s: wrong buf_len %zu != 0 for xattr set: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), buf_len, rc);
+ RETURN(rc);
}
lbuf->lb_buf = buf;
lbuf->lb_len = buf_len;
tmp = object_update_param_get(update, 1, &size);
- if (IS_ERR(tmp) || size != sizeof(*tmp)) {
- CERROR("%s: empty or wrong size %zu pos: rc = %ld\n",
- tgt_name(tsi->tsi_tgt), size, PTR_ERR(tmp));
- RETURN(PTR_ERR(tmp));
+ if (IS_ERR(tmp)) {
+ rc = PTR_ERR(tmp);
+ CERROR("%s: empty pos: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), rc);
+ RETURN(rc);
+ }
+ if (size != sizeof(*tmp)) {
+ rc = -EPROTO;
+ CERROR("%s: wrong size for pos %zu != %zu: rc = %d\n",
+ tgt_name(tsi->tsi_tgt), size, sizeof(*tmp), rc);
+ RETURN(rc);
}
if (req_capsule_req_need_swab(tsi->tsi_pill))