fuse icon indicating copy to clipboard operation
fuse copied to clipboard

Support NFSv4 export

Open itfanr opened this issue 9 years ago • 14 comments

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?

itfanr avatar Jul 26 '16 14:07 itfanr

It seems code changes are needed.

  1. The filesystem must support lookups of . and ..; I'm not sure of the exact semantics right now
  2. InitExportSupport must be set in InitResponse.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 avatar Jul 26 '16 15:07 tv42

@tv42 Do you mean it is feasible ?

itfanr avatar Jul 27 '16 00:07 itfanr

With code changes, sure.

tv42 avatar Jul 27 '16 00:07 tv42

@tv42 It sounds great ! But how about the performance after the second nfs export ?

itfanr avatar Jul 27 '16 01:07 itfanr

https://github.com/sahlberg/fuse-nfs https://github.com/libfuse/sshfs
https://github.com/libfuse/libfuse/blob/master/example/fusexmp.c

All of above

itfanr avatar Jul 27 '16 06:07 itfanr

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 avatar Jul 27 '16 14:07 tv42

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

itfanr avatar Jul 28 '16 00:07 itfanr

But how to reduce overhead or times of copy between kernel space and user space ?

itfanr avatar Jul 28 '16 00:07 itfanr

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

itfanr avatar Jul 28 '16 00:07 itfanr

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 avatar Jul 28 '16 00:07 tv42

@tv42 Are you really asking about re-exporting an NFS mount? Yes. Can you give me some idea?

itfanr avatar Jul 28 '16 00:07 itfanr

Sorry, NFS has nothing to do with FUSE, and I'd rather forget every single thing about it.

tv42 avatar Jul 28 '16 00:07 tv42

@tv42 I have made it by nfs-kernel-client + fuse + nfs-kernel-server.

itfanr avatar Jul 28 '16 01:07 itfanr

I can only get the speed of 6M/s for write .

itfanr avatar Jul 29 '16 02:07 itfanr