Revision 6f1b228529ae49b0f85ab89bcdb6c365df401558 authored by Gautham Ananthakrishna on 28 October 2021, 21:36:17 UTC, committed by Linus Torvalds on 29 October 2021, 00:18:55 UTC
Encountered a race between ocfs2_test_bg_bit_allocatable() and
jbd2_journal_put_journal_head() resulting in the below vmcore.

  PID: 106879  TASK: ffff880244ba9c00  CPU: 2   COMMAND: "loop3"
  Call trace:
    panic
    oops_end
    no_context
    __bad_area_nosemaphore
    bad_area_nosemaphore
    __do_page_fault
    do_page_fault
    page_fault
      [exception RIP: ocfs2_block_group_find_clear_bits+316]
    ocfs2_block_group_find_clear_bits [ocfs2]
    ocfs2_cluster_group_search [ocfs2]
    ocfs2_search_chain [ocfs2]
    ocfs2_claim_suballoc_bits [ocfs2]
    __ocfs2_claim_clusters [ocfs2]
    ocfs2_claim_clusters [ocfs2]
    ocfs2_local_alloc_slide_window [ocfs2]
    ocfs2_reserve_local_alloc_bits [ocfs2]
    ocfs2_reserve_clusters_with_limit [ocfs2]
    ocfs2_reserve_clusters [ocfs2]
    ocfs2_lock_refcount_allocators [ocfs2]
    ocfs2_make_clusters_writable [ocfs2]
    ocfs2_replace_cow [ocfs2]
    ocfs2_refcount_cow [ocfs2]
    ocfs2_file_write_iter [ocfs2]
    lo_rw_aio
    loop_queue_work
    kthread_worker_fn
    kthread
    ret_from_fork

When ocfs2_test_bg_bit_allocatable() called bh2jh(bg_bh), the
bg_bh->b_private NULL as jbd2_journal_put_journal_head() raced and
released the jounal head from the buffer head.  Needed to take bit lock
for the bit 'BH_JournalHead' to fix this race.

Link: https://lkml.kernel.org/r/1634820718-6043-1-git-send-email-gautham.ananthakrishna@oracle.com
Signed-off-by: Gautham Ananthakrishna <gautham.ananthakrishna@oracle.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: <rajesh.sivaramasubramaniom@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 337546e
Raw File
leds-el15203000.rst
.. SPDX-License-Identifier: GPL-2.0

==================================
Kernel driver for Crane EL15203000
==================================

/sys/class/leds/<led>/hw_pattern
--------------------------------

Specify a hardware pattern for the EL15203000 LED.

The LEDs board supports only predefined patterns by firmware
for specific LEDs.

Breathing mode for Screen frame light tube::

    "0 4000 1 4000"

	^
	|
    Max-|     ---
	|    /   \
	|   /     \
	|  /       \     /
	| /         \   /
    Min-|-           ---
	|
	0------4------8--> time (sec)

Cascade mode for Pipe LED::

    "1 800 2 800 4 800 8 800 16 800"

	^
	|
  0 On -|----+                   +----+                   +---
	|    |                   |    |                   |
    Off-|    +-------------------+    +-------------------+
	|
  1 On -|    +----+                   +----+
	|    |    |                   |    |
    Off |----+    +-------------------+    +------------------
	|
  2 On -|         +----+                   +----+
	|         |    |                   |    |
    Off-|---------+    +-------------------+    +-------------
	|
  3 On -|              +----+                   +----+
	|              |    |                   |    |
    Off-|--------------+    +-------------------+    +--------
	|
  4 On -|                   +----+                   +----+
	|                   |    |                   |    |
    Off-|-------------------+    +-------------------+    +---
	|
	0---0.8--1.6--2.4--3.2---4---4.8--5.6--6.4--7.2---8--> time (sec)

Inverted cascade mode for Pipe LED::

    "30 800 29 800 27 800 23 800 15 800"

	^
	|
  0 On -|    +-------------------+    +-------------------+
	|    |                   |    |                   |
    Off-|----+                   +----+                   +---
	|
  1 On -|----+    +-------------------+    +------------------
	|    |    |                   |    |
    Off |    +----+                   +----+
	|
  2 On -|---------+    +-------------------+    +-------------
	|         |    |                   |    |
    Off-|         +----+                   +----+
	|
  3 On -|--------------+    +-------------------+    +--------
	|              |    |                   |    |
    Off-|              +----+                   +----+
	|
  4 On -|-------------------+    +-------------------+    +---
	|                   |    |                   |    |
    Off-|                   +----+                   +----+
	|
	0---0.8--1.6--2.4--3.2---4---4.8--5.6--6.4--7.2---8--> time (sec)

Bounce mode for Pipe LED::

    "1 800 2 800 4 800 8 800 16 800 16 800 8 800 4 800 2 800 1 800"

	^
	|
  0 On -|----+                                       +--------
	|    |                                       |
    Off-|    +---------------------------------------+
	|
  1 On -|    +----+                             +----+
	|    |    |                             |    |
    Off |----+    +-----------------------------+    +--------
	|
  2 On -|         +----+                   +----+
	|         |    |                   |    |
    Off-|---------+    +-------------------+    +-------------
	|
  3 On -|              +----+         +----+
	|              |    |         |    |
    Off-|--------------+    +---------+    +------------------
	|
  4 On -|                   +---------+
	|                   |         |
    Off-|-------------------+         +-----------------------
	|
	0---0.8--1.6--2.4--3.2---4---4.8--5.6--6.4--7.2---8--> time (sec)

Inverted bounce mode for Pipe LED::

    "30 800 29 800 27 800 23 800 15 800 15 800 23 800 27 800 29 800 30 800"

	^
	|
  0 On -|    +---------------------------------------+
	|    |                                       |
    Off-|----+                                       +--------
	|
  1 On -|----+    +-----------------------------+    +--------
	|    |    |                             |    |
    Off |    +----+                             +----+
	|
  2 On -|---------+    +-------------------+    +-------------
	|         |    |                   |    |
    Off-|         +----+                   +----+
	|
  3 On -|--------------+    +---------+    +------------------
	|              |    |         |    |
    Off-|              +----+         +----+
	|
  4 On -|-------------------+         +-----------------------
	|                   |         |
    Off-|                   +---------+
	|
	0---0.8--1.6--2.4--3.2---4---4.8--5.6--6.4--7.2---8--> time (sec)
back to top