From patchwork Mon Jan 13 20:12:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael David Tinoco X-Patchwork-Id: 1222311 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ubuntu.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47xPrr0CFNz9sPn; Tue, 14 Jan 2020 07:12:26 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ir64R-00073x-Ee; Mon, 13 Jan 2020 20:12:19 +0000 Received: from mail-vs1-f66.google.com ([209.85.217.66]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ir64P-00073q-3e for kernel-team@lists.ubuntu.com; Mon, 13 Jan 2020 20:12:17 +0000 Received: by mail-vs1-f66.google.com with SMTP id p6so6694489vsj.11 for ; Mon, 13 Jan 2020 12:12:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=In+AcGXEWEWTuzRUCS5/sgxLNHVRetTfP6697hcKooA=; b=FlDq+3QrNZMsMKSKy/4sR3dGPPeelDBtIijNtPHwojnmos76M5rxkdifsifRQ4E3f+ lMy9ItbggSOLUC5KoJkHROkkselLFfUIWh/iJfimP01LO8Mn+N2NgYLhVxcpCXwX1F14 Ce9HlMDaC9kdRxm2AL3NkHdtYUV1wM8F94bBZOJDSK2VViUIua0fAobHVGDgUybJXjuF NvqgxSd+gILzeiRA8t/FZhDtPSo9loHAmwV1HxmR6bcjy05M4LXV3IuwgNqDLf56h5Sf jZ+Y+ynzeDoBS+U/naOmaOuQwhmcMgljagsOl2Faq+hvv8MQc4FG5XTkUzsZvVA1bdwp h57Q== X-Gm-Message-State: APjAAAUzLMCr19AN9pCAjoug5J7Q97Y593GZBH6n2wqras54dXlfmvye IpF5NqbE8bxg0xfR6B+pu76cufOWQSuMuw== X-Google-Smtp-Source: APXvYqw779nQQP0g2jbhdEPEHF1Fw9Is9rWNXJ0jjrAKP2v6ykqwqp64DC8qETNKIIS5KKjS6l25gw== X-Received: by 2002:a67:fb14:: with SMTP id d20mr9548017vsr.136.1578946335832; Mon, 13 Jan 2020 12:12:15 -0800 (PST) Received: from workstation.celeiro ([107.181.164.77]) by smtp.gmail.com with ESMTPSA id o39sm3048569uad.6.2020.01.13.12.12.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2020 12:12:15 -0800 (PST) From: Rafael David Tinoco To: kernel-team@lists.ubuntu.com Subject: [PATCH][focal] ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less Date: Mon, 13 Jan 2020 20:12:12 +0000 Message-Id: <20200113201212.1149950-1-rafaeldtinoco@ubuntu.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rafaeldtinoco@gmail.com Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1852122 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 Acked-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: [5.3+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit b73eba2a867e10b9b4477738677341f3307c07bb) Signed-off-by: Rafael David Tinoco --- fs/ocfs2/dlmglue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 6e774c5ea13b..8a2e284ccfcd 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3282,6 +3282,7 @@ static void ocfs2_dlm_init_debug(struct ocfs2_super *osb) debugfs_create_u32("locking_filter", 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)