Details
-
Bug
-
Resolution: Fixed
-
Minor
-
Lustre 2.8.0
-
3
-
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.