diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2010-04-06 17:34:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-07 11:38:03 -0400 |
commit | 70655c06bd3f25111312d63985888112aed15ac5 (patch) | |
tree | e6db465a10b6ece8f50fbcfce97404f03044e248 | |
parent | 12765517d9dbb477a2432375938f1eb5bdbcb532 (diff) |
readahead: fix NULL filp dereference
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>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-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 999b54bb462f..dfa9a1a03a11 100644 --- a/mm/readahead.c +++ b/mm/readahead.c | |||
@@ -503,7 +503,7 @@ void page_cache_sync_readahead(struct address_space *mapping, | |||
503 | return; | 503 | return; |
504 | 504 | ||
505 | /* be dumb */ | 505 | /* be dumb */ |
506 | if (filp->f_mode & FMODE_RANDOM) { | 506 | if (filp && (filp->f_mode & FMODE_RANDOM)) { |
507 | force_page_cache_readahead(mapping, filp, offset, req_size); | 507 | force_page_cache_readahead(mapping, filp, offset, req_size); |
508 | return; | 508 | return; |
509 | } | 509 | } |