[LU-11610] Incorrect use of PTR_ERR on valid pointers in out_handler.c Created: 03/Nov/18 Updated: 20/Jan/22 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.12.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Oleg Drokin | Assignee: | WC Triage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | easy | ||
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
It looks like there's a lot of incorrect code like this:
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));
}
so it's clear when IS_ERR is true all is fine, but when sizeof does not match - the pointer is likely valid so some different handling needs to be made? here's the total list of all offenders: |
| Comments |
| Comment by Andreas Dilger [ 20/Jan/22 ] |
|
still an issue |