[LU-7628] bad NULL pointer check in cb_migrate_mdt_init() Created: 04/Jan/16 Updated: 25/Jan/16 Resolved: 25/Jan/16 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.8.0 |
| Fix Version/s: | Lustre 2.8.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | John Hammond | Assignee: | Emoly Liu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | llapi | ||
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
At the end of cb_migrate_mdt_init(), after calling opendir() we should test *dirp rather than dirp: out:
if (dirp != NULL) {
/* If the directory is being migration, we need
* close the directory after migration,
* so the old directory cache will be cleanup
* on the client side, and re-open to get the
* new directory handle */
*dirp = opendir(path);
if (dirp == NULL) {
ret = -errno;
llapi_error(LLAPI_MSG_ERROR, ret,
"%s: Failed to open '%s'", __func__, path);
return ret;
}
}
if (parent == NULL)
closedir(dir);
return ret;
We also may leak dir on early return but the logic of this function is so convoluted that it's hard to tell. |
| Comments |
| Comment by Gerrit Updater [ 05/Jan/16 ] |
|
Emoly Liu (emoly.liu@intel.com) uploaded a new patch: http://review.whamcloud.com/17814 |
| Comment by Gerrit Updater [ 25/Jan/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/17814/ |
| Comment by Emoly Liu [ 25/Jan/16 ] |
|
Landed for 2.8.0 |