]>
Commit | Line | Data |
---|---|---|
d3e91060 SL |
1 | From 6ba9665853fe5afb2f902d4594eea01db1fd3e3c Mon Sep 17 00:00:00 2001 |
2 | From: Junxiao Bi <junxiao.bi@oracle.com> | |
3 | Date: Fri, 28 Dec 2018 00:32:50 -0800 | |
4 | Subject: ocfs2: fix panic due to unrecovered local alloc | |
5 | ||
6 | [ Upstream commit 532e1e54c8140188e192348c790317921cb2dc1c ] | |
7 | ||
8 | mount.ocfs2 ignore the inconsistent error that journal is clean but | |
9 | local alloc is unrecovered. After mount, local alloc not empty, then | |
10 | reserver cluster didn't alloc a new local alloc window, reserveration | |
11 | map is empty(ocfs2_reservation_map.m_bitmap_len = 0), that triggered the | |
12 | following panic. | |
13 | ||
14 | This issue was reported at | |
15 | ||
16 | https://oss.oracle.com/pipermail/ocfs2-devel/2015-May/010854.html | |
17 | ||
18 | and was advised to fixed during mount. But this is a very unusual | |
19 | inconsistent state, usually journal dirty flag should be cleared at the | |
20 | last stage of umount until every other things go right. We may need do | |
21 | further debug to check that. Any way to avoid possible futher | |
22 | corruption, mount should be abort and fsck should be run. | |
23 | ||
24 | (mount.ocfs2,1765,1):ocfs2_load_local_alloc:353 ERROR: Local alloc hasn't been recovered! | |
25 | found = 6518, set = 6518, taken = 8192, off = 15912372 | |
26 | ocfs2: Mounting device (202,64) on (node 0, slot 3) with ordered data mode. | |
27 | o2dlm: Joining domain 89CEAC63CC4F4D03AC185B44E0EE0F3F ( 0 1 2 3 4 5 6 8 ) 8 nodes | |
28 | ocfs2: Mounting device (202,80) on (node 0, slot 3) with ordered data mode. | |
29 | o2hb: Region 89CEAC63CC4F4D03AC185B44E0EE0F3F (xvdf) is now a quorum device | |
30 | o2net: Accepted connection from node yvwsoa17p (num 7) at 172.22.77.88:7777 | |
31 | o2dlm: Node 7 joins domain 64FE421C8C984E6D96ED12C55FEE2435 ( 0 1 2 3 4 5 6 7 8 ) 9 nodes | |
32 | o2dlm: Node 7 joins domain 89CEAC63CC4F4D03AC185B44E0EE0F3F ( 0 1 2 3 4 5 6 7 8 ) 9 nodes | |
33 | ------------[ cut here ]------------ | |
34 | kernel BUG at fs/ocfs2/reservations.c:507! | |
35 | invalid opcode: 0000 [#1] SMP | |
36 | Modules linked in: ocfs2 rpcsec_gss_krb5 auth_rpcgss nfsv4 nfs fscache lockd grace ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs sunrpc ipt_REJECT nf_reject_ipv4 nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ib_ipoib rdma_ucm ib_ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr ipv6 ovmapi ppdev parport_pc parport xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea acpi_cpufreq pcspkr i2c_piix4 i2c_core sg ext4 jbd2 mbcache2 sr_mod cdrom xen_blkfront pata_acpi ata_generic ata_piix floppy dm_mirror dm_region_hash dm_log dm_mod | |
37 | CPU: 0 PID: 4349 Comm: startWebLogic.s Not tainted 4.1.12-124.19.2.el6uek.x86_64 #2 | |
38 | Hardware name: Xen HVM domU, BIOS 4.4.4OVM 09/06/2018 | |
39 | task: ffff8803fb04e200 ti: ffff8800ea4d8000 task.ti: ffff8800ea4d8000 | |
40 | RIP: 0010:[<ffffffffa05e96a8>] [<ffffffffa05e96a8>] __ocfs2_resv_find_window+0x498/0x760 [ocfs2] | |
41 | Call Trace: | |
42 | ocfs2_resmap_resv_bits+0x10d/0x400 [ocfs2] | |
43 | ocfs2_claim_local_alloc_bits+0xd0/0x640 [ocfs2] | |
44 | __ocfs2_claim_clusters+0x178/0x360 [ocfs2] | |
45 | ocfs2_claim_clusters+0x1f/0x30 [ocfs2] | |
46 | ocfs2_convert_inline_data_to_extents+0x634/0xa60 [ocfs2] | |
47 | ocfs2_write_begin_nolock+0x1c6/0x1da0 [ocfs2] | |
48 | ocfs2_write_begin+0x13e/0x230 [ocfs2] | |
49 | generic_perform_write+0xbf/0x1c0 | |
50 | __generic_file_write_iter+0x19c/0x1d0 | |
51 | ocfs2_file_write_iter+0x589/0x1360 [ocfs2] | |
52 | __vfs_write+0xb8/0x110 | |
53 | vfs_write+0xa9/0x1b0 | |
54 | SyS_write+0x46/0xb0 | |
55 | system_call_fastpath+0x18/0xd7 | |
56 | Code: ff ff 8b 75 b8 39 75 b0 8b 45 c8 89 45 98 0f 84 e5 fe ff ff 45 8b 74 24 18 41 8b 54 24 1c e9 56 fc ff ff 85 c0 0f 85 48 ff ff ff <0f> 0b 48 8b 05 cf c3 de ff 48 ba 00 00 00 00 00 00 00 10 48 85 | |
57 | RIP __ocfs2_resv_find_window+0x498/0x760 [ocfs2] | |
58 | RSP <ffff8800ea4db668> | |
59 | ---[ end trace 566f07529f2edf3c ]--- | |
60 | Kernel panic - not syncing: Fatal exception | |
61 | Kernel Offset: disabled | |
62 | ||
63 | Link: http://lkml.kernel.org/r/20181121020023.3034-2-junxiao.bi@oracle.com | |
64 | Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com> | |
65 | Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com> | |
66 | Acked-by: Joseph Qi <jiangqi903@gmail.com> | |
67 | Cc: Jun Piao <piaojun@huawei.com> | |
68 | Cc: Mark Fasheh <mfasheh@versity.com> | |
69 | Cc: Joel Becker <jlbec@evilplan.org> | |
70 | Cc: Changwei Ge <ge.changwei@h3c.com> | |
71 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | |
72 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | |
73 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
74 | --- | |
75 | fs/ocfs2/localalloc.c | 9 +++++++-- | |
76 | 1 file changed, 7 insertions(+), 2 deletions(-) | |
77 | ||
78 | diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c | |
79 | index 0a4457fb0711..85111d740c9d 100644 | |
80 | --- a/fs/ocfs2/localalloc.c | |
81 | +++ b/fs/ocfs2/localalloc.c | |
82 | @@ -345,13 +345,18 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb) | |
83 | if (num_used | |
84 | || alloc->id1.bitmap1.i_used | |
85 | || alloc->id1.bitmap1.i_total | |
86 | - || la->la_bm_off) | |
87 | - mlog(ML_ERROR, "Local alloc hasn't been recovered!\n" | |
88 | + || la->la_bm_off) { | |
89 | + mlog(ML_ERROR, "inconsistent detected, clean journal with" | |
90 | + " unrecovered local alloc, please run fsck.ocfs2!\n" | |
91 | "found = %u, set = %u, taken = %u, off = %u\n", | |
92 | num_used, le32_to_cpu(alloc->id1.bitmap1.i_used), | |
93 | le32_to_cpu(alloc->id1.bitmap1.i_total), | |
94 | OCFS2_LOCAL_ALLOC(alloc)->la_bm_off); | |
95 | ||
96 | + status = -EINVAL; | |
97 | + goto bail; | |
98 | + } | |
99 | + | |
100 | osb->local_alloc_bh = alloc_bh; | |
101 | osb->local_alloc_state = OCFS2_LA_ENABLED; | |
102 | ||
103 | -- | |
104 | 2.19.1 | |
105 |