From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Chandan Rajendra <chandan@linux.ibm.com>,
Harish Sriram <harish@linux.ibm.com>, Jan Kara <jack@suse.cz>,
Theodore Ts'o <tytso@mit.edu>, Sasha Levin <sashal@kernel.org>,
linux-ext4@vger.kernel.org
Subject: [PATCH AUTOSEL 4.4 11/16] jbd2: flush_descriptor(): Do not decrease buffer head's ref count
Date: Fri, 25 Oct 2019 09:58:35 -0400 [thread overview]
Message-ID: <20191025135842.25977-11-sashal@kernel.org> (raw)
In-Reply-To: <20191025135842.25977-1-sashal@kernel.org>
From: Chandan Rajendra <chandan@linux.ibm.com>
[ Upstream commit 547b9ad698b434eadca46319cb47e5875b55ef03 ]
When executing generic/388 on a ppc64le machine, we notice the following
call trace,
VFS: brelse: Trying to free free buffer
WARNING: CPU: 0 PID: 6637 at /root/repos/linux/fs/buffer.c:1195 __brelse+0x84/0xc0
Call Trace:
__brelse+0x80/0xc0 (unreliable)
invalidate_bh_lru+0x78/0xc0
on_each_cpu_mask+0xa8/0x130
on_each_cpu_cond_mask+0x130/0x170
invalidate_bh_lrus+0x44/0x60
invalidate_bdev+0x38/0x70
ext4_put_super+0x294/0x560
generic_shutdown_super+0xb0/0x170
kill_block_super+0x38/0xb0
deactivate_locked_super+0xa4/0xf0
cleanup_mnt+0x164/0x1d0
task_work_run+0x110/0x160
do_notify_resume+0x414/0x460
ret_from_except_lite+0x70/0x74
The warning happens because flush_descriptor() drops bh reference it
does not own. The bh reference acquired by
jbd2_journal_get_descriptor_buffer() is owned by the log_bufs list and
gets released when this list is processed. The reference for doing IO is
only acquired in write_dirty_buffer() later in flush_descriptor().
Reported-by: Harish Sriram <harish@linux.ibm.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chandan Rajendra <chandan@linux.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/jbd2/revoke.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
index 705ae577882b1..8ad752c4bee31 100644
--- a/fs/jbd2/revoke.c
+++ b/fs/jbd2/revoke.c
@@ -658,10 +658,8 @@ static void flush_descriptor(journal_t *journal,
{
jbd2_journal_revoke_header_t *header;
- if (is_journal_aborted(journal)) {
- put_bh(descriptor);
+ if (is_journal_aborted(journal))
return;
- }
header = (jbd2_journal_revoke_header_t *)descriptor->b_data;
header->r_count = cpu_to_be32(offset);
--
2.20.1
next prev parent reply other threads:[~2019-10-25 13:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-25 13:58 [PATCH AUTOSEL 4.4 01/16] PCI/ASPM: Do not initialize link state when aspm_disabled is set Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 02/16] ACPI: video: Use vendor backlight on Sony VPCEH3U1E Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 03/16] driver core: platform: Fix the usage of platform device name(pdev->name) Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 04/16] powerpc/pseries/hvconsole: Fix stack overread via udbg Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 05/16] scsi: RDMA/srp: Fix a sleep-in-invalid-context bug Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 06/16] sch_netem: fix rcu splat in netem_enqueue() Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 07/16] llc: fix sk_buff leak in llc_sap_state_process() Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 08/16] llc: fix sk_buff leak in llc_conn_service() Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 09/16] bonding: fix potential NULL deref in bond_update_slave_arr Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 10/16] net: usb: sr9800: fix uninitialized local variable Sasha Levin
2019-10-25 13:58 ` Sasha Levin [this message]
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 12/16] ath9k: dynack: fix possible deadlock in ath_dynack_node_{de}init Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 13/16] Btrfs: fix hang when loading existing inode cache off disk Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 14/16] ubi: ubi_wl_get_peb: Increase the number of attempts while getting PEB Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 15/16] RDMA/iwcm: Fix a lock inversion issue Sasha Levin
2019-10-25 13:58 ` [PATCH AUTOSEL 4.4 16/16] bdi: Do not use freezable workqueue Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191025135842.25977-11-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=chandan@linux.ibm.com \
--cc=harish@linux.ibm.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox