Re: Patch for mmap Bug in dazukofs 3.1.0-rc1
Lino Sanfilippo <[email protected]> Thu, 02 Jul 2009 10:22:39 +0200
| Newsgroups | gmane.linux.dazuko.devel |
|---|---|
| Message-ID | <[email protected]> |
John Ogness wrote: > On 2009-07-01, Lino Sanfilippo <[email protected]> wrote: > >> This patch ensures that generic_file_readonly_mmap() is only called >> if the lower file actually supports mmap. >> >> If not the error code -ENODEV, which is used by the vfs to indicate >> that mmap is not supported, is returned. >> >> +static int dazukofs_mmap(struct file *file, struct vm_area_struct *vm) >> +{ >> + struct file *lower_file = get_lower_file(file); >> + >> + /* if lower fs does not support mmap, we dont call generic_mmap(), since >> + * this would result in calling lower readpage(), which might not be defined >> + * by lower fs, since mmap is not supported */ >> + if (!lower_file->f_op || !lower_file->f_op->mmap) >> + return -ENODEV; >> + return generic_file_mmap(file, vm); >> +} >> > > Shouldn't it be: > > if (!lower_file->f_op || !lower_file->f_op->mmap) > return -ENODEV; > return generic_file_readonly_mmap(file, vm); > > instead? > > John Ogness > > Oops, yes of course ;)) Geschäftsführender Gesellschafter: Tjark Auerbach Sitz der Gesellschaft: Tettnang Handelsregister: Amtsgericht Ulm, HRB 630992 ALLGEMEINE GESCHÄFTSBEDINGUNGEN Es gelten unsere Allgemeinen Geschäftsbedingungen (AGB). Sie finden sie in der jeweils gültigen Fassung im Internet unter http://www.avira.de/agb ***************************************************