All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Peter Osterlund <petero2@telia.com>
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@suse.de>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] CDRW packet writing support for 2.6.7-bk13
Date: Mon, 5 Jul 2004 11:26:19 +0100	[thread overview]
Message-ID: <20040705102619.GA15033@infradead.org> (raw)
In-Reply-To: <m2llhz5o4o.fsf@telia.com>

On Mon, Jul 05, 2004 at 01:49:43AM +0200, Peter Osterlund wrote:
> For fsync_bdev(), which you say is not needed anyway. Also for the
> invalidate_bdev() call in pkt_remove_dev(). The loop driver is also
> calling invalidate_bdev() in its loop_clr_fd() function, so I guess
> that call is needed.

Only as long as it's reusing the same gendisk for different devices,
more on that below.

> > > +	for (i = 0; i < MAX_WRITERS; i++) {
> > > +		struct pktcdvd_device *pd = &pkt_devs[i];
> > > +		struct gendisk *disk = disks[i];
> > > +		disk->major = PACKET_MAJOR;
> > > +		disk->first_minor = i;
> > > +		disk->fops = &pktcdvd_ops;
> > > +		disk->flags = GENHD_FL_REMOVABLE;
> > > +		sprintf(disk->disk_name, "pktcdvd%d", i);
> > > +		sprintf(disk->devfs_name, "pktcdvd/%d", i);
> > > +		disk->private_data = pd;
> > > +		disk->queue = blk_alloc_queue(GFP_KERNEL);
> > > +		if (!disk->queue)
> > > +			goto out_mem3;
> > > +		add_disk(disk);
> > > +	}
> > 
> > Please allocate all these on demand only when you actually attach
> > a device.
> 
> But I need to open the device to be able to perform the ioctl to
> attach a device, and I can't open the device until add_disk() has been
> called. The loop device does the same thing.

And loops is broken the same way ;-)  This I need an blockdevice to actually
attach it scheme breaks in many ways, like the need to reset a gendisk
instead of allocating a new one, lots of warts in ->open and problems with
udev.  Just keep a single character device around for all administrative
work (like device mapper) - otoh if packet writing really moves to the
block layer all this is magically fixed..


  parent reply	other threads:[~2004-07-05 10:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-01 13:34 [PATCH] CDRW packet writing support for 2.6.7-bk13 Peter Osterlund
2004-07-02 21:52 ` Peter Osterlund
2004-07-02 22:08   ` Andrew Morton
2004-07-02 22:47     ` Greg KH
2004-07-02 22:59       ` Andrew Morton
2004-07-02 23:24         ` Peter Osterlund
2004-07-02 23:51           ` Andrew Morton
2004-07-04 11:57             ` Peter Osterlund
2004-07-04 20:58               ` Andrew Morton
2004-07-04 21:06                 ` Christoph Hellwig
2004-07-04 12:30 ` [PATCH] Fix race in pktcdvd kernel thread handling Peter Osterlund
2004-07-04 12:37 ` [PATCH] Fix open/close races in pktcdvd Peter Osterlund
2004-07-04 13:05 ` [PATCH] CDRW packet writing support for 2.6.7-bk13 Christoph Hellwig
2004-07-04 23:49   ` Peter Osterlund
2004-07-05  0:01     ` Peter Osterlund
2004-07-10 23:20       ` Arnd Bergmann
2004-07-10 23:27         ` Christoph Hellwig
2004-07-11  1:06           ` Peter Osterlund
2004-07-12 16:25             ` Arnd Bergmann
2004-07-12 16:34               ` Christoph Hellwig
2004-07-13  6:04                 ` Jens Axboe
2004-07-14  0:06             ` [RFC][PATCH] Control pktcdvd with an auxiliary character device Peter Osterlund
2004-07-14  0:17               ` Peter Osterlund
2004-07-05  8:17     ` [PATCH] CDRW packet writing support for 2.6.7-bk13 Jens Axboe
2004-07-05 10:26     ` Christoph Hellwig [this message]
2004-07-06  8:45     ` Peter Osterlund
2004-07-07 10:06   ` Peter Osterlund

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=20040705102619.GA15033@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petero2@telia.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.