Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5044634pxj; Tue, 22 Jun 2021 13:54:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaqj2y/unRdwjnsYj2gRRuRysMAEDIdn9WN0JolGYiSTXSKGgG7urZCTZvwkmtQroC4tTD X-Received: by 2002:a17:906:8a72:: with SMTP id hy18mr5928046ejc.393.1624395246160; Tue, 22 Jun 2021 13:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624395246; cv=none; d=google.com; s=arc-20160816; b=OPwSmi+91ClDNWRzqCBvOn9+1CuhsOC3uvDRZ8pVkWjkWaXkY0+cSrGKTZZv8uE6Pk h+KgCsVPunBUoKs9ky0MWYrSxqMg8Dcu+iudB4kO5+TjaIRlsjEkHgArlToP8at/W4kS vPvbxcdIyo81bjqnNRTrLuSC8u/wLncBLcxKS6OmvQfFaFF/ETT9textCF7qUO7BKkrb +McHLWlGJUIrCdyWr0arGF9wiglT5oXfIg/uI3Zo96b9GtyrYcmPHJ3oljaW982t3RuU CjC4fjfzgkji8r11rD5EXE9OaZ0m7bBN277okBC/83sqJpZ8ysEA2LUrsA/FxjXiYaEc svJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=ZY3YaHE10SpvWGlFOYAiGNFzyBoBoxG7r17DT+vqrXQ=; b=MjBTSzXXLARQy/dDni/+kmkduugknCP+wTDgEK9azgIn+jpxHbpsoV4OSDKxbmA45Q vT+vofLd1RL6zl36SPYoh1WIqy+NKO13ljUDxE6aCiDa43hVR4b80TuQwHdydRMOtGHM 2Mvt0Qi5E4VJXRVpIQ4N8FaNKQr4M9KC8W9rGqPRL8K/aszuFer//YOsRNfyLdKLr2oq xaoq0G87203TkpXoxOFCLRbEZJX9MWuXBG2p4TUrmFfpA13n8ka0oGuxBwJ4GnJUvY9J KW7BL3wzFRQgTmhLMd+YbioJKjjgmMYgXr9GPk+QlwzjW11OjljwTcsh+4JURNF+FGnj ptWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Lkkzz8xg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si17159659ejk.224.2021.06.22.13.53.42; Tue, 22 Jun 2021 13:54:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Lkkzz8xg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbhFVUyQ (ORCPT + 99 others); Tue, 22 Jun 2021 16:54:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbhFVUyP (ORCPT ); Tue, 22 Jun 2021 16:54:15 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84577C06175F for ; Tue, 22 Jun 2021 13:51:59 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id s15so512671edt.13 for ; Tue, 22 Jun 2021 13:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZY3YaHE10SpvWGlFOYAiGNFzyBoBoxG7r17DT+vqrXQ=; b=Lkkzz8xgvR4WijuDgBCSmNfFcjiHP1ZaGCOPnAYe06FmobkuzmkXtqFUhxHgxT8y8a s1e8UekMvWi4xMuXwtVNTsCjRDv+ZvIcJ/sAUbcjE4pCaFOmcM2dvYClmlB/fadIxAUP ooLWq5/OVVj4Jl2ULqLpOazUlV7XgDMzD+j8w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZY3YaHE10SpvWGlFOYAiGNFzyBoBoxG7r17DT+vqrXQ=; b=svHQt3qwfHCAZsJfm4ecQq+w7TMPczbwgGhs/SCtJbEm7dvgaLl9Tf7Dw8FeOR+DKe QqI+80ZYTIOzFX8Ae89VvgPsmsmon4joEURaNvx5BxzbqpIZlPNmT/XaNmznqaoHM2Gh T+pSQjnCuutzx1koEhKyDoJXudtoDjoeNymhxBk4N3Sjb1ZWoK+83eGrN1pVsg7Vglh+ FpC1vqWQm/UTVQmgjQ9jCR7STKWZzybo8PuJcHSbX7wHM7z165MWg6yAc2BAtGokCoqJ 53Ddu+a1RXjwzbHhttlcPHvAlEs9M7ZsxIz4mYDY389/WHD/dgP6fnrBIsCCT/TL+/tg JpWw== X-Gm-Message-State: AOAM532AV00PY0xaxfNa+JJBfuV1KDn+h81ceGs53FrCpEKL28x+f9p6 oSJajBrs46yidfUsPSUDPA4MVxeO2nL+yQ== X-Received: by 2002:a05:6402:34c6:: with SMTP id w6mr7851532edc.174.1624395117905; Tue, 22 Jun 2021 13:51:57 -0700 (PDT) Received: from [192.168.1.149] ([80.208.64.110]) by smtp.gmail.com with ESMTPSA id g16sm6356357ejh.92.2021.06.22.13.51.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Jun 2021 13:51:57 -0700 (PDT) Subject: Re: [PATCH v5 4/4] lib/test_printf.c: add test cases for '%pD' To: Jia He , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Jonathan Corbet , Alexander Viro , Linus Torvalds Cc: "Peter Zijlstra (Intel)" , Eric Biggers , "Ahmed S. Darwish" , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Matthew Wilcox , Christoph Hellwig , nd@arm.com References: <20210622140634.2436-1-justin.he@arm.com> <20210622140634.2436-5-justin.he@arm.com> From: Rasmus Villemoes Message-ID: <03f59e85-bba3-2e2c-ebaa-48daa93d6fec@rasmusvillemoes.dk> Date: Tue, 22 Jun 2021 22:51:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210622140634.2436-5-justin.he@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/06/2021 16.06, Jia He wrote: > After the behaviour of specifier '%pD' is changed to print the full path > of struct file, the related test cases are also updated. > > Given the full path string of '%pD' is prepended from the end of the scratch > buffer, the check of "wrote beyond the nul-terminator" should be skipped > for '%pD'. > > Parameterize the new using_scratch_space in __test, do_test to skip the > test case mentioned above, I actually prefer the first suggestion of just having a file-global bool. If and when we get other checks that need to be done selectively [e.g. "snprintf into a too short buffer produces a prefix of the full string", which also came up during this discussion but was ultimately kept] depending on the % being exercised, we can add a "u32 nocheck" with a bunch of bits saying what to elide. Not insisting either way, just my $0.02. Rasmus