Gentoo Archives: gentoo-soc

From: Kaoru Esashika <e_kaoru5@××××××××.jp>
To: gentoo-soc@l.g.o
Subject: Re: [gentoo-soc] Weekly Report: Fusebox - FUSE Porwered sandbox project
Date: Mon, 22 Jun 2020 16:17:37
Message-Id: CAHuS14NNivRO6KB0GX+cbQxS8Bk1ACyMo3=c6Pmt149UPBao7g@mail.gmail.com
In Reply to: Re: [gentoo-soc] Weekly Report: Fusebox - FUSE Porwered sandbox project by "Michał Górny"
1 Thank you for the reaction, Luca, Michał.
2
3 I will expand my blog post soon. Thank you, Luca.
4
5 I want to answer the question from Michał.
6
7 > 1. From our talking you indicated that FUSE has both high-level and low-
8 > level API. However, the post only hints at it. Could you explain both
9 > shortly and why you've chosen the one you've chosen?
10
11 There are some FUSE libraries which I can choose. But actively
12 maintenanced ones are pyfuse3 and libfuse (both are developed by the
13 same person).
14 pyfuse3 is an asynchronous python library. I call it 'low-level'
15 because functions that should be implemented are called with inode
16 arguments.
17 libfuse is a C library. It has two interfaces, high-level synchronous
18 one and low-level asynchronous one. The difference between the two is
19 whether arguments are path or inode.
20 So, with the exception of libraries that are no longer maintained, the
21 only choice is pyfuse3.
22
23 > 2. How are you planning to deal with the essential problem that
24 > the underlying directory tree may consist of multiple filesystems with
25 > different files having colliding inode numbers?
26
27 VFS in the kernel and programs in userland expects consistency with
28 regard to inode, so Fusebox should provide a unique inode for each
29 file.
30 Fusebox can do this by finding out which device the file belongs to.
31 Then remember mappings from/to device-inode pairs to/from 'virtual'
32 inode.
33 However, I worried this solution hits performance since it potentially
34 causes many stat() system calls.
35
36 > 3. How do other passthrough filesystems deal with the same problem?
37 > What are the advantages/disadvantages of different approaches you've
38 > considered, and why did you chose this solution?
39
40 I investigated the high-level interface of libfuse. It caches the
41 reply of the user program. and automatically convert inode and path.
42 So the high-level interface of libfuse will affect the problem.
43 I also investigate sandboxfs ( https://github.com/bazelbuild/sandboxfs
44 ). I think it take same strategy to Fusebox.
45 sandboxfs construct filesystem tree virtually on memory and notice
46 virtual inode to user application.
47 This approach may hit performance because of frequent stat() call, but
48 I cannot think better approaches.
49
50 Thank you for your reply and support.
51
52 Would you mind if I publish this mail on my blog, Michał? It was a
53 worthwhile discussion and I'd like to share it on my blog.
54
55 Regards,
56 Kaoru Esashika

Replies