linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] misc: watch_queue: Fix build error
@ 2019-09-03  7:37 YueHaibing
  2019-09-04 12:20 ` David Howells
  0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2019-09-03  7:37 UTC (permalink / raw)
  To: jannh, axboe, dhowells, james.morris, yuehaibing; +Cc: linux-kernel

drivers/misc/watch_queue.c: In function watch_queue_account_mem:
drivers/misc/watch_queue.c:309:38: error: struct user_struct has no member named locked_vm; did you mean locked_shm?
  cur_pages = atomic_long_read(&user->locked_vm);
                                      ^~~~~~~~~
                                      locked_shm

struct user_struct {
...
   #if defined(CONFIG_PERF_EVENTS) || defined(CONFIG_BPF_SYSCALL) || \
       defined(CONFIG_NET) || defined(CONFIG_IO_URING)
           atomic_long_t locked_vm;
   #endif
...
}

If none of the CONFIGS is defined, locked_vm will be unavailable.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 064756fb355a ("General notification queue with user mmap()'able ring buffer")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 include/linux/sched/user.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/sched/user.h b/include/linux/sched/user.h
index 917d88e..126494d 100644
--- a/include/linux/sched/user.h
+++ b/include/linux/sched/user.h
@@ -33,7 +33,8 @@ struct user_struct {
 	kuid_t uid;
 
 #if defined(CONFIG_PERF_EVENTS) || defined(CONFIG_BPF_SYSCALL) || \
-    defined(CONFIG_NET) || defined(CONFIG_IO_URING)
+	defined(CONFIG_NET) || defined(CONFIG_IO_URING) || \
+	defined(CONFIG_WATCH_QUEUE)
 	atomic_long_t locked_vm;
 #endif
 
-- 
2.7.4



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

* Re: [PATCH -next] misc: watch_queue: Fix build error
  2019-09-03  7:37 [PATCH -next] misc: watch_queue: Fix build error YueHaibing
@ 2019-09-04 12:20 ` David Howells
  2019-10-08  6:43   ` Yuehaibing
  0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2019-09-04 12:20 UTC (permalink / raw)
  To: YueHaibing; +Cc: dhowells, jannh, axboe, james.morris, linux-kernel

Thanks, I've folded that in.

David

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

* Re: [PATCH -next] misc: watch_queue: Fix build error
  2019-09-04 12:20 ` David Howells
@ 2019-10-08  6:43   ` Yuehaibing
  0 siblings, 0 replies; 3+ messages in thread
From: Yuehaibing @ 2019-10-08  6:43 UTC (permalink / raw)
  To: David Howells; +Cc: jannh, axboe, james.morris, linux-kernel

On 2019/9/4 20:20, David Howells wrote:
> Thanks, I've folded that in.

This issue still occur in linux-next 20191008 :

drivers/misc/watch_queue.c: In function ‘watch_queue_account_mem’:
drivers/misc/watch_queue.c:315:38: error: ‘struct user_struct’ has no member named ‘locked_vm’; did you mean ‘locked_shm’?
  cur_pages = atomic_long_read(&user->locked_vm);
                                      ^~~~~~~~~
                                      locked_shm
drivers/misc/watch_queue.c:321:50: error: ‘struct user_struct’ has no member named ‘locked_vm’; did you mean ‘locked_shm’?
  } while (atomic_long_try_cmpxchg_relaxed(&user->locked_vm, &cur_pages,
                                                  ^~~~~~~~~
                                                  locked_shm
drivers/misc/watch_queue.c: In function ‘watch_queue_unaccount_mem’:
drivers/misc/watch_queue.c:333:44: error: ‘struct user_struct’ has no member named ‘locked_vm’; did you mean ‘locked_shm’?
   atomic_long_sub(wqueue->nr_pages, &user->locked_vm);
                                            ^~~~~~~~~
                                            locked_shm
scripts/Makefile.build:265: recipe for target 'drivers/misc/watch_queue.o' failed

> 
> David
> 
> .
> 


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

end of thread, other threads:[~2019-10-08  6:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03  7:37 [PATCH -next] misc: watch_queue: Fix build error YueHaibing
2019-09-04 12:20 ` David Howells
2019-10-08  6:43   ` Yuehaibing

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).