Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp357742lqb; Tue, 16 Apr 2024 19:50:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW+fCHIc2dVnhhQ4C71r0yGssq63ocwTit2EPDw43sH6bD1/7ESVZ4907xLKxn32mad9r8MBTMMy4VB0Jjq5Tz2UytmA9bVy12ROmiewQ== X-Google-Smtp-Source: AGHT+IF+IBaQnIz8x1toqguxTQR7Ip/VunZy8tB9hFSuDM8WbY8vPFh6qpNfMtSozBSigPF3SFc1 X-Received: by 2002:a05:6358:9793:b0:186:b3e5:abb2 with SMTP id f19-20020a056358979300b00186b3e5abb2mr11700095rwb.22.1713322251849; Tue, 16 Apr 2024 19:50:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713322251; cv=pass; d=google.com; s=arc-20160816; b=B9hWbhxSbm5LS4746uFxni7jFreX1GfyiykL3Mn2KyrmnW2uprF41rUVp3XX3ndOcz VKsIicEYXtIIbWDelWhvIGcWBanfkal53d8XgnVVpvrSLuYA9Uma4obPO4tHJrQ+h1rE Dju1HhIVlcdc2G9M9fM0Muszg8Q9BwbebFgzG4b8Br5AF3xY528WCgMUgC32UWpYodjq EfzMOaVBDYOXpbgM2JspWziC6H4R+zZ413hnTlwxCJlDfIlU9ajhvduNEDKcNOAPNbt4 tW5GspjfYWnq1thiJp/sTF4sthg36Wc1SrRuzcXxpzZV8lWpP2fffcRfZzVxP01IPNfW Z2Fw== 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=a/rtQZtLs/mz2eWV/Bg/16BoPls0vGnu3jMo7OCv9/g=; fh=uRRo/bsVkkMz4T1a2t0y0xSNbzWg22XBPvnHoLuz/8k=; b=R/LY53/jOtQfKeE496tSyJy2z9YCtlbPg9S39Euq5vrgcl9OAG3qeIJQiDxQlq+a1y NiFt+xOy0y14GNpqZdX+/mic0Nr8G+ucn0a+UmR0/08opn9wko9TAynth2YWwjpslEIg jIwjuYpwxdZStfO2ps+PpbcYbmQk1B8eUL9F3mbc+VOUox2tsIOUCOS1XYbNPvfIHnpA 4VMY1Y+OwfRFwVW+8hmdXcqv2jVizLOWzxOzY5Pr1LrVySuwE6jLhylOPe8IOtdEHxV4 cBZ9vRUrFT488j+t5V1x6aCeOL6FqwTVYKM9P7oWRgjutuMLPwk2nP9mBWogSBgGrPgQ 4LMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LA57phaG; 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-147867-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147867-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p14-20020a05622a00ce00b00437661568e6si961656qtw.161.2024.04.16.19.50.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 19:50:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147867-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LA57phaG; 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-147867-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147867-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8C0C21C20ACA for ; Wed, 17 Apr 2024 02:50:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECB246FBF; Wed, 17 Apr 2024 02:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="LA57phaG" Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (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 CED8E187F for ; Wed, 17 Apr 2024 02:50:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713322245; cv=none; b=evn8SFpI+9mfrZQY5A8Hwr3HAe0lQFzbZ+HQ+P5wvoEICqXogv9UTJ46exbkDO6FZc/iqDL0GoQm2mvFCuokTQigBCffbaJDXayPVMfpq4/LEaB3ga0lm33lStu5aVOXocRVCZKLRuhCtlY1pwaf0IJA/09VkZqqLqqDdja2whQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713322245; c=relaxed/simple; bh=/FDO3Uw9+p8ydkHOVunFPN9wYZTRJmeTTdMPpt00iKw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KNkXMGFq++jhvhHyDhuMSZxc4Gk7alK1fHuYp2DesjD/Z20QZ9YLWC4U31DF19VYS+zrkS28ORzYQlj61GDHJg4+qTa3QSqG0D6n9fe1h/inJxP5Trihey5xTIOrIh141GHX94dJ1nsCD+lf267oPNVirjqpWEraX6QcOPQWrJQ= 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=LA57phaG; arc=none smtp.client-ip=95.215.58.187 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: <66ecea56-e4d3-4241-a1dc-378d70555321@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713322240; 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=a/rtQZtLs/mz2eWV/Bg/16BoPls0vGnu3jMo7OCv9/g=; b=LA57phaG9cFvsxw3USySWeg4HYSn9eWdLVuJ1mszLR880/JyyNEt5h+5hPE6Me34Qqh19u Fac801LkcsF623K4yvXzi7yw9LoWNA3U258CUKSDGNDYb+aAUqy1tDPkBMFDPcUoxMvRr9 WJqt/xQjGc9EypiYyhhDlhdn9fdHkPQ= Date: Wed, 17 Apr 2024 10:50:10 +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: linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org, Youling Tang References: <20240417015448.84294-1-youling.tang@linux.dev> 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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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) > 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? --- 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.