From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 953EEC43381 for ; Sun, 24 Feb 2019 00:44:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 56F7A20855 for ; Sun, 24 Feb 2019 00:44:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bcsC/zcR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728046AbfBXAos (ORCPT ); Sat, 23 Feb 2019 19:44:48 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:41262 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727800AbfBXAos (ORCPT ); Sat, 23 Feb 2019 19:44:48 -0500 Received: by mail-qt1-f196.google.com with SMTP id v10so6741824qtp.8 for ; Sat, 23 Feb 2019 16:44:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/sMOt/+SEjM/1bL4uXX55cpRt3cuJj0+Xln6iWucoLg=; b=bcsC/zcRREEa+bm1NolYomJl0YhqgSkxR/bFzRgSWgepm25pQWQtuu5PbHppFTZU8D qwiAtDAUuNkEWqSmT+jIN9CXpoElzSZzBMriA44dxb7aHlFoQmcZj7hmoN7b0uIJtB+B ctJxBD9bzPFOk57QHV5OatcALh6ebwOkqYu5MQj+6dtl01Y/+fWbMTLeuZFCwcawrAhq mP2d+NGHTWLqSbuttiQFS1bO8sPkTfmmumjGoK4lQyijaKOoBCbwizZIPrYxY6eIMPa/ 9R8WE1fW20c/4gZGmW8KAnwVttNyl5Q/itjIQOr7NpjXwfrP3xa1vEduN4St5+f9KRk1 y8oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/sMOt/+SEjM/1bL4uXX55cpRt3cuJj0+Xln6iWucoLg=; b=ZZu8ydI5eDEgbKc1TRaANUyhLQ3PsV9ld6g1DLKLG4Jj3anrEoOnG8CW/Md+2FC5ZX uBa6+Ylege4l497upNNtJkc/EbHd/9qMhyncw3KVp2RmofKX3mxRxdLs/EtG+hlqWOIU eyAYLpCu+iYr2188AGrVOz8KcRQKfFVxWsMlZfWbodnC3JwTy91jVRoYOrwLKJS2f5ud ABFGSfqILqCeh4Wab8IDXElwz/SyN3l+VkIq7z4wLRlcnwtUVmcKYxyF8wb66gVkGT5I V/ZMHKSTbg7bNwFSv5R5e2MCp3AZZVpz3LYBJRhNNIhunlbXFXv5XyCJ4DQRHDs0ys5R XpTw== X-Gm-Message-State: AHQUAuadfdp9NFo4Hhj8d4aKuG1+CbjIsJaKc3+E7PRMqnhcGmaHxDjj 8/RhAaN5FbDmZegLmmf63ZA= X-Google-Smtp-Source: AHgI3IboLbbWIaW2UNLbaZ4Jv+8gN2MXxur9HSRsTTTMd0jQRx5ThhvHuoVm3mUAWhFghlo2F8rwkg== X-Received: by 2002:aed:359b:: with SMTP id c27mr8363307qte.292.1550969086461; Sat, 23 Feb 2019 16:44:46 -0800 (PST) Received: from eaf ([181.47.179.0]) by smtp.gmail.com with ESMTPSA id y17sm3708866qtc.33.2019.02.23.16.44.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Feb 2019 16:44:45 -0800 (PST) Date: Sat, 23 Feb 2019 21:44:41 -0300 From: Ernesto =?utf-8?Q?A=2E_Fern=C3=A1ndez?= To: tchou Cc: linux-fsdevel@vger.kernel.org Subject: Re: The question about hfs+ patch (hfsplus: fix BUG on bnode parent update) Message-ID: <20190224004441.hhuakey36t2vvvag@eaf> References: <73216487-9ed5-4492-b7c6-b757fdb3b566@Mail> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73216487-9ed5-4492-b7c6-b757fdb3b566@Mail> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Hi, On Sat, Feb 23, 2019 at 04:19:23PM +0800, tchou wrote: > Hi Ernesto, > > Sorry to disturb. No problem. > I'm investigating an HFS+ BUG. > The call trace is attached[1]. > > As you can see, the bnode is been free twice, > I suspect that the bug is ralative to this patch 19a9d0f1acf75e8be8cfba19c1a34e941846fa2b > (hfsplus: fix BUG on bnode parent update). Those messages you get are reporting an attempt to free on-disk bnodes that were already free. My patch was about bnode structures in memory, so it's not likely to be related. > > There are three questions: > 1. The commit message says "Creating, renaming or deleting a file may hit BUG_ON()". > Where is the BUG_ON() been triggered? Is that the same BUG_ON() in my call trace? The BUG_ON() from my patch was in hfs_bnode_put(). I don't think there is any BUG_ON() in your case, you are getting a general protection fault. > > 2. I run the script in your commit message, but I can not reproduce it. > Could you please tell me how many times in average it need to execute to trigger the bug? > I'm wondering if I took some mistake. The bug should be triggered after a single run. Did you revert the patch before? > > > 3. If my guess is wrong, this bug is unrelative to this patch, > do you have any idea on it? Or do you have faced the same bug of mine? This seems to be related to the xattr implementation, which is a mess. I think it would be best to rewrite it or get rid of it entirely... Ernesto > Thanks for your help! > > [1] > ================================================================================================== > > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.504049] hfsplus: trying to free free bnode 294912(2) > > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.510017] hfsplus: trying to free free bnode 294912(2) > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.515983] hfsplus: trying to free free bnode 294912(2) > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.521949] general protection fault: 0000 [#1] SMP > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.621069] CPU: 1 PID: 18715 Comm: SYNO.FileStatio Tainted: P C O 3.10.102 #15152 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.630308] Hardware name: Synology Inc. DS1517+/Type2 - Board Product Name1, BIOS M.405 2017/05/09 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.640423] task: ffff8802753fa040 ti: ffff880270880000 task.ti: ffff880270880000 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.648779] RIP: 0010:[] [] hfsplus_bnode_write+0x9e/0x1e0 [hfsplus] > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.659489] RSP: 0018:ffff880270883c18 EFLAGS: 00010202 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.665415] RAX: 0000000000000000 RBX: 0000000000000002 RCX: 000000000000aeff > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.673391] RDX: 0000000000000000 RSI: ffff880270883c56 RDI: db73880000000000 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.681366] RBP: ffff88005f7b1920 R08: 0000000000000002 R09: 0000000000000002 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.689343] R10: ffff88005f7b18d0 R11: 0000000000000002 R12: 0000000000001ffc > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.697310] R13: ffff880270883c56 R14: 0000000000000002 R15: 0000000000000002 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.705286] FS: 00007f4fee0607c0(0000) GS:ffff88027fc40000(0000) knlGS:0000000000000000 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.714322] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.720744] CR2: 00007f4fee05d000 CR3: 0000000247210000 CR4: 00000000001007e0 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.728711] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.736687] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.744654] Stack: > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.746896] ffff88005f7b18c0 ffff880270883cd0 0000000000001ffc 0000000000001f9c > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.755181] 0000000000000060 000000000000000e ffffffffa05146ff aeff000000000031 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.763468] ffffffffa0516bf9 000000606228c340 ffff880270883cd0 00000000fffffffe > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.771763] Call Trace: > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.774497] [] ? hfsplus_bnode_write_u16+0x1f/0x30 [hfsplus] > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.782671] [] ? hfsplus_brec_remove+0x129/0x190 [hfsplus] > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.790650] [] ? __hfsplus_delete_attr+0x90/0xf0 [hfsplus] > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.798629] [] ? hfsplus_delete_all_attrs+0x49/0xb0 [hfsplus] > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.806900] [] ? hfsplus_delete_cat+0x1c2/0x2b0 [hfsplus] > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.814782] [] ? hfsplus_unlink+0x1d0/0x1e0 [hfsplus] > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.822277] [] ? __inode_permission+0x1d/0xb0 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.828992] [] ? vfs_unlink+0x8a/0x100 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.835025] [] ? do_unlinkat+0x223/0x230 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.841255] [] ? mntput_no_expire+0x13/0x130 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.847873] [] ? task_work_run+0x9c/0xe0 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.854102] [] ? do_notify_resume+0x61/0x90 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.860624] [] ? fput+0x57/0xb0 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.865978] [] ? system_call_fastpath+0x16/0x1b > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.872884] Code: 48 63 ca 48 01 cf 48 83 fb 08 0f 83 fd 00 00 00 31 c0 41 f6 c3 04 74 09 8b 06 89 07 b8 04 00 00 00 41 f6 c3 02 74 0c 0f b7 0c 06 <66> 89 0c 07 48 8d 40 02 41 83 e3 01 74 07 0f b6 0c 06 88 0c 07 > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.894293] RIP [] hfsplus_bnode_write+0x9e/0x1e0 [hfsplus] > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.902375] RSP > > 2017-08-30T10:32:30-04:00 BS-SAN kernel: [ 5471.906350] ---[ end trace 0e65d1ee34a1e12e ]--- > > > ================================================================================================== > > > > Best regards, > Ting-Chang Hou #8487 >