From: maxim.cournoyer@gmail.com
To: 39770@debbugs.gnu.org
Subject: bug#39770: mount-file-system fails to mount NFS file system
Date: Mon, 24 Feb 2020 14:39:13 -0500 [thread overview]
Message-ID: <875zfvixlq.fsf@raisin.i-did-not-set--mail-host-address--so-tickle-me> (raw)
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
next reply other threads:[~2020-02-24 19:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-24 19:39 maxim.cournoyer [this message]
2020-02-24 21:21 ` bug#39770: mount-file-system fails to mount NFS file system Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875zfvixlq.fsf@raisin.i-did-not-set--mail-host-address--so-tickle-me \
--to=maxim.cournoyer@gmail.com \
--cc=39770@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).