[GH-ISSUE #1746] locking problem #899

Closed
opened 2026-03-04 01:49:46 +03:00 by kerem · 1 comment
Owner

Originally created by @VVoidV on GitHub (Aug 24, 2021).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1746

When I test copy file into s3fs while disk cache is low, I got s3fs hang at

#0  0x00007f5054f8e4ed in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x00007f5054f89dcb in _L_lock_883 () from /lib64/libpthread.so.0
#2  0x00007f5054f89c98 in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x00000000004a1757 in AutoLock::AutoLock (this=0x7f504bffe500, pmutex=0x7f50440052d0, type=AutoLock::NONE) at autolock.cpp:47
#4  0x000000000048d57c in FdEntity::UploadPendingMeta (this=0x7f50440052d0) at fdcache_entity.cpp:2083
#5  0x000000000048976a in FdEntity::RowFlushMixMultipart (this=0x7f50440052d0, pseudo_obj=0x7f5044007160, tpath=0x0) at fdcache_entity.cpp:1658
#6  0x0000000000486a71 in FdEntity::RowFlush (this=0x7f50440052d0, fd=2, tpath=0x0, force_sync=false) at fdcache_entity.cpp:1362
#7  0x0000000000428e10 in FdEntity::Flush (this=0x7f50440052d0, fd=2, force_sync=false) at fdcache_entity.h:121
#8  0x0000000000416c46 in s3fs_flush (_path=0x7f504400efc0 "/ffff", fi=0x7f504bffebb0) at s3fs.cpp:2418
#9  0x00007f50563fe447 in fuse_flush_common () from /lib64/libfuse.so.2
#10 0x00007f50563fe6d0 in fuse_lib_flush () from /lib64/libfuse.so.2
#11 0x00007f5056404d06 in do_flush () from /lib64/libfuse.so.2
#12 0x00007f5056405b6b in fuse_ll_process_buf () from /lib64/libfuse.so.2
#13 0x00007f5056402401 in fuse_do_work () from /lib64/libfuse.so.2
#14 0x00007f5054f87dd5 in start_thread () from /lib64/libpthread.so.0
#15 0x00007f5054cb0ead in clone () from /lib64/libc.so.6

I think there is no need to lock fdent_lock in UploadPendingMeta, because it already locked in RowFlush ?

image

github.com/s3fs-fuse/s3fs-fuse@a868c0656e/src/fdcache_entity.cpp (L2083)
github.com/s3fs-fuse/s3fs-fuse@a868c0656e/src/fdcache_entity.cpp (L1336)

Originally created by @VVoidV on GitHub (Aug 24, 2021). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1746 When I test copy file into s3fs while disk cache is low, I got s3fs hang at ``` #0 0x00007f5054f8e4ed in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x00007f5054f89dcb in _L_lock_883 () from /lib64/libpthread.so.0 #2 0x00007f5054f89c98 in pthread_mutex_lock () from /lib64/libpthread.so.0 #3 0x00000000004a1757 in AutoLock::AutoLock (this=0x7f504bffe500, pmutex=0x7f50440052d0, type=AutoLock::NONE) at autolock.cpp:47 #4 0x000000000048d57c in FdEntity::UploadPendingMeta (this=0x7f50440052d0) at fdcache_entity.cpp:2083 #5 0x000000000048976a in FdEntity::RowFlushMixMultipart (this=0x7f50440052d0, pseudo_obj=0x7f5044007160, tpath=0x0) at fdcache_entity.cpp:1658 #6 0x0000000000486a71 in FdEntity::RowFlush (this=0x7f50440052d0, fd=2, tpath=0x0, force_sync=false) at fdcache_entity.cpp:1362 #7 0x0000000000428e10 in FdEntity::Flush (this=0x7f50440052d0, fd=2, force_sync=false) at fdcache_entity.h:121 #8 0x0000000000416c46 in s3fs_flush (_path=0x7f504400efc0 "/ffff", fi=0x7f504bffebb0) at s3fs.cpp:2418 #9 0x00007f50563fe447 in fuse_flush_common () from /lib64/libfuse.so.2 #10 0x00007f50563fe6d0 in fuse_lib_flush () from /lib64/libfuse.so.2 #11 0x00007f5056404d06 in do_flush () from /lib64/libfuse.so.2 #12 0x00007f5056405b6b in fuse_ll_process_buf () from /lib64/libfuse.so.2 #13 0x00007f5056402401 in fuse_do_work () from /lib64/libfuse.so.2 #14 0x00007f5054f87dd5 in start_thread () from /lib64/libpthread.so.0 #15 0x00007f5054cb0ead in clone () from /lib64/libc.so.6 ``` I think there is no need to lock fdent_lock in UploadPendingMeta, because it already locked in RowFlush ? ![image](https://user-images.githubusercontent.com/17823956/130623087-e08410c1-3f45-4e9a-9071-c5a1e91383a8.png) https://github.com/s3fs-fuse/s3fs-fuse/blob/a868c0656e3082f2cb978b55e5fe45af86abf3c8/src/fdcache_entity.cpp#L2083 https://github.com/s3fs-fuse/s3fs-fuse/blob/a868c0656e3082f2cb978b55e5fe45af86abf3c8/src/fdcache_entity.cpp#L1336
kerem closed this issue 2026-03-04 01:49:46 +03:00
Author
Owner

@ggtakec commented on GitHub (Aug 30, 2021):

Thanks for a report and send PR.

<!-- gh-comment-id:908450704 --> @ggtakec commented on GitHub (Aug 30, 2021): Thanks for a report and send PR.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#899
No description provided.