Skip to content

Commit

Permalink
ext4: fix oops in trace_ext4_mb_release_group_pa
Browse files Browse the repository at this point in the history
Our QA reported an oops in the ext4_mb_release_group_pa tracing,
and Josef Bacik pointed out that it was because we may have a
non-null but uninitialized ac_inode in the allocation context.

I can reproduce it when running xfstests with ext4 tracepoints on, 
on a CONFIG_SLAB_DEBUG kernel.

We call trace_ext4_mb_release_group_pa from 2 places, 
ext4_mb_discard_group_preallocations and 
ext4_mb_discard_lg_preallocations

In both cases we allocate an ac as a container just for tracing (!)
and never fill in the ac_inode.  There's no reason to be assigning,
testing, or printing it as far as I can see, so just remove it from
the tracepoint.

Signed-off-by: Eric Sandeen <[email protected]>
Reviewed-by: Josef Bacik <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
  • Loading branch information
Eric Sandeen authored and tytso committed Oct 28, 2010
1 parent 0c9169c commit 4d54761
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions include/trace/events/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,16 +432,13 @@ TRACE_EVENT(ext4_mb_release_group_pa,

TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
__field( __u64, pa_pstart )
__field( __u32, pa_len )

),

TP_fast_assign(
__entry->dev = sb->s_dev;
__entry->ino = (ac && ac->ac_inode) ?
ac->ac_inode->i_ino : 0;
__entry->pa_pstart = pa->pa_pstart;
__entry->pa_len = pa->pa_len;
),
Expand Down

0 comments on commit 4d54761

Please sign in to comment.