pyfuse3 icon indicating copy to clipboard operation
pyfuse3 copied to clipboard

Allow users to modify connection properties in `init`

Open SupraSummus opened this issue 4 years ago • 4 comments

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

SupraSummus avatar Oct 30 '21 19:10 SupraSummus

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.

Nikratio avatar Oct 31 '21 09:10 Nikratio

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.

SupraSummus avatar Nov 01 '21 00:11 SupraSummus

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).

Nikratio avatar Nov 01 '21 10:11 Nikratio

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.

ThomasWaldmann avatar Aug 07 '23 14:08 ThomasWaldmann