Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1733687

Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier usages

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier usages
Date 2017-09-18 09:10 +0200
Message-ID <uqYlP-2Ut-3@gated-at.bofh.it> (permalink)
References (5 earlier) <upxnI-2uK-21@gated-at.bofh.it> <upxQJ-2Ek-3@gated-at.bofh.it> <upyD8-3bN-21@gated-at.bofh.it> <upyWt-3iw-7@gated-at.bofh.it> <upESe-7ea-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On (09/14/17 16:01), Luck, Tony wrote:
> 
> > let's hear from ia64 and ppc64 guys.
> 
> If you write a patch, I can try it on some ia64 h/w.
> 
> Please include some test cases (perhaps as a second patch that adds a few good/bad %pF and %pS
> to some code (both in base kernel, and in a module).

Hello,

I sent out an RFC patch set.


would the following test case work for you?

kernel)

   echo 1 > /proc/sys/vm/drop_caches

module)

   modprobe zram
   echo 100M > /sys/block/zram0/disksize


---

 drivers/block/zram/zram_drv.c | 15 +++++++++++++++
 fs/drop_caches.c              | 11 +++++++++++
 2 files changed, 26 insertions(+)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 2981c27d3aae..ac92aaeaced0 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1508,6 +1508,12 @@ static int zram_add(void)
 	struct request_queue *queue;
 	int ret, device_id;
 
+	printk("printk#13 %pF\n", (void *)_RET_IP_);
+	printk("printk#14 %pS\n", (void *)_RET_IP_);
+
+	printk("printk#15 %pF\n", __builtin_return_address(0));
+	printk("printk#16 %pS\n", __builtin_return_address(0));
+
 	zram = kzalloc(sizeof(struct zram), GFP_KERNEL);
 	if (!zram)
 		return -ENOMEM;
@@ -1730,6 +1736,15 @@ static int __init zram_init(void)
 {
 	int ret;
 
+	printk("printk#7 %pF\n", zram_init);
+	printk("printk#8 %pS\n", zram_init);
+
+	printk("printk#9 %pF\n", (void *)_RET_IP_);
+	printk("printk#10 %pS\n", (void *)_RET_IP_);
+
+	printk("printk#11 %pF\n", __builtin_return_address(0));
+	printk("printk#12 %pS\n", __builtin_return_address(0));
+
 	ret = cpuhp_setup_state_multi(CPUHP_ZCOMP_PREPARE, "block/zram:prepare",
 				      zcomp_cpu_up_prepare, zcomp_cpu_dead);
 	if (ret < 0)
diff --git a/fs/drop_caches.c b/fs/drop_caches.c
index d72d52b90433..3db4adcac78d 100644
--- a/fs/drop_caches.c
+++ b/fs/drop_caches.c
@@ -39,11 +39,22 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused)
 	iput(toput_inode);
 }
 
+#include <linux/sched.h>
+
 int drop_caches_sysctl_handler(struct ctl_table *table, int write,
 	void __user *buffer, size_t *length, loff_t *ppos)
 {
 	int ret;
 
+	printk("printk#1 %pF\n", schedule_timeout);
+	printk("printk#2 %pS\n", schedule_timeout);
+
+	printk("printk#3 %pF\n", (void *)_RET_IP_);
+	printk("printk#4 %pS\n", (void *)_RET_IP_);
+
+	printk("printk#5 %pF\n", __builtin_return_address(0));
+	printk("printk#6 %pS\n", __builtin_return_address(0));
+
 	ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
 	if (ret)
 		return ret;
 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier  usages Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-09-14 09:50 +0200
  Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier  usages Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-09-14 10:10 +0200
    Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier  usages Helge Deller <deller@gmx.de> - 2017-09-14 10:40 +0200
      Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier  usages Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-09-14 11:30 +0200
        Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier  usages Helge Deller <deller@gmx.de> - 2017-09-14 11:50 +0200
          RE: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier  usages "Luck, Tony" <tony.luck@intel.com> - 2017-09-14 18:10 +0200
            Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier  usages Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-09-18 09:10 +0200

csiph-web