linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	stable@kernel.org, "Yan, Zheng" <yanzheng@21cn.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [PATCH][BUGFIX] readahead: fix NULL filp dereference
Date: Fri, 2 Apr 2010 15:18:04 +0300	[thread overview]
Message-ID: <r2gcc557aab1004020518u5329383eh2bfaaf404fc5d8e2@mail.gmail.com> (raw)
In-Reply-To: <20100402072750.GA22952@localhost>

On Fri, Apr 2, 2010 at 10:27 AM, Wu Fengguang <fengguang.wu@intel.com> =
wrote:
> The btrfs relocate_file_extent_cluster() calls us with NULL filp:
>
> =C2=A0[ 4005.426805] BUG: unable to handle kernel NULL pointer derefe=
rence at 00000021
> =C2=A0[ 4005.426818] IP: [<c109a130>] page_cache_sync_readahead+0x18/=
0x3e
>
> CC: Yan Zheng <yanzheng@21cn.com>
> Reported-by: Kirill A. Shutemov <kirill@shutemov.name>
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> ---
>
> Andrew and Greg:
>
> This is an obvious correct bug fix for .34 and .33-stable,
> so I'm resending it directly to you without Kirill's confirmation.

Sorry.

Tested-by: Kirill A. Shutemov <kirill@shutemov.name>

> --- sound-2.6.orig/mm/readahead.c =C2=A0 =C2=A0 =C2=A0 2010-03-26 11:=
51:57.000000000 +0800
> +++ sound-2.6/mm/readahead.c =C2=A0 =C2=A02010-03-26 11:52:11.0000000=
00 +0800
> @@ -502,7 +502,7 @@ void page_cache_sync_readahead(struct ad
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return;
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0/* be dumb */
> - =C2=A0 =C2=A0 =C2=A0 if (filp->f_mode & FMODE_RANDOM) {
> + =C2=A0 =C2=A0 =C2=A0 if (filp && (filp->f_mode & FMODE_RANDOM)) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0force_page_cac=
he_readahead(mapping, filp, offset, req_size);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return;
> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>

      reply	other threads:[~2010-04-02 12:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 13:06 Oops on btrfs filesystem balance Kirill A. Shutemov
2010-03-26  3:40 ` Yan, Zheng 
2010-03-26  4:01   ` Wu Fengguang
2010-04-02  7:27     ` [PATCH][BUGFIX] readahead: fix NULL filp dereference Wu Fengguang
2010-04-02 12:18       ` Kirill A. Shutemov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=r2gcc557aab1004020518u5329383eh2bfaaf404fc5d8e2@mail.gmail.com \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=yanzheng@21cn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).