linux-brain/fs/jbd2
zhangyi (F) 241f3e338d jbd2: fix compile warning when using JBUFFER_TRACE
commit 01215d3edb upstream.

The jh pointer may be used uninitialized in the two cases below and the
compiler complain about it when enabling JBUFFER_TRACE macro, fix them.

In file included from fs/jbd2/transaction.c:19:0:
fs/jbd2/transaction.c: In function ‘jbd2_journal_get_undo_access’:
./include/linux/jbd2.h:1637:38: warning: ‘jh’ is used uninitialized in this function [-Wuninitialized]
 #define JBUFFER_TRACE(jh, info) do { printk("%s: %d\n", __func__, jh->b_jcount);} while (0)
                                      ^
fs/jbd2/transaction.c:1219:23: note: ‘jh’ was declared here
  struct journal_head *jh;
                       ^
In file included from fs/jbd2/transaction.c:19:0:
fs/jbd2/transaction.c: In function ‘jbd2_journal_dirty_metadata’:
./include/linux/jbd2.h:1637:38: warning: ‘jh’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define JBUFFER_TRACE(jh, info) do { printk("%s: %d\n", __func__, jh->b_jcount);} while (0)
                                      ^
fs/jbd2/transaction.c:1332:23: note: ‘jh’ was declared here
  struct journal_head *jh;
                       ^

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-23 13:19:51 +01:00
..
checkpoint.c jbd2: fix use after free in jbd2_log_do_checkpoint() 2018-11-13 11:16:55 -08:00
commit.c fs: use mapping_set_error instead of opencoded set_bit 2016-10-11 15:06:33 -07:00
journal.c jbd2: fix use after free in kjournald2() 2018-04-29 11:31:57 +02:00
Kconfig jbd2: remove debug dependency on debug_fs and update Kconfig help text 2013-06-12 23:07:51 -04:00
Makefile [PATCH] jbd2: rename jbd2 symbols to avoid duplication of jbd symbols 2006-10-11 11:14:15 -07:00
recovery.c fs: have ll_rw_block users pass in op and flags separately 2016-06-07 13:41:38 -06:00
revoke.c jbd2: don't leak memory if setting up journal fails 2017-03-30 09:41:27 +02:00
transaction.c jbd2: fix compile warning when using JBUFFER_TRACE 2019-03-23 13:19:51 +01:00