fix oops in ext4_mb_release_group_pa tracing
Subsystems (2)
PATCH 1/1 fix oops in ext4_mb_release_group_pa tracing
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.
---
include/trace/events/ext4.h +0 -3
@@ -432,7 +432,6 @@ 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 )
@@ -440,8 +439,6 @@ TRACE_EVENT(ext4_mb_release_group_pa,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; ),
Quoted 33 lines · Eric Sandeen
Our QA reported an oops in the
ext4_mb_release_group_patracing, and Josef Bacik pointed out that it was because we may have a non-null but uninitializedac_inodein the allocation context.I can reproduce it when running xfstests with ext4 tracepoints on, on a
CONFIG_SLAB_DEBUGkernel.We call
trace_ext4_mb_release_group_pafrom 2 places,ext4_mb_discard_group_preallocationsandext4_mb_discard_lg_preallocationsIn 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]>---
include/trace/events/ext4.h +0
-1@@ -432,7 +432,6 @@ 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 )
include/trace/events/ext4.h TRACE_EVENT(ext4_mb_release_group_pa, · line 444
Quoted 8 lines
include/trace/events/ext4.h +0
-2@@ -440,8 +439,6 @@ TRACE_EVENT(ext4_mb_release_group_pa,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; ),
Thanks,
Josef
Quoted 7 lines · Eric Sandeen
Our QA reported an oops in the
ext4_mb_release_group_patracing, and Josef Bacik pointed out that it was because we may have a non-null but uninitializedac_inodein the allocation context.I can reproduce it when running xfstests with ext4 tracepoints on, on a
CONFIG_SLAB_DEBUGkernel.
Quoted 8 lines
We call
trace_ext4_mb_release_group_pafrom 2 places,ext4_mb_discard_group_preallocationsandext4_mb_discard_lg_preallocationsIn 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.
Ping on this one at least?
avoid-null-dereference-in-trace_ext4_mballoc_discard is in the patch queue, this one is similar and should go with it.
I'd really like to see
[PATCH] don't use ext4_allocation_contexts for tracing go soon as well so we stop abusing the slab cache all day long...
Thanks,
-Eric
Quoted 29 lines
Signed-off-by Eric Sandeen <[email protected]>---
include/trace/events/ext4.h +0
-4@@ -432,7 +432,6 @@ 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 )@@ -440,8 +439,6 @@ TRACE_EVENT(ext4_mb_release_group_pa,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; ), --To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 11 lines · Eric Sandeen
Our QA reported an oops in the
ext4_mb_release_group_patracing, and Josef Bacik pointed out that it was because we may have a non-null but uninitializedac_inodein the allocation context.I can reproduce it when running xfstests with ext4 tracepoints on, on a
CONFIG_SLAB_DEBUGkernel.We call
trace_ext4_mb_release_group_pafrom 2 places,ext4_mb_discard_group_preallocationsandext4_mb_discard_lg_preallocations
Quoted 6 lines
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]>
ping on this one too, oopsing while tracing is bad ... ;)
-Eric
Quoted 28 lines
---
include/trace/events/ext4.h +0
-4@@ -432,7 +432,6 @@ 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 )@@ -440,8 +439,6 @@ TRACE_EVENT(ext4_mb_release_group_pa,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; ), --To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Ted Ts'o
maintainerQuoted 11 lines · Eric Sandeen
Our QA reported an oops in the
ext4_mb_release_group_patracing, and Josef Bacik pointed out that it was because we may have a non-null but uninitializedac_inodein the allocation context.I can reproduce it when running xfstests with ext4 tracepoints on, on a
CONFIG_SLAB_DEBUGkernel.We call
trace_ext4_mb_release_group_pafrom 2 places,ext4_mb_discard_group_preallocationsandext4_mb_discard_lg_preallocations
Quoted 6 lines
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]>
Thanks for the ping; I've added it to the ext4 patch tree.
- Ted