linux-brain/fs/jbd2
zhangyi (F) e1e3101a0c 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 14:35:26 +01:00
..
checkpoint.c jbd2: fix use after free in jbd2_log_do_checkpoint() 2018-11-13 11:15:05 -08:00
commit.c jbd2: don't clear and reset errors after waiting on writeback 2017-07-06 07:02:22 -04:00
journal.c ext4: pass -ESHUTDOWN code to jbd2 layer 2018-04-24 09:36:30 +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-15 15:08:48 -04:00
transaction.c jbd2: fix compile warning when using JBUFFER_TRACE 2019-03-23 14:35:26 +01:00