All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Mayrhofer <rene.mayrhofer@gibraltar.at>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Jason Baron <jbaron@redhat.com>
Subject: Re: pivot_root solved by patch to 2.4.22-pre7
Date: Wed, 06 Aug 2003 08:27:36 +0200	[thread overview]
Message-ID: <3F309FD8.8090105@gibraltar.at> (raw)
In-Reply-To: <Pine.LNX.4.44.0308051506570.26542-100000@dhcp64-178.boston.redhat.com>

Hi all,

The problem with pivot_root that appeared in 2.4.21-ac4 and the 
2.4.22-pre kernels is now solved (at least for my case) by applying the 
trvial patch sent by Jason Baron.

Jason Baron wrote:
> right. so the semantics of how file tables are shared has changed a bit. I
> would think that for at least 'init', it'd be nice to preserve the
> original behavior, for situations such as you described. Something like
> the following would probably work, although i havent' tried the test
> script.
> 
> --- linux/kernel/fork.c.orig  2003-07-23 21:34:59.000000000 -0400
> +++ linux/kernel/fork.c       2003-07-23 21:35:45.000000000 -0400
> @@ -558,7 +558,7 @@ int unshare_files(void)
>  
>         /* This can race but the race causes us to copy when we don't
>            need to and drop the copy */
> -       if(atomic_read(&files->count) == 1)
> +       if(atomic_read(&files->count) == 1 || (current->pid == 1))
>         {
>                 atomic_inc(&files->count);
>                 return 0;
>    



I tried that on my system and it works as expected. The kernel processes
close their fds and the old root fs can thus be unmounted after
pivot_root. Thanks for the hint !
So the problem is solved for me and it would be wonderful to get it into
2.4.22.

best regards,
Rene


       reply	other threads:[~2003-08-06  6:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44.0308051506570.26542-100000@dhcp64-178.boston.redhat.com>
2003-08-06  6:27 ` Rene Mayrhofer [this message]
2003-08-06 19:33   ` pivot_root solved by patch to 2.4.22-pre7 Marcelo Tosatti
2003-08-06 19:51     ` Herbert Pötzl
2003-08-07  9:34       ` Andreas Haumer
2003-08-07 10:33         ` Rene Mayrhofer
2003-08-07 11:58   ` Alan Cox
2003-08-07 15:26     ` Jason Baron
2003-08-07 15:50       ` Alan Cox
2003-08-07 16:41         ` Jason Baron
2003-08-15 18:14         ` Jason Lunz
2003-09-23 17:25 Mathias Sundman

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=3F309FD8.8090105@gibraltar.at \
    --to=rene.mayrhofer@gibraltar.at \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.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.