mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
readahead: fix NULL filp dereference
commit 70655c06bd
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>
This commit is contained in:
parent
957c93832c
commit
a54573d774
@ -502,7 +502,7 @@ void page_cache_sync_readahead(struct address_space *mapping,
|
||||
return;
|
||||
|
||||
/* be dumb */
|
||||
if (filp->f_mode & FMODE_RANDOM) {
|
||||
if (filp && (filp->f_mode & FMODE_RANDOM)) {
|
||||
force_page_cache_readahead(mapping, filp, offset, req_size);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user