mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm: do_generic_file_read() doesn't need to validate filp
@ 2008-09-22  4:03 Krishna Kumar
  2008-09-22  5:32 ` KOSAKI Motohiro
  2008-09-22  7:47 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Krishna Kumar @ 2008-09-22  4:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: krkumar2, Krishna Kumar

From: Krishna Kumar <krkumar2@in.ibm.com>

do_generic_file_read() doesn't need to validate filp when accessing it. This
is probably a remnant of an earlier code.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
 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,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: do_generic_file_read() doesn't need to validate filp
  2008-09-22  4:03 [PATCH] mm: do_generic_file_read() doesn't need to validate filp Krishna Kumar
@ 2008-09-22  5:32 ` KOSAKI Motohiro
  2008-09-22  7:47 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: KOSAKI Motohiro @ 2008-09-22  5:32 UTC (permalink / raw)
  To: Krishna Kumar; +Cc: kosaki.motohiro, linux-kernel

Hi

Please write explictly that filp is never passed NULL for patch description clarify.
Otherthing, looks good to me.

Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>


> From: Krishna Kumar <krkumar2@in.ibm.com>
> 
> do_generic_file_read() doesn't need to validate filp when accessing it. This
> is probably a remnant of an earlier code.
> 
> Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
> ---
>  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/




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: do_generic_file_read() doesn't need to validate filp
  2008-09-22  4:03 [PATCH] mm: do_generic_file_read() doesn't need to validate filp Krishna Kumar
  2008-09-22  5:32 ` KOSAKI Motohiro
@ 2008-09-22  7:47 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2008-09-22  7:47 UTC (permalink / raw)
  To: Krishna Kumar; +Cc: linux-kernel

On Mon, Sep 22, 2008 at 09:33:25AM +0530, Krishna Kumar wrote:
> From: Krishna Kumar <krkumar2@in.ibm.com>
> 
> do_generic_file_read() doesn't need to validate filp when accessing it. This
> is probably a remnant of an earlier code.

Looks good, thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-22  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-22  4:03 [PATCH] mm: do_generic_file_read() doesn't need to validate filp Krishna Kumar
2008-09-22  5:32 ` KOSAKI Motohiro
2008-09-22  7:47 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®