Skip to content

Commit

Permalink
ResourceLog Fix / Streamwalker Interface Improvements / Non-Root Conf…
Browse files Browse the repository at this point in the history
…ig Initialization Fix (#232)


- Update to resourcelog tracking of operation chains, allowing for seemingly completed operations to be reissued. This closes a possible edge case associated with replaying the logfile of a failed marfs-rman invocation which had completed only the head element of an operation chain.
- Added proper cmdline support to streamwalker ( history, in-place cmd editing, tab completion, etc. ) via readline
- Minor change to avoid forcing recursive config verification by non-root instances
- Downgrade of mdal->statref() failures to informational only ( to avoid log overload when trying to see error messages )
  • Loading branch information
gransom authored Jan 30, 2024
1 parent 5a6d548 commit 767e09f
Show file tree
Hide file tree
Showing 9 changed files with 935 additions and 302 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ AXATTR_SET_FUNC_CHECK
AC_CHECK_LIB([m], [log10], [], [AC_MSG_ERROR(["Could not locate libm!])])
AC_CHECK_LIB([xml2], [xmlReadFile], [], [AC_MSG_ERROR(["Could not locate libxml2!"])])
AC_CHECK_LIB([fuse], [fuse_main], [], [AC_MSG_ERROR(["Could not locate libfuse!"])])
AC_CHECK_LIB([readline], [readline], [], [AC_MSG_ERROR(["Could not locate libreadline!"])])
AC_CHECK_LIB([ne], [ne_init], [], [AC_MSG_ERROR(["Could not locate libne! Please build and install the 'erasureUtils' repo. If using a custom install location, you may need to add that 'lib' dir to your LDFLAGS='-L*' environment var."])])
AC_CHECK_LIB([TQ], [tq_init], [], [AC_MSG_ERROR(["Could not locate libTQ! Please build and install the 'erasureUtils' repo. If using a custom install location, you may need to add that 'lib' dir to your LDFLAGS='-L*' environment var."])])
AC_CHECK_LIB([mpi], [MPI_Abort], [], [AC_MSG_ERROR(["Could not locate libmpi!"])])
Expand Down
6 changes: 4 additions & 2 deletions src/api/marfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ marfs_ctxt marfs_init( const char* configpath, marfs_interface type, pthread_mut
return NULL;
}
// verify our config
if ( config_verify( ctxt->config, ".", CFG_MDALCHECK | CFG_DALCHECK | CFG_RECURSE ) ) {
int verifyflags = CFG_MDALCHECK | CFG_DALCHECK;
if ( getuid() == 0 ) { verifyflags |= CFG_RECURSE; } // only attempt to recurse if we are running as root ( guarantess sub-NS access )
if ( config_verify( ctxt->config, ".", verifyflags ) ) {
LOG( LOG_ERR, "Encountered uncorrected errors with the MarFS config\n" );
config_term( ctxt->config );
free( ctxt );
Expand Down Expand Up @@ -559,7 +561,7 @@ int marfs_stat( marfs_ctxt ctxt, const char* path, struct stat *buf, int flags )
* @param const char* path : String path of the target file
* @param mode_t mode : New mode value for the file (see inode man page)
* @param int flags : A bitwise OR of the following...
* AT_SYMLINK_NOFOLLOW - do not dereference a symlink target
* AT_SYMLINK_NOFOLLOW - (AVOID: POSIX LEAVES UNIMPLEMENTED) do not dereference a symlink target
* @return int : Zero on success, or -1 if a failure occurred
*/
int marfs_chmod( marfs_ctxt ctxt, const char* path, mode_t mode, int flags ) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/marfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ int marfs_stat(marfs_ctxt ctxt, const char* path, struct stat *buf, int flags);
* @param const char* path : String path of the target file
* @param mode_t mode : New mode value for the file (see inode man page)
* @param int flags : A bitwise OR of the following...
* AT_SYMLINK_NOFOLLOW - do not dereference a symlink target
* AT_SYMLINK_NOFOLLOW - (AVOID: POSIX LEAVES UNIMPLEMENTED) do not dereference a symlink target
* @return int : Zero on success, or -1 if a failure occurred
*/
int marfs_chmod(marfs_ctxt ctxt, const char* path, mode_t mode, int flags);
Expand Down
6 changes: 3 additions & 3 deletions src/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,10 +719,10 @@ char* config_validatemnt( marfs_config* config, marfs_ns* tgtns, char* subpath )
* restrictive perms. Such non-NS paths must actually be traversed.
* Example, original values:
* tgtns == rootns
* return == "subspace/somedir/../../../target"
* subpath == "subspace/somedir/../../target"
* Result:
* tgtns == subspace (NOT rootns)
* return == "somedir/../../../target" (NOT "target")
* tgtns == subspace (NOT rootns)
* return == "somedir/../../target" (NOT "target")
* @param marfs_config* config : Config to traverse
* @param marfs_ns** tgtns : Reference populated with the initial NS value
* This will be updated to reflect the resulting NS value
Expand Down
Loading

0 comments on commit 767e09f

Please sign in to comment.