aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-07-12allow link_path_walk() to take ERR_PTR()Al Viro1-33/+5
There is a check for IS_ERR(name) immediately upstream of each call of link_path_walk(name, nd), with positives treated as if link_path_walk() failed with PTR_ERR(name). Taking that check into link_path_walk() itself simplifies things nicely. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12make path_init() unconditionally paired with terminate_walk()Al Viro1-16/+16
including the failure exits Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12document alloc_file() changesAl Viro1-0/+12
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12make alloc_file() staticAl Viro2-4/+1
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12do_shmat(): grab shp->shm_file earlier, switch to alloc_file_clone()Al Viro1-21/+18
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12new helper: alloc_file_clone()Al Viro3-4/+15
alloc_file_clone(old_file, mode, ops): create a new struct file with ->f_path equal to that of old_file. pipe converted. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12create_pipe_files(): switch the first allocation to alloc_file_pseudo()Al Viro1-26/+8
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12anon_inode_getfile(): switch to alloc_file_pseudo()Al Viro1-23/+6
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12hugetlb_file_setup(): switch to alloc_file_pseudo()Al Viro1-37/+16
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12ocxlflash_getfile(): switch to alloc_file_pseudo()Al Viro1-19/+4
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12cxl_getfile(): switch to alloc_file_pseudo()Al Viro1-17/+4
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12... and switch shmem_file_setup() to alloc_file_pseudo()Al Viro1-30/+7
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12__shmem_file_setup(): reorder allocationsAl Viro1-23/+20
grab inode and reserve memory first. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12new wrapper: alloc_file_pseudo()Al Viro4-39/+39
takes inode, vfsmount, name, O_... flags and file_operations and either returns a new struct file (in which case inode reference we held is consumed) or returns ERR_PTR(), in which case no refcounts are altered. converted aio_private_file() and sock_alloc_file() to it Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12kill FILE_{CREATED,OPENED}Al Viro1-4/+0
no users left Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12switch atomic_open() and lookup_open() to returning 0 in all success casesAl Viro1-17/+17
caller can tell "opened" from "open it yourself" by looking at ->f_mode. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12document ->atomic_open() changesAl Viro3-9/+19
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12->atomic_open(): return 0 in all success casesAl Viro2-17/+17
FMODE_OPENED can be used to distingusish "successful open" from the "called finish_no_open(), do it yourself" cases. Since finish_no_open() has been adjusted, no changes in the instances were actually needed. The caller has been adjusted. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12get rid of 'opened' in path_openat() and the helpers downstreamAl Viro1-14/+8
unused now Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12get rid of 'opened' argument of ->atomic_open() - part 3Al Viro13-21/+13
now it can be done... Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12getting rid of 'opened' argument of ->atomic_open() - part 2Al Viro3-15/+13
__gfs2_lookup(), gfs2_create_inode(), nfs_finish_open() and fuse_create_open() don't need 'opened' anymore. Get rid of that argument in those. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12getting rid of 'opened' argument of ->atomic_open() - part 1Al Viro10-14/+12
'opened' argument of finish_open() is unused. Kill it. Signed-off-by Al Viro <[email protected]>
2018-07-12IMA: don't propagate opened through the entire thingAl Viro6-17/+16
just check ->f_mode in ima_appraise_measurement() Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12introduce FMODE_CREATED and switch to itAl Viro10-15/+20
Parallel to FILE_CREATED, goes into ->f_mode instead of *opened. NFS is a bit of a wart here - it doesn't have file at the point where FILE_CREATED used to be set, so we need to propagate it there (for now). IMA is another one (here and everywhere)... Note that this needs do_dentry_open() to leave old bits in ->f_mode alone - we want it to preserve FMODE_CREATED if it had been already set (no other bit can be there). Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12switch all remaining checks for FILE_OPENED to FMODE_OPENEDAl Viro3-13/+5
... and don't bother with setting FILE_OPENED at all. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12now we can fold open_check_o_direct() into do_dentry_open()Al Viro3-19/+6
These checks are better off in do_dentry_open(); the reason we couldn't put them there used to be that callers couldn't tell what kind of cleanup would do_dentry_open() failure call for. Now that we have FMODE_OPENED, cleanup is the same in all cases - it's simply fput(). So let's fold that into do_dentry_open(), as Christoph's patch tried to. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12lift fput() on late failures into path_openat()Al Viro1-16/+12
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12fold put_filp() into fput()Al Viro4-21/+10
Just check FMODE_OPENED in __fput() and be done with that... Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12introduce FMODE_OPENEDAl Viro3-1/+5
basically, "is that instance set up enough for regular fput(), or do we want put_filp() for that one". NOTE: the only alloc_file() caller that could be followed by put_filp() is in arch/ia64/kernel/perfmon.c, which is (Kconfig-level) broken. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12->file_open(): lose cred argumentAl Viro6-10/+10
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12security_file_open(): lose cred argumentAl Viro3-6/+5
Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12get rid of cred argument of vfs_open() and do_dentry_open()Al Viro3-12/+9
always equal to ->f_cred Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12pass ->f_flags value to alloc_empty_file()Al Viro4-13/+9
... and have it set the f_flags-derived part of ->f_mode. Signed-off-by: Al Viro <[email protected]>
2018-07-12pass creds to get_empty_filp(), make sure dentry_open() passes the right credsAl Viro4-6/+5
... and rename get_empty_filp() to alloc_empty_file(). dentry_open() gets creds as argument, but the only thing that sees those is security_file_open() - file->f_cred still ends up with current_cred(). For almost all callers it's the same thing, but there are several broken cases. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-12alloc_file(): switch to passing O_... flags instead of FMODE_... modeAl Viro12-36/+27
... so that it could set both ->f_flags and ->f_mode, without callers having to set ->f_flags manually. Signed-off-by: Al Viro <[email protected]>
2018-07-10make sure do_dentry_open() won't return positive as an errorAl Viro1-0/+2
An ->open() instances really, really should not be doing that. There's a lot of places e.g. around atomic_open() that could be confused by that, so let's catch that early. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-10create_pipe_files(): use fput() if allocation of the second file failsAl Viro1-4/+3
... just use put_pipe_info() to get the pipe->files down to 1 and let fput()-called pipe_release() do freeing. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-10turn filp_clone_open() into inline wrapper for dentry_open()Al Viro4-23/+6
it's exactly the same thing as dentry_open(&file->f_path, file->f_flags, file->f_cred) ... and rename it to file_clone_open(), while we are at it. 'filp' naming convention is bogus; sure, it's "file pointer", but we generally don't do that kind of Hungarian notation. Some of the instances have too many callers to touch, but this one has only two, so let's sanitize it while we can... Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-10fold security_file_free() into file_free()Al Viro1-6/+4
.. and the call of file_free() in case of security_file_alloc() failure in get_empty_filp() should be simply file_free_rcu() - no point in rcu-delays there, anyway. Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-10ocxlflash_getfile(): fix double-iput() on alloc_file() failuresAl Viro1-3/+2
Cc: [email protected] Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-10cxl_getfile(): fix double-iput() on alloc_file() failuresAl Viro1-4/+4
Doing iput() after path_put() is wrong. Cc: [email protected] Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-07-10drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open()Al Viro3-16/+2
Failure of ->open() should *not* be followed by fput(). Fixed by using filp_clone_open(), which gets the cleanups right. Cc: [email protected] Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-06-27proc: add proc_seq_releaseChunyu Hu1-1/+10
kmemleak reported some memory leak on reading proc files. After adding some debug lines, find that proc_seq_fops is using seq_release as release handler, which won't handle the free of 'private' field of seq_file, while in fact the open handler proc_seq_open could create the private data with __seq_open_private when state_size is greater than zero. So after reading files created with proc_create_seq_private, such as /proc/timer_list and /proc/vmallocinfo, the private mem of a seq_file is not freed. Fix it by adding the paired proc_seq_release as the default release handler of proc_seq_ops instead of seq_release. Fixes: 44414d82cfe0 ("proc: introduce proc_create_seq_private") Reviewed-by: Christoph Hellwig <[email protected]> CC: Christoph Hellwig <[email protected]> Signed-off-by: Chunyu Hu <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-06-17Linux 4.18-rc1Linus Torvalds1-2/+2
2018-06-17Merge tag 'for-linus-20180616' of git://git.kernel.dk/linux-blockLinus Torvalds16-275/+174
Pull block fixes from Jens Axboe: "A collection of fixes that should go into -rc1. This contains: - bsg_open vs bsg_unregister race fix (Anatoliy) - NVMe pull request from Christoph, with fixes for regressions in this window, FC connect/reconnect path code unification, and a trace point addition. - timeout fix (Christoph) - remove a few unused functions (Christoph) - blk-mq tag_set reinit fix (Roman)" * tag 'for-linus-20180616' of git://git.kernel.dk/linux-block: bsg: fix race of bsg_open and bsg_unregister block: remov blk_queue_invalidate_tags nvme-fabrics: fix and refine state checks in __nvmf_check_ready nvme-fabrics: handle the admin-only case properly in nvmf_check_ready nvme-fabrics: refactor queue ready check blk-mq: remove blk_mq_tagset_iter nvme: remove nvme_reinit_tagset nvme-fc: fix nulling of queue data on reconnect nvme-fc: remove reinit_request routine blk-mq: don't time out requests again that are in the timeout handler nvme-fc: change controllers first connect to use reconnect path nvme: don't rely on the changed namespace list log nvmet: free smart-log buffer after use nvme-rdma: fix error flow during mapping request data nvme: add bio remapping tracepoint nvme: fix NULL pointer dereference in nvme_init_subsystem blk-mq: reinit q->tag_set_list entry only after grace period
2018-06-17Merge tag 'docs-broken-links' of git://linuxtv.org/mchehab/experimentalLinus Torvalds206-339/+372
Pull documentation fixes from Mauro Carvalho Chehab: "This solves a series of broken links for files under Documentation, and improves a script meant to detect such broken links (see scripts/documentation-file-ref-check). The changes on this series are: - can.rst: fix a footnote reference; - crypto_engine.rst: Fix two parsing warnings; - Fix a lot of broken references to Documentation/*; - improve the scripts/documentation-file-ref-check script, in order to help detecting/fixing broken references, preventing false-positives. After this patch series, only 33 broken references to doc files are detected by scripts/documentation-file-ref-check" * tag 'docs-broken-links' of git://linuxtv.org/mchehab/experimental: (26 commits) fix a series of Documentation/ broken file name references Documentation: rstFlatTable.py: fix a broken reference ABI: sysfs-devices-system-cpu: remove a broken reference devicetree: fix a series of wrong file references devicetree: fix name of pinctrl-bindings.txt devicetree: fix some bindings file names MAINTAINERS: fix location of DT npcm files MAINTAINERS: fix location of some display DT bindings kernel-parameters.txt: fix pointers to sound parameters bindings: nvmem/zii: Fix location of nvmem.txt docs: Fix more broken references scripts/documentation-file-ref-check: check tools/*/Documentation scripts/documentation-file-ref-check: get rid of false-positives scripts/documentation-file-ref-check: hint: dash or underline scripts/documentation-file-ref-check: add a fix logic for DT scripts/documentation-file-ref-check: accept more wildcards at filenames scripts/documentation-file-ref-check: fix help message media: max2175: fix location of driver's companion documentation media: v4l: fix broken video4linux docs locations media: dvb: point to the location of the old README.dvb-usb file ...
2018-06-17Merge tag 'fsnotify_for_v4.18-rc1' of ↵Linus Torvalds14-147/+230
git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify updates from Jan Kara: "fsnotify cleanups unifying handling of different watch types. This is the shortened fsnotify series from Amir with the last five patches pulled out. Amir has modified those patches to not change struct inode but obviously it's too late for those to go into this merge window" * tag 'fsnotify_for_v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fsnotify: add fsnotify_add_inode_mark() wrappers fanotify: generalize fanotify_should_send_event() fsnotify: generalize send_to_group() fsnotify: generalize iteration of marks by object type fsnotify: introduce marks iteration helpers fsnotify: remove redundant arguments to handle_event() fsnotify: use type id to identify connector object type
2018-06-17Merge tag 'fbdev-v4.18' of git://github.com/bzolnier/linuxLinus Torvalds50-2986/+87
Pull fbdev updates from Bartlomiej Zolnierkiewicz: "There is nothing really major here, few small fixes, some cleanups and dead drivers removal: - mark omapfb drivers as orphans in MAINTAINERS file (Tomi Valkeinen) - add missing module license tags to omap/omapfb driver (Arnd Bergmann) - add missing GPIOLIB dependendy to omap2/omapfb driver (Arnd Bergmann) - convert savagefb, aty128fb & radeonfb drivers to use msleep & co. (Jia-Ju Bai) - allow COMPILE_TEST build for viafb driver (media part was reviewed by media subsystem Maintainer) - remove unused MERAM support from sh_mobile_lcdcfb and shmob-drm drivers (drm parts were acked by shmob-drm driver Maintainer) - remove unused auo_k190xfb drivers - misc cleanups (Souptick Joarder, Wolfram Sang, Markus Elfring, Andy Shevchenko, Colin Ian King)" * tag 'fbdev-v4.18' of git://github.com/bzolnier/linux: (26 commits) fb_omap2: add gpiolib dependency video/omap: add module license tags MAINTAINERS: make omapfb orphan video: fbdev: pxafb: match_string() conversion fixup video: fbdev: nvidia: fix spelling mistake: "scaleing" -> "scaling" video: fbdev: fix spelling mistake: "frambuffer" -> "framebuffer" video: fbdev: pxafb: Convert to use match_string() helper video: fbdev: via: allow COMPILE_TEST build video: fbdev: remove unused sh_mobile_meram driver drm: shmobile: remove unused MERAM support video: fbdev: sh_mobile_lcdcfb: remove unused MERAM support video: fbdev: remove unused auo_k190xfb drivers video: omap: Improve a size determination in omapfb_do_probe() video: sm501fb: Improve a size determination in sm501fb_probe() video: fbdev-MMP: Improve a size determination in path_init() video: fbdev-MMP: Delete an error message for a failed memory allocation in two functions video: auo_k190x: Delete an error message for a failed memory allocation in auok190x_common_probe() video: sh_mobile_lcdcfb: Delete an error message for a failed memory allocation in two functions video: sh_mobile_meram: Delete an error message for a failed memory allocation in sh_mobile_meram_probe() video: fbdev: sh_mobile_meram: Drop SUPERH platform dependency ...
2018-06-16Merge branch 'afs-proc' of ↵Linus Torvalds22-645/+892
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull AFS updates from Al Viro: "Assorted AFS stuff - ended up in vfs.git since most of that consists of David's AFS-related followups to Christoph's procfs series" * 'afs-proc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: afs: Optimise callback breaking by not repeating volume lookup afs: Display manually added cells in dynamic root mount afs: Enable IPv6 DNS lookups afs: Show all of a server's addresses in /proc/fs/afs/servers afs: Handle CONFIG_PROC_FS=n proc: Make inline name size calculation automatic afs: Implement network namespacing afs: Mark afs_net::ws_cell as __rcu and set using rcu functions afs: Fix a Sparse warning in xdr_decode_AFSFetchStatus() proc: Add a way to make network proc files writable afs: Rearrange fs/afs/proc.c to remove remaining predeclarations. afs: Rearrange fs/afs/proc.c to move the show routines up afs: Rearrange fs/afs/proc.c by moving fops and open functions down afs: Move /proc management functions to the end of the file
2018-06-16Merge branch 'work.compat' of ↵Linus Torvalds3-136/+112
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull compat updates from Al Viro: "Some biarch patches - getting rid of assorted (mis)uses of compat_alloc_user_space(). Not much in that area this cycle..." * 'work.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: orangefs: simplify compat ioctl handling signalfd: lift sigmask copyin and size checks to callers of do_signalfd4() vmsplice(): lift importing iovec into vmsplice(2) and compat counterpart