Skip to content

Commit

Permalink
Merge branch 'master' into Nasf-Fan/DAOS-16809_1
Browse files Browse the repository at this point in the history
Resolve some merge conflict for copyright.

Skip-test: true
Skip-unit-tests: true
Skip-nlt: true
Skip-func-test: true

Signed-off-by: Fan Yong <[email protected]>
  • Loading branch information
Nasf-Fan committed Jan 17, 2025
2 parents 1245805 + 15842c6 commit 021833f
Show file tree
Hide file tree
Showing 17 changed files with 96 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
trivy-config: 'utils/trivy/trivy.yaml'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
sarif_file: 'trivy-results.sarif'

Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
daos (2.7.101-3) unstable; urgency=medium
[ Jeff Olivier ]
* Switch from libfuse3 to libfused

-- Jeff Olivier <[email protected]> Thu, 19 Dec 2024 20:15:00 +0000

daos (2.7.101-2) unstable; urgency=medium
[ Denis Barakhtanov ]
* Add pydaos.torch module to daos-client package
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Build-Depends: debhelper (>= 10),
python3-distro,
libabt-dev (>= 1.2),
libpmemobj-dev (>= 2.1.0),
libfuse3-dev,
libfused-dev,
libprotobuf-c-dev,
libjson-c-dev,
dpdk-dev (>= 21.11.2),
Expand Down
12 changes: 12 additions & 0 deletions site_scons/components/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2016-2024 Intel Corporation
# Copyright 2025 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -307,6 +308,17 @@ def define_components(reqs):
required_progs=['libtoolize', 'ninja', 'meson'],
out_of_src_build=True)

reqs.define('fused', libs=['fused'], defines=['FUSE_USE_VERSION=35'],
retriever=GitRepoRetriever(),
commands=[['meson', 'setup', '--prefix=$FUSED_PREFIX', '-Ddisable-mtab=True',
'-Dudevrulesdir=$FUSED_PREFIX/udev', '-Dutils=False',
'--default-library', 'static', '../fused'],
['meson', 'setup', '--reconfigure', '../fused'],
['ninja', 'install']],
headers=['fused/fuse.h'],
required_progs=['libtoolize', 'ninja', 'meson'],
out_of_src_build=True)

# Tell SPDK which CPU to optimize for, by default this is native which works well unless you
# are relocating binaries across systems, for example in CI under GitHub actions etc. There
# isn't a minimum value needed here, but getting this wrong will cause daos server to exit
Expand Down
3 changes: 1 addition & 2 deletions site_scons/prereq_tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ def __init__(self, env, opts):
opts.Add('USE_INSTALLED', 'Comma separated list of preinstalled dependencies', 'none')
opts.Add(('MPI_PKG', 'Specifies name of pkg-config to load for MPI', None))
opts.Add(BoolVariable('FIRMWARE_MGMT', 'Build in device firmware management.', False))
opts.Add(BoolVariable('STATIC_FUSE', "Build with static libfuse library", False))
opts.Add(EnumVariable('BUILD_TYPE', "Set the build type", 'release',
['dev', 'debug', 'release'], ignorecase=1))
opts.Add(EnumVariable('TARGET_TYPE', "Set the prerequisite type", 'default',
Expand Down Expand Up @@ -545,7 +544,7 @@ def run_build(self, opts):
"""Build and dependencies"""
common_reqs = ['ofi', 'hwloc', 'mercury', 'boost', 'uuid', 'crypto', 'protobufc',
'lz4', 'isal', 'isal_crypto']
client_reqs = ['fuse', 'json-c', 'capstone', 'aio']
client_reqs = ['fused', 'json-c', 'capstone', 'aio']
server_reqs = ['argobots', 'pmdk', 'spdk', 'ipmctl']
test_reqs = ['cmocka']

Expand Down
34 changes: 5 additions & 29 deletions src/client/dfuse/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def check_ioctl_def(context, ctype):
context.Message(f'Checking if fuse ioctl is type {ctype} ')

# pylint: disable-next=consider-using-f-string
src = """#include <fuse3/fuse_lowlevel.h>
src = """#include <fused/fuse_lowlevel.h>
extern void
my_ioctl (fuse_req_t req, fuse_ino_t ino, %s cmd,
Expand All @@ -178,31 +178,13 @@ def configure_fuse(cenv):

if check.CheckFuseIoctl('unsigned int'):
pass
elif check.CheckFuseIoctl('int'):
cenv.AppendUnique(CPPDEFINES={'FUSE_IOCTL_USE_INT': '1'})
else:
print('Could not determine type of fuse ioctl type')
print('Expected unsigned int ioctl type')
Exit(2)

check.Finish()


def find_static_fuse(cenv):
"""Find and copy static fuse library"""

fuse_prefix = '/usr'
if os.path.exists(cenv.subst('$FUSE_PREFIX')):
fuse_prefix = cenv.subst('$FUSE_PREFIX')

for path in ['lib64', 'lib/x86_64-linux-gnu', 'lib/aarch64-linux-gnu', 'lib']:
fuselib = os.path.join(fuse_prefix, path, "libfuse3.a")
if os.path.exists(fuselib):
return [File(fuselib)]

print("Could not find libfuse3.a")
return []


def scons():
"""Scons function"""

Expand Down Expand Up @@ -241,14 +223,8 @@ def scons():
cenv.AppendUnique(LIBS=['dfs', 'duns'])

cenv.require('hwloc')
if cenv.get('STATIC_FUSE'):
cenv.require('fuse', headers_only=True)
static_fuse = find_static_fuse(cenv)
extra_libs = ['dl']
else:
cenv.require('fuse')
static_fuse = []
extra_libs = ['dl']
cenv.require('fused')
extra_libs = ['dl']

configure_fuse(cenv)

Expand All @@ -258,7 +234,7 @@ def scons():
for src in OPS_SRC:
dfuse_obj += cenv.Object(os.path.join('ops', f'{src}.c'))
cenv.AppendUnique(LIBS=['gurt'] + extra_libs)
dfuse_bin = cenv.d_program('dfuse/dfuse', common + dfuse_obj + static_fuse)
dfuse_bin = cenv.d_program('dfuse/dfuse', common + dfuse_obj)

Default(dfuse_bin)

Expand Down
4 changes: 2 additions & 2 deletions src/client/dfuse/dfuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#include <semaphore.h>

#include <fuse3/fuse.h>
#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse.h>
#include <fused/fuse_lowlevel.h>

#include <gurt/list.h>
#include <gurt/hash.h>
Expand Down
17 changes: 8 additions & 9 deletions src/client/dfuse/dfuse_fuseops.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* (C) Copyright 2016-2023 Intel Corporation.
* (C) Copyright 2016-2024 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/

#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse_lowlevel.h>

#include "dfuse_common.h"
#include "dfuse.h"
Expand Down Expand Up @@ -44,16 +44,15 @@ dfuse_show_flags(void *handle, unsigned int cap, unsigned int want)
SHOW_FLAG(handle, cap, want, FUSE_CAP_PARALLEL_DIROPS);
SHOW_FLAG(handle, cap, want, FUSE_CAP_POSIX_ACL);
SHOW_FLAG(handle, cap, want, FUSE_CAP_HANDLE_KILLPRIV);

#ifdef FUSE_CAP_CACHE_SYMLINKS
SHOW_FLAG(handle, cap, want, FUSE_CAP_HANDLE_KILLPRIV_V2);
SHOW_FLAG(handle, cap, want, FUSE_CAP_CACHE_SYMLINKS);
#endif
#ifdef FUSE_CAP_NO_OPENDIR_SUPPORT
SHOW_FLAG(handle, cap, want, FUSE_CAP_NO_OPENDIR_SUPPORT);
#endif
#ifdef FUSE_CAP_EXPLICIT_INVAL_DATA
SHOW_FLAG(handle, cap, want, FUSE_CAP_EXPLICIT_INVAL_DATA);
#endif
SHOW_FLAG(handle, cap, want, FUSE_CAP_EXPIRE_ONLY);
SHOW_FLAG(handle, cap, want, FUSE_CAP_SETXATTR_EXT);
SHOW_FLAG(handle, cap, want, FUSE_CAP_DIRECT_IO_ALLOW_MMAP);
SHOW_FLAG(handle, cap, want, FUSE_CAP_PASSTHROUGH);
SHOW_FLAG(handle, cap, want, FUSE_CAP_NO_EXPORT_SUPPORT);

if (cap)
DFUSE_TRA_WARNING(handle, "Unknown capability flags %#x", cap);
Expand Down
4 changes: 2 additions & 2 deletions src/client/dfuse/dfuse_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <getopt.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <fuse3/fuse.h>
#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse.h>
#include <fused/fuse_lowlevel.h>
#include <string.h>

#include <sys/types.h>
Expand Down
4 changes: 2 additions & 2 deletions src/client/dfuse/dfuse_thread.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* (C) Copyright 2020-2023 Intel Corporation.
* (C) Copyright 2020-2024 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/

#include <pthread.h>

#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse_lowlevel.h>
#define D_LOGFAC DD_FAC(dfuse)
#include "dfuse.h"

Expand Down
29 changes: 26 additions & 3 deletions src/container/srv_target.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Google LLC
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
Expand Down Expand Up @@ -1614,11 +1615,23 @@ ds_cont_local_open(uuid_t pool_uuid, uuid_t cont_hdl_uuid, uuid_t cont_uuid,
*/
D_ASSERT(hdl->sch_cont != NULL);
D_ASSERT(hdl->sch_cont->sc_pool != NULL);

hdl->sch_cont->sc_open++;
if (hdl->sch_cont->sc_open > 1) {
/* If there is an inflight open being stuck, then
* let's retry and wait until it finished.
*/
if (hdl->sch_cont->sc_open_initializing) {
hdl->sch_cont->sc_open--;
D_GOTO(err_cont, rc = -DER_AGAIN);
}

if (hdl->sch_cont->sc_open > 1)
goto opened;
/* Only go through if the 1st open succeeds */
if (hdl->sch_cont->sc_props_fetched)
goto opened;
}

hdl->sch_cont->sc_open_initializing = 1;
if (ds_pool_restricted(hdl->sch_cont->sc_pool->spc_pool, false))
goto csum_init;

Expand Down Expand Up @@ -1653,6 +1666,8 @@ ds_cont_local_open(uuid_t pool_uuid, uuid_t cont_hdl_uuid, uuid_t cont_uuid,
rc = ds_cont_csummer_init(hdl->sch_cont);
if (rc != 0)
D_GOTO(err_dtx, rc);

hdl->sch_cont->sc_open_initializing = 0;
}
opened:
if (cont_hdl != NULL) {
Expand All @@ -1670,6 +1685,7 @@ ds_cont_local_open(uuid_t pool_uuid, uuid_t cont_hdl_uuid, uuid_t cont_uuid,
dtx_cont_close(hdl->sch_cont, true);

err_cont:
hdl->sch_cont->sc_open_initializing = 0;
if (daos_handle_is_valid(poh)) {
int rc_tmp;

Expand Down Expand Up @@ -1757,9 +1773,15 @@ ds_cont_tgt_open(uuid_t pool_uuid, uuid_t cont_hdl_uuid,
D_DEBUG(DB_TRACE, "open pool/cont/hdl "DF_UUID"/"DF_UUID"/"DF_UUID"\n",
DP_UUID(pool_uuid), DP_UUID(cont_uuid), DP_UUID(cont_hdl_uuid));

retry:
rc = ds_pool_thread_collective(pool_uuid, PO_COMP_ST_NEW | PO_COMP_ST_DOWN |
PO_COMP_ST_DOWNOUT, cont_open_one, &arg, 0);
if (rc != 0)
if (rc != 0) {
if (rc == -DER_AGAIN) {
dss_sleep(50);
goto retry;
}

/* Once it exclude the target from the pool, since the target
* might still in the cart group, so IV cont open might still
* come to this target, especially if cont open/close will be
Expand All @@ -1769,6 +1791,7 @@ ds_cont_tgt_open(uuid_t pool_uuid, uuid_t cont_hdl_uuid,
D_ERROR("open "DF_UUID"/"DF_UUID"/"DF_UUID":"DF_RC"\n",
DP_UUID(pool_uuid), DP_UUID(cont_uuid),
DP_UUID(cont_hdl_uuid), DP_RC(rc));
}

return rc;
}
Expand Down
20 changes: 6 additions & 14 deletions src/include/daos_srv/container.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* (C) Copyright 2015-2024 Intel Corporation.
* (C) Copyright 2025 Google LLC
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -66,20 +67,11 @@ struct ds_cont_child {
ABT_cond sc_scrub_cond;
ABT_cond sc_rebuild_cond;
ABT_cond sc_fini_cond;
uint32_t sc_dtx_resyncing:1,
sc_dtx_reindex:1,
sc_dtx_reindex_abort:1,
sc_dtx_delay_reset:1,
sc_dtx_registered:1,
sc_props_fetched:1,
sc_stopping:1,
sc_destroying:1,
sc_vos_agg_active:1,
sc_ec_agg_active:1,
/* flag of CONT_CAPA_READ_DATA/_WRITE_DATA disabled */
sc_rw_disabled:1,
sc_scrubbing:1,
sc_rebuilding:1;
uint32_t sc_dtx_resyncing : 1, sc_dtx_reindex : 1, sc_dtx_reindex_abort : 1,
sc_dtx_delay_reset : 1, sc_dtx_registered : 1, sc_props_fetched : 1, sc_stopping : 1,
sc_destroying : 1, sc_vos_agg_active : 1, sc_ec_agg_active : 1,
/* flag of CONT_CAPA_READ_DATA/_WRITE_DATA disabled */
sc_rw_disabled : 1, sc_scrubbing : 1, sc_rebuilding : 1, sc_open_initializing : 1;
uint32_t sc_dtx_batched_gen;
/* Tracks the schedule request for aggregation ULT */
struct sched_request *sc_agg_req;
Expand Down
4 changes: 3 additions & 1 deletion src/pool/srv_pool.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -7240,7 +7241,8 @@ pool_svc_update_map(struct pool_svc *svc, crt_opcode_t opc, bool exclude_rank,
d_agetenv_str(&env, REBUILD_ENV);
if ((env && !strcasecmp(env, REBUILD_ENV_DISABLED)) ||
daos_fail_check(DAOS_REBUILD_DISABLE)) {
D_DEBUG(DB_TRACE, "Rebuild is disabled\n");
D_DEBUG(DB_REBUILD, DF_UUID ": Rebuild is disabled for all pools\n",
DP_UUID(svc->ps_pool->sp_uuid));
d_freeenv_str(&env);
D_GOTO(out, rc = 0);
}
Expand Down
15 changes: 13 additions & 2 deletions src/rebuild/srv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -2245,11 +2246,21 @@ regenerate_task_of_type(struct ds_pool *pool, pool_comp_state_t match_states, ui
int
ds_rebuild_regenerate_task(struct ds_pool *pool, daos_prop_t *prop)
{
struct daos_prop_entry *entry;
int rc = 0;
struct daos_prop_entry *entry;
char *env;
int rc = 0;

rebuild_gst.rg_abort = 0;

d_agetenv_str(&env, REBUILD_ENV);
if (env && !strcasecmp(env, REBUILD_ENV_DISABLED)) {
D_DEBUG(DB_REBUILD, DF_UUID ": Rebuild is disabled for all pools\n",
DP_UUID(pool->sp_uuid));
d_freeenv_str(&env);
return DER_SUCCESS;
}
d_freeenv_str(&env);

if (pool->sp_reint_mode == DAOS_REINT_MODE_NO_DATA_SYNC) {
D_DEBUG(DB_REBUILD, DF_UUID" No data sync for reintegration\n",
DP_UUID(pool->sp_uuid));
Expand Down
5 changes: 2 additions & 3 deletions utils/build.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ component=daos

[commit_versions]
argobots=v1.2
fuse=fuse-3.16.2
fused=v1.0.0-rc3
pmdk=2.1.0
isal=v2.30.0
isal_crypto=v2.23.0
Expand All @@ -15,7 +15,7 @@ ucx=v1.14.1

[repos]
argobots=https://github.com/pmodels/argobots.git
fuse=https://github.com/libfuse/libfuse.git
fused=https://github.com/daos-stack/fused.git
pmdk=https://github.com/pmem/pmdk.git
isal=https://github.com/intel/isa-l.git
isal_crypto=https://github.com/intel/isa-l_crypto.git
Expand All @@ -27,7 +27,6 @@ ucx=https://github.com/openucx/ucx.git

[patch_versions]
spdk=https://github.com/spdk/spdk/commit/b0aba3fcd5aceceea530a702922153bc75664978.diff,https://github.com/spdk/spdk/commit/445a4c808badbad3942696ecf16fa60e8129a747.diff
fuse=https://github.com/libfuse/libfuse/commit/c9905341ea34ff9acbc11b3c53ba8bcea35eeed8.diff
mercury=https://raw.githubusercontent.com/daos-stack/mercury/f3dc286fb40ec1a3a38a2e17c45497bc2aa6290d/na_ucx.patch
pmdk=https://github.com/pmem/pmdk/commit/2abe15ac0b4eed894b6768cd82a3b0a7c4336284.diff
argobots=https://github.com/pmodels/argobots/pull/397/commits/411e5b344642ebc82190fd8b125db512e5b449d1.diff,https://github.com/pmodels/argobots/commit/bb0c908abfac4bfe37852eee621930634183c6aa.diff
Loading

0 comments on commit 021833f

Please sign in to comment.