All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Folkert van Heusden <folkert@vanheusden.com>,
	Peter Korsgaard <jacmet@sunsite.dk>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: bdi: register sysfs bdi device only once per queue
Date: Mon, 03 Nov 2008 17:08:50 +0100	[thread overview]
Message-ID: <1225728530.7803.1630.camel@twins> (raw)
In-Reply-To: <1225727635.6009.9.camel@linux>

On Mon, 2008-11-03 at 16:53 +0100, Kay Sievers wrote:
> Andrew, can you pick this up this please?
> 
> Thanks,
> Kay
> 
> 
> From: Kay Sievers <kay.sievers@vrfy.org>
> Subject: bdi: register sysfs bdi device only once per queue
> 
> Devices which share the same queue, like floppies and mtd devices,
> get registered multiple times in the bdi interface, but bdi accounts
> only the last registered device of the devices sharing one queue.

David, is there any reason the mtd devices do this?

> On remove, all earlier registered devices leak, stay around in
> sysfs, and cause "duplicate filename" errors if the devices are
> re-created.
> 
> This prevents the creation of multiple bdi interfaces per queue,
> and the bdi device will carry the dev_t name of the block device
> which is the first one registered, of the pool of devices using
> the same queue.
> 
> Tested-By: Peter Korsgaard <jacmet@sunsite.dk>
> Acked-By: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
> ---
> 
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index f2e574d..e6676e5 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -176,6 +176,9 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
>  	int ret = 0;
>  	struct device *dev;
>  
> +	if (bdi->dev)
> +		goto exit;
> +
>  	va_start(args, fmt);
>  	dev = device_create_vargs(bdi_class, parent, MKDEV(0, 0), bdi, fmt, args);
>  	va_end(args);

Would it make sense to make it print something like, please fix me?

  reply	other threads:[~2008-11-03 16:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-03 15:53 bdi: register sysfs bdi device only once per queue Kay Sievers
2008-11-03 16:08 ` Peter Zijlstra [this message]
2008-11-05 20:10   ` Andrew Morton
2008-11-05 22:10     ` David Woodhouse
2008-11-05 22:21       ` Peter Zijlstra
2008-11-07 14:11       ` Peter Zijlstra

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=1225728530.7803.1630.camel@twins \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=folkert@vanheusden.com \
    --cc=jacmet@sunsite.dk \
    --cc=kay.sievers@vrfy.org \
    --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.