Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp367204lqb; Tue, 16 Apr 2024 20:22:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJ2VRCrOGY8ZKXvTgfC2egFlLKl517UYs802gAwmc/UhNGjfXezHLA0s3nRMfEnN8k1AEl4tw6XVlqYin8iWmBhdGJJDEGYXftN8BKjw== X-Google-Smtp-Source: AGHT+IGlcK1NM8/4GbRSkqH6oq6oF8zMHw+k5OosqIjfBNH6vbQ5Z6HQJcS1BQp83QH4UaNSGmZQ X-Received: by 2002:a17:907:7208:b0:a51:a329:cd76 with SMTP id dr8-20020a170907720800b00a51a329cd76mr12109030ejc.13.1713324129626; Tue, 16 Apr 2024 20:22:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713324129; cv=pass; d=google.com; s=arc-20160816; b=l+WtwapzJV95xg+Vb7LC4k/cfg4jbzSq+DLP0ROGk+3KNOY8zhWSW0D006MRznIzVY h2DQb9iCF2jfzzTscA/coGbJ90x/GeS4wZDDkOc11cd1mulQ4iQpOY0DIta1qZQcoBcU lU7nHGPVY9VlW15W9kcFe8X9wdz2lH/zmC6WL9X+EJLOqAVjgK6l8YRxzd1ijccQtqOK LIFTY9WXYdYDQKWWaMZtklcR2Zc5+PMeXL/s0/AwG3Pr5rtKG+bj55Bvu59ciEicmZV/ G9XeI5ouEjQtIPCJ9l6uq4lCZ/ODImiQpjfNU9FqzesutQAiCB1RFO2EVvh69uFSQwMH 18OQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=E16eUmJZvGr3LUCQSM/RVro8CVGGUHbQbQfqvRY2Qa4=; fh=DHRxGEUg1r/bzSi92Och/Y1GKhwn80xsTK6z+nb/twY=; b=kBgL0jCVtTbgNAGnrxBIaagxSnJ4zE0T6Morl1/kwJWcilxDG7PgNiMWPNI4BNkM3k 2vFWQH43nm6ltubMzEYveKvRfBMA3d36rwYQRqKXNggaoo+jDEr7yC5MV7fp70uyMUsy /LIvIVu5OlSkWnRbGaFZZyRTCJuLlD0BczKMsSuBChDMFj0KgWx1mSZ5gIlodLGow0dI t3/eMSDAm+x3TcxYVtyEl8uJDIePhSX9tQp5laIfkbLSsZNG3jD0Le1bSD7XIN2R852q /OTtMI4tFS4F9Jh7mBgzOQt8BVuunVaKJbOjuNhXWGafXa0dge6ETM48SZN87PG1cZi4 ZQrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-147894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147894-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id mp29-20020a1709071b1d00b00a4e6138f12asi6215030ejc.810.2024.04.16.20.22.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 20:22:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-147894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147894-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 695051F2232F for ; Wed, 17 Apr 2024 03:22:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC6DC8BFC; Wed, 17 Apr 2024 03:21:59 +0000 (UTC) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A4A579C8; Wed, 17 Apr 2024 03:21:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713324119; cv=none; b=R6UjjzsWbFyd4IDpO7SBm7F/LdLrN+eiKeEXFrvpg3+BeF3/MJ5XFVDBv6EGV1oBgbeVltPgDtKtLgS2DtxidTXVsMVfuD1Dl/WICb3GKv6VK8YgbteK5GsCqvoRNyGb1L6JNQNYHV0a0a66ojnNaPrdPditnrRtm8WKs5aaTDk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713324119; c=relaxed/simple; bh=fLdlGO7j7XhUstcblOGfcv3EBSqQgQaMsoq7a/ba3Wo=; h=Message-ID:Date:MIME-Version:Subject:From:To:CC:References: In-Reply-To:Content-Type; b=SR0INQd0OtpeLDX8BMh6bbPABCNkoOOLrV7MinhGenyJbyGMLXXVVh+Aj5o51iAnj46PHkisHWSktZrLFV7Qw7Kw9FA5DUiTM02xnXp4IStyeU53ypvKua4mYR4nakWWElrOwtEUQ3YBkGrwYv+xfUrC4hp+ZKqQSJgXhfF0LAs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4VK5jF0Rtpz2Ccht; Wed, 17 Apr 2024 11:18:57 +0800 (CST) Received: from dggpeml500022.china.huawei.com (unknown [7.185.36.66]) by mail.maildlp.com (Postfix) with ESMTPS id DA4A61A0172; Wed, 17 Apr 2024 11:21:54 +0800 (CST) Received: from [10.67.111.104] (10.67.111.104) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 17 Apr 2024 11:21:54 +0800 Message-ID: <29d5ea19-21b5-4076-9acc-8286a050c33f@huawei.com> Date: Wed, 17 Apr 2024 11:21:54 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] bcachefs: Align the display format of `btrees/inodes/keys` Content-Language: en-US From: Hongbo Li To: Kent Overstreet , Youling Tang CC: , , Youling Tang References: <20240417015448.84294-1-youling.tang@linux.dev> <66ecea56-e4d3-4241-a1dc-378d70555321@linux.dev> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500022.china.huawei.com (7.185.36.66) On 2024/4/17 11:16, Hongbo Li wrote: > > > On 2024/4/17 10:59, Kent Overstreet wrote: >> On Wed, Apr 17, 2024 at 10:50:10AM +0800, Youling Tang wrote: >>> Hi, Kent >>> On 17/04/2024 10:20, Kent Overstreet wrote: >>>> On Wed, Apr 17, 2024 at 09:54:48AM +0800, Youling Tang wrote: >>>>> From: Youling Tang >>>>> >>>>> Before patch: >>>>> ``` >>>>>    #cat btrees/inodes/keys >>>>>    u64s 17 type inode_v3 0:4096:U32_MAX len 0 ver 0:   mode=40755 >>>>>      flags= (16300000) >>>>> ``` >>>>> >>>>> After patch: >>>>> ``` >>>>>    #cat btrees/inodes/keys >>>>>    u64s 17 type inode_v3 0:4096:U32_MAX len 0 ver 0: >>>>>      mode=40755 >>>>>      flags= (16300000) > The flags also with the space after "=". Is it reseonable? Sorry, I misspell. I mean whether it is reasonable. >>>> This would print a newline for keys that don't have a value... >>> The original intention was to make the display of the printed content in >>> '__bch2_inode_unpacked_to_text ()' consistent, without considering other >>> callbacks. >>> >>> Or just modify it in the following way? >> >> Yeah, that's better >> >> Do it off my master branch though, there's some printbuf imprevements in >> there. >> >> https://evilpiepirate.org/git/bcachefs.git >> >>> --- a/fs/bcachefs/inode.c >>> +++ b/fs/bcachefs/inode.c >>> @@ -534,6 +534,8 @@ int bch2_inode_v3_invalid(struct bch_fs *c, struct >>> bkey_s_c k, >>>   static void __bch2_inode_unpacked_to_text(struct printbuf *out, >>> struct bch_inode_unpacked *inode) >>>   { >>> +       prt_newline(out); >>> + >>>          printbuf_indent_add(out, 2); >>>          prt_printf(out, "mode=%o", inode->bi_mode); >>>          prt_newline(out); >>> >>> >>> Thanks, >>> Youling. >> >