diff mbox series

[SRU,eoan] ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less

Message ID 20200113201455.1150030-1-rafaeldtinoco@ubuntu.com
State New
Headers show
Series [SRU,eoan] ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less | expand

Commit Message

Rafael David Tinoco Jan. 13, 2020, 8:14 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1852122

ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less

Because ocfs2_get_dlm_debug() function is called once less here, ocfs2
file system will trigger the system crash, usually after ocfs2 file
system is unmounted.

This system crash is caused by a generic memory corruption, these crash
backtraces are not always the same, for exapmle,

    ocfs2: Unmounting device (253,16) on (node 172167785)
    general protection fault: 0000 [#1] SMP PTI
    CPU: 3 PID: 14107 Comm: fence_legacy Kdump:
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
    RIP: 0010:__kmalloc+0xa5/0x2a0
    Code: 00 00 4d 8b 07 65 4d 8b
    RSP: 0018:ffffaa1fc094bbe8 EFLAGS: 00010286
    RAX: 0000000000000000 RBX: d310a8800d7a3faf RCX: 0000000000000000
    RDX: 0000000000000000 RSI: 0000000000000dc0 RDI: ffff96e68fc036c0
    RBP: d310a8800d7a3faf R08: ffff96e6ffdb10a0 R09: 00000000752e7079
    R10: 000000000001c513 R11: 0000000004091041 R12: 0000000000000dc0
    R13: 0000000000000039 R14: ffff96e68fc036c0 R15: ffff96e68fc036c0
    FS:  00007f699dfba540(0000) GS:ffff96e6ffd80000(0000) knlGS:00000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 000055f3a9d9b768 CR3: 000000002cd1c000 CR4: 00000000000006e0
    Call Trace:
     ext4_htree_store_dirent+0x35/0x100 [ext4]
     htree_dirblock_to_tree+0xea/0x290 [ext4]
     ext4_htree_fill_tree+0x1c1/0x2d0 [ext4]
     ext4_readdir+0x67c/0x9d0 [ext4]
     iterate_dir+0x8d/0x1a0
     __x64_sys_getdents+0xab/0x130
     do_syscall_64+0x60/0x1f0
     entry_SYSCALL_64_after_hwframe+0x49/0xbe
    RIP: 0033:0x7f699d33a9fb

This regression problem was introduced by commit e581595ea29c ("ocfs: no
need to check return value of debugfs_create functions").

Link: http://lkml.kernel.org/r/20191225061501.13587-1-ghe@suse.com
Fixes: e581595ea29c ("ocfs: no need to check return value of debugfs_create functions")
Signed-off-by: Gang He <ghe@suse.com>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.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>	[5.3+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(backported from commit b73eba2a867e10b9b4477738677341f3307c07bb linux)
Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
---
 fs/ocfs2/dlmglue.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stefan Bader Jan. 16, 2020, 2:28 p.m. UTC | #1
On 13.01.20 21:14, Rafael David Tinoco wrote:
> BugLink: https://bugs.launchpad.net/bugs/1852122
> 
> ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less
> 
> Because ocfs2_get_dlm_debug() function is called once less here, ocfs2
> file system will trigger the system crash, usually after ocfs2 file
> system is unmounted.
> 
> This system crash is caused by a generic memory corruption, these crash
> backtraces are not always the same, for exapmle,
> 
>     ocfs2: Unmounting device (253,16) on (node 172167785)
>     general protection fault: 0000 [#1] SMP PTI
>     CPU: 3 PID: 14107 Comm: fence_legacy Kdump:
>     Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
>     RIP: 0010:__kmalloc+0xa5/0x2a0
>     Code: 00 00 4d 8b 07 65 4d 8b
>     RSP: 0018:ffffaa1fc094bbe8 EFLAGS: 00010286
>     RAX: 0000000000000000 RBX: d310a8800d7a3faf RCX: 0000000000000000
>     RDX: 0000000000000000 RSI: 0000000000000dc0 RDI: ffff96e68fc036c0
>     RBP: d310a8800d7a3faf R08: ffff96e6ffdb10a0 R09: 00000000752e7079
>     R10: 000000000001c513 R11: 0000000004091041 R12: 0000000000000dc0
>     R13: 0000000000000039 R14: ffff96e68fc036c0 R15: ffff96e68fc036c0
>     FS:  00007f699dfba540(0000) GS:ffff96e6ffd80000(0000) knlGS:00000
>     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>     CR2: 000055f3a9d9b768 CR3: 000000002cd1c000 CR4: 00000000000006e0
>     Call Trace:
>      ext4_htree_store_dirent+0x35/0x100 [ext4]
>      htree_dirblock_to_tree+0xea/0x290 [ext4]
>      ext4_htree_fill_tree+0x1c1/0x2d0 [ext4]
>      ext4_readdir+0x67c/0x9d0 [ext4]
>      iterate_dir+0x8d/0x1a0
>      __x64_sys_getdents+0xab/0x130
>      do_syscall_64+0x60/0x1f0
>      entry_SYSCALL_64_after_hwframe+0x49/0xbe
>     RIP: 0033:0x7f699d33a9fb
> 
> This regression problem was introduced by commit e581595ea29c ("ocfs: no
> need to check return value of debugfs_create functions").
> 
> Link: http://lkml.kernel.org/r/20191225061501.13587-1-ghe@suse.com
> Fixes: e581595ea29c ("ocfs: no need to check return value of debugfs_create functions")
> Signed-off-by: Gang He <ghe@suse.com>
> Acked-by: Joseph Qi <joseph.qi@linux.alibaba.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>	[5.3+]
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> (backported from commit b73eba2a867e10b9b4477738677341f3307c07bb linux)
> Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  fs/ocfs2/dlmglue.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
> index 14207234fa3d..01f0e5ffe5b2 100644
> --- a/fs/ocfs2/dlmglue.c
> +++ b/fs/ocfs2/dlmglue.c
> @@ -3292,6 +3292,7 @@ static void ocfs2_dlm_init_debug(struct ocfs2_super *osb)
>  						0600,
>  						osb->osb_debug_root,
>  						&dlm_debug->d_filter_secs);
> +	ocfs2_get_dlm_debug(dlm_debug);
>  }
>  
>  static void ocfs2_dlm_shutdown_debug(struct ocfs2_super *osb)
>
Connor Kuehl Jan. 17, 2020, 11:34 p.m. UTC | #2
On 1/13/20 12:14 PM, Rafael David Tinoco wrote:
> BugLink: https://bugs.launchpad.net/bugs/1852122
> 
> ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less
> 
> Because ocfs2_get_dlm_debug() function is called once less here, ocfs2
> file system will trigger the system crash, usually after ocfs2 file
> system is unmounted.
> 
> This system crash is caused by a generic memory corruption, these crash
> backtraces are not always the same, for exapmle,
> 
>      ocfs2: Unmounting device (253,16) on (node 172167785)
>      general protection fault: 0000 [#1] SMP PTI
>      CPU: 3 PID: 14107 Comm: fence_legacy Kdump:
>      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
>      RIP: 0010:__kmalloc+0xa5/0x2a0
>      Code: 00 00 4d 8b 07 65 4d 8b
>      RSP: 0018:ffffaa1fc094bbe8 EFLAGS: 00010286
>      RAX: 0000000000000000 RBX: d310a8800d7a3faf RCX: 0000000000000000
>      RDX: 0000000000000000 RSI: 0000000000000dc0 RDI: ffff96e68fc036c0
>      RBP: d310a8800d7a3faf R08: ffff96e6ffdb10a0 R09: 00000000752e7079
>      R10: 000000000001c513 R11: 0000000004091041 R12: 0000000000000dc0
>      R13: 0000000000000039 R14: ffff96e68fc036c0 R15: ffff96e68fc036c0
>      FS:  00007f699dfba540(0000) GS:ffff96e6ffd80000(0000) knlGS:00000
>      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>      CR2: 000055f3a9d9b768 CR3: 000000002cd1c000 CR4: 00000000000006e0
>      Call Trace:
>       ext4_htree_store_dirent+0x35/0x100 [ext4]
>       htree_dirblock_to_tree+0xea/0x290 [ext4]
>       ext4_htree_fill_tree+0x1c1/0x2d0 [ext4]
>       ext4_readdir+0x67c/0x9d0 [ext4]
>       iterate_dir+0x8d/0x1a0
>       __x64_sys_getdents+0xab/0x130
>       do_syscall_64+0x60/0x1f0
>       entry_SYSCALL_64_after_hwframe+0x49/0xbe
>      RIP: 0033:0x7f699d33a9fb
> 
> This regression problem was introduced by commit e581595ea29c ("ocfs: no
> need to check return value of debugfs_create functions").
> 
> Link: http://lkml.kernel.org/r/20191225061501.13587-1-ghe@suse.com
> Fixes: e581595ea29c ("ocfs: no need to check return value of debugfs_create functions")
> Signed-off-by: Gang He <ghe@suse.com>
> Acked-by: Joseph Qi <joseph.qi@linux.alibaba.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>	[5.3+]
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> (backported from commit b73eba2a867e10b9b4477738677341f3307c07bb linux)
> Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>

Acked-by: Connor Kuehl <connor.kuehl@canonical.com>

> ---
>   fs/ocfs2/dlmglue.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
> index 14207234fa3d..01f0e5ffe5b2 100644
> --- a/fs/ocfs2/dlmglue.c
> +++ b/fs/ocfs2/dlmglue.c
> @@ -3292,6 +3292,7 @@ static void ocfs2_dlm_init_debug(struct ocfs2_super *osb)
>   						0600,
>   						osb->osb_debug_root,
>   						&dlm_debug->d_filter_secs);
> +	ocfs2_get_dlm_debug(dlm_debug);
>   }
>   
>   static void ocfs2_dlm_shutdown_debug(struct ocfs2_super *osb)
>
diff mbox series

Patch

diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 14207234fa3d..01f0e5ffe5b2 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -3292,6 +3292,7 @@  static void ocfs2_dlm_init_debug(struct ocfs2_super *osb)
 						0600,
 						osb->osb_debug_root,
 						&dlm_debug->d_filter_secs);
+	ocfs2_get_dlm_debug(dlm_debug);
 }
 
 static void ocfs2_dlm_shutdown_debug(struct ocfs2_super *osb)