Commit 60e07cf515e541ea3e13b888d273c9b19a2ad9dd
Committed by
Theodore Ts'o
1 parent
384703b8e6
Exists in
master
and in
6 other branches
ext4: do not reference pa_inode from group_pa
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 <fengguang.wu@intel.com> Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Showing 2 changed files with 4 additions and 4 deletions Side-by-side Diff
fs/ext4/mballoc.c
... | ... | @@ -3671,7 +3671,7 @@ |
3671 | 3671 | ext4_group_t group; |
3672 | 3672 | ext4_grpblk_t bit; |
3673 | 3673 | |
3674 | - trace_ext4_mb_release_group_pa(pa); | |
3674 | + trace_ext4_mb_release_group_pa(sb, pa); | |
3675 | 3675 | BUG_ON(pa->pa_deleted == 0); |
3676 | 3676 | ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, &bit); |
3677 | 3677 | BUG_ON(group != e4b->bd_group && pa->pa_len != 0); |
include/trace/events/ext4.h
... | ... | @@ -573,9 +573,9 @@ |
573 | 573 | ); |
574 | 574 | |
575 | 575 | TRACE_EVENT(ext4_mb_release_group_pa, |
576 | - TP_PROTO(struct ext4_prealloc_space *pa), | |
576 | + TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa), | |
577 | 577 | |
578 | - TP_ARGS(pa), | |
578 | + TP_ARGS(sb, pa), | |
579 | 579 | |
580 | 580 | TP_STRUCT__entry( |
581 | 581 | __field( dev_t, dev ) |
... | ... | @@ -585,7 +585,7 @@ |
585 | 585 | ), |
586 | 586 | |
587 | 587 | TP_fast_assign( |
588 | - __entry->dev = pa->pa_inode->i_sb->s_dev; | |
588 | + __entry->dev = sb->s_dev; | |
589 | 589 | __entry->pa_pstart = pa->pa_pstart; |
590 | 590 | __entry->pa_len = pa->pa_len; |
591 | 591 | ), |