<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }p { margin-top: 0px; margin-bottom: 0px; }div.foxdiv20160503155310276755 { }body { font-size: 16pt; font-family: ????; color: rgb(0, 0, 0); line-height: 1.5; }</style>
</head>
<body>
<div><span></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;">
<div class="FoxDiv20160503155310276755">
<p><span style="font-size: 13px; background-color: rgba(0, 0, 0, 0);">Hi &nbsp;</span><span style="font-size: small; line-height: 19px; background-color: window;">Joseph</span></p>
<p><font size="2">After a repeated test,&nbsp;</font><font size="2" style="background-color: window;"><span srcinfo="0:1" dstinfo="0:3" paragraphname="paragraph0" issource="false" id="ouHighlight__0_1TO0_3" class="highlighted" style="line-height: normal; widows: 1;">This</span><span id="noHighlight_0.9911661390215158" style="line-height: normal; widows: 1;">&nbsp;</span><span srcinfo="4:5" dstinfo="14:16" paragraphname="paragraph0" issource="false" id="ouHighlight__4_5TO14_16" class="" style="line-height: normal; widows: 1;"><span style="line-height: 19px; widows: auto;">patch
 which&nbsp;</span>may</span><span id="noHighlight_0.9246258228085935" style="line-height: normal; widows: 1;">&nbsp;</span><span srcinfo="6:7" dstinfo="18:22" paragraphname="paragraph0" issource="false" id="ouHighlight__6_7TO18_22" class="" style="line-height: normal; widows: 1;">solve</span><span id="noHighlight_0.17606931971386075" style="line-height: normal; widows: 1;">&nbsp;</span><span srcinfo="8:9" dstinfo="24:27" paragraphname="paragraph0" issource="false" id="ouHighlight__8_9TO24_27" class="" style="line-height: normal; widows: 1;">some</span><span id="noHighlight_0.542412874288857" style="line-height: normal; widows: 1;">&nbsp;</span><span srcinfo="10:11" dstinfo="29:36" paragraphname="paragraph0" issource="false" id="ouHighlight__10_11TO29_36" class="" style="line-height: normal; widows: 1;">problems</span><span id="noHighlight_0.5957124235574156" style="line-height: normal; widows: 1;">,</span><span id="noHighlight_0.6765727247111499" style="line-height: normal; widows: 1;">&nbsp;</span><span srcinfo="13:14" dstinfo="39:41" paragraphname="paragraph0" issource="false" id="ouHighlight__13_14TO39_41" class="" style="line-height: normal; widows: 1;">but</span><span id="noHighlight_0.5307400184683502" style="line-height: normal; widows: 1;">&nbsp;</span><span srcinfo="15:16" dstinfo="43:45" paragraphname="paragraph0" issource="false" id="ouHighlight__15_16TO43_45" class="" style="line-height: normal; widows: 1;">not</span><span id="noHighlight_0.2696844497695565" style="line-height: normal; widows: 1;">&nbsp;</span><span srcinfo="17:18" dstinfo="47:49" paragraphname="paragraph0" issource="false" id="ouHighlight__17_18TO47_49" class="" style="line-height: normal; widows: 1;">all</span><span id="noHighlight_0.5456205212976784" style="line-height: normal; widows: 1;">&nbsp;</span><span srcinfo="20:21" dstinfo="51:61" paragraphname="paragraph0" issource="false" id="ouHighlight__20_21TO51_61" class="" style="line-height: normal; widows: 1;">cases,&nbsp;</span></font><font size="2" style="background-color: window;">run
 fsck offline and a separate fix to fsck</font><font size="2" style="background-color: window;">&nbsp;is needed.&nbsp;</font><span style="background-color: window; font-size: small; line-height: 1.5;">Thanks, &nbsp;</span></p>
<p><span style="background-color: window; font-size: small; line-height: 1.5;">in&nbsp;</span><span style="font-size: 13px; line-height: 19px; background-color: window;">ocfs2_block_group_clear_bits,
</span><span style="font-size: 13px; line-height: 1.5; background-color: window;">jbd_lock_bh_state and&nbsp;</span><span style="font-size: 13px; line-height: 1.5; background-color: window;">jbd_unlock_bh_state is not&nbsp;</span><span style="color: rgb(51, 51, 51); font-family: Arial, Helvetica; font-size: 13px; line-height: 18px; widows: 1;">in
 pair&nbsp;in some case</span><span style="background-color: window; font-size: 13px; line-height: 1.5;">.</span></p>
<p><font size="2" style="background-color: window;"><br>
</font></p>
<p><span style="font-size: 13px; background-color: rgba(0, 0, 0, 0);">Apr 29 18:42:11 cvk53 kernel: [31836.074181] (mount.ocfs2,35204,6):ocfs2_load_local_alloc:353 ERROR: Local alloc hasn't been recovered!<br>
Apr 29 18:42:11 cvk53 kernel: [31836.074181] found = 1011, set = 1011, taken = 2048, off = 387073<br>
Apr 29 18:42:11 cvk53 kernel: [31836.074193] (mount.ocfs2,35204,6):ocfs2_load_local_alloc:373 ERROR: status = -22<br>
Apr 29 18:42:11 cvk53 kernel: [31836.074198] ocfs2: local alloc needs recovery on device (252,0).<br>
Apr 29 18:42:11 cvk53 kernel: [31836.099410] ocfs2: Mounting device (252,0) on (node 1, slot 1) with ordered data mode.<br>
Apr 29 18:42:11 cvk53 kernel: [31836.101379] OCFS2: ERROR (device dm-0): ocfs2_block_group_clear_bits: Group descriptor # 99090432 has bit count 32256 but claims 32281 are freed. num_bits 1037<br>
Apr 29 18:42:11 cvk53 kernel: [31836.101388] File system is now read-only due to the potential of on-disk corruption. Please run fsck.ocfs2 once the file system is unmounted.<br>
Apr 29 18:42:11 cvk53 kernel: [31836.101394] (kworker/u128:0,29935,6):_ocfs2_free_suballoc_bits:2498 ERROR: status = -30<br>
Apr 29 18:42:11 cvk53 kernel: [31836.101399] (kworker/u128:0,29935,6):_ocfs2_free_suballoc_bits:2521 ERROR: status = -30<br>
Apr 29 18:42:11 cvk53 kernel: [31836.101404] (kworker/u128:0,29935,6):_ocfs2_free_clusters:2584 ERROR: status = -30<br>
Apr 29 18:42:11 cvk53 kernel: [31836.101409] (kworker/u128:0,29935,6):_ocfs2_free_clusters:2593 ERROR: status = -30<br>
Apr 29 18:42:11 cvk53 kernel: [31836.101414] (kworker/u128:0,29935,6):ocfs2_sync_local_to_main:1025 ERROR: status = -30<br>
Apr 29 18:42:11 cvk53 kernel: [31836.101419] (kworker/u128:0,29935,6):ocfs2_sync_local_to_main:1037 ERROR: status = -30<br>
Apr 29 18:42:11 cvk53 kernel: [31836.101424] (kworker/u128:0,29935,6):ocfs2_complete_local_alloc_recovery:606 ERROR: status = -30<br>
Apr 29 18:42:12 cvk53 kernel: [31836.247874] chbk: chbk_store_chk_report 2971: store check result: store wlf2-500g is normal<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231311] NMI watchdog: BUG: soft lockup - CPU#6 stuck for 23s! [jbd2/dm-0-617:35472]<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231320] Modules linked in: ip6table_filter(E) ip6_tables(E) iptable_filter(E) ip_tables(E) ebtable_nat(E) ebtables(E) x_tables(E) ocfs2(OE) quota_tree(E) cls_u32(E) sch_sfq(E) sch_htb(E) chbk(OE) drbd(E) lru_cache(E) 8021q(E)
 mrp(E) garp(E) stp(E) llc(E) ipmi_devintf(E) dm_round_robin(E) vhost_net(E) macvtap(E) macvlan(E) vhost(E) kvm_intel(OE) kvm(OE) ib_iser(E) rdma_cm(E) ib_cm(E) iw_cm(E) ib_sa(E) ib_mad(E) ib_core(E) ib_addr(E) iscsi_tcp(E) libiscsi_tcp(E) ocfs2_dlmfs(OE) ocfs2_stack_o2cb(OE)
 ocfs2_dlm(OE) ocfs2_nodemanager(OE) ocfs2_stackglue(OE) configfs(E) dm_multipath(E) scsi_dh(E) openvswitch(OE) nf_conntrack(E) nf_defrag_ipv4(E) gre(E) libcrc32c(E) nf_defrag_ipv6(E) nfsd(E) nfs_acl(E) auth_rpcgss(E) nfs(E) fscache(E) lockd(E) sunrpc(E) grace(E)
 ipmi_ssif(E) psmouse(E) serio_raw(E) sb_edac(E) edac_core(E) lpc_ich(E) hpwdt(E) hpilo(E) ioatdma(E) dca(E) 8250_fintek(E) ipmi_si(E) ipmi_msghandler(E) video(E) wmi(E) mac_hid(E) acpi_power_meter(E) lp(E) parport(E) be2iscs<br>
Apr 29 18:42:36 cvk53 kernel: i(E) iscsi_boot_sysfs(E) libiscsi(E) be2net(E) scsi_transport_iscsi(E) vxlan(E) hpsa(E) udp_tunnel(E) ip6_udp_tunnel(E) nbd(E)<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231367] CPU: 6 PID: 35472 Comm: jbd2/dm-0-617 Tainted: G OE 4.1.0-generic #1<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231369] Hardware name: H3C FlexServer B390, BIOS I31 12/20/2013<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231370] task: ffff8801fd3c8a10 ti: ffff8807cdc4c000 task.ti: ffff8807cdc4c000<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231371] RIP: 0010:[&lt;ffffffff812e06b3&gt;] [&lt;ffffffff812e06b3&gt;] jbd2_journal_commit_transaction&#43;0xc03/0x1aa0<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231379] RSP: 0018:ffff8807cdc4fc58 EFLAGS: 00000206<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231380] RAX: 0000000000a20029 RBX: ffffffff812e7f48 RCX: 3ffffffffffffffe<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231381] RDX: 0000000000000000 RSI: 000000010078349b RDI: ffff88040ec34f60<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231382] RBP: ffff8807cdc4fe28 R08: ffff8807cdc4c000 R09: 0000000000000020<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231383] R10: 0000000000000002 R11: 0000000000000000 R12: ffff8803dec1e9c0<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231384] R13: ffff8807cdc4fbc8 R14: ffffffff81236f36 R15: ffff8807cdc4fbc8<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231385] FS: 0000000000000000(0000) GS:ffff88042f780000(0000) knlGS:0000000000000000<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231386] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231387] CR2: 0000000000bbd328 CR3: 0000000001c0f000 CR4: 00000000001406e0<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231388] Stack:<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231389] ffff8807cdc4fc68 ffff8801fd3c8a78 ffff88042fa97530 ffff8801fd3c8a78<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231391] ffff88042fa97530 0000000c00000000 ffff8807cdc4fcf8 ffff8802bb749000<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231393] 0000000000000000 ffff8803bb659024 ffff8807cdc4fce8 ffffffff810a85dc<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231395] Call Trace:<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231400] [&lt;ffffffff810a85dc&gt;] ? ttwu_do_wakeup&#43;0x2c/0x110<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231403] [&lt;ffffffff810bb055&gt;] ? pick_next_task_fair&#43;0x115/0x4d0<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231406] [&lt;ffffffff81015686&gt;] ? __switch_to&#43;0x1e6/0x580<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231409] [&lt;ffffffff810a50f5&gt;] ? finish_task_switch&#43;0xf5/0x150<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231413] [&lt;ffffffff810e908f&gt;] ? try_to_del_timer_sync&#43;0x4f/0x70<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231415] [&lt;ffffffff812e4d33&gt;] kjournald2&#43;0xb3/0x230<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231418] [&lt;ffffffff810c10a0&gt;] ? prepare_to_wait_event&#43;0x100/0x100<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231419] [&lt;ffffffff812e4c80&gt;] ? commit_timeout&#43;0x10/0x10<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231421] [&lt;ffffffff8109def9&gt;] kthread&#43;0xc9/0xe0<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231422] [&lt;ffffffff8109de30&gt;] ? flush_kthread_worker&#43;0x90/0x90<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231427] [&lt;ffffffff817f6a22&gt;] ret_from_fork&#43;0x42/0x70<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231428] [&lt;ffffffff8109de30&gt;] ? flush_kthread_worker&#43;0x90/0x90<br>
Apr 29 18:42:36 cvk53 kernel: [31861.231429] Code: ff ff 00 00 00 00 48 89 8d 98 fe ff ff e9 06 fa ff ff 89 c6 4c 89 ef e8 0c 77 00 00 4d 8b 74 24 28 e9 f2 f9 ff ff f3 90 49 8b 06 &lt;a9&gt; 00 00 80 00 75 f4 e9 8b f6 ff ff 90 45 85 ff 0f 85 65 0e 00&nbsp;</span></p>
<p><font size="2"><br>
</font><br>
<br>
<font size="2">Date: Wed, 2 Dec 2015 15:07:11 &#43;0800</font><br>
<font size="2">From: Junxiao Bi &lt;junxiao.bi@oracle.com&gt;</font><br>
<font size="2">Subject: Re: [Ocfs2-devel] [PATCH] ocfs2: fix BUG due to uncleaned</font><br>
<font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localalloc during mount</font><br>
<font size="2">To: xuejiufei@huawei.com, Joseph Qi &lt;joseph.qi@huawei.com&gt;,&nbsp;&nbsp;&nbsp;&nbsp; Andrew</font><br>
<font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Morton &lt;akpm@linux-foundation.org&gt;</font><br>
<font size="2">Cc: Mark Fasheh &lt;mfasheh@suse.com&gt;,&nbsp;&nbsp;&nbsp;&nbsp; &quot;ocfs2-devel@oss.oracle.com&quot;</font><br>
<font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ocfs2-devel@oss.oracle.com&gt;</font><br>
<font size="2">Message-ID: &lt;565E989F.9020302@oracle.com&gt;</font><br>
<font size="2">Content-Type: text/plain; charset=windows-1252</font><br>
<br>
<font size="2">On 12/02/2015 02:52 PM, Xue jiufei wrote:</font><br>
<font size="2">&gt; Hi Junxiao,</font><br>
<font size="2">&gt; On 2015/12/1 16:02, Junxiao Bi wrote:</font><br>
<font size="2">&gt;&gt; Hi Joseph,</font><br>
<font size="2">&gt;&gt;</font><br>
<font size="2">&gt;&gt; On 11/24/2015 09:38 PM, Joseph Qi wrote:</font><br>
<font size="2">&gt;&gt;&gt; Tariq has reported a BUG before and posted a fix at:</font><br>
<font size="2">&gt;&gt;&gt; </font><a href="https://oss.oracle.com/pipermail/ocfs2-devel/2015-April/010696.html" style="font-size: small;">https://oss.oracle.com/pipermail/ocfs2-devel/2015-April/010696.html</a><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; This is because during umount, localalloc shutdown relies on journal</font><br>
<font size="2">&gt;&gt;&gt; shutdown. But during journal shutdown, it just stops commit thread</font><br>
<font size="2">&gt;&gt;&gt; without checking its result. So it may happen that localalloc shutdown</font><br>
<font size="2">&gt;&gt;&gt; uncleaned during I/O error and after that, journal then has been marked</font><br>
<font size="2">&gt;&gt;&gt; clean if I/O restores.</font><br>
<font size="2">&gt;&gt; The above is a storage issue. In this condition, io error can even</font><br>
<font size="2">&gt;&gt; happen to journal commit, some transactions may have wrong data. Let fs</font><br>
<font size="2">&gt;&gt; go without a fsck may cause corruption.</font><br>
<font size="2">&gt;&gt; I am thinking whether we can fail the mount and mark the journal dirty</font><br>
<font size="2">&gt;&gt; again. Then we can do fsck to it withoug a fsck patch.</font><br>
<font size="2">&gt;&gt;</font><br>
<font size="2">&gt; Can you explain which situation would cause file system corruption. I think</font><br>
<font size="2">&gt; if IO error happens to journal commit and commit block have not reach the disk,</font><br>
<font size="2">&gt; the whole transactions is skipped while recovering the journal. So file system</font><br>
<font size="2">&gt; is still consistent.</font><br>
<font size="2">At least local alloc inconsistent as this storage error, right? I think</font><br>
<font size="2">it can't be sure whether this caused some other metadata inconsistent,</font><br>
<font size="2">so a full fsck deserved.</font><br>
<br>
<font size="2">Thanks,</font><br>
<font size="2">Junxiao.</font><br>
<br>
<font size="2">&gt; Thanks,</font><br>
<font size="2">&gt; Xuejiufei</font><br>
<font size="2">&gt;</font><br>
<font size="2">&gt;&gt; Thanks,</font><br>
<font size="2">&gt;&gt; Junxiao.</font><br>
<font size="2">&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; Then during mount, localalloc won't be recovered because of clean</font><br>
<font size="2">&gt;&gt;&gt; journal and then trigger BUG when claiming clusters from localalloc.</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; In Tariq's fix, we have to run fsck offline and a separate fix to fsck</font><br>
<font size="2">&gt;&gt;&gt; is needed because it currently does not support clearing out localalloc</font><br>
<font size="2">&gt;&gt;&gt; inode. And my way to fix this issue is checking localalloc before</font><br>
<font size="2">&gt;&gt;&gt; actually loading it during mount. And this is somewhat online.</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; Signed-off-by: Joseph Qi &lt;joseph.qi@huawei.com&gt;</font><br>
<font size="2">&gt;&gt;&gt; ---</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; fs/ocfs2/localalloc.c | 19 &#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;-------</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; fs/ocfs2/localalloc.h |&nbsp; 2 &#43;-</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; fs/ocfs2/super.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 17 &#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;---</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; 3 files changed, 27 insertions(&#43;), 11 deletions(-)</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c</font><br>
<font size="2">&gt;&gt;&gt; index 0a4457f..ceebaef 100644</font><br>
<font size="2">&gt;&gt;&gt; --- a/fs/ocfs2/localalloc.c</font><br>
<font size="2">&gt;&gt;&gt; &#43;&#43;&#43; b/fs/ocfs2/localalloc.c</font><br>
<font size="2">&gt;&gt;&gt; @@ -281,7 &#43;281,7 @@ bail:</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; return ret;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; }</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; -int ocfs2_load_local_alloc(struct ocfs2_super *osb)</font><br>
<font size="2">&gt;&gt;&gt; &#43;int ocfs2_load_local_alloc(struct ocfs2_super *osb, int check, int *recovery)</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; {</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; int status = 0;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; struct ocfs2_dinode *alloc = NULL;</font><br>
<font size="2">&gt;&gt;&gt; @@ -345,21 &#43;345,26 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; if (num_used</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; || alloc-&gt;id1.bitmap1.i_used</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; || alloc-&gt;id1.bitmap1.i_total</font><br>
<font size="2">&gt;&gt;&gt; -&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; || la-&gt;la_bm_off)</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; || la-&gt;la_bm_off) {</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mlog(ML_ERROR, &quot;Local alloc hasn't been recovered!\n&quot;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &quot;found = %u, set = %u, taken = %u, off = %u\n&quot;,</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; num_used, le32_to_cpu(alloc-&gt;id1.bitmap1.i_used),</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; le32_to_cpu(alloc-&gt;id1.bitmap1.i_total),</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; OCFS2_LOCAL_ALLOC(alloc)-&gt;la_bm_off);</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; status = -EINVAL;</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *recovery = 1;</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; goto bail;</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; }</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; -&nbsp;&nbsp; osb-&gt;local_alloc_bh = alloc_bh;</font><br>
<font size="2">&gt;&gt;&gt; -&nbsp;&nbsp; osb-&gt;local_alloc_state = OCFS2_LA_ENABLED;</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; if (!check) {</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osb-&gt;local_alloc_bh = alloc_bh;</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osb-&gt;local_alloc_state = OCFS2_LA_ENABLED;</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; }</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; bail:</font><br>
<font size="2">&gt;&gt;&gt; -&nbsp;&nbsp; if (status &lt; 0)</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; if (status &lt; 0 || check)</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; brelse(alloc_bh);</font><br>
<font size="2">&gt;&gt;&gt; -&nbsp;&nbsp; if (inode)</font><br>
<font size="2">&gt;&gt;&gt; -&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iput(inode);</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; iput(inode);</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; trace_ocfs2_load_local_alloc(osb-&gt;local_alloc_bits);</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; diff --git a/fs/ocfs2/localalloc.h b/fs/ocfs2/localalloc.h</font><br>
<font size="2">&gt;&gt;&gt; index 44a7d1f..a913841 100644</font><br>
<font size="2">&gt;&gt;&gt; --- a/fs/ocfs2/localalloc.h</font><br>
<font size="2">&gt;&gt;&gt; &#43;&#43;&#43; b/fs/ocfs2/localalloc.h</font><br>
<font size="2">&gt;&gt;&gt; @@ -26,7 &#43;26,7 @@</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; #ifndef OCFS2_LOCALALLOC_H</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; #define OCFS2_LOCALALLOC_H</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; -int ocfs2_load_local_alloc(struct ocfs2_super *osb);</font><br>
<font size="2">&gt;&gt;&gt; &#43;int ocfs2_load_local_alloc(struct ocfs2_super *osb, int check, int *recovery);</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb);</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c</font><br>
<font size="2">&gt;&gt;&gt; index 2de4c8a..4004b29 100644</font><br>
<font size="2">&gt;&gt;&gt; --- a/fs/ocfs2/super.c</font><br>
<font size="2">&gt;&gt;&gt; &#43;&#43;&#43; b/fs/ocfs2/super.c</font><br>
<font size="2">&gt;&gt;&gt; @@ -2428,6 &#43;2428,7 @@ static int ocfs2_check_volume(struct ocfs2_super *osb)</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; int status;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; int dirty;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; int local;</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; int la_dirty = 0, recovery = 0;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; struct ocfs2_dinode *local_alloc = NULL; /* only used if we</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; * recover</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; * ourselves. */</font><br>
<font size="2">&gt;&gt;&gt; @@ -2449,6 &#43;2450,16 @@ static int ocfs2_check_volume(struct ocfs2_super *osb)</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp;&nbsp; * recover anything. Otherwise, journal_load will do that</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp;&nbsp; * dirty work for us :) */</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; if (!dirty) {</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* It may happen that local alloc is unclean shutdown, but</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * journal has been marked clean, so check it here and do</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * recovery if needed */</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; status = ocfs2_load_local_alloc(osb, 1, &amp;recovery);</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (recovery) {</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printk(KERN_NOTICE &quot;ocfs2: local alloc needs recovery &quot;</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;on device (%s).\n&quot;, osb-&gt;dev_str);</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; la_dirty = 1;</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font><br>
<font size="2">&gt;&gt;&gt; &#43;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; status = ocfs2_journal_wipe(osb-&gt;journal, 0);</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (status &lt; 0) {</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mlog_errno(status);</font><br>
<font size="2">&gt;&gt;&gt; @@ -2477,7 &#43;2488,7 @@ static int ocfs2_check_volume(struct ocfs2_super *osb)</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JBD2_FEATURE_COMPAT_CHECKSUM, 0,</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT);</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; -&nbsp;&nbsp; if (dirty) {</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; if (dirty || la_dirty) {</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* recover my local alloc if we didn't unmount cleanly. */</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; status = ocfs2_begin_local_alloc_recovery(osb,</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; osb-&gt;slot_num,</font><br>
<font size="2">&gt;&gt;&gt; @@ -2490,13 &#43;2501,13 @@ static int ocfs2_check_volume(struct ocfs2_super *osb)</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * ourselves as mounted. */</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; }</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; -&nbsp;&nbsp; status = ocfs2_load_local_alloc(osb);</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; status = ocfs2_load_local_alloc(osb, 0, &amp;recovery);</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; if (status &lt; 0) {</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mlog_errno(status);</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; goto finally;</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; }</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;&gt; -&nbsp;&nbsp; if (dirty) {</font><br>
<font size="2">&gt;&gt;&gt; &#43;&nbsp;&nbsp; if (dirty || la_dirty) {</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Recovery will be completed after we've mounted the</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * rest of the volume. */</font><br>
<font size="2">&gt;&gt;&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osb-&gt;dirty = 1;</font><br>
<font size="2">&gt;&gt;&gt;</font><br>
<font size="2">&gt;&gt;</font><br>
<font size="2">&gt;&gt;</font><br>
<font size="2">&gt;&gt; _______________________________________________</font><br>
<font size="2">&gt;&gt; Ocfs2-devel mailing list</font><br>
<font size="2">&gt;&gt; Ocfs2-devel@oss.oracle.com</font><br>
<font size="2">&gt;&gt; </font><a href="https://oss.oracle.com/mailman/listinfo/ocfs2-devel" style="font-size: small;">https://oss.oracle.com/mailman/listinfo/ocfs2-devel</a><br>
<font size="2">&gt;&gt;</font><br>
<font size="2">&gt;&gt; .</font><br>
<font size="2">&gt;&gt;</font><br>
<font size="2">&gt;</font><br>
<br>
<br>
<br>
<br>
</p>
</div>
</blockquote>
<span style="font-size:7.5pt;font-family:华文细黑;color:gray"><span lang="EN-US">-------------------------------------------------------------------------------------------------------------------------------------<br>
</span>本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出<span lang="EN-US"><br>
</span>的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、<span lang="EN-US"><br>
</span>或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本<span lang="EN-US"><br>
</span>邮件!<span lang="EN-US"><br>
</span></span><span lang="EN-US" style="font-size:7.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:gray">This e-mail and its attachments contain confidential information from H3C, which is
<br>
intended only for the person or entity whose address is listed above. Any use of the
<br>
information contained herein in any way (including, but not limited to, total or partial
<br>
disclosure, reproduction, or dissemination) by persons other than the intended <br>
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
<br>
by phone or email immediately and delete it!</span>
</body>
</html>