linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Tejun Heo <tj@kernel.org>, Li Zefan <lizefan@huawei.com>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>
Subject: Re: 3.15 regression: wrong cgroup magic
Date: Mon, 2 Jun 2014 18:15:36 -0700	[thread overview]
Message-ID: <CA+55aFz+cijJuUTs6xs6SdGnasmR7uYXKkr7=0YTuPQ+xgjFEA@mail.gmail.com> (raw)
In-Reply-To: <CALCETrXbpiqwY=qyPcNWn2zX=vehXzBbxDG725egM9T2Ox2KTA@mail.gmail.com>

On Mon, Jun 2, 2014 at 5:56 PM, Andy Lutomirski <luto@amacapital.net> wrote:
>
> In particular, this piece:
>
> -       sb->s_magic = CGROUP_SUPER_MAGIC;
>
> The result is that cgroup shows up with the wrong magic number, so my
> code goes "oh crap, cgroupfs isn't mounted" and fails.
>
> I can change my code to hack around this, but I can imagine other
> things getting tripped up.  Is there still time to fix this?

Sure. Send me a tested patch. I'm assuming it's going to look something like

  --- a/kernel/cgroup.c
  +++ b/kernel/cgroup.c
  @@ -54,6 +54,7 @@
   #include <linux/vmalloc.h> /* TODO: replace with more sophisticated array */
   #include <linux/kthread.h>
   #include <linux/delay.h>
  +#include <linux/magic.h>

   #include <linux/atomic.h>

  @@ -1607,6 +1608,8 @@ out_unlock:
          dentry = kernfs_mount(fs_type, flags, root->kf_root, &new_sb);
          if (IS_ERR(dentry) || !new_sb)
                  cgroup_put(&root->cgrp);
  +       else
  +               dentry->d_sb->s_magic = CGROUP_SUPER_MAGIC;
          return dentry;
   }

but somebody definitely needs to test it.

               Linus

  reply	other threads:[~2014-06-03  1:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03  0:56 3.15 regression: wrong cgroup magic Andy Lutomirski
2014-06-03  1:15 ` Linus Torvalds [this message]
2014-06-03  1:18 ` Li Zefan
2014-06-03  1:22   ` Tejun Heo
2014-06-03  1:30     ` Linus Torvalds
2014-06-03  4:26       ` Greg Kroah-Hartman
2014-06-03 17:23       ` Linus Torvalds
2014-06-03 17:48         ` Andy Lutomirski
2014-06-03 17:49           ` Linus Torvalds
2014-06-03 17:52         ` Tejun Heo
2014-06-03 17:53           ` Tejun Heo

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='CA+55aFz+cijJuUTs6xs6SdGnasmR7uYXKkr7=0YTuPQ+xgjFEA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=luto@amacapital.net \
    --cc=tj@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 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 NNTP newsgroup(s).