All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org,
	dledford@redhat.com
Subject: Re: [PATCH] Proposed module init race fix.
Date: Wed, 15 Jan 2003 17:34:45 +0100	[thread overview]
Message-ID: <3E258DA5.4BB14A41@linux-m68k.org> (raw)
In-Reply-To: 20030115082444.13D1A2C128@lists.samba.org

Hi,

Rusty Russell wrote:

> diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17886-linux-2.5-bk/drivers/block/genhd.c .17886-linux-2.5-bk.updated/drivers/block/genhd.c
> --- .17886-linux-2.5-bk/drivers/block/genhd.c   2003-01-13 16:56:23.000000000 +1100
> +++ .17886-linux-2.5-bk.updated/drivers/block/genhd.c   2003-01-13 22:58:07.000000000 +1100
> @@ -104,10 +104,13 @@ static int exact_lock(dev_t dev, void *d
>   * @gp: per-device partitioning information
>   *
>   * This function registers the partitioning information in @gp
> - * with the kernel.
> + * with the kernel.  Your init function MUST NOT FAIL after this.
>   */
>  void add_disk(struct gendisk *disk)
>  {
> +       /* It needs to be accessible so we can read partitions. */
> +       make_module_live(disk->fops->owner);
> +

After this the module can be removed without problems.

>         disk->flags |= GENHD_FL_UP;
>         blk_register_region(MKDEV(disk->major, disk->first_minor), disk->minors,
>                         NULL, exact_match, exact_lock, disk);

blk_register_region() allocates memory, which can fail?

bye, Roman



  reply	other threads:[~2003-01-15 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-15  8:24 [PATCH] Proposed module init race fix Rusty Russell
2003-01-15 16:34 ` Roman Zippel [this message]
2003-01-17  1:38   ` Rusty Russell
2003-01-17 15:35     ` Roman Zippel
  -- strict thread matches above, loose matches on Subject: below --
2003-01-15  8:46 Adam J. Richter
2003-01-15  9:06 ` Rusty Russell
2003-01-15 14:21 Petr Vandrovec
2003-01-16  1:48 ` Rusty Russell
2003-01-16  2:55   ` Werner Almesberger

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=3E258DA5.4BB14A41@linux-m68k.org \
    --to=zippel@linux-m68k.org \
    --cc=dledford@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@transmeta.com \
    /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.