From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Chao Yu <yuchao0@huawei.com>,
Jaegeuk Kim <jaegeuk@kernel.org>,
Sasha Levin <alexander.levin@verizon.com>
Subject: [PATCH 4.4 30/46] f2fs: do not wait for writeback in write_begin
Date: Thu, 19 Oct 2017 15:49:06 +0200 [thread overview]
Message-ID: <20171019134847.306952519@linuxfoundation.org> (raw)
In-Reply-To: <20171019134845.293630834@linuxfoundation.org>
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jaegeuk Kim <jaegeuk@kernel.org>
[ Upstream commit 86d54795c94532075d862aa0a79f0c981dab4bdd ]
Otherwise we can get livelock like below.
[79880.428136] dbench D 0 18405 18404 0x00000000
[79880.428139] Call Trace:
[79880.428142] __schedule+0x219/0x6b0
[79880.428144] schedule+0x36/0x80
[79880.428147] schedule_timeout+0x243/0x2e0
[79880.428152] ? update_sd_lb_stats+0x16b/0x5f0
[79880.428155] ? ktime_get+0x3c/0xb0
[79880.428157] io_schedule_timeout+0xa6/0x110
[79880.428161] __lock_page+0xf7/0x130
[79880.428164] ? unlock_page+0x30/0x30
[79880.428167] pagecache_get_page+0x16b/0x250
[79880.428171] grab_cache_page_write_begin+0x20/0x40
[79880.428182] f2fs_write_begin+0xa2/0xdb0 [f2fs]
[79880.428192] ? f2fs_mark_inode_dirty_sync+0x16/0x30 [f2fs]
[79880.428197] ? kmem_cache_free+0x79/0x200
[79880.428203] ? __mark_inode_dirty+0x17f/0x360
[79880.428206] generic_perform_write+0xbb/0x190
[79880.428213] ? file_update_time+0xa4/0xf0
[79880.428217] __generic_file_write_iter+0x19b/0x1e0
[79880.428226] f2fs_file_write_iter+0x9c/0x180 [f2fs]
[79880.428231] __vfs_write+0xc5/0x140
[79880.428235] vfs_write+0xb2/0x1b0
[79880.428238] SyS_write+0x46/0xa0
[79880.428242] entry_SYSCALL_64_fastpath+0x1e/0xad
Fixes: cae96a5c8ab6 ("f2fs: check io submission more precisely")
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/data.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1416,7 +1416,12 @@ static int f2fs_write_begin(struct file
goto fail;
}
repeat:
- page = grab_cache_page_write_begin(mapping, index, flags);
+ /*
+ * Do not use grab_cache_page_write_begin() to avoid deadlock due to
+ * wait_for_stable_page. Will wait that below with our IO control.
+ */
+ page = pagecache_get_page(mapping, index,
+ FGP_LOCK | FGP_WRITE | FGP_CREAT, GFP_NOFS);
if (!page) {
err = -ENOMEM;
goto fail;
next prev parent reply other threads:[~2017-10-19 13:53 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 13:48 [PATCH 4.4 00/46] 4.4.94-stable review Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 01/46] percpu: make this_cpu_generic_read() atomic w.r.t. interrupts Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 02/46] drm/dp/mst: save vcpi with payloads Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 03/46] MIPS: Fix minimum alignment requirement of IRQ stack Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 04/46] sctp: potential read out of bounds in sctp_ulpevent_type_enabled() Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 05/46] bpf/verifier: reject BPF_ALU64|BPF_END Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 06/46] udpv6: Fix the checksum computation when HW checksum does not apply Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 07/46] ip6_gre: skb_push ipv6hdr before packing the header in ip6gre_header Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 08/46] net: emac: Fix napi poll list corruption Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 09/46] packet: hold bind lock when rebinding to fanout hook Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 10/46] bpf: one perf event close wont free bpf program attached by another perf event Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 11/46] isdn/i4l: fetch the ppp_write buffer in one shot Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 12/46] vti: fix use after free in vti_tunnel_xmit/vti6_tnl_xmit Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 13/46] l2tp: Avoid schedule while atomic in exit_net Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 14/46] l2tp: fix race condition in l2tp_tunnel_delete Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 15/46] tun: bail out from tun_get_user() if the skb is empty Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 16/46] packet: in packet_do_bind, test fanout with bind_lock held Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 17/46] packet: only test po->has_vnet_hdr once in packet_snd Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 18/46] net: Set sk_prot_creator when cloning sockets to the right proto Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 19/46] tipc: use only positive error codes in messages Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 20/46] Revert "bsg-lib: dont free job in bsg_prepare_job" Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 22/46] watchdog: kempld: fix gcc-4.3 build Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 23/46] irqchip/crossbar: Fix incorrect type of local variables Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 24/46] mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 25/46] mac80211: fix power saving clients handling in iwlwifi Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 26/46] net/mlx4_en: fix overflow in mlx4_en_init_timestamp() Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 27/46] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 28/46] iio: adc: xilinx: Fix error handling Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 29/46] Btrfs: send, fix failure to rename top level inode due to name collision Greg Kroah-Hartman
2017-10-19 13:49 ` Greg Kroah-Hartman [this message]
2017-10-19 13:49 ` [PATCH 4.4 31/46] md/linear: shutup lockdep warnning Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 32/46] sparc64: Migrate hvcons irq to panicked cpu Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 33/46] net/mlx4_core: Fix VF overwrite of module param which disables DMFS on new probed PFs Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 34/46] crypto: xts - Add ECB dependency Greg Kroah-Hartman
2017-11-10 20:40 ` Ben Hutchings
2017-11-13 19:04 ` alexander.levin
2017-10-19 13:49 ` [PATCH 4.4 35/46] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 36/46] slub: do not merge cache if slub_debug contains a never-merge flag Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 37/46] scsi: scsi_dh_emc: return success in clariion_std_inquiry() Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 38/46] net: mvpp2: release reference to txq_cpu[] entry after unmapping Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 39/46] i2c: at91: ensure state is restored after suspending Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 40/46] ceph: clean up unsafe d_parent accesses in build_dentry_path Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 41/46] uapi: fix linux/rds.h userspace compilation errors Greg Kroah-Hartman
2017-11-12 18:50 ` Ben Hutchings
2017-11-13 19:03 ` alexander.levin
2017-10-19 13:49 ` [PATCH 4.4 42/46] uapi: fix linux/mroute6.h " Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 43/46] target/iscsi: Fix unsolicited data seq_end_offset calculation Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 44/46] nfsd/callback: Cleanup callback cred on shutdown Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 45/46] cpufreq: CPPC: add ACPI_PROCESSOR dependency Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 46/46] Revert "tty: goldfish: Fix a parameter of a call to free_irq" Greg Kroah-Hartman
2017-10-19 22:18 ` [PATCH 4.4 00/46] 4.4.94-stable review Tom Gall
2017-10-20 6:26 ` Greg Kroah-Hartman
2017-10-20 16:54 ` Tom Gall
2017-10-21 7:25 ` Greg Kroah-Hartman
2017-10-21 14:37 ` Tom Gall
2017-10-20 13:05 ` Guenter Roeck
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=20171019134847.306952519@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=alexander.levin@verizon.com \
--cc=jaegeuk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=yuchao0@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).