Bug 491219

Summary: GFS2 oops when I twiddle /sys/fs/gfs2/hda4/freeze
Product: [Fedora] Fedora Reporter: Andy Price <andy>
Component: GFS-kernelAssignee: Steve Whitehouse <swhiteho>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: adas, bmarzins, rpeterso, swhiteho
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-03-27 10:41:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Attempted fix none

Description Andy Price 2009-03-19 21:42:43 UTC
Description of problem:

  When I write 1 to /sys/fs/gfs2/hda4/freeze the kernel oopses.

Version-Release number of selected component (if applicable):

  Using steve's latest gfs2-nmw kernel.

Steps to Reproduce:

  1. # mount /dev/hda4 /mnt/gfs2
  2. # echo 1 > /sys/fs/gfs2/hda4/freeze
  
Additional info:

$ grep GFS2 .config
CONFIG_GFS2_FS=m
# CONFIG_GFS2_FS_LOCKING_DLM is not set

$ sudo gfs2_tool sb /dev/hda4 all
  mh_magic = 0x01161970
  mh_type = 1
  mh_format = 100
  sb_fs_format = 1801
  sb_multihost_format = 1900
  sb_bsize = 4096
  sb_bsize_shift = 12
  no_formal_ino = 2
  no_addr = 22
  no_formal_ino = 1
  no_addr = 21
  sb_lockproto = lock_nolock
  sb_locktable = 
  uuid = FDE29691-C703-62E9-C77E-323A1E8634B3

Trace from dmesg:

[  877.541880] BUG: unable to handle kernel paging request at 000000000000824a
[  877.541894] IP: [<ffffffffa0072574>] gfs2_glock_dq+0x74/0x1a0 [gfs2]
[  877.541939] PGD 2e290067 PUD 2e38d067 PMD 0 
[  877.541947] Oops: 0002 [#1] PREEMPT SMP 
[  877.541954] last sysfs file: /sys/fs/gfs2/hda4/freeze
[  877.541959] CPU 0 
[  877.541962] Modules linked in: gfs2 b43 ssb pcmcia yenta_socket rsrc_nonstatic pcmcia_core
[  877.541978] Pid: 4595, comm: bash Not tainted 2.6.29-rc2-adp5-gfs2 #1
[  877.541983] RIP: 0010:[<ffffffffa0072574>]  [<ffffffffa0072574>] gfs2_glock_dq+0x74/0x1a0 [gfs2]
[  877.542017] RSP: 0018:ffff88002e25fd58  EFLAGS: 00010246
[  877.542022] RAX: ffff88003329e5c0 RBX: ffff88002e25fdd8 RCX: 0000000000000000
[  877.542027] RDX: 0000000000008242 RSI: 0000000000000000 RDI: 0000000000000001
[  877.542032] RBP: ffff88002e25fd88 R08: 0000000000000000 R09: 0000000000000001
[  877.542037] R10: 0000000000000001 R11: 0000000000000000 R12: ffff88002e253950
[  877.542042] R13: ffff88003f98f7e8 R14: ffff88002e25397c R15: ffff88002e2539a0
[  877.542048] FS:  00007f3a05aeb6f0(0000) GS:ffffffff809bf040(0000) knlGS:0000000000000000
[  877.542054] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[  877.542058] CR2: 000000000000824a CR3: 000000002e235000 CR4: 00000000000006e0
[  877.542063] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  877.542068] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  877.542074] Process bash (pid: 4595, threadinfo ffff88002e25e000, task ffff88002e253950)
[  877.542079] Stack:
[  877.542082]  ffff88000100e4b8 ffff88002e25fdd8 ffff88002e25fe18 ffff88003f98f7e8
[  877.542091]  0000000000000000 ffff88003f98f000 ffff88002e25fda8 ffffffffa00728e1
[  877.542100]  0000000000000000 ffff88002e25fe38 ffff88002e25fe78 ffffffffa008932f
[  877.542110] Call Trace:
[  877.542115]  [<ffffffffa00728e1>] gfs2_glock_dq_uninit+0x11/0x20 [gfs2]
[  877.542147]  [<ffffffffa008932f>] gfs2_freeze_fs+0x16f/0x250 [gfs2]
[  877.542182]  [<ffffffff80281933>] ? __alloc_pages_internal+0xe3/0x4b0
[  877.542195]  [<ffffffffa008a99d>] freeze_store+0x8d/0xb0 [gfs2]
[  877.542228]  [<ffffffffa0089540>] gfs2_attr_store+0x20/0x30 [gfs2]
[  877.542261]  [<ffffffff802fe355>] sysfs_write_file+0xc5/0x140
[  877.542273]  [<ffffffff802a9fdb>] vfs_write+0xcb/0x170
[  877.542282]  [<ffffffff802aa170>] sys_write+0x50/0x90
[  877.542290]  [<ffffffff8020bb1b>] system_call_fastpath+0x16/0x1b
[  877.542299] Code: 10 08 41 8b 44 24 44 83 f8 01 0f 84 e7 00 00 00 85 c0 0f 85 cf 00 00 00 0f 1f 80 00 00 00 00 48 8b 43 08 48 8b 13 4d 8d 7c 24 50 <48> 89 42 08 48 89 10 48 89 1b 49 8b 44 24 50 48 89 5b 08 4c 39 
[  877.542369] RIP  [<ffffffffa0072574>] gfs2_glock_dq+0x74/0x1a0 [gfs2]
[  877.542400]  RSP <ffff88002e25fd58>
[  877.542403] CR2: 000000000000824a
[  877.542423] ---[ end trace 7a7b4cc958541749 ]---
[  877.542430] note: bash[4595] exited with preempt_count 1
[  877.542456] BUG: scheduling while atomic: bash/4595/0x10000002
[  877.542461] Modules linked in: gfs2 b43 ssb pcmcia yenta_socket rsrc_nonstatic pcmcia_core
[  877.542480] Pid: 4595, comm: bash Tainted: G      D    2.6.29-rc2-adp5-gfs2 #1
[  877.542485] Call Trace:
[  877.542495]  [<ffffffff8023b49a>] __schedule_bug+0x8a/0xa0
[  877.542504]  [<ffffffff806cecca>] schedule+0xea/0x30e
[  877.542513]  [<ffffffff806d15c9>] ? _spin_unlock+0x29/0x40
[  877.542522]  [<ffffffff803f05a8>] ? sprintf+0x68/0x70
[  877.542531]  [<ffffffff8023c667>] __cond_resched+0x17/0x40
[  877.542538]  [<ffffffff806cf765>] _cond_resched+0x35/0x50
[  877.542547]  [<ffffffff80291fcf>] unmap_vmas+0x86f/0x9e0
[  877.542556]  [<ffffffff80297361>] exit_mmap+0xa1/0x1a0
[  877.542564]  [<ffffffff8023f805>] mmput+0x35/0xd0
[  877.542572]  [<ffffffff80243aae>] exit_mm+0xfe/0x140
[  877.542579]  [<ffffffff806d14ca>] ? _spin_unlock_irq+0x2a/0x40
[  877.542587]  [<ffffffff80245dd3>] do_exit+0x813/0x8f0
[  877.542595]  [<ffffffff8020c5de>] ? apic_timer_interrupt+0xe/0x20
[  877.542604]  [<ffffffff8020fcfb>] oops_end+0x9b/0xa0
[  877.542613]  [<ffffffff8022c66c>] do_page_fault+0x42c/0x980
[  877.542621]  [<ffffffff802361c5>] ? enqueue_entity+0xd5/0x150
[  877.542629]  [<ffffffff80235962>] ? check_preempt_wakeup+0xe2/0x1a0
[  877.542638]  [<ffffffff806d14f2>] ? _spin_unlock_irqrestore+0x12/0x40
[  877.542647]  [<ffffffff8023c43c>] ? try_to_wake_up+0x16c/0x220
[  877.542656]  [<ffffffff8023c4fd>] ? default_wake_function+0xd/0x10
[  877.542664]  [<ffffffff80258f41>] ? autoremove_wake_function+0x11/0x40
[  877.542672]  [<ffffffff80234c22>] ? __wake_up_common+0x52/0x80
[  877.542680]  [<ffffffff806d1a0f>] page_fault+0x1f/0x30
[  877.542713]  [<ffffffffa0072574>] ? gfs2_glock_dq+0x74/0x1a0 [gfs2]
[  877.542745]  [<ffffffffa0072539>] ? gfs2_glock_dq+0x39/0x1a0 [gfs2]
[  877.542776]  [<ffffffffa00728e1>] gfs2_glock_dq_uninit+0x11/0x20 [gfs2]
[  877.542811]  [<ffffffffa008932f>] gfs2_freeze_fs+0x16f/0x250 [gfs2]
[  877.542820]  [<ffffffff80281933>] ? __alloc_pages_internal+0xe3/0x4b0
[  877.542855]  [<ffffffffa008a99d>] freeze_store+0x8d/0xb0 [gfs2]
[  877.542888]  [<ffffffffa0089540>] gfs2_attr_store+0x20/0x30 [gfs2]
[  877.542898]  [<ffffffff802fe355>] sysfs_write_file+0xc5/0x140
[  877.542907]  [<ffffffff802a9fdb>] vfs_write+0xcb/0x170
[  877.542915]  [<ffffffff802aa170>] sys_write+0x50/0x90
[  877.542922]  [<ffffffff8020bb1b>] system_call_fastpath+0x16/0x1b

Comment 1 Steve Whitehouse 2009-03-20 15:02:22 UTC
I think I can see whats going on here. Shouldn't be too tricky to fix.

Comment 2 Steve Whitehouse 2009-03-23 10:50:56 UTC
Created attachment 336269 [details]
Attempted fix

Does this patch fix the issue?

Comment 3 Andy Price 2009-03-23 12:34:58 UTC
(In reply to comment #2)
> Does this patch fix the issue?  

Yes that works for me:

# echo 1 > /sys/fs/gfs2/hda4/freeze 
# cat /sys/fs/gfs2/hda4/freeze 
1
# echo 0 > /sys/fs/gfs2/hda4/freeze 
# cat /sys/fs/gfs2/hda4/freeze 
0

and nothing in dmesg.

Comment 4 Steve Whitehouse 2009-03-27 10:41:51 UTC
In 2.6.30