Subject: linux-next: build failure after merge of the random tree

From: Stephen Rothwell <[email-masked]>
Date: Fri, 29 Jun 2018 16:06:10 +1000

Hi Theodore,

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

In file included from include/linux/mmzone.h:10:0,
                 from include/linux/gfp.h:6,
                 from include/linux/umh.h:4,
                 from include/linux/kmod.h:22,
                 from include/linux/module.h:13,
                 from drivers/char/random.c:242:
drivers/char/random.c: In function 'random_ioctl':
drivers/char/random.c:1973:32: error: 'random_wait' undeclared (first use in this function); did you mean 'random_write'?
    wake_up_interruptible_poll(&random_wait, POLLIN);
                                ^
include/linux/wait.h:216:12: note: in definition of macro 'wake_up_interruptible_poll'
  __wake_up(x, TASK_INTERRUPTIBLE, 1, poll_to_key(m))
            ^
drivers/char/random.c:1973:32: note: each undeclared identifier is reported only once for each function it appears in
    wake_up_interruptible_poll(&random_wait, POLLIN);
                                ^
include/linux/wait.h:216:12: note: in definition of macro 'wake_up_interruptible_poll'
  __wake_up(x, TASK_INTERRUPTIBLE, 1, poll_to_key(m))
            ^

Caused by commit

  e4f3df9712bb ("random: Wake up writers when random pools are zapped")

interacting with commit

  a11e1d432b51 ("Revert changes to convert to ->poll_mask() and aio IOCB_CMD_POLL")

from Linus' tree.

I took a stab and applied the following patch:

From: Stephen Rothwell <[email-masked]>
Date: Fri, 29 Jun 2018 15:43:01 +1000
Subject: [PATCH] random: fix up for revert of poll_mask changes

Signed-off-by: Stephen Rothwell <[email-masked]>
---
 drivers/char/random.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 00db7aed3204..d686aa2a129b 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1970,7 +1970,7 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
 		input_pool.entropy_count = 0;
 		blocking_pool.entropy_count = 0;
 		if (random_write_wakeup_bits) {
-			wake_up_interruptible_poll(&random_wait, POLLIN);
+			wake_up_interruptible_poll(&random_write_wait, POLLIN);
 			kill_fasync(&fasync, SIGIO, POLL_OUT);
 		}
 		return 0;
-- 
2.17.1

-- 
Cheers,
Stephen Rothwell