From: Greg KH on
2.6.33-stable review patch. If anyone has any objections, please let us know.


From: Wu Fengguang <fengguang.wu(a)>

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(a)>
Cc: Yan Zheng <yanzheng(a)>
Reported-by: Kirill A. Shutemov <kirill(a)>
Tested-by: Kirill A. Shutemov <kirill(a)>
Signed-off-by: Andrew Morton <akpm(a)>
Signed-off-by: Linus Torvalds <torvalds(a)>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)>

mm/readahead.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -502,7 +502,7 @@ void page_cache_sync_readahead(struct ad

/* be dumb */
- if (filp->f_mode & FMODE_RANDOM) {
+ if (filp && (filp->f_mode & FMODE_RANDOM)) {
force_page_cache_readahead(mapping, filp, offset, req_size);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)
More majordomo info at
Please read the FAQ at