mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Shaohua Li <shli@fb.com>, Dmitry Monakhov <dmonakhov@openvz.org>,
	Jan Kara <jack@suse.cz>, Christoph Hellwig <hch@lst.de>,
	Al Viro <viro@zeniv.linux.org.uk>,
	"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Subject: [PATCH for v4.9 LTS 74/86] aio: fix lock dep warning
Date: Sat, 17 Jun 2017 22:24:53 +0000	[thread overview]
Message-ID: <20170617222420.19316-74-alexander.levin@verizon.com> (raw)
In-Reply-To: <20170617222420.19316-1-alexander.levin@verizon.com>

From: Shaohua Li <shli@fb.com>

[ Upstream commit a12f1ae61c489076a9aeb90bddca7722bf330df3 ]

lockdep reports a warnning. file_start_write/file_end_write only
acquire/release the lock for regular files. So checking the files in aio
side too.

[  453.532141] ------------[ cut here ]------------
[  453.533011] WARNING: CPU: 1 PID: 1298 at ../kernel/locking/lockdep.c:3514 lock_release+0x434/0x670
[  453.533011] DEBUG_LOCKS_WARN_ON(depth <= 0)
[  453.533011] Modules linked in:
[  453.533011] CPU: 1 PID: 1298 Comm: fio Not tainted 4.9.0+ #964
[  453.533011] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.0-1.fc24 04/01/2014
[  453.533011]  ffff8803a24b7a70 ffffffff8196cffb ffff8803a24b7ae8 0000000000000000
[  453.533011]  ffff8803a24b7ab8 ffffffff81091ee1 ffff8803a5dba700 00000dba00000008
[  453.533011]  ffffed0074496f59 ffff8803a5dbaf54 ffff8803ae0f8488 fffffffffffffdef
[  453.533011] Call Trace:
[  453.533011]  [<ffffffff8196cffb>] dump_stack+0x67/0x9c
[  453.533011]  [<ffffffff81091ee1>] __warn+0x111/0x130
[  453.533011]  [<ffffffff81091f97>] warn_slowpath_fmt+0x97/0xb0
[  453.533011]  [<ffffffff81091f00>] ? __warn+0x130/0x130
[  453.533011]  [<ffffffff8191b789>] ? blk_finish_plug+0x29/0x60
[  453.533011]  [<ffffffff811205d4>] lock_release+0x434/0x670
[  453.533011]  [<ffffffff8198af94>] ? import_single_range+0xd4/0x110
[  453.533011]  [<ffffffff81322195>] ? rw_verify_area+0x65/0x140
[  453.533011]  [<ffffffff813aa696>] ? aio_write+0x1f6/0x280
[  453.533011]  [<ffffffff813aa6c9>] aio_write+0x229/0x280
[  453.533011]  [<ffffffff813aa4a0>] ? aio_complete+0x640/0x640
[  453.533011]  [<ffffffff8111df20>] ? debug_check_no_locks_freed+0x1a0/0x1a0
[  453.533011]  [<ffffffff8114793a>] ? debug_lockdep_rcu_enabled.part.2+0x1a/0x30
[  453.533011]  [<ffffffff81147985>] ? debug_lockdep_rcu_enabled+0x35/0x40
[  453.533011]  [<ffffffff812a92be>] ? __might_fault+0x7e/0xf0
[  453.533011]  [<ffffffff813ac9bc>] do_io_submit+0x94c/0xb10
[  453.533011]  [<ffffffff813ac2ae>] ? do_io_submit+0x23e/0xb10
[  453.533011]  [<ffffffff813ac070>] ? SyS_io_destroy+0x270/0x270
[  453.533011]  [<ffffffff8111d7b3>] ? mark_held_locks+0x23/0xc0
[  453.533011]  [<ffffffff8100201a>] ? trace_hardirqs_on_thunk+0x1a/0x1c
[  453.533011]  [<ffffffff813acb90>] SyS_io_submit+0x10/0x20
[  453.533011]  [<ffffffff824f96aa>] entry_SYSCALL_64_fastpath+0x18/0xad
[  453.533011]  [<ffffffff81119190>] ? trace_hardirqs_off_caller+0xc0/0x110
[  453.533011] ---[ end trace b2fbe664d1cc0082 ]---

Cc: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 fs/aio.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 428484f2f841..0fcb49ad67d4 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1085,7 +1085,8 @@ static void aio_complete(struct kiocb *kiocb, long res, long res2)
 		 * Tell lockdep we inherited freeze protection from submission
 		 * thread.
 		 */
-		__sb_writers_acquired(file_inode(file)->i_sb, SB_FREEZE_WRITE);
+		if (S_ISREG(file_inode(file)->i_mode))
+			__sb_writers_acquired(file_inode(file)->i_sb, SB_FREEZE_WRITE);
 		file_end_write(file);
 	}
 
@@ -1492,7 +1493,8 @@ static ssize_t aio_write(struct kiocb *req, struct iocb *iocb, bool vectored,
 		 * by telling it the lock got released so that it doesn't
 		 * complain about held lock when we return to userspace.
 		 */
-		__sb_writers_release(file_inode(file)->i_sb, SB_FREEZE_WRITE);
+		if (S_ISREG(file_inode(file)->i_mode))
+			__sb_writers_release(file_inode(file)->i_sb, SB_FREEZE_WRITE);
 	}
 	kfree(iovec);
 	return ret;
-- 
2.11.0

  parent reply	other threads:[~2017-06-17 22:29 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-17 22:24 [PATCH for v4.9 LTS 01/86] sparc64: Handle PIO & MEM non-resumable errors Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 02/86] sparc64: Zero pages on allocation for mondo and error queues Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 03/86] net: ethtool: add support for 2500BaseT and 5000BaseT link modes Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 04/86] net: phy: add an option to disable EEE advertisement Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 06/86] net: phy: fix sign type error in genphy_config_eee_advert Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 05/86] dt-bindings: net: add EEE capability constants Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 09/86] ARM64: dts: amlogic: Add Meson GX dtsi from GXBB Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 07/86] net: phy: use boolean dt properties for eee broken modes Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 08/86] dt: bindings: net: " Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 11/86] ARM64: dts: meson-gxbb-odroidc2: fix GbE tx link breakage Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 12/86] perf/x86/intel: Handle exclusive threadid correctly on CPU hotplug Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 10/86] ARM64: dts: meson-gx: Add firmware reserved memory zones Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 13/86] ubifs: allow encryption ioctls in compat mode Levin, Alexander (Sasha Levin)
2017-06-19 17:02   ` Eric Biggers
2017-06-19 19:21     ` Richard Weinberger
2017-06-19 19:41       ` Levin, Alexander (Sasha Levin)
2017-06-19 20:09         ` Richard Weinberger
2017-06-17 22:24 ` [PATCH for v4.9 LTS 14/86] KVM: x86: fix fixing of hypercalls Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 16/86] stmmac: add missing of_node_put Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 17/86] scsi: lpfc: Set elsiocb contexts to NULL after freeing it Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 15/86] scsi: sd: Fix wrong DPOFUA disable in sd_read_cache_type Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 19/86] qla2xxx: Fix erroneous invalid handle message Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 18/86] qla2xxx: Terminate exchange if corrupted Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 21/86] drm/amdgpu: add support for new hainan variants Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 22/86] net: phy: dp83848: add DP83620 PHY support Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 20/86] drm/amdgpu: fix program vce instance logic error Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 24/86] net: ethtool: Initialize buffer when querying device channel settings Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 23/86] powerpc/eeh: Enable IO path on permanent error Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 25/86] xen-netback: fix memory leaks on XenBus disconnect Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 26/86] xen-netback: protect resource cleaning " Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 27/86] bnxt_en: Fix "uninitialized variable" bug in TPA code path Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 28/86] bpf: don't trigger OOM killer under pressure with map alloc Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 30/86] gianfar: Do not reuse pages from emergency reserve Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 29/86] objtool: Fix IRET's opcode Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 33/86] virtio_console: fix a crash in config_work_handler Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 31/86] Btrfs: Fix deadlock between direct IO and fast fsync Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 32/86] Btrfs: fix truncate down when no_holes feature is enabled Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 36/86] xen-netfront: Fix Rx stall during network stress and OOM Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 35/86] net: sctp: fix array overrun read on sctp_timer_tbl Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 34/86] swiotlb-xen: update dev_addr after swapping pages Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 37/86] scsi: virtio_scsi: Reject commands when virtqueue is broken Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 39/86] platform/x86: ideapad-laptop: handle ACPI event 1 Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 38/86] iwlwifi: fix kernel crash when unregistering thermal zone Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 40/86] amd-xgbe: Check xgbe_init() return code Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 41/86] net: dsa: Check return value of phy_connect_direct() Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 43/86] vfio/spapr: fail tce_iommu_attach_group() when iommu_data is null Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 42/86] drm/amdgpu: check ring being ready before using Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 44/86] mlxsw: spectrum_router: Correctly reallocate adjacency entries Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 45/86] virtio_net: fix PAGE_SIZE > 64k Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 46/86] ip6_tunnel: must reload ipv6h in ip6ip6_tnl_xmit() Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 47/86] vxlan: do not age static remote mac entries Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 50/86] Documentation: devicetree: change the mediatek ethernet compatible string Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 49/86] kernel/panic.c: add missing \n Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 48/86] ibmveth: Add a proper check for the availability of the checksum features Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 52/86] perf/x86/intel/uncore: Fix hardcoded socket 0 assumption in the Haswell init code Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 53/86] pinctrl: intel: Set pin direction properly Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 51/86] drm/etnaviv: trick drm_mm into giving out a low IOVA Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 55/86] mac80211: recalculate min channel width on VHT opmode changes Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 54/86] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 57/86] HID: i2c-hid: Add sleep between POWER ON and RESET Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 58/86] scsi: lpfc: avoid double free of resource identifiers Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 56/86] perf/x86/intel: Use ULL constant to prevent undefined shift behaviour Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 59/86] usb: gadget: composite: Fix function used to free memory Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 61/86] spi: davinci: use dma_mapping_error() Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 60/86] usb: dwc3: exynos fix axius clock error path to do cleanup Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 64/86] drm/radeon/si: load special ucode for certain MC configs Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 63/86] net: thunderx: acpi: fix LMAC initialization Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 62/86] arm64: assembler: make adr_l work in modules under KASLR Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 65/86] drm/amd/powerplay: fix vce cg logic error on CZ/St Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 66/86] drm/amd/powerplay: refine vce dpm update code on Cz Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 67/86] pmem: return EIO on read_pmem() failure Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 69/86] KVM: arm64: Access CNTHCTL_EL2 bit fields correctly on VHE systems Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 68/86] mac80211: initialize SMPS field in HT capabilities Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 70/86] x86/tsc: Add the Intel Denverton Processor to native_calibrate_tsc() Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 71/86] x86/mpx: Use compatible types in comparison to fix sparse error Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 72/86] perf/core: Fix sys_perf_event_open() vs. hotplug Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` Levin, Alexander (Sasha Levin) [this message]
2017-06-17 22:24 ` [PATCH for v4.9 LTS 73/86] perf/x86: Reject non sampling events with precise_ip Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 76/86] swiotlb: ensure that page-sized mappings are page-aligned Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 77/86] s390/ctl_reg: make __ctl_load a full memory barrier Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 75/86] coredump: Ensure proper size of sparse core files Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 79/86] be2net: fix status check in be_cmd_pmac_add() Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 80/86] be2net: don't delete MAC on close on unprivileged BE3 VFs Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 78/86] usb: dwc2: gadget: Fix GUSBCFG.USBTRDTIM value Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 81/86] be2net: fix MAC addr setting on privileged BE3 VFs Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 83/86] net: phy: dp83867: allow RGMII_TXID/RGMII_RXID interface types Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 82/86] perf probe: Fix to show correct locations for events on modules Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 84/86] tipc: allocate user memory with GFP_KERNEL flag Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 85/86] perf probe: Fix to probe on gcc generated functions in modules Levin, Alexander (Sasha Levin)
2017-06-17 22:24 ` [PATCH for v4.9 LTS 86/86] net/mlx4_core: Eliminate warning messages for SRQ_LIMIT under SRIOV Levin, Alexander (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=20170617222420.19316-74-alexander.levin@verizon.com \
    --to=alexander.levin@verizon.com \
    --cc=dmonakhov@openvz.org \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shli@fb.com \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®