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 C85BAC43381 for ; Tue, 5 Mar 2019 23:24:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7065D20652 for ; Tue, 5 Mar 2019 23:24:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UC95vrRD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726430AbfCEXYE (ORCPT ); Tue, 5 Mar 2019 18:24:04 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:35689 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726069AbfCEXYE (ORCPT ); Tue, 5 Mar 2019 18:24:04 -0500 Received: by mail-qk1-f194.google.com with SMTP id z13so5769574qki.2; Tue, 05 Mar 2019 15:24:03 -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:content-transfer-encoding:in-reply-to; bh=8+2Gac8f5LOwiMHt/NQ8G5QKjYMIX/lg2EbsoB/2myI=; b=UC95vrRDe0NOt4ThWcp8/yEETgg9J4L/DltzYmvFuCndFR3m1gPi/MAqZfBIi45trO N2j95xrlBT2xsxvWXU1QQz/VG+qhaiT6LYxB2Jr+8GzrD/lQZBpsmT54vBiAjHcx/K3e aHXC8jothznsy0JMIfWuEzAUUjWTAWktGXb8KB+rWa/22ZYx3EVp/kSrLy+If6K9JruQ XOmW60af2aKfmo/82kHqUzLAEK/qKM8TKV0vaqSxEHYrmscDTHL3euHdyzET5sLqixUO jqWNm/4vYnNa2Qr3AF2GZQ/lsGCUSYCOCIEXcyi2nHWXdyxY2QvO+z97sW6Mv2vCFEFU Pn2Q== 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:content-transfer-encoding :in-reply-to; bh=8+2Gac8f5LOwiMHt/NQ8G5QKjYMIX/lg2EbsoB/2myI=; b=WsBbGXYrmKlBmSMOzur45VDdCTZOTvpuH3yP34pARQu7bSt4KFYCr63CTAEsPuMi9Y fRVM7GuhRhjce8SZIoIsl6FT/1vWk9WRY98l0u4mbXVLZsmYCp5r6L/JmxpZDGDCG5t1 lQPdDo3h3KhmCDzTCtyPo+QZP4IpeKSDugEEM+R6vkvxbt5lBmgLY5yOECA3fIbCdGzj NzpYibV69bV8e5YWb6M03T6B4D46XOoQ0+aNLna1A3zE1t6pQyxV40eB/IWm/qhe0O7E RSbs6n6kHCDEOa2jVqHIZTwqe4vesgu/6sWEr2sxNGIktWf0GtHkGCqxn5xG+WC3WHQn T6ww== X-Gm-Message-State: APjAAAXCliFyLrAKhR7Y+pL2+UNWrL3rgzEJTHH2nSpXLdrjvYz3i9PD nozmIx9vdgt3x/S6xcSpT7s= X-Google-Smtp-Source: APXvYqx54dw0Zew5Il4mlQkd/+WUWfo7tC0uVCA8nImabOij802k1T5S7CIw0DJAE53bvKgXN7fJww== X-Received: by 2002:a37:c403:: with SMTP id d3mr3542671qki.54.1551828242588; Tue, 05 Mar 2019 15:24:02 -0800 (PST) Received: from eaf ([181.47.179.0]) by smtp.gmail.com with ESMTPSA id n42sm5911698qtb.43.2019.03.05.15.24.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Mar 2019 15:24:01 -0800 (PST) Date: Tue, 5 Mar 2019 20:23:57 -0300 From: Ernesto =?utf-8?Q?A=2E_Fern=C3=A1ndez?= To: tchou Cc: Viacheslav Dubeyko , linux-fsdevel@vger.kernel.org, linux-fsdevel-owner@vger.kernel.org, slava@dubeiko.com Subject: Re: The question about hfs+ patch (hfsplus: fix BUG on bnode parent update) Message-ID: <20190305232356.bjfawa7rqv4cjvvj@eaf> References: <73216487-9ed5-4492-b7c6-b757fdb3b566@Mail> <20190224004441.hhuakey36t2vvvag@eaf> <1551204111.8087.10.camel@dubeyko.com> <4f5b2f03b81ba97f8c110d05716018d9@synology.com> <20190227031040.ueywvamixruuwbo2@eaf> <1201647b624089e119d01256cf3e1089@synology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1201647b624089e119d01256cf3e1089@synology.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Feb 27, 2019 at 11:39:46AM +0800, tchou wrote: > Ernesto A. Fernández 於 2019-02-27 11:10 寫到: > > On Wed, Feb 27, 2019 at 09:46:16AM +0800, tchou wrote: > > > Viacheslav Dubeyko 於 2019-02-27 02:01 寫到: > > > > On Tue, 2019-02-26 at 11:32 +0800, tchou wrote: > > > > > Ernesto A. Fernández 於 2019-02-24 08:44 寫到: > > > > > > > > > > > > > > > > > > > > [skipped] > > > > > > > > > > > > > > > > > > [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 ]--- > > > > > > > > > > > > > > > > > > > > > ================================================================= > > > > > > > ================================= > > > > > > > > > > > > > > > > > > > Could you please share more details about the environment of the bug? > > > > Do you know what operation trigger the bug? How had volume been > > > > created? Can you reproduce the issue? > > > > > > > > It looks like the file deletion operation took place. Do you have any > > > > idea what file is under deletion and what features it has? Does this > > > > file contain any xattr? > > > > > > Ok, the following description is my situation. The Linux versions of > > > our products are 3.10 and 4.4. > > > > > > Users may plug-in the external USB drive, whose hfs+ is formatted on > > > their macOS device, to our device. They can do all file system > > > operations(etc create, remove, rename files, and so on) on both > > > macOS side and Linux side. > > > > > > The files created on macOS have the default xattr: > > > com.apple.FinderInfo=0sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKrmU= > > > The files created on Linux have no xattr. > > > > > > Some users seem enconter the call trace when removing the file on > > > our device.And it will stock when we unmount it and cause the > > > unmount fail. > > > > > > We cannot reproduce it by ourselves. The following link is the > > > only one I can find that have the same situation of mine: > > > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1646565/comments/5 > > > > > > I try some reproduce ways: > > > 1. Format the USB drive on Linux and macOS. > > > 2. Use fsstress to stress create and unlink operations on Linux. > > > 3. Create and remove the 100,000 files on Linux. > > > 4. Create 10,000 ~ 500,000 files on MacOS and remove all on Linux. > > > All of ways failed. > > > > > > There are about 10+ users enconter this situation so I try to fix it. > > > Any Idea about it? > > > > Try this script: > > > > touch test.file > > i=1 > > while [ $i -le 250 ]; do > > setfattr -n user.$i test.file > > ((++i)) > > done > > rm test.file > > > > I submitted a patch for this issue over a year ago. I no longer believe > > the > > xattr implementation can be fixed, but maybe it can help with your > > problem. > > Ok, I will try it. And which patch is it? Maybe I can figure somthing out. You can get it from patchwork.kernel.org/patch/9990497/ I haven't tested this in a while, and for the record I no longer believe it to be the proper solution. It's just a simple hack to work around some of the many issues with the xattr implementation. It's still better than getting a segfault. Ernesto > > > > > > > > > Thanks, > > > Ting-Chang Hou > > > > > > > > > > > Thanks, > > > > Vyacheslav Dubeyko. > > > > > > > > > > > > > > > > > > > > > > > > > Best regards, > > > > > > > Ting-Chang Hou #8487 > > > > > > > >