Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 31 Jan 2018 01:58:07 +0000 (17:58 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 31 Jan 2018 01:58:07 +0000 (17:58 -0800)
Pull poll annotations from Al Viro:
 "This introduces a __bitwise type for POLL### bitmap, and propagates
  the annotations through the tree. Most of that stuff is as simple as
  'make ->poll() instances return __poll_t and do the same to local
  variables used to hold the future return value'.

  Some of the obvious brainos found in process are fixed (e.g. POLLIN
  misspelled as POLL_IN). At that point the amount of sparse warnings is
  low and most of them are for genuine bugs - e.g. ->poll() instance
  deciding to return -EINVAL instead of a bitmap. I hadn't touched those
  in this series - it's large enough as it is.

  Another problem it has caught was eventpoll() ABI mess; select.c and
  eventpoll.c assumed that corresponding POLL### and EPOLL### were
  equal. That's true for some, but not all of them - EPOLL### are
  arch-independent, but POLL### are not.

  The last commit in this series separates userland POLL### values from
  the (now arch-independent) kernel-side ones, converting between them
  in the few places where they are copied to/from userland. AFAICS, this
  is the least disruptive fix preserving poll(2) ABI and making epoll()
  work on all architectures.

  As it is, it's simply broken on sparc - try to give it EPOLLWRNORM and
  it will trigger only on what would've triggered EPOLLWRBAND on other
  architectures. EPOLLWRBAND and EPOLLRDHUP, OTOH, are never triggered
  at all on sparc. With this patch they should work consistently on all
  architectures"

* 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (37 commits)
  make kernel-side POLL... arch-independent
  eventpoll: no need to mask the result of epi_item_poll() again
  eventpoll: constify struct epoll_event pointers
  debugging printk in sg_poll() uses %x to print POLL... bitmap
  annotate poll(2) guts
  9p: untangle ->poll() mess
  ->si_band gets POLL... bitmap stored into a user-visible long field
  ring_buffer_poll_wait() return value used as return value of ->poll()
  the rest of drivers/*: annotate ->poll() instances
  media: annotate ->poll() instances
  fs: annotate ->poll() instances
  ipc, kernel, mm: annotate ->poll() instances
  net: annotate ->poll() instances
  apparmor: annotate ->poll() instances
  tomoyo: annotate ->poll() instances
  sound: annotate ->poll() instances
  acpi: annotate ->poll() instances
  crypto: annotate ->poll() instances
  block: annotate ->poll() instances
  x86: annotate ->poll() instances
  ...

68 files changed:
1  2 
arch/alpha/include/uapi/asm/Kbuild
arch/ia64/include/uapi/asm/Kbuild
arch/m32r/include/uapi/asm/Kbuild
arch/mn10300/include/uapi/asm/Kbuild
arch/score/include/uapi/asm/Kbuild
arch/x86/include/uapi/asm/Kbuild
block/bsg.c
crypto/af_alg.c
crypto/algif_skcipher.c
drivers/android/binder.c
drivers/gpio/gpiolib.c
drivers/infiniband/hw/hfi1/file_ops.c
drivers/md/md.c
drivers/media/dvb-core/dvb_ca_en50221.c
drivers/media/dvb-core/dvb_frontend.c
drivers/media/platform/sh_veu.c
drivers/media/radio/radio-si476x.c
drivers/media/radio/radio-wl1273.c
drivers/media/v4l2-core/v4l2-mem2mem.c
drivers/media/v4l2-core/videobuf-core.c
drivers/media/v4l2-core/videobuf2-core.c
drivers/media/v4l2-core/videobuf2-v4l2.c
drivers/net/ppp/ppp_generic.c
drivers/net/tap.c
drivers/net/tun.c
drivers/platform/chrome/cros_ec_debugfs.c
drivers/s390/char/monreader.c
drivers/tty/n_tty.c
drivers/usb/core/devio.c
drivers/usb/gadget/function/f_fs.c
drivers/usb/mon/mon_bin.c
drivers/vhost/net.c
drivers/vhost/vhost.c
drivers/xen/pvcalls-front.c
fs/fcntl.c
fs/orangefs/devorangefs-req.c
fs/proc/inode.c
fs/proc_namespace.c
fs/userfaultfd.c
include/crypto/if_alg.h
include/linux/fs.h
include/linux/skbuff.h
include/net/sctp/sctp.h
include/net/sock.h
include/net/tcp.h
ipc/mqueue.c
kernel/events/core.c
kernel/printk/printk.c
kernel/time/posix-clock.c
kernel/trace/ring_buffer.c
kernel/trace/trace.c
mm/memcontrol.c
net/9p/trans_fd.c
net/dccp/proto.c
net/ipv4/tcp.c
net/packet/af_packet.c
net/rxrpc/af_rxrpc.c
net/sctp/socket.c
net/socket.c
net/sunrpc/cache.c
net/tipc/socket.c
net/vmw_vsock/af_vsock.c
security/apparmor/apparmorfs.c
sound/core/oss/pcm_oss.c
sound/core/pcm_native.c
sound/core/rawmidi.c
sound/core/seq/seq_clientmgr.c
sound/usb/mixer_quirks.c

index 14a2e9af97e9992d87821e8f11276ecfef8e57cf,574fe90c8b5850c14230f13dcf9bad2cfe0955f1..9afaba5e5503308125c79b5ec38645702fb1ddfd
@@@ -1,4 -1,4 +1,5 @@@
  # UAPI Header export list
  include include/uapi/asm-generic/Kbuild.asm
  
 +generic-y += bpf_perf_event.h
+ generic-y += poll.h
index f5c6967a93bb204ff41bfdee837d3ec4bdaa94dd,4c9825edd4a347a489694c21f30fbb520a8cc7ea..c0527cfc48f088bfb7e05c4e18cf8136ef162561
@@@ -1,5 -1,5 +1,6 @@@
  # UAPI Header export list
  include include/uapi/asm-generic/Kbuild.asm
  
 +generic-y += bpf_perf_event.h
  generic-y += kvm_para.h
+ generic-y += poll.h
index 451bf6071c6e28036f0da81dedb35c8b184f3b5a,21f241553a2e3e025ae15a4ff90105962f2ca5c9..c3df55aeefe70731d953f8b49eb82efbec9f6d86
@@@ -1,6 -1,6 +1,7 @@@
  # UAPI Header export list
  include include/uapi/asm-generic/Kbuild.asm
  
 +generic-y += bpf_perf_event.h
  generic-y += kvm_para.h
+ generic-y += poll.h
  generic-y += siginfo.h
index 81271d3af47cb1000ebfab2539efa92080a1eccc,162fbdbb5fd5f52d804dd52a926e7a8694e68a14..b04fd1632051d1e45beb8d1e73fea1f4a2f7c12f
@@@ -1,5 -1,5 +1,6 @@@
  # UAPI Header export list
  include include/uapi/asm-generic/Kbuild.asm
  
 +generic-y     += bpf_perf_event.h
+ generic-y     += poll.h
  generic-y     += siginfo.h
index 81271d3af47cb1000ebfab2539efa92080a1eccc,162fbdbb5fd5f52d804dd52a926e7a8694e68a14..b04fd1632051d1e45beb8d1e73fea1f4a2f7c12f
@@@ -1,5 -1,5 +1,6 @@@
  # UAPI Header export list
  include include/uapi/asm-generic/Kbuild.asm
  
 +generic-y     += bpf_perf_event.h
+ generic-y     += poll.h
  generic-y     += siginfo.h
Simple merge
diff --cc block/bsg.c
Simple merge
diff --cc crypto/af_alg.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc drivers/md/md.c
Simple merge
index d48b61eb01f4cdc7f11913208a6beef0136a7bff,dbb527a2befc3fa56c9ed16f340ee7982065a794..3f6c8bd8f8699c08a9bc3f8f350147e8e2c9bfa8
@@@ -1780,9 -1781,9 +1780,9 @@@ static int dvb_ca_en50221_io_release(st
   * @file: File concerned.
   * @wait: poll wait table.
   *
 - * @return Standard poll mask.
 + * return: Standard poll mask.
   */
- static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table *wait)
+ static __poll_t dvb_ca_en50221_io_poll(struct file *file, poll_table *wait)
  {
        struct dvb_device *dvbdev = file->private_data;
        struct dvb_ca_private *ca = dvbdev->priv;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/fcntl.c
Simple merge
Simple merge
diff --cc fs/proc/inode.c
Simple merge
Simple merge
Simple merge
index f38227a78eae9f6b2d99ca9d1ca7dbb6ef720ce1,c670b30e405aaf4c23bf101caaa21eadcdb2e0e8..482461d8931d9186c4a11b7b2d9a24f981a595bc
@@@ -243,9 -242,8 +243,9 @@@ int af_alg_sendmsg(struct socket *sock
                   unsigned int ivsize);
  ssize_t af_alg_sendpage(struct socket *sock, struct page *page,
                        int offset, size_t size, int flags);
 +void af_alg_free_resources(struct af_alg_async_req *areq);
  void af_alg_async_cb(struct crypto_async_request *_req, int err);
unsigned int af_alg_poll(struct file *file, struct socket *sock,
__poll_t af_alg_poll(struct file *file, struct socket *sock,
                         poll_table *wait);
  struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk,
                                           unsigned int areqlen);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc ipc/mqueue.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc mm/memcontrol.c
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/tcp.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/socket.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge