06a3822965
[Improvement #2490 ] Add GUARDED_BY to FdEntity and fix locking
2024-10-15 02:04:46 +09:00
743c86e506
Fix issues discovered by Coverity ( #2535 )
2024-10-08 08:07:13 +09:00
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
fcb5aa77fb
Fix minor issues when compiling with MSYS ( #2505 )
...
References #2503 .
2024-07-27 09:43:16 +09:00
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
622dc0a815
Convert pthread_mutex to std::mutex ( #2476 )
...
This simplifies resource management and improve Windows compatibility.
2024-06-24 00:48:01 +09:00
86b353511a
Replace memset with C++11 value initialization ( #2471 )
...
This generates the same code but is safer due to using an implicit
length and allowing member initialization.
2024-06-24 00:24:49 +09:00
fa807a56fb
Fix typos ( #2473 )
2024-06-23 15:33:46 +09:00
254d717a4a
Address clang-tidy 19 warnings ( #2474 )
2024-06-23 12:21:51 +09:00
2841601ad5
Remove uses of AutoLock::ALREADY_LOCKED ( #2466 )
...
Instead annotate the methods with REQUIRES so that the caller knows if
they should lock. For public interfaces, introduce HasLock wrappers.
This simplifies control flow, allows migration to std::mutex, and
eventually will enable use of static lock checking.
2024-06-23 11:24:51 +09:00
ebae5a302f
Prefer std::string::clear where possible ( #2467 )
...
This is somewhat more clear and is declared noexcept.
2024-06-10 23:36:49 +09:00
c97f7a2a13
Address clang-tidy 18 warnings ( #2428 )
2024-03-07 01:04:22 +09:00
517574c40c
Fixed a bug in fdatasync(fsync)
2024-02-06 14:11:37 +09:00
68bbfee8ea
Address clang-tidy modernize-deprecated-headers ( #2370 )
2023-11-19 10:00:16 +09:00
4845831f93
Convert some const to constexpr ( #2342 )
...
This guarantees that the function or value will resolve at compile-time.
2023-11-14 22:15:17 +09:00
f9d3941d9d
Fixed a bug in the re-upload part of Streamupload
2023-11-10 10:41:26 +09:00
d0c4b5c763
Fixed a bug in exclusive control of pagelist in FdEntity class
2023-09-26 21:26:17 +09:00
61df7bf42c
Use std::unique_ptr for fclose ( #2318 )
...
References #2261 .
2023-09-25 23:55:11 +09:00
4d5632912a
Initialize variable before use ( #2302 )
...
clang-analyzer found a path where this could be used without
initialization.
2023-09-06 23:32:49 +09:00
e8cb6d6d34
Abort after failed MPU ( #2298 )
...
This reclaims storage after a failed MPU which caused OutOfMemory
issues in #2291 .
2023-08-29 23:29:16 +09:00
7bb9609827
Return errors from AutoFdEntity::Open ( #2296 )
...
Found via pjdfstest which creates a PATH_MAX path that should return
NAMETOOLONG.
2023-08-29 22:57:30 +09:00
b2bb12fd2c
Remove unneeded explicit std::string constructors ( #2273 )
...
std::string(const char*) implicitly constructs these. The remaining call sites
requires string literals from C++14.
2023-08-17 22:12:28 +09:00
5b93765802
Fixed a warning for compiling C/C++ codes
2023-08-13 20:49:39 +09:00
b29f8d0f2b
Use C++ enum class for most enums ( #2241 )
...
This promotes type-safety.
2023-07-30 22:53:17 +09:00
a7b38a6940
Address stray warnings ( #2237 )
2023-07-29 09:19:18 +09:00
1f04165a33
Convert most str callers to C++11 std::to_string ( #2238 )
...
Remaining ones handle timespec.
2023-07-28 18:21:55 +09:00
36db898d01
Use C++11 std::map::erase return value ( #2236 )
2023-07-27 23:34:43 +09:00
a4a2841c05
Use C++11 nullptr instead of 0 or NULL ( #2234 )
...
This improves type-safety.
2023-07-27 21:56:58 +09:00
0ece204393
Fix -Wshorten-64-to-32 warnings
2023-07-27 12:23:26 +09:00
6344d74ae3
Replace some raw pointers with std::unique_ptr ( #2195 )
...
This simplifies code paths and makes memory leaks less likely. It
also makes memory ownership more explicit by requiring std::move.
This commit requires C++11. References #2179 .
2023-07-27 09:12:28 +09:00
faec0d9d15
Refixed for cppcheck 2.1x
2023-07-26 07:55:33 +09:00
7978395083
Use smart pointer to manage pcfstat object
...
Previously pcfstat points to a raw pointer, and it may be leaked if
function returned before deleting it.
So use smart pointer to automatically release the object.
Note that currently s3fs only uses c++03, so we use auto_ptr here, not
unique_ptr, which requires c++11.
Fixes: 6ca5a24a7f ("Fix two inconsistency issues between stat cache and cache file (#2152 )")
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com >
2023-07-19 20:15:55 +09:00
b2537052ef
Fixed data race in threads found thread sanitizer
2023-07-09 20:53:27 +09:00
6448c8f1a8
Protect FdEntity::physical_fd with fdent_lock ( #2194 )
...
* Protect FdEntity::physical_fd with fdent_lock
Found via ThreadSanitizer.
2023-06-25 16:43:15 +09:00
6ca5a24a7f
Fix two inconsistency issues between stat cache and cache file ( #2152 )
...
* Fix inconsistency between stat cache file and cache file
We unlock stat cache file too early in FdEntity::Open(), and would
truncate cache file and update stat cache file, so there's a window that
stat cache doesn't reflect cache file status.
Suggested-by: Takeshi Nakatani <ggtakec@gmail.com >
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com >
* Mark pagelist as unloaded if cache file has been truncated
If cache file size doesn't match object size, the cache file might be
corrupted, so invalidate it and save new cache stat file.
Suggested-by: Takeshi Nakatani <ggtakec@gmail.com >
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com >
---------
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com >
2023-05-30 18:39:50 +09:00
18495c44aa
Added cache clearing on upload error ( #2127 )
2023-03-13 21:22:13 +09:00
f8a825e9b9
multipart upload id is converted by url encode ( #2097 )
2023-02-18 11:40:25 +09:00
0ba49518e9
Make some methods and parameters const ( #2078 )
...
This requires making some locks mutable.
2023-01-04 20:23:39 +09:00
c491fbeabc
Replace uses of lock_already_held flag with AutoLock::Type
2022-07-30 16:20:43 +09:00
48e9e51f4f
Remove more unneeded headers identified by IWYU ( #2011 )
2022-07-30 12:06:47 +09:00
3928a7e359
Remove more uses of const_cast ( #2006 )
...
Follows on to #2004 .
2022-07-28 23:37:15 +09:00
4b2f3fecb5
Set mtime/ctime/atime of all objects as nanosecond
2022-07-28 13:47:03 +09:00
e0655008b3
Protect pending_status in UploadPending ( #1992 )
...
This requires avoiding double-locking in RowFlush. References #1991 .
2022-07-22 23:30:04 +09:00
22f2392fca
Fixed bugs about stream upload
2022-07-19 21:29:56 +09:00
faddb4900f
Merged the code corresponding to the mknod fix( f11eb7d)
2022-07-17 22:20:45 +09:00
b0eeaa6679
Reflected the result of the review in the code
2022-07-17 22:20:45 +09:00
d22e1dc018
Add the stream upload which starts uploading parts before Flush
2022-07-17 22:20:45 +09:00
f11eb7d69b
Fixed a bug that regular files could not be created by mknod
2022-06-29 16:56:19 +09:00
73b49c1038
Fixed a bug that regular files could not be created by mknod
2022-06-29 16:56:19 +09:00
8a5c4306f5
Preserve sub-second precision where possible ( #1915 )
2022-02-23 23:58:51 +09:00