ext4: do not reference pa_inode from group_pa
authorYongqiang Yang <xiaoqiangnk@gmail.com>
Sun, 18 Dec 2011 20:49:54 +0000 (15:49 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 18 Dec 2011 20:49:54 +0000 (15:49 -0500)
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>
fs/ext4/mballoc.c
include/trace/events/ext4.h

index e2d8be8f28bfb8555644bef5100b2f9b8c2cbe9a..cb990b21c698bd9dd1ec0e4bb8488f6e82bbe2f7 100644 (file)
@@ -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);
index 748ff7cbe5557989e6fd40fcacb70e5b8760956f..319538bf17d219d1bb3c11525c94cecdf669b978 100644 (file)
@@ -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;
        ),