Message ID | 20210428135929.27011-1-justin.he@arm.com |
---|---|
State | New |
Headers | show |
Series | [1/4] iwlwifi: mvm: Explicitly use %pd1 in debugfs entry | expand |
On Wed, Apr 28, 2021 at 5:56 PM Jia He <justin.he@arm.com> wrote: > > From: Linus Torvalds <torvalds@linux-foundation.org> Hmm... Okay. > We have '%pD'(no digit following) for printing a filename. It may not be > perfect (by default it only prints one component. > > %pD4 should be more than good enough, but we should make plain "%pD" mean > "as much of the path that is reasonable" rather than "as few components as > possible" (ie 1). Sorry, but from above I didn't get why. The commit message tells only about %pD, but patch changes behaviour of the ~100 or so users of "%pd" without any explanation. Besides that the patch is prepended only by one change (which is also not related to %pD), while we have ~30 users which behaviour got changed.
On Thu, Apr 29, 2021 at 11:47 AM Petr Mladek <pmladek@suse.com> wrote: > > On Wed 2021-04-28 21:59:27, Jia He wrote: > > From: Linus Torvalds <torvalds@linux-foundation.org> > > > > We have '%pD'(no digit following) for printing a filename. It may not be > > perfect (by default it only prints one component. > > > > %pD4 should be more than good enough, but we should make plain "%pD" mean > > "as much of the path that is reasonable" rather than "as few components as > > possible" (ie 1). > > Could you please provide link to the discussion where this idea was > came from? https://lore.kernel.org/lkml/20210427025805.GD3122264@magnolia/
On Thu 2021-04-29 11:52:49, Andy Shevchenko wrote: > On Thu, Apr 29, 2021 at 11:47 AM Petr Mladek <pmladek@suse.com> wrote: > > > > On Wed 2021-04-28 21:59:27, Jia He wrote: > > > From: Linus Torvalds <torvalds@linux-foundation.org> > > > > > > We have '%pD'(no digit following) for printing a filename. It may not be > > > perfect (by default it only prints one component. > > > > > > %pD4 should be more than good enough, but we should make plain "%pD" mean > > > "as much of the path that is reasonable" rather than "as few components as > > > possible" (ie 1). > > > > Could you please provide link to the discussion where this idea was > > came from? > > https://lore.kernel.org/lkml/20210427025805.GD3122264@magnolia/ Thanks for the link. I see that it was not clear whether the patch was good for %pd behavior. Linus actually suggests to keep %pd behavior as it was before, see https://lore.kernel.org/lkml/CAHk-=wimsMqGdzik187YWLb-ru+iktb4MYbMQG1rnZ81dXYFVg@mail.gmail.com/ Well, I think that this is up to the file system developers to decide. I am not sure if the path would do more harm than good, or vice versa, for dentry names. Best Regards, Petr
Hi > -----Original Message----- > From: Petr Mladek <pmladek@suse.com> > Sent: Thursday, April 29, 2021 5:25 PM > To: Andy Shevchenko <andy.shevchenko@gmail.com> > Cc: Justin He <Justin.He@arm.com>; Linus Torvalds <torvalds@linux- > foundation.org>; Steven Rostedt <rostedt@goodmis.org>; Sergey Senozhatsky > <senozhatsky@chromium.org>; Andy Shevchenko > <andriy.shevchenko@linux.intel.com>; Rasmus Villemoes > <linux@rasmusvillemoes.dk>; Jonathan Corbet <corbet@lwn.net>; Luca Coelho > <luciano.coelho@intel.com>; Kalle Valo <kvalo@codeaurora.org>; David S. > Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Heiko > Carstens <hca@linux.ibm.com>; Vasily Gorbik <gor@linux.ibm.com>; Christian > Borntraeger <borntraeger@de.ibm.com>; Johannes Berg > <johannes.berg@intel.com>; Linux Documentation List <linux- > doc@vger.kernel.org>; Linux Kernel Mailing List <linux- > kernel@vger.kernel.org>; open list:TI WILINK WIRELES... <linux- > wireless@vger.kernel.org>; netdev <netdev@vger.kernel.org>; linux- > s390@vger.kernel.org > Subject: Re: [PATCH 2/4] lib/vsprintf.c: Make %p{D,d} mean as much > components as possible > > On Thu 2021-04-29 11:52:49, Andy Shevchenko wrote: > > On Thu, Apr 29, 2021 at 11:47 AM Petr Mladek <pmladek@suse.com> wrote: > > > > > > On Wed 2021-04-28 21:59:27, Jia He wrote: > > > > From: Linus Torvalds <torvalds@linux-foundation.org> > > > > > > > > We have '%pD'(no digit following) for printing a filename. It may not > be > > > > perfect (by default it only prints one component. > > > > > > > > %pD4 should be more than good enough, but we should make plain "%pD" > mean > > > > "as much of the path that is reasonable" rather than "as few > components as > > > > possible" (ie 1). > > > > > > Could you please provide link to the discussion where this idea was > > > came from? > > > > https://lore.kernel.org/lkml/20210427025805.GD3122264@magnolia/ > > Thanks for the link. I see that it was not clear whether the patch > was good for %pd behavior. > > Linus actually suggests to keep %pd behavior as it was before, see > https://lore.kernel.org/lkml/CAHk-=wimsMqGdzik187YWLb- > ru+iktb4MYbMQG1rnZ81dXYFVg@mail.gmail.com/ Okay, let me keep the default %pd behavior as before('%pd' is '%pd1') and change the behavior of %pD ('%pD' is '%pD4') -- Cheers, Justin (Jia He) > > Well, I think that this is up to the file system developers to decide. > I am not sure if the path would do more harm than good, > or vice versa, for dentry names. > > Best Regards, > Petr IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c index 38d0bfb649cc..41ccbb4286c2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c @@ -752,7 +752,7 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) * find * netdev:wlan0 -> ../../../ieee80211/phy0/netdev:wlan0/iwlmvm/ */ - snprintf(buf, 100, "../../../%pd3/%pd", + snprintf(buf, 100, "../../../%pd3/%pd1", dbgfs_dir, mvmvif->dbgfs_dir);
'%pd'(no digit following) will mean to print last 4 components of file dentry. Hence explicitly use %pd1 instead. Signed-off-by: Jia He <justin.he@arm.com> --- drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)