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