[LU-6500] strange redundant rc checks in ldlm Created: 25/Apr/15 Updated: 25/Apr/15 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Oleg Drokin | Assignee: | WC Triage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
smatch highlights these two redundant checks in ldlm. ldlm_lock.c::ldlm_lock_enqueue: } else if (rc != ELDLM_OK ||
(rc == ELDLM_OK && (*flags & LDLM_FL_INTENT_ONLY))) {
ldlm_lock_destroy(lock);
return rc;
}
We probbly can just drop the other 'rc ==' check ldlm_lib.c::client_connect_import(): rc = ptlrpc_connect_import(imp);
if (rc != 0) {
LASSERT(imp->imp_state == LUSTRE_IMP_DISCON);
goto out_ldlm;
}
...
if (rc) {
out_ldlm:
cli->cl_conn_count--;
class_disconnect(*exp);
We probably can drop the latter rc check now? |