mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-04-27 03:12:57 +00:00
dm: Fix concurrent acrn-dm hugetlb init race
During init of hugetlb we check and create /run/hugepage/acrn folder. Concurrent acrn-dm instances might race between the time of check and create. This commit ignore EEXIST error when creating directory. Tracked-On: #8764 Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
This commit is contained in:
parent
bff0493d25
commit
11d7c0dcb3
@ -555,8 +555,13 @@ bool init_hugetlb(void)
|
||||
path[i] = 0;
|
||||
if (access(path, F_OK) != 0) {
|
||||
if (mkdir(path, 0755) < 0) {
|
||||
pr_err("mkdir %s failed.\n", path);
|
||||
return -1;
|
||||
/* We might have multiple acrn-dm instances booting VMs at
|
||||
* the same time
|
||||
*/
|
||||
if (errno != EEXIST) {
|
||||
pr_err("mkdir %s failed: %s\n", path, errormsg(errno));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
path[i] = '/';
|
||||
|
Loading…
Reference in New Issue
Block a user