lkml.org 
[lkml]   [2008]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] mm: do_generic_file_read() never gets a NULL 'filp' argument
Date
> On Mon, 22 Sep 2008 11:46:10 +0530 Krishna Kumar <krkumar2@in.ibm.com> wrote:
>
> > From: Krishna Kumar <krkumar2@in.ibm.com>
> >
> > The 'filp' argument to do_generic_file_read() is never NULL.
> >
>
> How did you verify this?
>
> NFS used to like passing NULL file*'s into VFS functions. I don't
> recall whether it affected do_generic_file_read().

Andrew, current do_generic_file_read have filp dereference at the beginning of function.
So, I believe nobody pass to NULL.


static void do_generic_file_read(struct file *filp, loff_t *ppos,
read_descriptor_t *desc, read_actor_t actor)
{
struct address_space *mapping = filp->f_mapping; /* here */
struct inode *inode = mapping->host;
struct file_ra_state *ra = &filp->f_ra; /* ditto */
pgoff_t index;
pgoff_t last_index;
pgoff_t prev_index;



>
> > mm/filemap.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff -ruNp 2.6.27-rc7-org/mm/filemap.c 2.6.27-rc7-new/mm/filemap.c
> > --- 2.6.27-rc7-org/mm/filemap.c 2008-09-17 12:53:25.000000000 +0530
> > +++ 2.6.27-rc7-new/mm/filemap.c 2008-09-17 12:53:59.000000000 +0530
> > @@ -1186,8 +1186,7 @@ out:
> > ra->prev_pos |= prev_offset;
> >
> > *ppos = ((loff_t)index << PAGE_CACHE_SHIFT) + offset;
> > - if (filp)
> > - file_accessed(filp);
> > + file_accessed(filp);
> > }
> >
> > int file_read_actor(read_descriptor_t *desc, struct page *page,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/





\
 
 \ /
  Last update: 2008-09-22 10:43    [W:0.041 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site