Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store nfs v4 url extensions in state file #2154

Open
skidoo23 opened this issue Nov 25, 2024 · 1 comment
Open

Store nfs v4 url extensions in state file #2154

skidoo23 opened this issue Nov 25, 2024 · 1 comment

Comments

@skidoo23
Copy link
Contributor

Store nfs v4 url extensions in MPD state file. Add via nfs v4 exported directory to MPD (without version=4 mount is not successful) MPD and mpc from git. Compiled to Debian testing x64.

$ mpc mount nfs 'nfs://nfs:/data/music?version=4'

Now access to audio files unter nfs is possible. MPD statefile now shows

uri: nfs
mounted_url: nfs://nfs/data/music
mount_end

Restart MPD. Nfs directory does not work. Have to unmount and re-mount it again. Storage plugin supports url extensions for nfs https://mpd.readthedocs.io/en/latest/plugins.html#nfs - would be nice to have a consistent usage with input plugin.

@skidoo23
Copy link
Contributor Author

Quick and dirty fix: force NFS v4 (no need to use URL extension)

$ mpc mount nfs 'nfs://nfs:/data/music'

diff --git a/src/lib/nfs/Connection.cxx b/src/lib/nfs/Connection.cxx
index 1901d43f2..b099d4faa 100644
--- a/src/lib/nfs/Connection.cxx
+++ b/src/lib/nfs/Connection.cxx
@@ -10,6 +10,7 @@

 extern "C" {
 #include <nfsc/libnfs.h>
+#include <nfsc/libnfs-raw-nfs4.h>
 }

 #include <utility>
@@ -200,6 +201,7 @@ NfsConnection::NfsConnection(EventLoop &_loop,
         server(_server), export_name(_export_name),
         context(_context)
 {
+       nfs_set_version(_context, NFS_V4);
 }

 NfsConnection::~NfsConnection() noexcept

Ugly but MPD works as advertised together with my NFS server. Correct solution: MPD should write NFS url extensions to state file and not to cache filename. I'm a little confused about how MPD creates and saves NFS url. Maybe someone could help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant