All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: lars-3XmpO8hA3EAAvxtiuMwx3w@public.gmane.org
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] dracut: write initramfs to temp file then move into place
Date: Fri, 22 Feb 2013 10:57:15 +0100	[thread overview]
Message-ID: <512740FB.2070605@redhat.com> (raw)
In-Reply-To: <1361482823-30898-1-git-send-email-lars-3XmpO8hA3EAAvxtiuMwx3w@public.gmane.org>

Am 21.02.2013 22:40, schrieb lars-3XmpO8hA3EAAvxtiuMwx3w@public.gmane.org:
> From: "Lars R. Damerow" <lars-3XmpO8hA3EAAvxtiuMwx3w@public.gmane.org>
> 
> We've been finding cases where multiple instances of dracut can be launched
> simultaneously, resulting in a corrupted initramfs file. This patch makes
> dracut write the initramfs to a new file, then move it into place atomically.
> ---
>  dracut.sh | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/dracut.sh b/dracut.sh
> index 31cf2a5..da96aaa 100755
> --- a/dracut.sh
> +++ b/dracut.sh
> @@ -1103,10 +1103,11 @@ fi
>  rm -f "$outfile"
>  dinfo "*** Creating image file ***"
>  if ! ( umask 077; cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet| \
> -    $compress > "$outfile"; ); then
> -    dfatal "dracut: creation of $outfile failed"
> +    $compress > "$outfile.$$"; ); then
> +    dfatal "dracut: creation of $outfile.$$ failed"
>      exit 1
>  fi
> +mv $outfile.$$ $outfile
>  dinfo "*** Creating image file done ***"
>  
>  dinfo "Wrote $outfile:"
> 

Yes, right!
Thanks for the patch!

      parent reply	other threads:[~2013-02-22  9:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-21 21:40 [PATCH] dracut: write initramfs to temp file then move into place lars-3XmpO8hA3EAAvxtiuMwx3w
     [not found] ` <1361482823-30898-1-git-send-email-lars-3XmpO8hA3EAAvxtiuMwx3w@public.gmane.org>
2013-02-22  9:57   ` Harald Hoyer [this message]

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=512740FB.2070605@redhat.com \
    --to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lars-3XmpO8hA3EAAvxtiuMwx3w@public.gmane.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.
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.