Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp411598lqb; Tue, 16 Apr 2024 22:52:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/n4Q6w7p6hg92UqYyPAoCQ6IsFlOHrn+4iQ9tf3WLlphGYx1jjSgyGlkFM4JSP9pbHesKJ8HymBLx5/AEbDtpxm7vId7f12kZsxaNzQ== X-Google-Smtp-Source: AGHT+IH5axPUdU6FhmeG0KIMX/sHwrCOhEUCDAR1o4MgF5s+MDlVbriPoVCg8XdvuRarpXLx1uBN X-Received: by 2002:a05:6870:c154:b0:234:56c5:9fa5 with SMTP id g20-20020a056870c15400b0023456c59fa5mr11592903oad.57.1713333162721; Tue, 16 Apr 2024 22:52:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713333162; cv=pass; d=google.com; s=arc-20160816; b=yJHyfJ+BOJw2gfasD9gHUrFUZhgfhrmUXcqsC9+cxIUI9YdO9JDIHeQBDSDnfoTRg3 Poa8iruyyWS6bgv7Ng257BJ7nmcrU17UwSFxAqcedvcBx/49tzVh4tPVLf8qx5us+Tpk LaD/P5p56YOUKoebtFi7PTnNWYOUSpGz/IKO4ft8RoJqKrnD0yD0BK8gN1PpUzOLJMsN n24yNmTEWrb7W2Y+e8IZ/I9vZEUz3myy4BMxON5fDBbQDQa7wb4Y4r2pL5szS7ep/gFc mk/RPAxuhrk1FVaArF3vp60ilvkL39e48VAqyiVUtuScW1A9fYOYDJuFJB6ofajgoc/M +UeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=J2Dby/WRTliM9FBH5twXlHiebzbOlY7PIwOVs26Z0d0=; fh=aE4cEAUa/EWT+RWDRhU10/mdVcgwvWFzBrn9YOWUgU8=; b=ggTx4C52Kt3tLDGWw16f+cdYyOhj3Fi9JzmdKb4HfuO03QVJP+EBiW7XRqsNWbLHZP k8reJvhdXel+IPPT3yE0zq3ZPEyLLSJysd23t0VWneOEyOatO8l1UFuG4MWWnjZQu+d7 M26J3LvEqxZzfYbieAUn0r8z75/lwuGQEgTul8fNLaxVzJeafMyMIyKnGTOyVIIXAlVH 7d4DYVCM9aMltL+7/8OAyzKtd4/tqcqFwD3kPvbxj3j+mUPoGcqFyrULynNdiKJzPah1 C4UAOCO7SME8TcHVRLVt7ERwXVC11U4Gq5MOsAsjgMPYjnK2eoll2riLpD99DzzCzqE9 PVtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Geqoz+z6; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-147969-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p12-20020aa7860c000000b006e6857da47asi10885426pfn.366.2024.04.16.22.52.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 22:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147969-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Geqoz+z6; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-147969-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CC1B4B22340 for ; Wed, 17 Apr 2024 05:52:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A44515338D; Wed, 17 Apr 2024 05:51:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Geqoz+z6" Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 624C652F6A for ; Wed, 17 Apr 2024 05:51:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713333116; cv=none; b=dyv2jYhUkT2VUHg1SEbsYO77V9j7KfGsa7mRIOCd4ykamVdZvHOstUPnK4sIAtjwbQuSHRK6HCkr9zRrVL4P5wIF7NNDxU84NIef/gAC+FRNb99WNCMbhky3fHzuq1mns4r8GDim6F8zQxJSB+awTWmUthQd97AxuaggfQDQ+kk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713333116; c=relaxed/simple; bh=w7HryCv2MkFLy3CMuRvGthJHQXfYUYmVwkRRMXWvh3w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WhBLcIlgdQm1/ffGMWHLUjgwrZx8AQlOD1LfF55o9wgs38NrI0pMBjHdrAPSsTYotBbFSGob3yKjVmeH1v/rhrKr3xyV3AeTEbOqYXMVMzSe9LG8nXPVmgIcqC201wnr7P+HA0rQeIMwP0gieBz6ypazElMIR0rF+VC/4OPW/Vk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Geqoz+z6; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <63d9540f-61bc-4eba-819c-c05d2e486bdb@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713333111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J2Dby/WRTliM9FBH5twXlHiebzbOlY7PIwOVs26Z0d0=; b=Geqoz+z6jqUXVuY2jrltHv4ffLMCgMmQ5/OMLSqlm9R29FRjsuVrVOk8debuq6epazkYIF kNWWCF2RSkhdmQjMptPX4z8XOuIRuHQaKCGs1mZYANfT6ZE6A32ckgCjrlxdnVNWieugbm GyMhxz+TukJmLpRd4GGzCu6ZXDVY2ug= Date: Wed, 17 Apr 2024 13:51:21 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] bcachefs: Align the display format of `btrees/inodes/keys` To: Kent Overstreet Cc: Hongbo Li , linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org, Youling Tang References: <20240417015448.84294-1-youling.tang@linux.dev> <66ecea56-e4d3-4241-a1dc-378d70555321@linux.dev> <29d5ea19-21b5-4076-9acc-8286a050c33f@huawei.com> Content-Language: en-US, en-AU X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Youling Tang In-Reply-To: <29d5ea19-21b5-4076-9acc-8286a050c33f@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Hi, Kent & Hongbo On 17/04/2024 11:21, Hongbo Li wrote: > > > 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 I will make the following changes based on the master branch, --- a/fs/bcachefs/inode.c +++ b/fs/bcachefs/inode.c @@ -534,12 +534,13 @@ 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_printf(out, "\n");         printbuf_indent_add(out, 2);         prt_printf(out, "mode=%o\n", inode->bi_mode);         prt_str(out, "flags=");         prt_bitflags(out, bch2_inode_flag_strs, inode->bi_flags & ((1U << 20) - 1)); -       prt_printf(out, " (%x)\n", inode->bi_flags); +       prt_printf(out, "(%x)\n", inode->bi_flags); >>> >>>> --- 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. >>> >>