linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the aio tree
@ 2016-01-12  5:40 Stephen Rothwell
  2016-01-12 16:38 ` Benjamin LaHaise
                   ` (2 more replies)
  0 siblings, 3 replies; 42+ messages in thread
From: Stephen Rothwell @ 2016-01-12  5:40 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: linux-next, linux-kernel

Hi Benjamin,

After merging the aio tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:

fs/built-in.o: In function `aio_thread_op_foo_at':
file.c:(.text+0x43808): undefined reference to `__get_user_bad'
file.c:(.text+0x43838): undefined reference to `__get_user_bad'

Caused by commit

  150a0b4905f1 ("aio: add support for async openat()")

I have used the aio tree from next-20160111 for today.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

^ permalink raw reply	[flat|nested] 42+ messages in thread
* linux-next: build failure after merge of the aio tree
@ 2016-03-15  6:46 Stephen Rothwell
  2016-03-15 14:38 ` Andy Shevchenko
  2016-03-15 16:19 ` Sudip Mukherjee
  0 siblings, 2 replies; 42+ messages in thread
From: Stephen Rothwell @ 2016-03-15  6:46 UTC (permalink / raw)
  To: Benjamin LaHaise
  Cc: linux-next, linux-kernel, Michael Ellerman,
	Benjamin Herrenschmidt, linuxppc-dev, Al Viro, Christoph Hellwig

Hi Benjamin,

After merging the aio tree, today's linux-next build (powerpc
ppc44x_defconfig) failed like this:

fs/built-in.o: In function `aio_thread_op_foo_at':
aio.c:(.text+0x4dab4): undefined reference to `__get_user_bad'
aio.c:(.text+0x4daec): undefined reference to `__get_user_bad'

Caused by commit

  150a0b4905f1 ("aio: add support for async openat()")

despite commit

  d2f7a973e11e ("aio: don't use __get_user() for 64 bit values")

This is due to a bug in the powerpc __get_user_check() macro (the return
value is defined to be "unsigned long" which is only 32 bits on a 32
bit platform).

I applied the patch below which seems to help (Michael, what do you
think?), but given Al's and Christoph's reactions, I am inclined to
remove the aio tree from tomorrow and maybe it can be revisited after
the merge window.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 15 Mar 2016 16:36:06 +1100
Subject: [PATCH] powerpc: fix get_user for 64 bit typs on 32 bit platforms

solution borrowed from the x86 uaccess.h

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/include/asm/uaccess.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h
index b7c20f0b8fbe..52262b2f37fc 100644
--- a/arch/powerpc/include/asm/uaccess.h
+++ b/arch/powerpc/include/asm/uaccess.h
@@ -261,10 +261,13 @@ do {								\
 	}							\
 } while (0)
 
+#define __inttype(x) \
+	__typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
+
 #define __get_user_nocheck(x, ptr, size)			\
 ({								\
 	long __gu_err;						\
-	unsigned long __gu_val;					\
+	__inttype(*(ptr)) __gu_val;				\
 	__typeof__(*(ptr)) __user *__gu_addr = (ptr);	\
 	__chk_user_ptr(ptr);					\
 	if (!is_kernel_addr((unsigned long)__gu_addr))		\
@@ -277,7 +280,7 @@ do {								\
 #define __get_user_check(x, ptr, size)					\
 ({									\
 	long __gu_err = -EFAULT;					\
-	unsigned long  __gu_val = 0;					\
+	__inttype(*(ptr)) __gu_val = 0;				\
 	__typeof__(*(ptr)) __user *__gu_addr = (ptr);		\
 	might_fault();							\
 	if (access_ok(VERIFY_READ, __gu_addr, (size)))			\
@@ -289,7 +292,7 @@ do {								\
 #define __get_user_nosleep(x, ptr, size)			\
 ({								\
 	long __gu_err;						\
-	unsigned long __gu_val;					\
+	__inttype(*(ptr)) __gu_val;				\
 	__typeof__(*(ptr)) __user *__gu_addr = (ptr);	\
 	__chk_user_ptr(ptr);					\
 	__get_user_size(__gu_val, __gu_addr, (size), __gu_err);	\
-- 
2.7.0

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply related	[flat|nested] 42+ messages in thread
* linux-next: build failure after merge of the aio tree
@ 2013-08-30  7:55 Stephen Rothwell
  2013-08-30 14:26 ` Benjamin LaHaise
  2013-08-30 17:38 ` Linus Torvalds
  0 siblings, 2 replies; 42+ messages in thread
From: Stephen Rothwell @ 2013-08-30  7:55 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: linux-next, linux-kernel, Waiman Long, Linus

[-- Attachment #1: Type: text/plain, Size: 1765 bytes --]

Hi Benjamin,

After merging the aio tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

In file included from include/linux/kernel.h:13:0,
                 from fs/aio.c:13:
fs/aio.c: In function 'aio_free_ring':
fs/aio.c:188:32: error: 'struct dentry' has no member named 'd_count'
    aio_ring_file->f_path.dentry->d_count,
                                ^
include/linux/printk.h:246:38: note: in definition of macro 'pr_debug'
  no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
                                      ^

Caused by commit 36bc08cc0170 ("s/aio: Add support to aio ring pages
migration") interacting with commit 98474236f72e ("vfs: make the dentry
cache use the lockref infrastructure") from Linus' tree.

I applied the following (probably suboptimal) fix and can carry it as
necessary.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 30 Aug 2013 17:49:10 +1000
Subject: [PATCH] aio: fixup for lockref changes

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 fs/aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/aio.c b/fs/aio.c
index 9f783e3..6d00cd9 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -185,7 +185,7 @@ static void aio_free_ring(struct kioctx *ctx)
 		truncate_setsize(aio_ring_file->f_inode, 0);
 		pr_debug("pid(%d) i_nlink=%u d_count=%d d_unhashed=%d i_count=%d\n",
 			current->pid, aio_ring_file->f_inode->i_nlink,
-			aio_ring_file->f_path.dentry->d_count,
+			aio_ring_file->f_path.dentry->d_lockref.count,
 			d_unhashed(aio_ring_file->f_path.dentry),
 			atomic_read(&aio_ring_file->f_inode->i_count));
 		fput(aio_ring_file);
-- 
1.8.4.rc3

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 42+ messages in thread
* linux-next: build failure after merge of the aio tree
@ 2013-08-21  7:45 Stephen Rothwell
  2013-08-21 15:52 ` Dave Kleikamp
  0 siblings, 1 reply; 42+ messages in thread
From: Stephen Rothwell @ 2013-08-21  7:45 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: linux-next, linux-kernel, Dave Kleikamp

[-- Attachment #1: Type: text/plain, Size: 2157 bytes --]

Hi Benjamin,

After merging the aio tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

fs/aio.c: In function 'aio_kernel_init_rw':
fs/aio.c:1359:6: error: 'struct kiocb' has no member named 'ki_left'
  iocb->ki_left = nr;
      ^
fs/aio.c: In function 'aio_kernel_submit':
fs/aio.c:1394:6: error: 'struct kiocb' has no member named 'ki_opcode'
  iocb->ki_opcode = op;
      ^
fs/aio.c:1395:6: error: 'struct kiocb' has no member named 'ki_buf'
  iocb->ki_buf = (char __user *)(unsigned long)ptr;
      ^
fs/aio.c:1398:2: error: too few arguments to function 'aio_run_iocb'
  ret = aio_run_iocb(iocb, 0);
  ^
fs/aio.c:1217:16: note: declared here
 static ssize_t aio_run_iocb(struct kiocb *req, unsigned opcode,
                ^

Caused by commit af9fa2024c38 ("aio: add aio_kernel_() interface") from
the aio-direct tree interacting with commit 8bc92afcf7f5 ("aio: Kill
unneeded kiocb members") from the aio tree.

I applied the following merge fix patch (and I can carry it as necessary
- thanks, Dave, for the hint patches):

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 21 Aug 2013 17:42:14 +1000
Subject: [PATCH] aio: semantic fixup

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 fs/aio.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 39fb7b0..59b46cd 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1356,7 +1356,6 @@ void aio_kernel_init_rw(struct kiocb *iocb, struct file *filp,
 			size_t nr, loff_t off)
 {
 	iocb->ki_filp = filp;
-	iocb->ki_left = nr;
 	iocb->ki_nbytes = nr;
 	iocb->ki_pos = off;
 	iocb->ki_ctx = (void *)-1;
@@ -1391,11 +1390,7 @@ int aio_kernel_submit(struct kiocb *iocb, unsigned short op, void *ptr)
 	BUG_ON(!iocb->ki_obj.complete);
 	BUG_ON(!iocb->ki_filp);
 
-	iocb->ki_opcode = op;
-	iocb->ki_buf = (char __user *)(unsigned long)ptr;
-	iocb->ki_iter = ptr;
-
-	ret = aio_run_iocb(iocb, 0);
+	ret = aio_run_iocb(iocb, op, ptr, 0);
 
 	if (ret)
 		aio_kernel_free(iocb);
-- 
1.8.4.rc3

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2016-03-16 14:07 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-12  5:40 linux-next: build failure after merge of the aio tree Stephen Rothwell
2016-01-12 16:38 ` Benjamin LaHaise
2016-01-27  2:40   ` Stephen Rothwell
2016-01-29 11:30     ` Russell King - ARM Linux
2016-01-29 12:03       ` Geert Uytterhoeven
2016-02-04  2:19         ` Stephen Rothwell
2016-02-04 13:41           ` Benjamin LaHaise
2016-02-04 13:50             ` Russell King - ARM Linux
2016-02-04 14:08               ` Benjamin LaHaise
2016-02-04 14:12                 ` Russell King - ARM Linux
2016-02-04 14:32                   ` Benjamin LaHaise
2016-02-04 14:39                     ` Russell King - ARM Linux
2016-02-04 16:01                       ` Benjamin LaHaise
2016-02-04 16:17                         ` Russell King - ARM Linux
2016-02-04 16:27                           ` Benjamin LaHaise
2016-02-04 16:47                           ` Benjamin LaHaise
2016-02-04 18:48                           ` Benjamin LaHaise
2016-01-15  2:24 ` Stephen Rothwell
2016-01-15  7:39 ` Christoph Hellwig
2016-01-15  9:23   ` Stephen Rothwell
2016-01-15  9:25     ` Christoph Hellwig
2016-01-15 15:18       ` Benjamin LaHaise
2016-01-15 22:55         ` Stephen Rothwell
2016-03-14  4:49           ` Stephen Rothwell
2016-03-14 17:08             ` Benjamin LaHaise
2016-03-14 20:41               ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2016-03-15  6:46 Stephen Rothwell
2016-03-15 14:38 ` Andy Shevchenko
2016-03-15 16:42   ` Arnd Bergmann
2016-03-15 16:19 ` Sudip Mukherjee
2016-03-15 16:22   ` Benjamin LaHaise
2016-03-15 22:02     ` Arnd Bergmann
2016-03-16 11:12       ` Andy Shevchenko
2016-03-16 13:59         ` Arnd Bergmann
2016-03-16 14:07           ` Benjamin LaHaise
2013-08-30  7:55 Stephen Rothwell
2013-08-30 14:26 ` Benjamin LaHaise
2013-08-30 17:38 ` Linus Torvalds
2013-08-30 17:42   ` Benjamin LaHaise
2013-08-21  7:45 Stephen Rothwell
2013-08-21 15:52 ` Dave Kleikamp
2013-08-21 23:53   ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).