diff options
author | Xue jiufei <xuejiufei@huawei.com> | 2015-06-25 01:55:20 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-25 02:49:39 +0200 |
commit | 74e364ad1b13fd518a0bd4e5aec56d5e8706152f (patch) | |
tree | fb2c14c51cf5c4d85252893e5a24ea2191ac19e4 /fs/ocfs2/journal.c | |
parent | ocfs2: o2net: should remove debugfs in o2net_init() out branch (diff) | |
download | linux-74e364ad1b13fd518a0bd4e5aec56d5e8706152f.tar.xz linux-74e364ad1b13fd518a0bd4e5aec56d5e8706152f.zip |
ocfs2: fix NULL pointer dereference in function ocfs2_abort_trigger()
ocfs2_abort_trigger() use bh->b_assoc_map to get sb. But there's no
function to set bh->b_assoc_map in ocfs2, it will trigger NULL pointer
dereference while calling this function. We can get sb from
bh->b_bdev->bd_super instead of b_assoc_map.
[akpm@linux-foundation.org: update comment, per Joseph]
Signed-off-by: joyce.xue <xuejiufei@huawei.com>
Cc: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r-- | fs/ocfs2/journal.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 72db49c0e2ab..69333bea6a1a 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -571,9 +571,7 @@ static void ocfs2_abort_trigger(struct jbd2_buffer_trigger_type *triggers, (unsigned long)bh, (unsigned long long)bh->b_blocknr); - /* We aren't guaranteed to have the superblock here - but if we - * don't, it'll just crash. */ - ocfs2_error(bh->b_assoc_map->host->i_sb, + ocfs2_error(bh->b_bdev->bd_super, "JBD2 has aborted our journal, ocfs2 cannot continue\n"); } |