Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758350Ab0GUOVV (ORCPT ); Wed, 21 Jul 2010 10:21:21 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:56630 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755624Ab0GUOVU (ORCPT ); Wed, 21 Jul 2010 10:21:20 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=KaKyyOrhOr9vnUEyLcpPZdjCmmxsg/f9yw2+GKk1Xupt+aQayTKyBLuv3UYZs5Tmny KjNAX2krv9ZChxhrX4PEg8vJCpK0BXe723dCAxJI/uR8rVUV1XnWe36/UCJKzGnjhnKY oDYSXWI9BxtBF6vtkk36DRFmBkkp+KrU4qSNI= Date: Wed, 21 Jul 2010 16:21:16 +0200 From: Frederic Weisbecker To: Steven Rostedt Cc: KOSAKI Motohiro , Li Zefan , "Theodore Ts'o" , LKML , linux-ext4@vger.kernel.org, Mathieu Desnoyers Subject: Re: [BUG] ext4 trace events cause NULL pointer dereferences Message-ID: <20100721142112.GB5764@nowhere> References: <4C401CE3.7010004@cn.fujitsu.com> <20100721222508.8704.A69D9226@jp.fujitsu.com> <1279721766.4818.39.camel@gandalf.stny.rr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1279721766.4818.39.camel@gandalf.stny.rr.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1725 Lines: 53 On Wed, Jul 21, 2010 at 10:16:06AM -0400, Steven Rostedt wrote: > On Wed, 2010-07-21 at 22:31 +0900, KOSAKI Motohiro wrote: > > Hi Steven, > > > if (ac) > > trace_ext4_mb_release_group_pa(ac, pa); > > > > But, I don't think this is proper fix because we don't want any overhead > > if the tracepoint is disabled. > > > > So, How do we check NULL in TP_fast_assign()? > > You could do: > > TP_fast_assign( > if (ac) { > __entry->dev = ac->ac_sb->s_dev; > __entry->ino = ac->ac_inode->i_ino; > __entry->pa_pstart = pa->pa_pstart; > __entry->pa_len = pa->pa_len; > } > ), > > But this just makes the __entry null and wastes the ring buffer. > > I may be able to add a __discard_entry that may help. Then we could do > something like this: > > if (ac) { > __entry->dev = ac->ac_sb->s_dev; > __entry->ino = ac->ac_inode->i_ino; > __entry->pa_pstart = pa->pa_pstart; > __entry->pa_len = pa->pa_len; > } else > __discard_entry; > > Does this seem reasonable? > > But for now, the wasting the entry seems to be the only choice we have, > or to do as you suggested and have the "if (ac) trace_...", but I don't > like that. > > -- Steve Is there no already existing branch in ext4 you could reuse in order to send the trace only if (ac) ? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/