On Tue, 18 Jan 2005, Hirokazu Takahashi wrote:

> > Index: linux-2.6.9/fs/hugetlbfs/inode.c
> > ===================================================================
> > --- linux-2.6.9.orig/fs/hugetlbfs/inode.c   2004-10-18 14:55:07.000000000 
> > -0700
> > +++ linux-2.6.9/fs/hugetlbfs/inode.c        2004-10-21 14:50:14.000000000 
> > -0700
> > @@ -79,10 +79,6 @@
> >     if (!(vma->vm_flags & VM_WRITE) && len > inode->i_size)
> >             goto out;
> >
> > -   ret = hugetlb_prefault(mapping, vma);
> > -   if (ret)
> > -           goto out;
> > -
> >     if (inode->i_size < len)
> >             inode->i_size = len;
> >  out:
>
> hugetlbfs_file_mmap() may fail with a weird error, as it returns
> uninitialized variable "ret".

Hmm. The current diff is:

@@ -79,11 +278,10 @@ static int hugetlbfs_file_mmap(struct fi
        if (!(vma->vm_flags & VM_WRITE) && len > inode->i_size)
                goto out;

-       ret = hugetlb_prefault(mapping, vma);
-       if (ret)
-               goto out;
+       ret = hugetlb_acct_commit(inode, VMACCTPG(vma->vm_pgoff),
+               VMACCTPG(vma->vm_pgoff + (vma_len >> PAGE_SHIFT)));

-       if (inode->i_size < len)
+       if (ret >= 0 && inode->i_size < len)
                inode->i_size = len;
 out:
        up(&inode->i_sem);

which does not leave ret uninitialized. Also this whole hugetlb
stuff has not been finalized yet and is not that high on my list of things
todo.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to