Skip to content

Commit f0654ce

Browse files
authored
Merge pull request #3130 from artpol84/dstore_fix/v2.x
opal/pmix: Bring dstore fixes for rc3 testing
2 parents e38309b + f4511f9 commit f0654ce

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

opal/mca/pmix/pmix112/README

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ Additional copyrights may follow
66
$HEADER$
77

88
===========================================================================
9-
This internal component includes PMIx v1.2.1 plus these two commits
9+
This internal component includes PMIx v1.2.1 plus following commits
1010
cherry-picked from the PMIx v1.2 branch (which will be included in the
1111
eventual PMIx v1.2.2 release). Newer patches at top.
1212

13+
* https://github.com/pmix/pmix/commit/1b86a6e7ee99fc5969a0789a9905a4a2159a6dc0
14+
* https://github.com/pmix/pmix/commit/14f865c4b631827fb99779d42eaf0567f117a76f
1315
* https://github.com/pmix/pmix/commit/4269e8484bd883523ae485bf2e1b7bbc0719c494
1416
* https://github.com/pmix/pmix/commit/a2d431cbec162b01e15920cc75df1af9ad244f06
1517
* https://github.com/pmix/pmix/commit/8587f278a17301633ccf6f0d7cb086e3be8f4793

opal/mca/pmix/pmix112/pmix/src/sm/pmix_mmap.c

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,38 @@ int _mmap_segment_create(pmix_sm_seg_t *sm_seg, const char *file_name, size_t si
6464
}
6565
/* size backing file - note the use of real_size here */
6666
#ifdef HAVE_POSIX_FALLOCATE
67-
if (0 != posix_fallocate(sm_seg->seg_id, 0, size)) {
67+
if (0 != (rc = posix_fallocate(sm_seg->seg_id, 0, size))) {
6868
pmix_output_verbose(2, pmix_globals.debug_output,
6969
"sys call posix_fallocate(2) fail\n");
70-
if (ENOSPC == errno) {
70+
if (ENOSPC == rc) {
7171
rc = PMIX_ERR_OUT_OF_RESOURCE;
72-
} else {
72+
goto out;
73+
} else if ((ENOTSUP != rc)
74+
#ifdef EOPNOTSUPP
75+
&& (EOPNOTSUPP != rc)
76+
#endif
77+
){
7378
rc = PMIX_ERROR;
79+
goto out;
7480
}
75-
goto out;
81+
/* else:
82+
* Not supported by OS and/or filesystem.
83+
* Must fall-back to ftruncate().
84+
*/
85+
} else {
86+
goto map_memory;
7687
}
77-
#else
88+
#endif
7889
if (0 != ftruncate(sm_seg->seg_id, size)) {
7990
pmix_output_verbose(2, pmix_globals.debug_output,
8091
"sys call ftruncate(2) fail\n");
8192
rc = PMIX_ERROR;
8293
goto out;
94+
} else {
95+
rc = PMIX_SUCCESS;
8396
}
84-
#endif
97+
98+
map_memory:
8599
if (MAP_FAILED == (seg_addr = mmap(NULL, size,
86100
PROT_READ | PROT_WRITE, MAP_SHARED,
87101
sm_seg->seg_id, 0))) {

0 commit comments

Comments
 (0)