Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6439002rwl; Wed, 22 Mar 2023 10:36:12 -0700 (PDT) X-Google-Smtp-Source: AK7set+B1jOSxUb4NQ77ffd89MJijXNxIzSQBWtAoAZsElJYjtY7hwf+AXVwSLqTKY97qHbuq3LZ X-Received: by 2002:a17:902:f544:b0:1a1:aa3b:e7d0 with SMTP id h4-20020a170902f54400b001a1aa3be7d0mr4223373plf.64.1679506572557; Wed, 22 Mar 2023 10:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679506572; cv=none; d=google.com; s=arc-20160816; b=ilhQlzbAENfPPnv9gnPG2/9JutmoIQsHPVRB0jI3pmtwsPs7+XZtSq3CMfHG0YkHVg pSdiR0iz/KB+XWWHAKoDe7mk87c6IZFOiaa99ujb1+1NIDan01hO1W1CSUssrw+tcnuC e+oHKEYtL/CV0quSdzlFJDjgVAvmuTxBpdXOkPxlwECzSsDHbQjAEtVFMo4K9b3WeyTC H50w/fM/8bHcKeDXUEENxO8TVMqWX9Pvnhj4vyCVSblyzQp9nAecsA50kyrWopWevBxa VuABeRWzHnk04jLIvfbQEBc4Ws/t8rluCBFAzXBF1YByFleBQu2jc88AWgM5ulTifQRP WPhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=ZJP3mA1N4qF5Kw86SxStXRq+7tB5BmUkuhCWnMdCRHQ=; b=BdIG9kTwLrsrsVY8LK7LrV2YHoPSc0anykGEe8yuj+4FGqHdHpUB/VnDp/U404gYVV iPW6zGyqVQ1LDGYU5yfFrzcU+rcqW8lFHM6xt+NpQx1CA+RIcVt28T/4swAg5X6pFGy2 touDXdpQIG7poKRUjQhK66VVShK/33mwznVrNu5SVNkg0nmqAUefNKi1fz1MMKUz/DNV 5Qv0ltUEfNu4pNSG87BjJg0TSX4wqAiX/BMjqKLvCOaw6ZpHvjfAjtsa5E88ZnapzhC8 il9DRDEa1AvvTpHWS1rrmFcFxKJpDoasPZFYSkUpumLBmtOl0FLtAU12mBEBhEpPBu3f wYhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VwHNSNQJ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n18-20020a170902d0d200b0019ed069f0a6si15359914pln.524.2023.03.22.10.35.42; Wed, 22 Mar 2023 10:36:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VwHNSNQJ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229666AbjCVR1W (ORCPT + 99 others); Wed, 22 Mar 2023 13:27:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbjCVR1V (ORCPT ); Wed, 22 Mar 2023 13:27:21 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59E384AFEC; Wed, 22 Mar 2023 10:27:20 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id s20so12542595ljp.1; Wed, 22 Mar 2023 10:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679506038; x=1682098038; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ZJP3mA1N4qF5Kw86SxStXRq+7tB5BmUkuhCWnMdCRHQ=; b=VwHNSNQJiMpcoSFj+q/06EUjF1UVKz8k4D3lt4JqIwXCM8BCePwBR3MVvk7TKc8Gmj BJcD9LytKDciE94i9R4EgLuxO6wbtaNM7yAU5oSFlyccFfWztxMSGTYSS0iSAGZQOhWT Myl5rmPDS5lAJU71/GCJXwQHjqoZmE+LxQI7q6fAKVxPClHOI5Wd5tpxfZjV20Jvr4lB s+GIXZ2BX8thcFbdL6BBU4MV8J6cxeXUYNYUIbBqQJehzaioq33rrBG7GmfbB1BKrWj6 HdaV1epFGsHjtCdhPSkMuHaCOROQUnyaUGTidWiEgh4KcguiNhinuyYGmprrTS1WlvUf 9aqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679506038; x=1682098038; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZJP3mA1N4qF5Kw86SxStXRq+7tB5BmUkuhCWnMdCRHQ=; b=izp7+Jnh3SXktAo25xsizEU6XQ7XotSIXqZwoqpTQeLda7SLuvCp3f21il0hAJ0Mui yynp5Jr219DodbbZU0yRFiWzTR2143SQaETIZrhQWjkQopzc3EO4bl+JLQ1BtylkMegX NKZEMmNsq8Fsys+SvQJnSIe9Mbcg4iVWD2t0XqxXhph/PCpZmtOJRzVD/T61YwhhDc2l hjpUycTGp+eoBQXC1wBjg+ckWLucT2lWk1KgT/QToEZ0IrL2ZThyd1B+LNS5WyHtxcHw 2/U9nO5nHySDTV6b+dyq6fIYEUOGLOkxRNF8h/Qxs7Yw3EfaTmlgQmi9/9KtQR/aUH59 ha/w== X-Gm-Message-State: AO0yUKVkwNvi8k29Uiq+qcxeb5Ya95yW+TDo8v6tM27Q/P5sc3RNu7Ru h4+fBnesQK3gZN18yG0Hzz5sUnBvza8= X-Received: by 2002:a05:651c:545:b0:29b:9e76:6ca3 with SMTP id q5-20020a05651c054500b0029b9e766ca3mr2812781ljp.4.1679506038170; Wed, 22 Mar 2023 10:27:18 -0700 (PDT) Received: from ?IPV6:2a00:1370:8182:2677:3d56:cefd:fe23:69dd? ([2a00:1370:8182:2677:3d56:cefd:fe23:69dd]) by smtp.gmail.com with ESMTPSA id s26-20020a2e9c1a000000b00298dc945e9bsm2669910lji.125.2023.03.22.10.27.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Mar 2023 10:27:17 -0700 (PDT) Message-ID: <6cde43c8-3300-9269-7a8a-8ff6e8b1e287@gmail.com> Date: Wed, 22 Mar 2023 20:27:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: A new special orphan inode 12 in ext4 only? Content-Language: en-US To: Qu Wenruo , Ext4 , "linux-btrfs@vger.kernel.org" References: <4034e634-59d3-e9a5-a1c5-1f275d8e2832@gmx.com> From: Andrei Borzenkov In-Reply-To: <4034e634-59d3-e9a5-a1c5-1f275d8e2832@gmx.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 22.03.2023 12:09, Qu Wenruo wrote: > Hi, > > Recently I observed newer mkfs.ext4 seems to create a new orphan inode > 12, with some file extents. > > Which seems to have no direct parent directory, thus tools like > btrfs-convert would also follow the ext4 inodes by creating an orphan > inode too. > > On the other hand, if I go mkfs.ext3, the mysterious inode seems to be gone. > > Is this inode 12 a known special inode? This is orphan file. It is normal file; mke2fs creates first normal inode for lost+found (11) and if enabled creates orphan file next which gets next inode number (12). Inode number is recorded in superblock as s_orphan_file_num. /*27c*/ __le16 s_encoding; /* Filename charset encoding */ __le16 s_encoding_flags; /* Filename charset encoding flags */ __le32 s_orphan_file_inum; /* Inode for tracking orphan inodes */ > If so, how can we avoid such special inode? > (s_special_ino is still 11, thus checking against that value doesn't > seem to help). > > > Some details of btrfs-convert: > > It goes with ext2fs_open_inode_scan() to iterate all inodes of an ext4. > > And if we hit an directory inode, we iterate the directory by using > ext2fs_dir_iterate2() to insert the dir entries between parent and child > inodes. > > So if we hit an inode without any parent dir, an equivalent btrfs inode > would still be created, but btrfs-check would complain about such orphan > inode. > > Thanks, > Qu