all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: John Darrington <john@darrington.wattle.id.au>
Cc: guix-devel@gnu.org
Subject: Re: mount syscall
Date: Thu, 17 Nov 2016 10:47:31 +0100	[thread overview]
Message-ID: <87a8cy780c.fsf@gnu.org> (raw)
In-Reply-To: <20161116210601.GA409@jocasta.intra> (John Darrington's message of "Wed, 16 Nov 2016 22:06:01 +0100")

John Darrington <john@darrington.wattle.id.au> skribis:

> On Tue, Nov 15, 2016 at 11:46:01AM +0100, Ludovic Court??s wrote:
>      John Darrington <john@darrington.wattle.id.au> skribis:
>      
>      > On Mon, Nov 14, 2016 at 10:48:18AM +0100, Ludovic Court??s wrote:
>      >      
>      >      The ???mount??? system call; see (gnu build file-systems).
>      >
>      > I confess, I have not really thought about this before. But supposing somebody has in their /etc/config.scm:
>      >
>      >   (file-systems 
>      >    (cons*
>      >     (file-system
>      >       (device "my-root")
>      >       (title 'label)
>      >       (mount-point "/")
>      >       (type "ext4"))
>      >     (file-system
>      >       (device "fileserver.example.com:/home")
>      >       (title 'device)
>      >       (mount-point "/home")
>      >       (type "nfs4"))
>      >     %base-file-systems))
>      >
>      > Would the /home filesystem then get mounted on boot?
>      
>      Maybe not.  :-)
>      
>      The man page for mount(2) says:
>      
>      --8<---------------cut here---------------start------------->8--- Values
>      for the filesystemtype argument supported by the kernel are listed in
>      /proc/filesystems (e.g., "btrfs", "ext4", "jfs", "xfs", "vfat", "fuse",
>      "tmpfs", "cgroup", "proc", "mqueue", "nfs", "cifs", "iso9660").  Further
>      types may become available when the appropriate modules are loaded.
>      --8<---------------cut here---------------end--------------->8---
>      
>      I don???t know what happens with NFS, you???ll have to tell us.
>
> The answer seems to be that it would fail unless we patch our mount syscall
> wrapper with something like:

[...]

> +                    (let ((xoptions
> +                           (cond
> +                            ((string-match "^nfs.*" type)
> +                             (let* ((hosts (string-split source #\:))
> +                                    (aa (car (getaddrinfo (car hosts)  #f)))
> +                                    (sa (addrinfo:addr aa))
> +                                    (inet-addr (inet-ntop (sockaddr:fam sa)
> +                                                          (sockaddr:addr sa))))
> +                               (string-append "addr="
> +                                              inet-addr
> +                                              (if options
> +                                                  (string-append "," options)
> +                                                  ""))))
> +                            (else
> +                             options))))

The ‘mount’ binding shouldn’t try to be smart and do things like this
IMO.  However, we could have a separate helper procedure to do that, if
needed and ‘file-system-shepherd-service’ would pick the right one.

Now, we should add system tests for that, otherwise it sounds like we’re
adding code that will rarely be used and we’ll never know whether it
actually works or how it’s supposed to be used.  :-)

Thanks,
Ludo’.

  reply	other threads:[~2016-11-17  9:47 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10 21:14 [PATCH 1/4] gnu: Separate util-linux into three packages John Darrington
2016-11-10 21:14 ` [PATCH 2/4] gnu: nfs-utils: Change input from util-linux to util-linux/mount John Darrington
2016-11-10 21:14 ` [PATCH 3/4] gnu: Move util-linux/mount to new file and deal with the effects John Darrington
2016-11-10 21:14 ` [PATCH 4/4] Add fs-search paths to util-linux John Darrington
2016-11-11 14:43 ` [PATCH 1/4] gnu: Separate util-linux into three packages Hartmut Goebel
2016-11-11 16:03   ` John Darrington
2016-11-11 16:40     ` Hartmut Goebel
2016-11-11 19:36       ` John Darrington
2016-11-12 14:53 ` Ludovic Courtès
2016-11-12 15:28   ` John Darrington
2016-11-12 17:09     ` John Darrington
2016-11-12 22:55       ` Ludovic Courtès
2016-11-13  8:21         ` John Darrington
2016-11-13 11:59           ` Ludovic Courtès
2016-11-13 14:06             ` John Darrington
2016-11-14  9:48               ` Ludovic Courtès
2016-11-14 17:46                 ` John Darrington
2016-11-15 10:46                   ` Ludovic Courtès
2016-11-16 21:06                     ` mount syscall John Darrington
2016-11-17  9:47                       ` Ludovic Courtès [this message]
2016-11-22 19:15                         ` [PATCH] gnu: Allow nfs filesystems to be automatically mounted John Darrington
2016-11-23 22:07                           ` Ludovic Courtès
2016-11-23 23:32                             ` John Darrington
2016-11-24 16:08                               ` Ludovic Courtès
2016-11-26  9:36                                 ` [PATCH] gnu: Allow nfs file systems " John Darrington
2016-11-26 18:37                                   ` Ludovic Courtès
2016-11-26 19:33                                     ` John Darrington
2016-11-28 13:59                                       ` Ludovic Courtès
2016-11-28 14:07                                         ` John Darrington
2016-11-28 21:05                                           ` Ludovic Courtès
2016-11-29  6:27                                             ` John Darrington
2016-11-29 21:51                                               ` Ludovic Courtès

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8cy780c.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=john@darrington.wattle.id.au \
    /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 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.