On Sunday 21 January 2007 3:05 pm, Alan Stern wrote:
> On Sun, 21 Jan 2007, Sarah Bailey wrote:
> 
> 
> > +           return 0;
> > +
> > +   k_buff = kmalloc(count, GFP_KERNEL);
> 
> You may want to put some size limit here on count.  Do other char device
> drivers worry about this sort of thing?  With a bulk endpoint, the user
> could try to pass a very large amount of data.  You could, for instance,
> divide the data up into pieces each of which is a not-too-large multiple
> of the maxpacket size, say no more than a few pages.

That's another thing that can fall out almost for free if you use
the AIO interfaces.  A large sync call can be processed one chunk
at a time, with the "retry" (misnamed!) callback handling the next
chunk until it's all done.  Such a "sync kiocb" would then hold off
other kiocbs until it finishes, preserving FIFO guarantees for the
I/O queue.

- Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to