Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp100600pxv; Thu, 24 Jun 2021 03:51:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEtkFUkJE/w4Xx4439wRi9XWb3MNxXBkR4rrTQ5LASTwQMRfdg1wZLYTZCH3GMMs2OHckm X-Received: by 2002:a5d:85c1:: with SMTP id e1mr3531117ios.18.1624531903533; Thu, 24 Jun 2021 03:51:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624531903; cv=none; d=google.com; s=arc-20160816; b=tXOoyopk7SEPihGKSb/IkPEvHmDEPdTHEZ6iVerv0j47o3+LIrj6WhujV/lLKYuR/k woL0nmmw6r8cFbwMVww4QNGLvvyjaPsBmBr/L7AEN3ZM4N61jjI27pfIMHxGVG0nk8jc DD4QyN8SK5/p3e8TG7/nJOHZHOSwn3z8ad/Z9vbsP0hKmuHdkC334BUtEiJrzc99GyDr rDUt6isDYBDXH0Q4i9emQvnS+9WTKuqOQ6Qg0wVqudjASdNYfTHr14MLWDyio27psx0g soOZYVGWj83rf++WdnjsFD8oWzMTRMtpt0eAF76fcMNQCL8Mmb1m/XgbZavQY6CcAK33 Z8ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=SKVSJf7/dV1Y3jFMycrYafjHl3UDp7OvgHWxbcm1aQs=; b=v81G2nJ8DvIHt/tGMZuUv7NTop5mojcE5xtT55hqpTy7JkHZjwMCTNMcXGV7YsBkIk QTyd1YGz52CTg1jgfFCMg7ql9y6ru54D/X8EiEtqivs316ZAJXT8pqm4FBsTjNlLETHu TM24x0hYy5Lp4Yl1rBK5TN76kuh3wGwIUJjx6NJadmH4gqjUhEPyeRGxonfpCLSu8D4W E6eWBrRRj6UUjRPjYCPNdJEEO98l/Zbmg+E1s21fdLBfpZ9/7jV87TyJzA9LvnoDiU49 4klGLGnvIdP86hpbjZPGrmuD/9BtZhV0mirnKaA39Ac/B4UJ6dDi9488Eku/+Xc6uLUj PLMg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si1949272ioq.84.2021.06.24.03.51.29; Thu, 24 Jun 2021 03:51:43 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232290AbhFXKwI (ORCPT + 99 others); Thu, 24 Jun 2021 06:52:08 -0400 Received: from mga11.intel.com ([192.55.52.93]:35377 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232191AbhFXKwI (ORCPT ); Thu, 24 Jun 2021 06:52:08 -0400 IronPort-SDR: w2IF1V6UF0o+iSWS7neQO8zQEvB9dSUnXtYcNzNYMfrlpEuOAXX/UHtdqi1rcc0T+04gJTGNp1 y8gBkbtQoMxw== X-IronPort-AV: E=McAfee;i="6200,9189,10024"; a="204438803" X-IronPort-AV: E=Sophos;i="5.83,296,1616482800"; d="scan'208";a="204438803" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2021 03:49:49 -0700 IronPort-SDR: bloUs6MTuopNNLA1Xl4hUG6pB2P7g9WQuQTLWQKu4SZmVZ3c4WP5g+1xC3v1QQDtzb2ljbVg9o IHTrS/tto6Ug== X-IronPort-AV: E=Sophos;i="5.83,296,1616482800"; d="scan'208";a="487710028" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2021 03:49:43 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1lwMvT-004yd4-Bm; Thu, 24 Jun 2021 13:49:39 +0300 Date: Thu, 24 Jun 2021 13:49:39 +0300 From: Andy Shevchenko To: Petr Mladek Cc: Jia He , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , Jonathan Corbet , Alexander Viro , Linus Torvalds , "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 Subject: Re: [PATCH v2 2/4] lib/vsprintf.c: make '%pD' print the full path of file Message-ID: References: <20210623055011.22916-1-justin.he@arm.com> <20210623055011.22916-3-justin.he@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 24, 2021 at 11:01:31AM +0200, Petr Mladek wrote: > On Wed 2021-06-23 13:50:09, Jia He wrote: ... > > If someone invokes snprintf() with small but positive space, > > prepend_name_with_len() moves or truncates the string partially. > > Does this comment belong to the 1st patch? > prepend_name_with_len() is not called in this patch. > > > More > > than that, kasprintf() will pass NULL @buf and @end as the parameters, > > and @end - @buf can be negative in some case. Hence make it return at > > the very beginning with false in these cases. > > Same here. file_d_path_name() does not return bool. It was my (apparently unclear) suggestion either to move it here, or be rewritten in generic way as you suggested in the other thread. -- With Best Regards, Andy Shevchenko