Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754607AbdIGHne (ORCPT ); Thu, 7 Sep 2017 03:43:34 -0400 Received: from mout.gmx.net ([212.227.17.20]:50989 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754583AbdIGHnc (ORCPT ); Thu, 7 Sep 2017 03:43:32 -0400 Subject: Re: [PATCH 06/14] md/bcache: Use %pS printk format for direct addresses To: Coly Li Cc: linux-kernel@vger.kernel.org, Sergey Senozhatsky , Petr Mladek , Andrew Morton , linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org References: <1504729681-3504-1-git-send-email-deller@gmx.de> <1504729681-3504-7-git-send-email-deller@gmx.de> <29e5f2a8-c829-0aba-5b06-1501c98690a6@coly.li> From: Helge Deller Message-ID: <30e9400c-b95d-5720-f9a0-6086f08ecd4a@gmx.de> Date: Thu, 7 Sep 2017 09:42:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <29e5f2a8-c829-0aba-5b06-1501c98690a6@coly.li> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:eY6tQ6Nkx0Jv2FiNMgwSS5F3xryD2aoUiedNZpY+Jjgrm1mkCeO RSRLj6zDlwrCkTs0EMccIDdZlt+INCYvk3mvnC941pKUa9Gxrmpd9gj3VxWct3uUVyWr3jX po4wEUZxwtMu5U9dG95QNUtu6YL7Pw0rdF+hk31oPN+qmOgs72kVmSlcVg2QSQ1zGI3AlfM N1pidYL8YT74fFhv98VFw== X-UI-Out-Filterresults: notjunk:1;V01:K0:TasxefCaExY=:RyjkjyxjWP68drT8t54kYe pMWP8b3xp3QJ5ohz3PQ2wl3Ul1xMcN+BTNStsXIQI7or13S3Zx4SHxODIcnSKowAGQjifWQ3x 1geoX+RSsuHdhBo9iw6L0JDwvswgWZ1Cb4vW3VW293+TBnBaNPQ8vxPanXFi07TdrBpmZQHWV vDUuUvovMsfG5tLrKvxSZEQljjOE8w7mq9NNEt+E7Z4s2+o7GmYYMvpYDK7mqP6HATrK7WoqI ELvbNkvGNS9pDDL89W3CvZPuZBe6va9XL/ppS4Wu8o6ejp2ObYM32Eo1nMaAOq6FozULbLHkI m8XlWUegMMVp1kd9l4hsCvDw3eXDE6kK0DXwKNqJRGtpiMf38v+CuLIY+tZjpr8V8us3h4eUy 5g2+rqJphhkkfYrQxNTS/jPLaO8AlNPpc7jYzqTlCGd6XyQHbj5397WXG2h4x6Adn2neSdCX7 QkLfrK3krdOMjxJQihRVWr9E264cX66LJcYZmdxIR8Vwk8UlDjjsemZe4ZuhwK7h1HULYnaEk zk/WkZ15Ibu+KmOZ8wT2TdrC7fwl3CmA+kalIL6iLsZKkw5RCoWcNfDVfVVn6vP4T1b8D+XFB Fchk8KvYD+qoic6Rm8I3yqh9OQ7s7OXUdlQ9EIljOaSGblT23T3swr8Ea16wcw5MBXjwj6lTc XvK9WAVOGR9vTV0mJ08y/xPtGV9OriCi+kKSXDzKGYHQ1Pu4BEqMCTMREP171UnOw7/e/TNGm jk1sdsD2xVw8XwXBbxEDANoybXE8INkxhva3b4iqJKwIGDJ0B6kPWxlyH+pJ8z9ZPyEr2C63n SWIDYruCjlv+ywYJHNJHasVzVAbSd2w5HQH+n4W36xabhK0vOA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2066 Lines: 53 On 07.09.2017 06:50, Coly Li wrote: > On 2017/9/7 上午4:27, Helge Deller wrote: >> Use the %pS instead of the %pF printk format specifier for printing symbols >> from direct addresses. This is needed for the ia64, ppc64 and parisc64 >> architectures. >> >> Signed-off-by: Helge Deller >> Cc: linux-bcache@vger.kernel.org >> Cc: linux-raid@vger.kernel.org >> --- >> drivers/md/bcache/closure.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c >> index 864e673..0b0c9bc 100644 >> --- a/drivers/md/bcache/closure.c >> +++ b/drivers/md/bcache/closure.c >> @@ -175,7 +175,7 @@ static int debug_seq_show(struct seq_file *f, void *data) >> list_for_each_entry(cl, &closure_list, all) { >> int r = atomic_read(&cl->remaining); >> >> - seq_printf(f, "%p: %pF -> %pf p %p r %i ", >> + seq_printf(f, "%p: %pS -> %pf p %p r %i ", >> cl, (void *) cl->ip, cl->fn, cl->parent, >> r & CLOSURE_REMAINING_MASK); >> >> @@ -187,7 +187,7 @@ static int debug_seq_show(struct seq_file *f, void *data) >> r & CLOSURE_SLEEPING ? "Sl" : ""); >> >> if (r & CLOSURE_WAITING) >> - seq_printf(f, " W %pF\n", >> + seq_printf(f, " W %pS\n", >> (void *) cl->waiting_on); >> >> seq_printf(f, "\n"); >> > > It is unclear to me, that if %pF is used, on ia64/ppc64/parisc64 a > function descriptor conversion happens, what negative effect exactly > takes place ? On ia64/ppc64/parisc64 the kernel will crash here in the worst case, because vsprintf() will try to read a pointer from that address and resolve it. But you hand over a return address (_RET_IP_) which should be resolved directly to a symbol. For that you need to use the %pS specifier, which is what my patch does. The patch has no negative effect on any platform. Output will still be the same on x86/mips/arm/... as it has been before with %pF. The only positive effect of the patch is that the seq_printf will now show correct output on ia64/ppc64/parisc64 too. Helge