summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'misc.poll' of ↵Linus Torvalds2018-01-30387-810/+928
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 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 ...
| * make kernel-side POLL... arch-independentAl Viro2017-11-2910-8/+125
| | | | | | | | | | | | mangle/demangle on the way to/from userland Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * eventpoll: no need to mask the result of epi_item_poll() againAl Viro2017-11-281-7/+2
| | | | | | | | | | | | | | | | | | | | | | two callers that do so don't need to bother - we'd already masked it with epi->event.events, which * couldn't have changed since we are holding ->mtx * had been set to event->events * is still equal to event->events, since *event is never changed by anything. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * eventpoll: constify struct epoll_event pointersAl Viro2017-11-281-3/+5
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * debugging printk in sg_poll() uses %x to print POLL... bitmapAl Viro2017-11-281-1/+1
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * annotate poll(2) gutsAl Viro2017-11-281-6/+10
| | | | | | | | | | | | | | struct pollfd contains two 16bit fields (mask and result) that encode the POLL... bitmaps. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * 9p: untangle ->poll() messAl Viro2017-11-281-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | First of all, NULL ->poll() means "always POLLIN, always POLLOUT", not an error. Furthermore, mixing -EREMOTEIO with POLL... masks and expecting it to do anything good is insane - both are arch-dependent, to start with. Pass a pointer to store the error value separately and make it return POLLERR in such case. And ->poll() calling conventions do *not* include "return -Esomething". Never had. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * ->si_band gets POLL... bitmap stored into a user-visible long fieldAl Viro2017-11-281-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * ring_buffer_poll_wait() return value used as return value of ->poll()Al Viro2017-11-282-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * the rest of drivers/*: annotate ->poll() instancesAl Viro2017-11-28144-256/+257
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * media: annotate ->poll() instancesAl Viro2017-11-2780-147/+143
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * fs: annotate ->poll() instancesAl Viro2017-11-2724-41/+41
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * ipc, kernel, mm: annotate ->poll() instancesAl Viro2017-11-277-14/+14
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * net: annotate ->poll() instancesAl Viro2017-11-2740-76/+77
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * apparmor: annotate ->poll() instancesAl Viro2017-11-271-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * tomoyo: annotate ->poll() instancesAl Viro2017-11-274-7/+7
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * sound: annotate ->poll() instancesAl Viro2017-11-2725-49/+49
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * acpi: annotate ->poll() instancesAl Viro2017-11-271-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * crypto: annotate ->poll() instancesAl Viro2017-11-273-4/+3
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * block: annotate ->poll() instancesAl Viro2017-11-271-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * x86: annotate ->poll() instancesAl Viro2017-11-272-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * um: annotate ->poll() instancesAl Viro2017-11-271-3/+3
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * ppc: annotate ->poll() instancesAl Viro2017-11-276-18/+16
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * mips: annotate ->poll() instancesAl Viro2017-11-271-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * ia64: annotate ->poll() instancesAl Viro2017-11-271-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * cris: annotate ->poll() instancesAl Viro2017-11-273-11/+11
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * dmabuf: annotate dma_buf->activeAl Viro2017-11-271-1/+1
| | | | | | | | | | | | Contains POLL... bitmaps Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * vhost: annotate vhost_pollAl Viro2017-11-272-3/+3
| | | | | | | | | | | | its ->mask is POLL... bitmap Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * scif: annotate scif_pollepdAl Viro2017-11-271-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * annotate poll_table_entry->keyAl Viro2017-11-271-1/+1
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * annotate poll_table_struct ->_keyAl Viro2017-11-2721-26/+26
| | | | | | | | | | | | | | Only POLL... bitmaps ever end up there and their only use is checking for POLL... bits in them. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * annotate poll-related wait keysAl Viro2017-11-279-18/+19
| | | | | | | | | | | | | | | | | | __poll_t is also used as wait key in some waitqueues. Verify that wait_..._poll() gets __poll_t as key and provide a helper for wakeup functions to get back to that __poll_t value. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * anntotate the places where ->poll() return values goAl Viro2017-11-2712-14/+15
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * ->poll() methods should return __poll_tAl Viro2017-11-2710-10/+10
| | | | | | | | | | | | | | The most common place to find POLL... bitmaps: return values of ->poll() and its subsystem counterparts. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * define __poll_t, annotate constantsAl Viro2017-11-278-26/+32
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * switch wrapper poll.h instances to generic-yAl Viro2017-11-2712-16/+7
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * um: make sure to have generated headers for targetAl Viro2017-11-271-0/+7
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * orangefs: fix a braino in ->poll()Al Viro2017-11-271-1/+1
| | | | | | | | | | | | It's POLLIN, not POLL_IN... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | Merge branch 'for-4.16' of ↵Linus Torvalds2018-01-306-22/+76
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: "Nothing too interesting. Documentation updates and trivial changes; however, this pull request does containt he previusly discussed dropping of __must_check from strscpy()" * 'for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: Documentation: Fix 'file_mapped' -> 'mapped_file' string: drop __must_check from strscpy() and restore strscpy() usages in cgroup cgroup, docs: document the root cgroup behavior of cpu and io controllers cgroup-v2.txt: fix typos cgroup: Update documentation reference Documentation/cgroup-v1: fix outdated programming details cgroup, docs: document cgroup v2 device controller
| * | Documentation: Fix 'file_mapped' -> 'mapped_file'Florian Schmidt2018-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no entry file_mapped in the memory.stat file. This looks like a simple word flip that's gone unnoticed since 2010 (dc10e281f5fc, memcg: update documentation). Signed-off-by: Florian Schmidt <florian.schmidt@neclab.eu> Acked-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
| * | string: drop __must_check from strscpy() and restore strscpy() usages in cgroupTejun Heo2018-01-192-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e7fd37ba1217 ("cgroup: avoid copying strings longer than the buffers") converted possibly unsafe strncpy() usages in cgroup to strscpy(). However, although the callsites are completely fine with truncated copied, because strscpy() is marked __must_check, it led to the following warnings. kernel/cgroup/cgroup.c: In function ‘cgroup_file_name’: kernel/cgroup/cgroup.c:1400:10: warning: ignoring return value of ‘strscpy’, declared with attribute warn_unused_result [-Wunused-result] strscpy(buf, cft->name, CGROUP_FILE_NAME_MAX); ^ To avoid the warnings, 50034ed49645 ("cgroup: use strlcpy() instead of strscpy() to avoid spurious warning") switched them to strlcpy(). strlcpy() is worse than strlcpy() because it unconditionally runs strlen() on the source string, and the only reason we switched to strlcpy() here was because it was lacking __must_check, which doesn't reflect any material differences between the two function. It's just that someone added __must_check to strscpy() and not to strlcpy(). These basic string copy operations are used in variety of ways, and one of not-so-uncommon use cases is safely handling truncated copies, where the caller naturally doesn't care about the return value. The __must_check doesn't match the actual use cases and forces users to opt for inferior variants which lack __must_check by happenstance or spread ugly (void) casts. Remove __must_check from strscpy() and restore strscpy() usages in cgroup. Signed-off-by: Tejun Heo <tj@kernel.org> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Chris Metcalf <cmetcalf@ezchip.com>
| * | Merge branch 'for-4.15-fixes' into for-4.16Tejun Heo2018-01-192-12/+15
| |\ \
| * | | cgroup, docs: document the root cgroup behavior of cpu and io controllersMaciej S. Szmigiero2018-01-161-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, cgroups v2 documentation contains only a generic remark that "How resource consumption in the root cgroup is governed is up to each controller", which isn't really telling users much, who need to dig in the code and / or commit messages to learn the exact behavior. In cgroups v1 at least the blkio controller had its operation with respect to competition between child threads and child cgroups documented in blkio-controller.txt, with references to cfq-iosched.txt. Also, cgroups v2 documentation describes v1 behavior of both cpu and blkio controllers in an "Issues with v1" section. Let's document this behavior also for cgroups v2 to make life easier for users. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: Tejun Heo <tj@kernel.org>
| * | | cgroup-v2.txt: fix typosVladimir Rutsky2018-01-021-4/+4
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Vladimir Rutsky <rutsky@google.com> Signed-off-by: Tejun Heo <tj@kernel.org>
| * | | cgroup: Update documentation referenceMatt Roper2018-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cgroup_subsys structure references a documentation file that has been renamed after the v1/v2 split. Since the v2 documentation doesn't currently contain any information on kernel interfaces for controllers, point the user to the v1 docs. Cc: Tejun Heo <tj@kernel.org> Cc: linux-doc@vger.kernel.org Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Tejun Heo <tj@kernel.org>
| * | | Documentation/cgroup-v1: fix outdated programming detailsMatt Roper2018-01-021-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cgroup-v1 documentation is out of date in a few places: * cgroup controllers can no longer be compiled as modules since commit 3ed80a6 ("cgroup: drop module support"); the functions and fields referenced here no longer exist. * Controllers need to create of a cgroup_subsys object named "<name>_cgrp_subsys" instead of "<name>_subsys" since commit 073219e ("cgroup: clean up cgroup_subsys names and initialization") Cc: Tejun Heo <tj@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Tejun Heo <tj@kernel.org>
| * | | cgroup, docs: document cgroup v2 device controllerRoman Gushchin2017-12-131-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the corresponding section in cgroup v2 documentation. Signed-off-by: Roman Gushchin <guro@fb.com> Cc: Tejun Heo <tj@kernel.org> Cc: Alexei Starovoitov <ast@kernel.org> Cc: kernel-team@fb.com Cc: cgroups@vger.kernel.org Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Tejun Heo <tj@kernel.org>
* | | | Merge branch 'for-4.16' of ↵Linus Torvalds2018-01-301-3/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu Pull percpu update from Tejun Heo: "One trivial patch to convert the return type from int to bool" * 'for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: percpu: percpu_counter_initialized can be boolean
| * | | | percpu: percpu_counter_initialized can be booleanguoyayun2017-12-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes percpu_counter_initialized return bool due to this particular function only using either one or zero as its return value. No functional change. Signed-off-by: guoyayun <guoyayun@cmss.chinamobile.com> Signed-off-by: Tejun Heo <tj@kernel.org>
* | | | | Merge branch 'for-4.16' of ↵Linus Torvalds2018-01-3012-470/+221
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata Pull libata updates from Tejun Heo: "Nothing too interesting. Several patches to convert mdelay() to usleep_range(), removal of unused pata_at32, and other low level driver specific changes" * 'for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: ata: pata_pdc2027x: Replace mdelay with msleep ata: pata_it821x: Replace mdelay with usleep_range in it821x_firmware_command ata: sata_mv: Replace mdelay with usleep_range in mv_reset_channel ata: remove pata_at32 phy: brcm-sata: remove unused variable phy: brcm-sata: fix semicolon.cocci warnings ata: ahci_brcm: Recover from failures to identify devices phy: brcm-sata: Implement calibrate callback ahci: Add Intel Cannon Lake PCH-H PCI ID ata_piix: constify pci_bits libata:pata_atiixp: Don't use unconnected secondary port on SB600 ata: ahci_brcm: Avoid clobbering SATA_TOP_CTRL_BUS_CTRL ahci: Allow setting a default LPM policy for mobile chipsets ahci: Add PCI ids for Intel Bay Trail, Cherry Trail and Apollo Lake AHCI ahci: Annotate PCI ids for mobile Intel chipsets as such