Commit Graph

2241 Commits

Author SHA1 Message Date
Andrew Gaul
4c5b7595b4
Add missing GUARDED_BY to fdcache_entity (#2549)
This requires a fake GetMutex for the lock checker to understand the
control flow.  Also remove unneeded locking comments that annotation
supersede.  Follows on to #2491.
2024-10-18 00:39:45 +09:00
Andrew Gaul
e613ae55bb
Replace curl_warnings_lock with std::atomic (#2550)
This is simpler and lighter-weight.
2024-10-18 00:36:36 +09:00
Andrew Gaul
5594106351
Add miscellaneous locking annotations (#2551) 2024-10-18 00:34:57 +09:00
Andrew Gaul
c5031a5a97
Simplify some method parameters (#2553)
Add const where possible and avoid unnecessary reference parameters.
2024-10-18 00:05:42 +09:00
brett-rickman
473f9df65a FreeBSD compilation fixes
Closes #2517.
2024-10-16 13:46:12 -07:00
Takeshi Nakatani
0c26014812 Fixed exclusive control of upload_id in PseudoFdInfo class 2024-10-16 02:46:48 +09:00
Takeshi Nakatani
06a3822965 [Improvement #2490] Add GUARDED_BY to FdEntity and fix locking 2024-10-15 02:04:46 +09:00
Takeshi Nakatani
2d1409a672 Fixed warnings on integer comparisons in openssl_auth.cpp 2024-10-15 02:00:20 +09:00
Andrew Gaul
1d3ab76cc4
Ensure that test checks data length (#2546)
wc has an optimization that can use metadata when stdin is set to a
file.  Also fix up logging.
2024-10-14 18:31:37 +09:00
Andrew Gaul
c00b5fd4bb
Propoagate error state from insertV4Headers (#2547)
s3fs_sha256_hex_fd returns an empty string when calculating the hash
fails.
2024-10-14 10:28:19 +09:00
Andrew Gaul
000273a8de
Configure target for clang thread safety checking (#2493) 2024-10-14 10:19:03 +09:00
Andrew Gaul
3ba8c2a139
Replace non-standard VLAs with std::array (#2544) 2024-10-13 12:03:56 +09:00
Andrew Gaul
c0219b38d1
Return correct success value from NSS s3fs_md5 (#2543) 2024-10-13 11:58:54 +09:00
Andrew Gaul
40f95272be
Fix locking annotations and add one missing lock (#2542)
This allows clang's thread safety checks to pass.
2024-10-13 11:53:56 +09:00
Andrew Gaul
15e2eae69a
Address clang-tidy 19 warnings (#2540) 2024-10-13 10:09:47 +09:00
Andrew Gaul
743c86e506
Fix issues discovered by Coverity (#2535) 2024-10-08 08:07:13 +09:00
Takeshi Nakatani
4605cc2035 Fixed fake_diskfree option 2024-10-07 01:24:35 +09:00
Andrew Gaul
a259981f16
Enable cppcoreguidelines-pro-type-const-cast (#2537)
This fixes dangerous uses of const_cast.
2024-10-06 18:40:48 +09:00
Andrew Gaul
bbbb2d0908
Specify deleter function for regex_t unique_ptr (#2536) 2024-10-06 18:30:22 +09:00
Andrew Gaul
e80de15cc6
Make FILE ownership clearer via unique_ptr (#2534) 2024-10-06 18:03:02 +09:00
Takeshi Nakatani
b283ab291a Modified and bypassed test_multipart_mix on MacOS with nocopyapi 2024-09-29 13:58:46 +09:00
Takeshi Nakatani
c24015ae17 Modified and bypassed some MacOS tests 2024-09-29 09:17:11 +09:00
Andrew Gaul
df5364d758
Enable readability-implicit-bool-conversion (#2530)
This fixes one real error, one misreported EPERM, and some false
positives.  References #2529.
2024-09-28 15:28:50 +09:00
Andrew Gaul
52c10cd45d
Call Rename outside AutoFdEntity scope (#2528)
This avoids a use-after-free in the destructor.
2024-09-28 15:25:02 +09:00
Takeshi Nakatani
e8f1e3473c Fixed miss-return code in S3fsCurl::RequestPerform 2024-09-28 13:25:37 +09:00
Andrew Gaul
37cf324c52
Return non-zero exit code on Valgrind errors (#2527)
Previously this ignored use-after-frees and other errors.
2024-09-28 11:37:25 +09:00
Andrew Gaul
5691071ac6
Log entire line when curldbg lacks a newline (#2526)
Previously -o curldbg=body would read uninitialized memory.
2024-09-28 11:35:49 +09:00
Takeshi Nakatani
6faaff10ee Fixed hardlink test for macos 2024-09-27 00:52:07 +09:00
Takeshi Nakatani
4796e982ab Fixed opensuse/leap:15 test 2024-09-27 00:51:51 +09:00
Andrew Gaul
22869d99a5
Set errno to zero before calling sysconf (#2515)
FreeBSD returns -1 since it has no limits for _SC_GETPW_R_SIZE_MAX and
_SC_GETGR_R_SIZE_MAX but is not required to reset errno.  Also fix up
logging.  Fixes #2514.
2024-08-24 09:48:54 +09:00
Fabrizio
7d2d4e8866
s3 signv4 support uri endpoints (#2510) 2024-08-17 13:46:13 +09:00
Naoki Ikeguchi
4fe2652c6c
Fix Windows compilation (#2506)
* docs: Fix Windows compile instructions

Signed-off-by: Naoki Ikeguchi <me@s6n.jp>

* fix: Use fallocate stub on MSYS2

Signed-off-by: Naoki Ikeguchi <me@s6n.jp>

---------

Signed-off-by: Naoki Ikeguchi <me@s6n.jp>
2024-07-27 09:54:38 +09:00
Andrew Gaul
fcb5aa77fb
Fix minor issues when compiling with MSYS (#2505)
References #2503.
2024-07-27 09:43:16 +09:00
Andrew Gaul
411e42384e
Acquire lock before logging (#2502)
This is not safe -- another caller could modify a std::string field
while logging which could read an invalid pointer.  References #2490.
2024-07-21 16:14:22 +09:00
Andrew Gaul
1c2f61e2a5
Remove unneeded lock utility functions (#2500)
std::mutex RAII removes the need for these.

Co-authored-by: Takeshi Nakatani <ggtakec@gmail.com>
2024-07-15 15:32:39 +09:00
Andrew Gaul
23efccbe39
Disable thread safety analysis on conditional locks (#2498)
Clang does not support this:

https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#conditional-locks

Co-authored-by: Takeshi Nakatani <ggtakec@gmail.com>
2024-07-15 15:17:47 +09:00
Andrew Gaul
77ffe7d634
Wrap CURL* in a std::unique_ptr (#2495)
This is safer and clarifies the ownership of pointers.

Co-authored-by: Takeshi Nakatani <ggtakec@gmail.com>
2024-07-15 15:15:03 +09:00
Andrew Gaul
60b871e0ae
Simplify has_mp_stat (#2499)
This is unnecessary since we moved from pthread_mutex_t to
std::atomic.
2024-07-15 15:04:28 +09:00
Takeshi Nakatani
44d5b5e1c9 Continued Github Actions(CI) execution after CentOS 7 EOL 2024-07-13 10:30:27 +05:30
Andrew Gaul
03651a30ea
Add infrastructure for clang static lock checking (#2492)
Co-authored-by: Takeshi Nakatani <ggtakec@gmail.com>
2024-07-13 09:48:43 +09:00
Andrew Gaul
db80fa2eb0 Upgrade CI to Alpine 3.20 2024-07-11 23:14:07 +05:30
Andrew Gaul
6f90c6918f
Fix incorrect locking annotations (#2494)
Co-authored-by: Takeshi Nakatani <ggtakec@gmail.com>
2024-07-11 23:13:44 +09:00
Andrew Gaul
437bf7ec95
Convert pthread_t to C++11 std::thread (#2481)
This has better cross-platform support and stronger type-safety.
2024-07-11 22:37:25 +09:00
Andrew Gaul
50d5a73f84
Simplify curl progress tracking (#2486)
Use a struct with named fields instead of a pair for clarity and use a
single map to store the structs for efficiency.
2024-07-06 16:35:25 +09:00
Takeshi Nakatani
ec183d0d9a Dropped Github Actions(CI) for CentOS 7 and Debian 10(Buster) 2024-07-01 23:46:18 +05:30
Andrew Gaul
ae28a110ab
Remove unused function (#2484)
Also clean up some function prototypes.

Co-authored-by: Takeshi Nakatani <ggtakec@gmail.com>
2024-07-01 23:30:32 +09:00
Andrew Gaul
a6637b29e6
Opt in to all clang-tidy checks by default (#2477)
Opt out of the noisy checks.  Disable clang-tidy on Debian bullseye
and buster and Ubuntu 20.04 due to segfaults.
2024-07-01 22:29:34 +09:00
Takeshi Nakatani
1a50b9a04a Fixed a deadlock in the FdManager::ChangeEntityToTempPath method call 2024-06-30 20:29:01 +05:30
Andrew Gaul
585f137cf0
Remove unused headers found by clang-tidy (#2480)
Found via misc-include-cleaner but this requires more work.
2024-06-25 23:32:46 +09:00
Andrew Gaul
1449905fe5
Make deleted constructors and operators public (#2479)
Deleting them better conveys the intent.
2024-06-24 08:26:24 +09:00