[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081124062417.GZ28946@ZenIV.linux.org.uk>
Date: Mon, 24 Nov 2008 06:24:17 +0000
From: Al Viro <viro@...IV.linux.org.uk>
To: Tejun Heo <tj@...nel.org>
Cc: Neil Brown <neilb@...e.de>, linux-kernel@...r.kernel.org,
linux-raid@...r.kernel.org, Doug Ledford <dledford@...hat.com>,
Greg KH <greg@...ah.com>, Jens Axboe <jens.axboe@...cle.com>
Subject: Re: [PATCH 1/2] md: make devices disappear when they are no longer
needed.
On Mon, Nov 24, 2008 at 02:34:30PM +0900, Tejun Heo wrote:
> > Maybe...
> >
> > If genhd.c:disk_release called e.g.
> > disk->fops->final_put(disk)
> >
> > then I could possibly link in to that to destroy the md state when the
> > gendisk finally disappears.
> >
> > When I want to kill the gendisk I would call blk_unregister_region
> > directly (not through del_gendisk) to allow it to disappear.
> > If md_probe then gets called before the final_put, I'd need to
> > call blk_register_region again to re-install it.
> >
> > I think that would work.
> >
> > Would 'block_device_operations' be the right place for this
> > 'final_put' or 'final_release' ??
>
> I suppose so. Maybe just void (*release)(struct gendisk *) but Jens is
> the maintainer. Jens, what do you think?
First of all, release is already taken (with exactly that argument, BTW).
And doing that at freeing gendisk is a bad idea - md.ko might have been
long gone by the time you've got there, not to mention anything else...
IOW, it's too late; once the damn thing is not opened anymore (and nobody
is the middle of trying to open it), the module might be dead and gone,
so all uses of ->private_data and ->fops are illegal after that point.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists