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: John Ogness
Subject: Re: [Dazuko-devel] Patch for mmap Bug in dazukofs 3.1.0-rc1
Date: Thu, 02 Jul 2009 09:08:48 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

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

-- 
Dazuko Maintainer




reply via email to

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