all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#39770: mount-file-system fails to mount NFS file system
@ 2020-02-24 19:39 maxim.cournoyer
  2020-02-24 21:21 ` Maxim Cournoyer
  0 siblings, 1 reply; 2+ messages in thread
From: maxim.cournoyer @ 2020-02-24 19:39 UTC (permalink / raw)
  To: 39770

The mount-file-system call used in our init RAM disk (see: (gnu build
file-systems)) doesn't produce the correct system call as can be
demontstrated by the following C program:

--8<---------------cut here---------------start------------->8---
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/mount.h>

/* int mount(const char *source, const char *target, */
/* 	  const char *filesystemtype, unsigned long mountflags, */
/* 	  const void *data); */

int main() {
  //char *src = "192.168.51.34:/mnt/scratch/yocto-sstate";
  char *src = "192.168.51.34:/mnt/scratch/yocto-sstate";
  char *target = "/mnt/scratch/yocto-sstate";
  char *type = "nfs";
  unsigned long mountflags = 0;
  char *data = "addr=192.168.51.34";  //file system specific options

  int ret = 0;
  ret = mount(src, target, type, mountflags, data);

  if (ret == -1); {
    int errsv = errno;
    printf("mount() failed with error: %s\n", strerror(errsv));
  }
}

--8<---------------cut here---------------end--------------->8---

Running the program with strace, we can see that it failed with a
connection refused error:

--8<---------------cut here---------------start------------->8---
/* mount("192.168.51.34:/mnt/scratch/yocto-sstate", "/mnt/scratch/yocto-sstate", "nfs", 0, "addr=192.168.51.34") = -1 ECONNREFUSED (Connection refused) */
--8<---------------cut here---------------end--------------->8---


When having nfs-utils installed and tracing mount.nfs with:

--8<---------------cut here---------------start------------->8---
strace -f -s320 mount j1-slave1.sfl.team:/mnt/scratch/yocto-dldir /mnt/scratch/yocto-dldir -t nfs
--8<---------------cut here---------------end--------------->8---

We can see that the working invocation reads as:

--8<---------------cut here---------------start------------->8---
mount("j1-slave1.sfl.team:/mnt/scratch/yocto-dldir", "/mnt/scratch/yocto-dldir", "nfs", 0, "vers=4.2,addr=192.168.51.34,clientaddr=192.168.49.249")
--8<---------------cut here---------------end--------------->8---

It seems we're missing either a "vers" (doubtful) or more likely the
"clientaddr" option.

Maxim

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-24 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24 19:39 bug#39770: mount-file-system fails to mount NFS file system maxim.cournoyer
2020-02-24 21:21 ` Maxim Cournoyer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.