diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2010-04-06 17:34:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-26 10:47:50 -0400 |
commit | 92ee813c7f2241000f9d35e71b01273cd871482b (patch) | |
tree | a2dca7b2aa417ed32fbdb7e63a732358aa03863a | |
parent | 769c76538f4a274f17b8d895475f97d4ab5cbeee (diff) |
readahead: fix NULL filp dereference
commit 70655c06bd3f25111312d63985888112aed15ac5 upstream.
btrfs relocate_file_extent_cluster() calls us with NULL filp:
[ 4005.426805] BUG: unable to handle kernel NULL pointer dereference at 00000021
[ 4005.426818] IP: [<c109a130>] page_cache_sync_readahead+0x18/0x3e
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Yan Zheng <yanzheng@21cn.com>
Reported-by: Kirill A. Shutemov <kirill@shutemov.name>
Tested-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | mm/readahead.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/readahead.c b/mm/readahead.c index 337b20e946f6..fe1a069fb595 100644 --- a/mm/readahead.c +++ b/mm/readahead.c | |||
@@ -502,7 +502,7 @@ void page_cache_sync_readahead(struct address_space *mapping, | |||
502 | return; | 502 | return; |
503 | 503 | ||
504 | /* be dumb */ | 504 | /* be dumb */ |
505 | if (filp->f_mode & FMODE_RANDOM) { | 505 | if (filp && (filp->f_mode & FMODE_RANDOM)) { |
506 | force_page_cache_readahead(mapping, filp, offset, req_size); | 506 | force_page_cache_readahead(mapping, filp, offset, req_size); |
507 | return; | 507 | return; |
508 | } | 508 | } |