linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: James Bottomley <jbottomley@parallels.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Jens Axboe <axboe@fb.com>, Tejun Heo <tj@kernel.org>,
	Jan Kara <jack@suse.cz>, Hannes Reinecke <hare@suse.de>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH] Fix a bdi reregistration race, v2
Date: Tue, 24 Nov 2015 15:23:21 -0800	[thread overview]
Message-ID: <5654F169.6070000@sandisk.com> (raw)
In-Reply-To: <20151124231331.GA25591@infradead.org>

On 11/24/2015 03:13 PM, Christoph Hellwig wrote:
> What sort of re-registration is this? Seems like we should only
> release the minor number once the bdi is released.

Hello Christoph,

As you most likely know the BDI device name for disks is based on the 
device major and minor number:

$ ls -l /dev/sda
brw-rw---- 1 root disk 8, 0 Nov 24 14:53 /dev/sda
$ ls -l /sys/block/sda/bdi
lrwxrwxrwx 1 root root 0 Nov 24 15:17 /sys/block/sda/bdi -> 
../../../../../../../../virtual/bdi/8:0

So if a driver stops using a (major, minor) number pair and the same 
device number is reused before the bdi device has been released the 
warning mentioned in the patch description at the start of this thread 
is triggered. This patch fixes that race by removing the bdi device from 
sysfs during the __scsi_remove_device() call instead of when the bdi 
device is released.

Bart.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-11-24 23:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 22:13 [PATCH] Fix a bdi reregistration race, v2 Bart Van Assche
2015-11-20 22:43 ` Aaro Koskinen
2015-11-20 22:55   ` Bart Van Assche
2015-11-24 23:13 ` Christoph Hellwig
2015-11-24 23:23   ` Bart Van Assche [this message]
2015-11-25  8:47     ` Christoph Hellwig
2015-11-25 14:59       ` Bart Van Assche
2015-12-01  0:57         ` Martin K. Petersen
2015-12-01  1:18           ` Bart Van Assche
2015-12-01  7:23             ` Christoph Hellwig

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=5654F169.6070000@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=axboe@fb.com \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=jbottomley@parallels.com \
    --cc=linux-mm@kvack.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --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).