Support NFSv4 export
For example:
On 192.168.0.2 the /home directory is exported via nfs protocol , and I mount it to /mnt/nfs on 192.168.0.3. Then I mount /mnt/nfs to /mnt/fuse via a fuse application.
At last, /mnt/fsue is exported via nfs again.
Could bazil-fuse make it?
It seems code changes are needed.
- The filesystem must support lookups of
.and..; I'm not sure of the exact semantics right now -
InitExportSupportmust be set inInitResponse.Flags; this requires changes in bazil.org/fuse
It would require changes, and filesystems would need to explicitly enable support for NFS exports, but we could support it, and it's a worthy goal.
Note: you must use NFSv4 not 3: http://unix.stackexchange.com/questions/102617/having-trouble-exporting-fuse-via-nfs
@tv42 Do you mean it is feasible ?
With code changes, sure.
@tv42 It sounds great ! But how about the performance after the second nfs export ?
https://github.com/sahlberg/fuse-nfs
https://github.com/libfuse/sshfs
https://github.com/libfuse/libfuse/blob/master/example/fusexmp.c
All of above
I'm not sure what you mean. fuse-nfs is a FUSE filesystem that acts as an NFSv3 client. sshfs is a FUSE filesystem that acts as an SFTP client. fusexmp.c is an example of how to program with the C FUSE library. What about them?
@tv42 If you want to export /mnt/nfs via nfs protocol , you will get that "/mnt/nfs is not supported by nfs. Only if map the /mnt/nfs to /mnt/fuse and export the /mnt/fuse via nfs protocol ,you can mount nfs directory from another host again.
But how to reduce overhead or times of copy between kernel space and user space ?
@tv42 I want to achieve is a gateway host , which seperate the client from backend of storage and have the ability to merge multiple storages.
Are you really asking about re-exporting an NFS mount? If so, that's a completely different problem, and FUSE doesn't really do anything for you. Please don't drag this FUSE library into that problem.
@tv42 Are you really asking about re-exporting an NFS mount? Yes. Can you give me some idea?
Sorry, NFS has nothing to do with FUSE, and I'd rather forget every single thing about it.
@tv42 I have made it by nfs-kernel-client + fuse + nfs-kernel-server.
I can only get the speed of 6M/s for write .