unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: David Michael <fedora.dm0@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH shepherd] support: Ignore errors on parent directories in mkdir-p.
Date: Thu, 04 Feb 2016 17:47:07 +0100	[thread overview]
Message-ID: <87d1scbeyc.fsf@gnu.org> (raw)
In-Reply-To: <8760y7axn2.fsf@gmail.com> (David Michael's message of "Tue, 02 Feb 2016 11:24:17 -0500")

David Michael <fedora.dm0@gmail.com> skribis:

> My use case for this is that I have a crazy Hurd setup that boots a
> read-only root file system with a passive tmpfs translator on /run.
> When mkdir-p runs with "/run/shepherd", it tries to mkdir "/run".  On
> Hurd, mkdir first tests for a read-only file system, so mkdir-p catches
> and throws EROFS instead of catching and ignoring EEXIST.  The init
> process then dies when it tries to stat the non-existent /run/shepherd.
>
> This patch ignores all errors from parent directories, assuming we only
> really care about the status of creating the final path component.
>
> Another possibility could be to try to change Hurd's error ordering
> instead, but it seems to be acceptably standard behavior:
>
>     If more than one error occurs in processing a function call, any one
>     of the possible errors may be returned, as the order of detection is
>     undefined.[0]

Interesting!

I think that it’s a case where it would be beneficial for the Hurd to
follow what Linux does, which is to return EEXIST.

How does Coreutils’ ‘mkdir -p’ behave in this situation?  (I’ve looked
at mkdir-p.c in Gnulib but it’s a bit complicated…)

> Can this be applied, or do you prefer another option?

I would prefer not to hide the initial error like the proposed patch
does.

OTOH, it’s no big deal, so if it turns out to be too much of a problem
or adds too much latency to wait for the Hurd fix, we could apply this
patch.

WDYT?

Ludo’.

  reply	other threads:[~2016-02-04 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 16:24 [PATCH shepherd] support: Ignore errors on parent directories in mkdir-p David Michael
2016-02-04 16:47 ` Ludovic Courtès [this message]
2016-02-05 18:22   ` David Michael
2016-02-06 13:14     ` 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

  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=87d1scbeyc.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=fedora.dm0@gmail.com \
    --cc=guix-devel@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).