aboutsummaryrefslogtreecommitdiffstats
path: root/example/notify_store_retrieve.c
AgeCommit message (Collapse)AuthorLines
2024-08-19Fix FUSE_USE_VERSION in example/notify_store_retrieve.cyangyun-1/+1
This is an addition to commit e75d2c54a347. This example sets FUSE_USE_VERSION = 34 but uses fuse_loop_cfg_* APIs, which is not allowed since these APIs are not introduced in version 34.
2024-06-25Fix wrong use of the EBADFD errnoCismonX-3/+3
should use EBADF instead
2024-06-04Add support for no_interrupt (#956)yangyun50-0/+8
The function fuse_session_process_buf_int() would do much things for FUSE_INTERRUPT requests, even there are no FUSE_INTERRUPT requests: 1. check every non-FUSE_INTERRUPT request and add these requests to the linked list(se->list) under a big lock(se->lock). 2. the function fuse_free_req() frees every request and remove them from the linked list(se->list) under a bing lock(se->lock). These operations are not meaningful when there are no FUSE_INTERRUPT requests, and have a great impact on the performance of fuse filesystem because the big lock for each request. In some cases, FUSE_INTERRUPT requests are infrequent, even none at all. Besides, the user-defined filesystem may do nothing for FUSE_INTERRUPT requests. And the kernel side has the option "no_interrupt" in struct fuse_conn. This kernel option can be enabled by return ENOSYS in libfuse for the reply of FUSE_INTERRUPT request. But I don't find the code to enable the "no_interrupt" kernel option in libfuse. So add the no_interrupt support, and when this operaion is enabled: 1. remove the useless locking operaions and list operations. 2. return ENOSYS for the reply of FUSE_INTERRUPT request to inform the kernel to disable FUSE_INTERRUPT request.
2024-04-20example/: Convert all fuse_session_loop_mt users to 3.12 API (#931)Bernd Schubert-4/+7
Convert all the remaining users of fuse_session_loop_mt() to the new 3.12 config api.
2024-02-26example/notify_store_retrieve: Fix races and handle errorsBernd Schubert-11/+38
This test was racy, the lookup counter must only be increased once kernel side has lookup completed and knows about the inode. However, this is still racy as app thread (python script) kernel-side libfuse thread kernel ---------------------------------------------------------------------- open file lookup req wait handle req reply wake app thread return new_inode() <continue file open> So actually on libfuse side even after returning from kernel side it is not ensured that the kernel has created the inode. I.e. using lookup_cnt in the test is still racy. A new variabled 'open_cnt' is added that is only increased in open Using open_cnt should be safe to use as kernel side (with atomic-open) first does lookup, from that data creates the inode and only then sends an open request. I.e. update_fs_loop() must only call fuse_lowlevel_notify_store() once it is absolutely sure kernel side has created the inode (open_cnt) and when it is sure the kernel inode still exists (lookup_cnt). Not really nice, but we actually need to accept some errors, as these still come up at umount time. Typically it is hard to hit, but tests in github actually frequently get it. Actually, it can be easily reproduced by commenting out the sleep line in update_fs_loop(). Underlying issue is that kernel side is sending ->destroy() only when it already internally released all inodes - too late for this test. The errors I run into are ENOENT and EBADFD, but I added back in ENODEV for safety. In order to avoid any other kind races mutex lock is also introduced.
2023-12-28examples/notify_store_retrieve: Add a clean shutdownBernd Schubert-11/+20
On shutdown update_fs_loop() was failing frequently in github test with ENOENT, but only ENODEV was tested for and only for the. With clean shutdown there is no need to test for such errors at all.
2020-09-09Updated example code to work with new API (#547)AKowshik-3/+7
2020-03-13State GPL version in comment (#485)Dr. David Alan Gilbert-1/+1
IN a bunch of comments we say 'under the terms of the GNU GPL', make it clear this is GPLv2 (as LICENSE says). Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-01-30examples: mark ops variables constant (#496)zsugabubus-1/+1
2019-03-08Document fuse_fsync_in.fsync_flags and remove magic numbers (#375)Alan Somers-5/+1
2017-11-27Spelling (#223)Josh Soref-1/+1
Fix spelling errors
2017-09-25Removed unneccessary #include <config.h> from examplesNikolaus Rath-2/+0
Fixes: #208.
2017-07-08Added public fuse_lib_help(), bumped minor versionNikolaus Rath-1/+1
2017-05-31notify_store_retrieve(): fix race on unmountNikolaus Rath-4/+11
update_fs_loop() is still running when the filesystem unmounts, but it that case calls to fuse_lowlevel_notify_* will fail. Fixes: #105.
2017-05-31example/notify_store_retrieve: add debugging code for issue #105.Nikolaus Rath-2/+10
2016-10-28Clean-up doxygen documentationNikolaus Rath-3/+2
Fixes: #81.
2016-10-15Make --help output more suitable for end-userNikolaus Rath-2/+1
We now only list options that are potentially useful for an end-user (and unlikely to accidentally break a file system). The full list of FUSE options has been moved to the documentation of the fuse_new() and fuse_session_new() functions.
2016-10-15Unify handling of fuse_conn_info optionsNikolaus Rath-1/+0
Instead of using command line options to modify struct fuse_conn_info before and after calling the init() handler, we now give the file system explicit control over this.
2016-10-13Make -o clone_fd into a parameter of session_loop_mt().Nikolaus Rath-1/+1
This option really affects the behavior of the session loop, not the low-level interface. Therefore, it does not belong in the fuse_session object.
2016-10-10Fix race condition in notify_* examplesNikolaus Rath-10/+17
The fix in commit cf4159156b was incomplete. While some false positives are caused by sleep() in the file system taking longer than expected, there was also a race condition where the file system would run before the contents are initialized properly.
2016-10-09Use NULL as option processor where possible.Nikolaus Rath-9/+1
2016-10-09Don't confuse lookup count for mountpoint and fileNikolaus Rath-2/+4
I think this is the reason for a sporadic test failure, where fuse_lowlevel_notify_store() fails.
2016-10-09Renamed timefsN examples to fuse_notify_*Nikolaus Rath-0/+417
This should make it more obvious at first glance what the different examples do.