Coder Social home page Coder Social logo

vfs4j's Introduction

VFS4J

An implementation of nfs4j's VirtualFileSystem interface which is based on Linux's open-by-handle API.

Usage

The vfs4j uses Java 22 Foreign Function and Memory API, which requires additional JVM options.

$ sudo java --enable-preview --enable-native-access=ALL-UNNAMED \
    -jar target/vfs4j-1.0-SNAPSHOT.jar /directory/to/export /path/to/export/file

The exports file is compatible with the standard /etc/exports file format.

How to contribute

VFS4J uses the linux kernel model where git is not only the source repository, but also the way to track contributions and copyrights.

Each submitted patch must have a "Signed-off-by" line. Patches without this line will not be accepted.

The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below:

    Developer's Certificate of Origin 1.1

    By making a contribution to this project, I certify that:

    (a) The contribution was created in whole or in part by me and I
         have the right to submit it under the open source license
         indicated in the file; or

    (b) The contribution is based upon previous work that, to the best
        of my knowledge, is covered under an appropriate open source
        license and I have the right under that license to submit that
        work with modifications, whether created in whole or in part
        by me, under the same open source license (unless I am
        permitted to submit under a different license), as indicated
        in the file; or

    (c) The contribution was provided directly to me by some other
        person who certified (a), (b) or (c) and I have not modified
        it.

    (d) I understand and agree that this project and the contribution
        are public and that a record of the contribution (including all
        personal information I submit with it, including my sign-off) is
        maintained indefinitely and may be redistributed consistent with
        this project or the open source license(s) involved.

Then you add a line saying ( git commit -s )

Signed-off-by: Random J Developer <[email protected]>

using your real name (sorry, no pseudonyms or anonymous contributions.)

License

This work is published under the Apache License 2.0

vfs4j's People

Contributors

anerokhi avatar dependabot[bot] avatar kofemann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vfs4j's Issues

Cannot build the project

Building the project failed.

JAVA: JDK19

Command Line:mvn -fn -Dmaven.repo.local=maven_repo clean install

Console Output:

 Picked up _JAVA_OPTIONS : '--enable-preview --enable-native-access=ALL-UNNAMED'
 [INFO] Scanning for projects...
 [WARNING]
 [WARNING] Some problems were encountered while building the effective model for org.dcache:vfs4j:jar:1.0-SNAPSHOT
 [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 64, column 21
 [WARNING]
 [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
 [WARNING]
 [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
 [WARNING]
 [INFO]
 

/directory/to/export can only use "/"

I have tested this code and noticed that "/directory/to/export" can not use the same directory that I used in /etc/exports file.

Here is what I have in my /etc/exports file:
/var/lib/testvfs4j/nfs *(rw,sec=NONE)

And when I run the jar file, I tried:
java -jar vfs4j-1.0-SNAPSHOT.jar /var/lib/testvfs4j/nfs /etc/exports

And when I run:
mount -t nfs localhost:/var/lib/testvsf4j/nfs /tmp/mnt

it returns error as:
mount.nfs: mounting localhost:/var/lib/testvfs4j/nfs failed, reason given by server: No such file or directory

2019-03-19 14:22:59.147 [localhost/0:0:0:0:0:0:0:1:999] [OncRpcSvc (15)] WARN o.d.n.v.PseudoFs - No exports found for: localhost/0:0:0:0:0:0:0:1
2019-03-19 14:22:59.200 [localhost/127.0.0.1:928] [OncRpcSvc (1)] WARN o.d.n.v.PseudoFs - No exports found for: localhost/127.0.0.1
2019-03-19 14:22:59.238 [localhost/0:0:0:0:0:0:0:1:933] [OncRpcSvc (0)] WARN o.d.n.v.PseudoFs - No exports found for: localhost/0:0:0:0:0:0:0:1
2019-03-19 14:22:59.265 [localhost/127.0.0.1:701] [OncRpcSvc (13)] WARN o.d.n.v.PseudoFs - No exports found for: localhost/127.0.0.1
2019-03-19 14:22:59.301 [] [OncRpcSvc (1)] WARN o.d.n.v.MountServer - mount request failed:

I also tried use /var/lib/testvfs4j or /var/lib... none of them are working and return error as:
mount.nfs: access denied by server while mounting localhost:/var/lib/testvfs4j

The only format works is when I use "/" so that the starting command becomes:

java -jar vfs4j-1.0-SNAPSHOT.jar / /etc/exports

Could you please give me some idea if this is a bug in the code or as designed?

Thanks,

fails when cp to mounted dir

when I execute
cp /tmp/nfs-utils-2.5.4.tar.xz /mnt1/
It say:
cp: cannot stat '/mnt1/nfs-utils-2.5.4.tar.xz': Input/output error

I have tracked the execution path, It fails on LOOKUP operation, this operation further call
the lookup method in LocalVFS, method call sequence is as following:
lookup->path2fh->fNameToHandleAt.invokeExact(fd, str.address(), bytes.address(), mntId.address(), flags)
the fNameToHandleAt returns -1
therefor the code fails on checkError(rc == 0), because of the target file nfs-utils-2.5.4.tar.xz dose not exists.
Are there any idea to fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.