From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [dhowells-fs:notifications-pipe-core 16/25] fs/pipe.c:758:3: error: implicit declaration of function 'watch_queue_clear'; did you mean 'blk_queue_dead'?
Date: Thu, 07 Nov 2019 22:41:45 +0800 [thread overview]
Message-ID: <201911072244.BqBoW5Rp%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 10532 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git notifications-pipe-core
head: b6a41c14eddc6c8db60aa86f62b22ed0cfce7dd3
commit: 42204b4e25526122562a97a286c86ab5c069ae53 [16/25] pipe: Add general notification queue support
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
git checkout 42204b4e25526122562a97a286c86ab5c069ae53
# save the attached .config to linux build tree
make ARCH=um SUBARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
fs/pipe.c: In function 'pipe_write':
fs/pipe.c:411:10: error: 'struct pipe_inode_info' has no member named 'watch_queue'
if (pipe->watch_queue) {
^~
fs/pipe.c: In function 'pipe_ioctl':
fs/pipe.c:575:9: error: implicit declaration of function 'watch_queue_set_size'; did you mean 'latch_tree_erase'? [-Werror=implicit-function-declaration]
ret = watch_queue_set_size(pipe, arg);
^~~~~~~~~~~~~~~~~~~~
latch_tree_erase
fs/pipe.c:580:9: error: implicit declaration of function 'watch_queue_set_filter'; did you mean 'ftrace_set_filter'? [-Werror=implicit-function-declaration]
ret = watch_queue_set_filter(
^~~~~~~~~~~~~~~~~~~~~~
ftrace_set_filter
fs/pipe.c: In function 'free_pipe_info':
fs/pipe.c:757:10: error: 'struct pipe_inode_info' has no member named 'watch_queue'
if (pipe->watch_queue) {
^~
>> fs/pipe.c:758:3: error: implicit declaration of function 'watch_queue_clear'; did you mean 'blk_queue_dead'? [-Werror=implicit-function-declaration]
watch_queue_clear(pipe->watch_queue);
^~~~~~~~~~~~~~~~~
blk_queue_dead
fs/pipe.c:758:25: error: 'struct pipe_inode_info' has no member named 'watch_queue'
watch_queue_clear(pipe->watch_queue);
^~
fs/pipe.c:759:3: error: implicit declaration of function 'put_watch_queue'; did you mean 'bit_waitqueue'? [-Werror=implicit-function-declaration]
put_watch_queue(pipe->watch_queue);
^~~~~~~~~~~~~~~
bit_waitqueue
fs/pipe.c:759:23: error: 'struct pipe_inode_info' has no member named 'watch_queue'
put_watch_queue(pipe->watch_queue);
^~
fs/pipe.c: In function 'create_pipe_files':
fs/pipe.c:839:7: error: implicit declaration of function 'watch_queue_init'; did you mean 'workqueue_init'? [-Werror=implicit-function-declaration]
if (watch_queue_init(inode->i_pipe) < 0) {
^~~~~~~~~~~~~~~~
workqueue_init
fs/pipe.c: In function 'pipe_set_size':
fs/pipe.c:1188:10: error: 'struct pipe_inode_info' has no member named 'watch_queue'
if (pipe->watch_queue)
^~
fs/pipe.c: In function 'get_pipe_info':
fs/pipe.c:1242:24: error: 'struct pipe_inode_info' has no member named 'watch_queue'
if (for_splice && pipe->watch_queue)
^~
cc1: some warnings being treated as errors
vim +758 fs/pipe.c
551
552 static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
553 {
554 struct pipe_inode_info *pipe = filp->private_data;
555 int count, head, tail, mask, ret;
556
557 switch (cmd) {
558 case FIONREAD:
559 __pipe_lock(pipe);
560 count = 0;
561 head = pipe->head;
562 tail = pipe->tail;
563 mask = pipe->ring_size - 1;
564
565 while (tail != head) {
566 count += pipe->bufs[tail & mask].len;
567 tail++;
568 }
569 __pipe_unlock(pipe);
570
571 return put_user(count, (int __user *)arg);
572
573 case IOC_WATCH_QUEUE_SET_SIZE:
574 __pipe_lock(pipe);
575 ret = watch_queue_set_size(pipe, arg);
576 __pipe_unlock(pipe);
577 return ret;
578
579 case IOC_WATCH_QUEUE_SET_FILTER:
> 580 ret = watch_queue_set_filter(
581 pipe, (struct watch_notification_filter __user *)arg);
582 return ret;
583
584 default:
585 return -ENOIOCTLCMD;
586 }
587 }
588
589 /* No kernel lock held - fine */
590 static __poll_t
591 pipe_poll(struct file *filp, poll_table *wait)
592 {
593 __poll_t mask;
594 struct pipe_inode_info *pipe = filp->private_data;
595 unsigned int head = READ_ONCE(pipe->head);
596 unsigned int tail = READ_ONCE(pipe->tail);
597
598 poll_wait(filp, &pipe->wait, wait);
599
600 BUG_ON(pipe_occupancy(head, tail) > pipe->ring_size);
601
602 /* Reading only -- no need for acquiring the semaphore. */
603 mask = 0;
604 if (filp->f_mode & FMODE_READ) {
605 if (!pipe_empty(head, tail))
606 mask |= EPOLLIN | EPOLLRDNORM;
607 if (!pipe->writers && filp->f_version != pipe->w_counter)
608 mask |= EPOLLHUP;
609 }
610
611 if (filp->f_mode & FMODE_WRITE) {
612 if (!pipe_full(head, tail, pipe->max_usage))
613 mask |= EPOLLOUT | EPOLLWRNORM;
614 /*
615 * Most Unices do not set EPOLLERR for FIFOs but on Linux they
616 * behave exactly like pipes for poll().
617 */
618 if (!pipe->readers)
619 mask |= EPOLLERR;
620 }
621
622 return mask;
623 }
624
625 static void put_pipe_info(struct inode *inode, struct pipe_inode_info *pipe)
626 {
627 int kill = 0;
628
629 spin_lock(&inode->i_lock);
630 if (!--pipe->files) {
631 inode->i_pipe = NULL;
632 kill = 1;
633 }
634 spin_unlock(&inode->i_lock);
635
636 if (kill)
637 free_pipe_info(pipe);
638 }
639
640 static int
641 pipe_release(struct inode *inode, struct file *file)
642 {
643 struct pipe_inode_info *pipe = file->private_data;
644
645 __pipe_lock(pipe);
646 if (file->f_mode & FMODE_READ)
647 pipe->readers--;
648 if (file->f_mode & FMODE_WRITE)
649 pipe->writers--;
650
651 if (pipe->readers || pipe->writers) {
652 wake_up_interruptible_sync_poll(&pipe->wait, EPOLLIN | EPOLLOUT | EPOLLRDNORM | EPOLLWRNORM | EPOLLERR | EPOLLHUP);
653 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
654 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
655 }
656 __pipe_unlock(pipe);
657
658 put_pipe_info(inode, pipe);
659 return 0;
660 }
661
662 static int
663 pipe_fasync(int fd, struct file *filp, int on)
664 {
665 struct pipe_inode_info *pipe = filp->private_data;
666 int retval = 0;
667
668 __pipe_lock(pipe);
669 if (filp->f_mode & FMODE_READ)
670 retval = fasync_helper(fd, filp, on, &pipe->fasync_readers);
671 if ((filp->f_mode & FMODE_WRITE) && retval >= 0) {
672 retval = fasync_helper(fd, filp, on, &pipe->fasync_writers);
673 if (retval < 0 && (filp->f_mode & FMODE_READ))
674 /* this can happen only if on == T */
675 fasync_helper(-1, filp, 0, &pipe->fasync_readers);
676 }
677 __pipe_unlock(pipe);
678 return retval;
679 }
680
681 unsigned long account_pipe_buffers(struct user_struct *user,
682 unsigned long old, unsigned long new)
683 {
684 return atomic_long_add_return(new - old, &user->pipe_bufs);
685 }
686
687 bool too_many_pipe_buffers_soft(unsigned long user_bufs)
688 {
689 unsigned long soft_limit = READ_ONCE(pipe_user_pages_soft);
690
691 return soft_limit && user_bufs > soft_limit;
692 }
693
694 bool too_many_pipe_buffers_hard(unsigned long user_bufs)
695 {
696 unsigned long hard_limit = READ_ONCE(pipe_user_pages_hard);
697
698 return hard_limit && user_bufs > hard_limit;
699 }
700
701 bool pipe_is_unprivileged_user(void)
702 {
703 return !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN);
704 }
705
706 struct pipe_inode_info *alloc_pipe_info(void)
707 {
708 struct pipe_inode_info *pipe;
709 unsigned long pipe_bufs = PIPE_DEF_BUFFERS;
710 struct user_struct *user = get_current_user();
711 unsigned long user_bufs;
712 unsigned int max_size = READ_ONCE(pipe_max_size);
713
714 pipe = kzalloc(sizeof(struct pipe_inode_info), GFP_KERNEL_ACCOUNT);
715 if (pipe == NULL)
716 goto out_free_uid;
717
718 if (pipe_bufs * PAGE_SIZE > max_size && !capable(CAP_SYS_RESOURCE))
719 pipe_bufs = max_size >> PAGE_SHIFT;
720
721 user_bufs = account_pipe_buffers(user, 0, pipe_bufs);
722
723 if (too_many_pipe_buffers_soft(user_bufs) && pipe_is_unprivileged_user()) {
724 user_bufs = account_pipe_buffers(user, pipe_bufs, 1);
725 pipe_bufs = 1;
726 }
727
728 if (too_many_pipe_buffers_hard(user_bufs) && pipe_is_unprivileged_user())
729 goto out_revert_acct;
730
731 pipe->bufs = kcalloc(pipe_bufs, sizeof(struct pipe_buffer),
732 GFP_KERNEL_ACCOUNT);
733
734 if (pipe->bufs) {
735 init_waitqueue_head(&pipe->wait);
736 pipe->r_counter = pipe->w_counter = 1;
737 pipe->max_usage = pipe_bufs;
738 pipe->ring_size = pipe_bufs;
739 pipe->nr_accounted = pipe_bufs;
740 pipe->user = user;
741 mutex_init(&pipe->mutex);
742 return pipe;
743 }
744
745 out_revert_acct:
746 (void) account_pipe_buffers(user, pipe_bufs, 0);
747 kfree(pipe);
748 out_free_uid:
749 free_uid(user);
750 return NULL;
751 }
752
753 void free_pipe_info(struct pipe_inode_info *pipe)
754 {
755 int i;
756
757 if (pipe->watch_queue) {
> 758 watch_queue_clear(pipe->watch_queue);
759 put_watch_queue(pipe->watch_queue);
760 }
761
762 (void) account_pipe_buffers(pipe->user, pipe->nr_accounted, 0);
763 free_uid(pipe->user);
764 for (i = 0; i < pipe->ring_size; i++) {
765 struct pipe_buffer *buf = pipe->bufs + i;
766 if (buf->ops)
767 pipe_buf_release(pipe, buf);
768 }
769 if (pipe->tmp_page)
770 __free_page(pipe->tmp_page);
771 kfree(pipe->bufs);
772 kfree(pipe);
773 }
774
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 8324 bytes --]
reply other threads:[~2019-11-07 14:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201911072244.BqBoW5Rp%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.