From 9bc355caf017519575f90675d5603f80be507798 Mon Sep 17 00:00:00 2001 From: Jianxin Xiong Date: Sun, 17 Mar 2024 14:12:21 -0700 Subject: [PATCH] prov/shm: Print shm name and error code when failed to open This help debugging issues when the two sides don't agree on the naming convention. For example, in fabtests, if one side forgets to use the '-s ' option, shm objects it creates may lack the node-name prefix, while the peer may try to open with the prefix. Cherry-picked from commit a955a515fbdb1f94b0e0de0c5bd2bc9496b4f9d8 Signed-off-by: Jianxin Xiong --- prov/shm/src/smr_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prov/shm/src/smr_util.c b/prov/shm/src/smr_util.c index 16f157b5e80..3f50519acc9 100644 --- a/prov/shm/src/smr_util.c +++ b/prov/shm/src/smr_util.c @@ -408,7 +408,8 @@ int smr_map_to_region(const struct fi_provider *prov, struct smr_map *map, fd = shm_open(name, O_RDWR, S_IRUSR | S_IWUSR); if (fd < 0) { - FI_WARN_ONCE(prov, FI_LOG_AV, "shm_open error\n"); + FI_WARN_ONCE(prov, FI_LOG_AV, + "shm_open error: name %s errno %d\n", name, errno); return -errno; }