libfuse / pyfuse3

Python 3 bindings for libfuse 3 with asynchronous API (Trio compatible)
https://pyfuse3.readthedocs.io/
Other
166 stars 48 forks source link

Allow users to modify connection properties in `init` #49

Open SupraSummus opened 2 years ago

SupraSummus commented 2 years ago

Hi,

I'd like to limit maximum size of read requests incoming to my FS. I tried using max_read=N option (with N = 4096), but then I get an error from libfuse:

fuse: error: init() and fuse_session_new() requested different maximum read size (0 vs 4096)

To illustrate the problem I modified test case - https://github.com/SupraSummus/pyfuse3/commit/ce20b49509b3366fc51f450b198beecdf949ce74

As far as I understand I need to pass max_read option to libfuse's init(). How do I do that?

Thanks and have a nice day! Jan Rydzewski

Nikratio commented 2 years ago

Thanks for your interest in libfuse! As far as I can tell, this is a question about how to use fuse rather than a bug report. Could you please send your question to the FUSE mailing list (https://lists.sourceforge.net/lists/listinfo/fuse-devel), instead of using the issue tracker? I'd like to reserve use of the latter to actually track issues and not use it for discussion.

SupraSummus commented 2 years ago

I wasn't clear enough, sorry for that. I believe there is no possibility to modify fuse_conn_info.max_read field in operation.init() handler, which is required to use max_read option. This means that it is impossible to use max_read=N via python binding for libfuse.

I've added simple support for that in https://github.com/SupraSummus/pyfuse3/commit/2e128cae6bba5cc3ba76a8f43468449342d0f2ef. I might open a PR with that change, I'm just not sure if my modifications are correct, because I'm new to cython and C-level libfuse. Anyway, tests seem to pass.

Nikratio commented 2 years ago

Apologies, now I see. That pull request looks mostly good, but please model it a bit more after the existing wrapper objects (e.g. StatvfsData).

ThomasWaldmann commented 1 year ago

Related: #50 (which was closed back then because it missed a test).

@SupraSummus are you interested in finishing this? If not, guess we can close this issue also.