ext4: do not reference pa_inode from group_pa
Subsystems (2)
PATCH 1/1 ext4: do not reference pa_inode from group_pa
commit 60e07cf515e541ea3e13b888d273c9b19a2ad9dd upstream.
From: Yongqiang Yang <[email protected]>
pa_inode in group_pa is set NULL in ext4_mb_new_group_pa, so pa_inode should be not referenced.
Reported-by Wu Fengguang <[email protected]>
Signed-off-by Yongqiang Yang <[email protected]>
Signed-off-by "Theodore Ts'o" <[email protected]>
--- fs/ext4/mballoc.c | 2 +- include/trace/events/ext4.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
fs/ext4/mballoc.c +1 -1
@@ -3671,7 +3671,7 @@ ext4_mb_release_group_pa(struct ext4_buddy *e4b,ext4_group_t group;ext4_grpblk_t bit; -trace_ext4_mb_release_group_pa (pa); +trace_ext4_mb_release_group_pa (sb, pa);BUG_ON (pa->pa_deleted ==0 );ext4_get_group_no_and_offset (sb, pa->pa_pstart, &group, &bit);BUG_ON (group != e4b->bd_group && pa->pa_len !=0 );
include/trace/events/ext4.h +3 -3
@@ -573,9 +573,9 @@ TRACE_EVENT(ext4_mb_release_inode_pa, ); TRACE_EVENT(ext4_mb_release_group_pa, - TP_PROTO(struct ext4_prealloc_space *pa), + TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa), - TP_ARGS(pa), + TP_ARGS(sb, pa), TP_STRUCT__entry( __field( dev_t, dev )
@@ -585,7 +585,7 @@ TRACE_EVENT(ext4_mb_release_group_pa, ), TP_fast_assign( - __entry->dev = pa->pa_inode->i_sb->s_dev; + __entry->dev = sb->s_dev; __entry->pa_pstart = pa->pa_pstart; __entry->pa_len = pa->pa_len; ),
Signature · 1 line
1.7.7.3
Quoted 10 lines · Wu Fengguang
commit
60e07cf515e541ea3e13b888d273c9b19a2ad9ddupstream.From: Yongqiang Yang <[email protected]>
pa_inodeingroup_pais set NULL inext4_mb_new_group_pa, sopa_inodeshould be not referenced.Reported-by Wu Fengguang <[email protected]>Signed-off-by Yongqiang Yang <[email protected]>Signed-off-by "Theodore Ts'o" <[email protected]>
I agree this should go into the stable kernel; it was an oversight that I didn't add a cc: [email protected]
Acked-by "Theodore Ts'o" <[email protected]>
- Ted