Re: BUG in videodev.c [PATCH]

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sun, 7 Mar 1999 17:22:07 +0000 (GMT)


> > It matches the sound driver and it matches the bug reports.
>
> The bug reports are from 2.0.x, no?

The bug reports are from 2.1.

> In 2.0.x, vm_area_struct used to have an inode pointer.
> In 2.2.x, it's a file pointer.
>
> Basically the description does not make sense, and I bet that there is
> something else wrong.

Well if I take the equivalent code out of the sound driver I can crash
the machine like in 2.0. If mmap, close the video without an munmap it
crashes and following the mm code I think the patch is right.

The mmap routine attaches a chunk of vmalloc memory to the vma, after
jumping through the neccessary hoops. The kernel mm/ routines don't set
the file on the vma because this is a device mapping. The mmap release
routines dont drop the file count or even know about it because the file
is NULL.

So I think it is exactly right (except that the vma should go to the driver)

The driver attaches the file, and bumps the use count. munmap then drops the
use count as it should.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/