@@ -1229,9 +1229,9 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
BUILD_BUG_ON(sizeof(struct lov_user_md_v3) <=
sizeof(struct lov_comp_md_v1));
- LASSERT(sizeof(lumv3) == sizeof(*lumv3p));
- LASSERT(sizeof(lumv3.lmm_objects[0]) ==
- sizeof(lumv3p->lmm_objects[0]));
+ BUILD_BUG_ON(sizeof(lumv3) != sizeof(*lumv3p));
+ BUILD_BUG_ON(sizeof(lumv3.lmm_objects[0]) !=
+ sizeof(lumv3p->lmm_objects[0]));
/* first try with v1 which is smaller than v3 */
if (copy_from_user(lumv1, lumv1p, sizeof(*lumv1)))
return -EFAULT;
@@ -2934,7 +2934,7 @@ int ptlrpc_replay_req(struct ptlrpc_request *req)
LASSERT(req->rq_import->imp_state == LUSTRE_IMP_REPLAY);
- LASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
+ BUILD_BUG_ON(sizeof(*aa) > sizeof(req->rq_async_args));
aa = ptlrpc_req_async_args(req);
memset(aa, 0, sizeof(*aa));
@@ -449,6 +449,7 @@ static void nrs_policy_get_info_locked(struct ptlrpc_nrs_policy *policy,
{
assert_spin_locked(&policy->pol_nrs->nrs_lock);
+ BUILD_BUG_ON(sizeof(info->pi_arg) != sizeof(policy->pol_arg));
memcpy(info->pi_name, policy->pol_desc->pd_name, NRS_POL_NAME_MAX);
info->pi_fallback = !!(policy->pol_flags & PTLRPC_NRS_FL_FALLBACK);