[PATCH] ub: atomic add_disk
authorPete Zaitcev <zaitcev@redhat.com>
Fri, 26 May 2006 03:04:54 +0000 (20:04 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 Jun 2006 22:04:14 +0000 (15:04 -0700)
commit688e9fb1bbdd4e5a51b5030b7f9b1c811fd5e5e3
tree302c191611e780f3e897d353b134f1fe3c9394bc
parent2f8ad9a1b91bc6856860a2fea8b07e0c82c0ad0a
[PATCH] ub: atomic add_disk

<zaitcev> I am taling about this: "if (disk->flags & GENHD_FL_UP) del_gendisk(disk);"
<zaitcev> If del_gendisk() undoes add_disk() like viro just said, why is it conditional?
<viro> huh?
<viro> add_disk() sets the damn flag
<zaitcev> So, I should not need to check ever
<viro> so the above is "if I've called add_disk(), call gendisk()"
<viro> which might be what you want, of course
<viro> but usually you know if you'd done add_disk() on that puppy anyway

In ub, nobody upstream should ever see half-constructed disks before
they were passed to add_disk. To that end, only add the struct lun to
the list on the path of no return. With that fix in place, we do
not need to test GENHD_FL_UP.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/block/ub.c