relan / exfat

Free exFAT file system implementation
GNU General Public License v2.0
789 stars 179 forks source link

main.c: to take care of fuse nonempty option again #130

Closed hmatrjp closed 3 years ago

hmatrjp commented 5 years ago

Somehow nonempty option does not take effect since version 1.3.0 ( or before?) This small tweak is to revive it again. find_option() is almost a copy of match_option() in libexfat/mount.c .

relan commented 5 years ago

Somehow nonempty option does not take effect since version 1.3.0

That's because I switched to fuse_main() API in 1.3.0. It's convenient, but fails on unrecognized options. So fuse-exfat does not pass options from command line to FUSE anymore. I agree that this is an issue.

This small tweak is to revive it again.

I'm thinking of a more generic solution. The problem here is that there are some exFAT-specific options that should never be passed to FUSE. A new argument for match_option() and get_option() can mark such options. When this argument is true, they will remove found option from the options string. The string of remaining options will be passed to FUSE. What do you think?

hmatrjp commented 5 years ago

I'm thinking of a more generic solution. The problem here is that there are some exFAT-specific options that should never be passed to FUSE. A new argument for match_option() and get_option() can mark such options. When this argument is true, they will remove found option from the options string. The string of remaining options will be passed to FUSE. What do you think?

Sounds good. There should be other fuse options to be processed in addition to nonempty. But as you know, match_option() can not be called from main.c , this is why I copied it to find_option(). This maybe not a big problem, just mentioned.

ghost commented 5 years ago

tested patch with udevil and it works..

relan commented 4 years ago

I tried the idea from https://github.com/relan/exfat/pull/130#issuecomment-521734473, it didn't work out very well (mutable options strings are inconvenient to manage).

I'll try to implement a filter that will remove exFAT-specific options before passing the options string from a user to FUSE. If this won't look good either, I'll take the approach in this PR.

jkhsjdhjs commented 3 years ago

I'll try to implement a filter that will remove exFAT-specific options before passing the options string from a user to FUSE. If this won't look good either, I'll take the approach in this PR.

I'd like to implement this the way you stated, since there hasn't been any activity in 18 months. Would this be ok?

relan commented 3 years ago

I actually did this in https://github.com/relan/exfat/commit/c2b08b002d52e6f97f7713967a567e3cf0d532d5 (optwhitelist branch).

jkhsjdhjs commented 3 years ago

Ah, I see. Your current approach is to allow certain options to be passed to FUSE. So I assume your approach to filter exFAT-specific options before passing the options string to FUSE didn't work out?

Anyways, do you have any plans on merging optwhitelist into master?

relan commented 3 years ago

So I assume your approach to filter exFAT-specific options before passing the options string to FUSE didn't work out?

Yeah, I decided it was too complex for such a small piece of functionality.

Anyways, do you have any plans on merging optwhitelist into master?

Merged those changes into master.

jkhsjdhjs commented 3 years ago

Very nice! I just tested it on Arch Linux, works fine!

131 can also be closed then.

relan commented 3 years ago

I'll close the bug when I make a release. Thanks for testing!