dazuko-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dazuko-devel] Patch for mmap Bug in dazukofs 3.1.0-rc1


From: Lino Sanfilippo
Subject: Re: [Dazuko-devel] Patch for mmap Bug in dazukofs 3.1.0-rc1
Date: Thu, 02 Jul 2009 10:22:39 +0200
User-agent: Icedove 1.5.0.14eol (X11/20090105)

John Ogness wrote:
On 2009-07-01, Lino Sanfilippo <address@hidden> 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
***************************************************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]