diff --git a/src/bio/bio_xstream.c b/src/bio/bio_xstream.c index 059556ba89a..f172e6028b1 100644 --- a/src/bio/bio_xstream.c +++ b/src/bio/bio_xstream.c @@ -300,7 +300,7 @@ bio_nvme_init_ext(const char *nvme_conf, int numa_node, unsigned int mem_size, } if (nvme_conf && strlen(nvme_conf) > 0) { - fd = open(nvme_conf, O_RDONLY, 0600); + fd = open(nvme_conf, O_RDONLY); if (fd < 0) D_WARN("Open %s failed, skip DAOS NVMe setup "DF_RC"\n", nvme_conf, DP_RC(daos_errno2der(errno))); diff --git a/src/common/ad_mem.c b/src/common/ad_mem.c index 03b3120344a..0c697145174 100644 --- a/src/common/ad_mem.c +++ b/src/common/ad_mem.c @@ -1,5 +1,6 @@ /** * (C) Copyright 2022-2023 Intel Corporation. + * (C) Copyright 2025 Hewlett Packard Enterprise Development LP * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -608,7 +609,7 @@ blob_file_open(struct ad_blob *blob, const char *path, size_t *size, bool create int flags = O_RDWR; while (1) { - fd = open(path, flags, 0600); + fd = open(path, flags, UMEM_FILE_MODE_DEFAULT); if (fd >= 0) break; diff --git a/src/include/daos/mem.h b/src/include/daos/mem.h index 18d8fe988a7..6528967987b 100644 --- a/src/include/daos/mem.h +++ b/src/include/daos/mem.h @@ -38,6 +38,8 @@ umempobj_pgsz(int backend); /* umem persistent object property flags */ #define UMEMPOBJ_ENABLE_STATS 0x1 +#define UMEM_FILE_MODE_DEFAULT 0660 + #ifdef DAOS_PMEM_BUILD /* The backend type is stored in meta blob header, don't change the value */ diff --git a/src/mgmt/mgmt_common.c b/src/mgmt/mgmt_common.c index 6cf29102fa9..af1f90cd6c2 100644 --- a/src/mgmt/mgmt_common.c +++ b/src/mgmt/mgmt_common.c @@ -163,7 +163,7 @@ ds_mgmt_tgt_recreate(uuid_t pool_uuid, daos_size_t scm_size, int tgt_nr, daos_si rc = -DER_NONEXIST; goto out; } - fd = open(rdb_path, O_RDWR | O_CREAT, 0600); + fd = open(rdb_path, O_RDWR | O_CREAT, UMEM_FILE_MODE_DEFAULT); if (fd < 0) { rc = daos_errno2der(errno); D_ERROR("failed to create/open the vos file %s:" DF_RC "\n", rdb_path, @@ -215,7 +215,7 @@ ds_mgmt_tgt_preallocate(uuid_t uuid, daos_size_t scm_size, int tgt_id, const cha D_DEBUG(DB_MGMT, DF_UUID ": creating vos file %s (%ld bytes)\n", DP_UUID(uuid), path, scm_size); - fd = open(path, O_CREAT | O_RDWR, 0600); + fd = open(path, O_CREAT | O_RDWR, UMEM_FILE_MODE_DEFAULT); if (fd < 0) { rc = daos_errno2der(errno); D_ERROR(DF_UUID ": failed to create vos file %s: " DF_RC "\n", DP_UUID(uuid), path, diff --git a/src/vos/vos_common.c b/src/vos/vos_common.c index a7397a94256..ea46a50bec5 100644 --- a/src/vos/vos_common.c +++ b/src/vos/vos_common.c @@ -979,7 +979,7 @@ vos_self_nvme_init(const char *vos_path, bool init_spdk) goto out; /* Only use hugepages if NVME SSD configuration existed. */ - fd = open(nvme_conf, O_RDONLY, 0600); + fd = open(nvme_conf, O_RDONLY); if (fd < 0) { rc = bio_nvme_init_ext(NULL, VOS_NVME_NUMA_NODE, 0, 0, VOS_NVME_NR_TARGET, true, init_spdk); diff --git a/src/vos/vos_pool.c b/src/vos/vos_pool.c index 96d516b32dd..513d0a928ef 100644 --- a/src/vos/vos_pool.c +++ b/src/vos/vos_pool.c @@ -996,7 +996,8 @@ vos_pmemobj_create(const char *path, uuid_t pool_id, const char *layout, umem_create: D_DEBUG(DB_MGMT, "umempobj_create sz: " DF_U64 " store_sz: " DF_U64, scm_sz, store.stor_size); - pop = umempobj_create(path, layout, UMEMPOBJ_ENABLE_STATS, scm_sz, 0600, &store); + pop = umempobj_create(path, layout, UMEMPOBJ_ENABLE_STATS, scm_sz, UMEM_FILE_MODE_DEFAULT, + &store); if (pop != NULL) { *ph = pop; return 0;