23 Sep, 2020

1 commit


08 Aug, 2020

1 commit

  • Pull init and set_fs() cleanups from Al Viro:
    "Christoph's 'getting rid of ksys_...() uses under KERNEL_DS' series"

    * 'hch.init_path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (50 commits)
    init: add an init_dup helper
    init: add an init_utimes helper
    init: add an init_stat helper
    init: add an init_mknod helper
    init: add an init_mkdir helper
    init: add an init_symlink helper
    init: add an init_link helper
    init: add an init_eaccess helper
    init: add an init_chmod helper
    init: add an init_chown helper
    init: add an init_chroot helper
    init: add an init_chdir helper
    init: add an init_rmdir helper
    init: add an init_unlink helper
    init: add an init_umount helper
    init: add an init_mount helper
    init: mark create_dev as __init
    init: mark console_on_rootfs as __init
    init: initialize ramdisk_execute_command at compile time
    devtmpfs: refactor devtmpfsd()
    ...

    Linus Torvalds
     

31 Jul, 2020

9 commits


24 Jun, 2020

1 commit


06 Jun, 2020

1 commit

  • Pull ext4 updates from Ted Ts'o:
    "A lot of bug fixes and cleanups for ext4, including:

    - Fix performance problems found in dioread_nolock now that it is the
    default, caused by transaction leaks.

    - Clean up fiemap handling in ext4

    - Clean up and refactor multiple block allocator (mballoc) code

    - Fix a problem with mballoc with a smaller file systems running out
    of blocks because they couldn't properly use blocks that had been
    reserved by inode preallocation.

    - Fixed a race in ext4_sync_parent() versus rename()

    - Simplify the error handling in the extent manipulation code

    - Make sure all metadata I/O errors are felected to
    ext4_ext_dirty()'s and ext4_make_inode_dirty()'s callers.

    - Avoid passing an error pointer to brelse in ext4_xattr_set()

    - Fix race which could result to freeing an inode on the dirty last
    in data=journal mode.

    - Fix refcount handling if ext4_iget() fails

    - Fix a crash in generic/019 caused by a corrupted extent node"

    * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (58 commits)
    ext4: avoid unnecessary transaction starts during writeback
    ext4: don't block for O_DIRECT if IOCB_NOWAIT is set
    ext4: remove the access_ok() check in ext4_ioctl_get_es_cache
    fs: remove the access_ok() check in ioctl_fiemap
    fs: handle FIEMAP_FLAG_SYNC in fiemap_prep
    fs: move fiemap range validation into the file systems instances
    iomap: fix the iomap_fiemap prototype
    fs: move the fiemap definitions out of fs.h
    fs: mark __generic_block_fiemap static
    ext4: remove the call to fiemap_check_flags in ext4_fiemap
    ext4: split _ext4_fiemap
    ext4: fix fiemap size checks for bitmap files
    ext4: fix EXT4_MAX_LOGICAL_BLOCK macro
    add comment for ext4_dir_entry_2 file_type member
    jbd2: avoid leaking transaction credits when unreserving handle
    ext4: drop ext4_journal_free_reserved()
    ext4: mballoc: use lock for checking free blocks while retrying
    ext4: mballoc: refactor ext4_mb_good_group()
    ext4: mballoc: introduce pcpu seqcnt for freeing PA to improve ENOSPC handling
    ext4: mballoc: refactor ext4_mb_discard_preallocations()
    ...

    Linus Torvalds
     

04 Jun, 2020

1 commit

  • Ext4 needs to remove inode from writeback lists after it is out of
    visibility of its journalling machinery (which can still dirty the
    inode). Export inode_io_list_del() for it.

    Signed-off-by: Jan Kara
    Link: https://lore.kernel.org/r/20200421085445.5731-3-jack@suse.cz
    Signed-off-by: Theodore Ts'o

    Jan Kara
     

03 Jun, 2020

1 commit

  • Pull io_uring updates from Jens Axboe:
    "A relatively quiet round, mostly just fixes and code improvements. In
    particular:

    - Make statx just use the generic statx handler, instead of open
    coding it. We don't need that anymore, as we always call it async
    safe (Bijan)

    - Enable closing of the ring itself. Also fixes O_PATH closure (me)

    - Properly name completion members (me)

    - Batch reap of dead file registrations (me)

    - Allow IORING_OP_POLL with double waitqueues (me)

    - Add tee(2) support (Pavel)

    - Remove double off read (Pavel)

    - Fix overflow cancellations (Pavel)

    - Improve CQ timeouts (Pavel)

    - Async defer drain fixes (Pavel)

    - Add support for enabling/disabling notifications on a registered
    eventfd (Stefano)

    - Remove dead state parameter (Xiaoguang)

    - Disable SQPOLL submit on dying ctx (Xiaoguang)

    - Various code cleanups"

    * tag 'for-5.8/io_uring-2020-06-01' of git://git.kernel.dk/linux-block: (29 commits)
    io_uring: fix overflowed reqs cancellation
    io_uring: off timeouts based only on completions
    io_uring: move timeouts flushing to a helper
    statx: hide interfaces no longer used by io_uring
    io_uring: call statx directly
    statx: allow system call to be invoked from io_uring
    io_uring: add io_statx structure
    io_uring: get rid of manual punting in io_close
    io_uring: separate DRAIN flushing into a cold path
    io_uring: don't re-read sqe->off in timeout_prep()
    io_uring: simplify io_timeout locking
    io_uring: fix flush req->refs underflow
    io_uring: don't submit sqes when ctx->refs is dying
    io_uring: async task poll trigger cleanup
    io_uring: add tee(2) support
    splice: export do_tee()
    io_uring: don't repeat valid flag list
    io_uring: rename io_file_put()
    io_uring: remove req->needs_fixed_files
    io_uring: cleanup io_poll_remove_one() logic
    ...

    Linus Torvalds
     

27 May, 2020

2 commits


14 May, 2020

1 commit

  • POSIX defines faccessat() as having a fourth "flags" argument, while the
    linux syscall doesn't have it. Glibc tries to emulate AT_EACCESS and
    AT_SYMLINK_NOFOLLOW, but AT_EACCESS emulation is broken.

    Add a new faccessat(2) syscall with the added flags argument and implement
    both flags.

    The value of AT_EACCESS is defined in glibc headers to be the same as
    AT_REMOVEDIR. Use this value for the kernel interface as well, together
    with the explanatory comment.

    Also add AT_EMPTY_PATH support, which is not documented by POSIX, but can
    be useful and is trivial to implement.

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     

03 Apr, 2020

1 commit

  • Pull vfs pathwalk sanitizing from Al Viro:
    "Massive pathwalk rewrite and cleanups.

    Several iterations have been posted; hopefully this thing is getting
    readable and understandable now. Pretty much all parts of pathname
    resolutions are affected...

    The branch is identical to what has sat in -next, except for commit
    message in "lift all calls of step_into() out of follow_dotdot/
    follow_dotdot_rcu", crediting Qian Cai for reporting the bug; only
    commit message changed there."

    * 'work.dotdot1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (69 commits)
    lookup_open(): don't bother with fallbacks to lookup+create
    atomic_open(): no need to pass struct open_flags anymore
    open_last_lookups(): move complete_walk() into do_open()
    open_last_lookups(): lift O_EXCL|O_CREAT handling into do_open()
    open_last_lookups(): don't abuse complete_walk() when all we want is unlazy
    open_last_lookups(): consolidate fsnotify_create() calls
    take post-lookup part of do_last() out of loop
    link_path_walk(): sample parent's i_uid and i_mode for the last component
    __nd_alloc_stack(): make it return bool
    reserve_stack(): switch to __nd_alloc_stack()
    pick_link(): take reserving space on stack into a new helper
    pick_link(): more straightforward handling of allocation failures
    fold path_to_nameidata() into its only remaining caller
    pick_link(): pass it struct path already with normal refcounting rules
    fs/namei.c: kill follow_mount()
    non-RCU analogue of the previous commit
    helper for mount rootwards traversal
    follow_dotdot(): be lazy about changing nd->path
    follow_dotdot_rcu(): be lazy about changing nd->path
    follow_dotdot{,_rcu}(): massage loops
    ...

    Linus Torvalds
     

25 Mar, 2020

1 commit


14 Mar, 2020

1 commit


30 Jan, 2020

2 commits

  • Pull io_uring updates from Jens Axboe:

    - Support for various new opcodes (fallocate, openat, close, statx,
    fadvise, madvise, openat2, non-vectored read/write, send/recv, and
    epoll_ctl)

    - Faster ring quiesce for fileset updates

    - Optimizations for overflow condition checking

    - Support for max-sized clamping

    - Support for probing what opcodes are supported

    - Support for io-wq backend sharing between "sibling" rings

    - Support for registering personalities

    - Lots of little fixes and improvements

    * tag 'for-5.6/io_uring-vfs-2020-01-29' of git://git.kernel.dk/linux-block: (64 commits)
    io_uring: add support for epoll_ctl(2)
    eventpoll: support non-blocking do_epoll_ctl() calls
    eventpoll: abstract out epoll_ctl() handler
    io_uring: fix linked command file table usage
    io_uring: support using a registered personality for commands
    io_uring: allow registering credentials
    io_uring: add io-wq workqueue sharing
    io-wq: allow grabbing existing io-wq
    io_uring/io-wq: don't use static creds/mm assignments
    io-wq: make the io_wq ref counted
    io_uring: fix refcounting with batched allocations at OOM
    io_uring: add comment for drain_next
    io_uring: don't attempt to copy iovec for READ/WRITE
    io_uring: honor IOSQE_ASYNC for linked reqs
    io_uring: prep req when do IOSQE_ASYNC
    io_uring: use labeled array init in io_op_defs
    io_uring: optimise sqe-to-req flags translation
    io_uring: remove REQ_F_IO_DRAINED
    io_uring: file switch work needs to get flushed on exit
    io_uring: hide uring_fd in ctx
    ...

    Linus Torvalds
     
  • Pull SCSI updates from James Bottomley:
    "This series is slightly unusual because it includes Arnd's compat
    ioctl tree here:

    1c46a2cf2dbd Merge tag 'block-ioctl-cleanup-5.6' into 5.6/scsi-queue

    Excluding Arnd's changes, this is mostly an update of the usual
    drivers: megaraid_sas, mpt3sas, qla2xxx, ufs, lpfc, hisi_sas.

    There are a couple of core and base updates around error propagation
    and atomicity in the attribute container base we use for the SCSI
    transport classes.

    The rest is minor changes and updates"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (149 commits)
    scsi: hisi_sas: Rename hisi_sas_cq.pci_irq_mask
    scsi: hisi_sas: Add prints for v3 hw interrupt converge and automatic affinity
    scsi: hisi_sas: Modify the file permissions of trigger_dump to write only
    scsi: hisi_sas: Replace magic number when handle channel interrupt
    scsi: hisi_sas: replace spin_lock_irqsave/spin_unlock_restore with spin_lock/spin_unlock
    scsi: hisi_sas: use threaded irq to process CQ interrupts
    scsi: ufs: Use UFS device indicated maximum LU number
    scsi: ufs: Add max_lu_supported in struct ufs_dev_info
    scsi: ufs: Delete is_init_prefetch from struct ufs_hba
    scsi: ufs: Inline two functions into their callers
    scsi: ufs: Move ufshcd_get_max_pwr_mode() to ufshcd_device_params_init()
    scsi: ufs: Split ufshcd_probe_hba() based on its called flow
    scsi: ufs: Delete struct ufs_dev_desc
    scsi: ufs: Fix ufshcd_probe_hba() reture value in case ufshcd_scsi_add_wlus() fails
    scsi: ufs-mediatek: enable low-power mode for hibern8 state
    scsi: ufs: export some functions for vendor usage
    scsi: ufs-mediatek: add dbg_register_dump implementation
    scsi: qla2xxx: Fix a NULL pointer dereference in an error path
    scsi: qla1280: Make checking for 64bit support consistent
    scsi: megaraid_sas: Update driver version to 07.713.01.00-rc1
    ...

    Linus Torvalds
     

21 Jan, 2020

2 commits


09 Jan, 2020

1 commit

  • Commit 85a8ce62c2ea ("block: add bio_truncate to fix guard_bio_eod")
    adds bio_truncate() for handling bio EOD. However, bio_truncate()
    doesn't use the passed 'op' parameter from guard_bio_eod's callers.

    So bio_trunacate() may retrieve wrong 'op', and zering pages may
    not be done for READ bio.

    Fixes this issue by moving guard_bio_eod() after bio_set_op_attrs()
    in submit_bh_wbc() so that bio_truncate() can always retrieve correct
    op info.

    Meantime remove the 'op' parameter from guard_bio_eod() because it isn't
    used any more.

    Cc: Carlos Maiolino
    Cc: linux-fsdevel@vger.kernel.org
    Fixes: 85a8ce62c2ea ("block: add bio_truncate to fix guard_bio_eod")
    Signed-off-by: Ming Lei

    Fold in kerneldoc and bio_op() change.

    Signed-off-by: Jens Axboe

    Ming Lei
     

03 Jan, 2020

1 commit

  • Now that both native and compat ioctl syscalls are
    in the same file, a couple of simplifications can
    be made, bringing the implementation closer together:

    - do_vfs_ioctl(), ioctl_preallocate(), and compat_ioctl_preallocate()
    can become static, allowing the compiler to optimize better

    - slightly update the coding style for consistency between
    the functions.

    - rather than listing each command in two switch statements
    for the compat case, just call a single function that has
    all the common commands.

    As a side-effect, FS_IOC_RESVSP/FS_IOC_RESVSP64 are now available
    to x86 compat tasks, along with FS_IOC_RESVSP_32/FS_IOC_RESVSP64_32.
    This is harmless for i386 emulation, and can be considered a bugfix
    for x32 emulation, which never supported these in the past.

    Reviewed-by: Ben Hutchings
    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

26 Oct, 2019

1 commit


21 Jul, 2019

1 commit

  • Pull dcache and mountpoint updates from Al Viro:
    "Saner handling of refcounts to mountpoints.

    Transfer the counting reference from struct mount ->mnt_mountpoint
    over to struct mountpoint ->m_dentry. That allows us to get rid of the
    convoluted games with ordering of mount shutdowns.

    The cost is in teaching shrink_dcache_{parent,for_umount} to cope with
    mixed-filesystem shrink lists, which we'll also need for the Slab
    Movable Objects patchset"

    * 'work.dcache2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    switch the remnants of releasing the mountpoint away from fs_pin
    get rid of detach_mnt()
    make struct mountpoint bear the dentry reference to mountpoint, not struct mount
    Teach shrink_dcache_parent() to cope with mixed-filesystem shrink lists
    fs/namespace.c: shift put_mountpoint() to callers of unhash_mnt()
    __detach_mounts(): lookup_mountpoint() can't return ERR_PTR() anymore
    nfs: dget_parent() never returns NULL
    ceph: don't open-code the check for dead lockref

    Linus Torvalds
     

20 Jul, 2019

2 commits

  • Pull iomap split/cleanup from Darrick Wong:
    "As promised, here's the second part of the iomap merge for 5.3, in
    which we break up iomap.c into smaller files grouped by functional
    area so that it'll be easier in the long run to maintain cohesiveness
    of code units and to review incoming patches. There are no functional
    changes and fs/iomap.c split cleanly.

    Summary:

    - Regroup the fs/iomap.c code by major functional area so that we can
    start development for 5.4 from a more stable base"

    * tag 'iomap-5.3-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
    iomap: move internal declarations into fs/iomap/
    iomap: move the main iteration code into a separate file
    iomap: move the buffered IO code into a separate file
    iomap: move the direct IO code into a separate file
    iomap: move the SEEK_HOLE code into a separate file
    iomap: move the file mapping reporting code into a separate file
    iomap: move the swapfile code into a separate file
    iomap: start moving code to fs/iomap/

    Linus Torvalds
     
  • Pull vfs mount updates from Al Viro:
    "The first part of mount updates.

    Convert filesystems to use the new mount API"

    * 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits)
    mnt_init(): call shmem_init() unconditionally
    constify ksys_mount() string arguments
    don't bother with registering rootfs
    init_rootfs(): don't bother with init_ramfs_fs()
    vfs: Convert smackfs to use the new mount API
    vfs: Convert selinuxfs to use the new mount API
    vfs: Convert securityfs to use the new mount API
    vfs: Convert apparmorfs to use the new mount API
    vfs: Convert openpromfs to use the new mount API
    vfs: Convert xenfs to use the new mount API
    vfs: Convert gadgetfs to use the new mount API
    vfs: Convert oprofilefs to use the new mount API
    vfs: Convert ibmasmfs to use the new mount API
    vfs: Convert qib_fs/ipathfs to use the new mount API
    vfs: Convert efivarfs to use the new mount API
    vfs: Convert configfs to use the new mount API
    vfs: Convert binfmt_misc to use the new mount API
    convenience helper: get_tree_single()
    convenience helper get_tree_nodev()
    vfs: Kill sget_userns()
    ...

    Linus Torvalds
     

17 Jul, 2019

1 commit


10 Jul, 2019

1 commit

  • Currently, running into a shrink list that contains dentries from different
    filesystems can cause several unpleasant things for shrink_dcache_parent()
    and for umount(2).

    The first problem is that there's a window during shrink_dentry_list() between
    __dentry_kill() takes a victim out and dropping reference to its parent. During
    that window the parent looks like a genuine busy dentry. shrink_dcache_parent()
    (or, worse yet, shrink_dcache_for_umount()) coming at that time will see no
    eviction candidates and no indication that it needs to wait for some
    shrink_dentry_list() to proceed further.

    That applies for any shrink list that might intersect with the subtree we are
    trying to shrink; the only reason it does not blow on umount(2) in the mainline
    is that we unregister the memory shrinker before hitting shrink_dcache_for_umount().

    Another problem happens if something in a mixed-filesystem shrink list gets
    be stuck in e.g. iput(), getting umount of unrelated fs to spin waiting for
    the stuck shrinker to get around to our dentries.

    Solution:
    1) have shrink_dentry_list() decrement the parent's refcount and
    make sure it's on a shrink list (ours unless it already had been on some
    other) before calling __dentry_kill(). That eliminates the window when
    shrink_dcache_parent() would've blown past the entire subtree without
    noticing anything with zero refcount not on shrink lists.
    2) when shrink_dcache_parent() has found no eviction candidates,
    but some dentries are still sitting on shrink lists, rather than
    repeating the scan in hope that shrinkers have progressed, scan looking
    for something on shrink lists with zero refcount. If such a thing is
    found, grab rcu_read_lock() and stop the scan, with caller locking
    it for eviction, dropping out of RCU and doing __dentry_kill(), with
    the same treatment for parent as shrink_dentry_list() would do.

    Note that right now mixed-filesystem shrink lists do not occur, so this
    is not a mainline bug. Howevere, there's a bunch of uses for such
    beasts (e.g. the "try and evict everything we can out of given page"
    patches; there are potential uses in mount-related code, considerably
    simplifying the life in fs/namespace.c, etc.)

    Signed-off-by: Al Viro

    Al Viro
     

28 Jun, 2019

1 commit


31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

26 May, 2019

2 commits

  • now both callers of mount_capable() have access to fs_context;
    the only difference is that for sget_fc() we have the possibility
    of fc->global being true, while for legacy_get_tree() it's guaranteed
    to be impossible. Unify to more generic variant...

    Signed-off-by: Al Viro

    Al Viro
     
  • 1) all call chains leading to sget_userns() pass through ->mount()
    instances.
    2) none of ->mount() instances is ever called directly - the only
    call site is legacy_get_tree()
    3) all remaining ->mount() instances end up calling sget_userns()

    IOW, we might as well do the capability checks just before calling
    ->mount(). As for the arguments passed to mount_capable(),
    in case of call chains to sget_userns() going through sget(),
    we either don't call mount_capable() at all, or pass current_user_ns()
    to it. The call chains going through mount_pseudo_xattr() don't
    call mount_capable() at all (SB_KERNMOUNT in flags on those).

    That could've been split into smaller steps (lifting the checks
    into sget(), then callers of sget(), then all the way to the
    entries of every ->mount() out there, then to the sole caller),
    but that would be too much churn for little benefit...

    Signed-off-by: Al Viro

    Al Viro
     

21 May, 2019

1 commit


08 May, 2019

2 commits

  • Pull mount ABI updates from Al Viro:
    "The syscalls themselves, finally.

    That's not all there is to that stuff, but switching individual
    filesystems to new methods is fortunately independent from everything
    else, so e.g. NFS series can go through NFS tree, etc.

    As those conversions get done, we'll be finally able to get rid of a
    bunch of duplication in fs/super.c introduced in the beginning of the
    entire thing. I expect that to be finished in the next window..."

    * 'work.mount-syscalls' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    vfs: Add a sample program for the new mount API
    vfs: syscall: Add fspick() to select a superblock for reconfiguration
    vfs: syscall: Add fsmount() to create a mount for a superblock
    vfs: syscall: Add fsconfig() for configuring and managing a context
    vfs: Implement logging through fs_context
    vfs: syscall: Add fsopen() to prepare for superblock creation
    Make anon_inodes unconditional
    teach move_mount(2) to work with OPEN_TREE_CLONE
    vfs: syscall: Add move_mount(2) to move mounts around
    vfs: syscall: Add open_tree(2) to reference or clone a mount

    Linus Torvalds
     
  • Pull misc dcache updates from Al Viro:
    "Most of this pile is putting name length into struct name_snapshot and
    making use of it.

    The beginning of this series ("ovl_lookup_real_one(): don't bother
    with strlen()") ought to have been split in two (separate switch of
    name_snapshot to struct qstr from overlayfs reaping the trivial
    benefits of that), but I wanted to avoid a rebase - by the time I'd
    spotted that it was (a) in -next and (b) close to 5.1-final ;-/"

    * 'work.dcache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    audit_compare_dname_path(): switch to const struct qstr *
    audit_update_watch(): switch to const struct qstr *
    inotify_handle_event(): don't bother with strlen()
    fsnotify: switch send_to_group() and ->handle_event to const struct qstr *
    fsnotify(): switch to passing const struct qstr * for file_name
    switch fsnotify_move() to passing const struct qstr * for old_name
    ovl_lookup_real_one(): don't bother with strlen()
    sysv: bury the broken "quietly truncate the long filenames" logics
    nsfs: unobfuscate
    unexport d_alloc_pseudo()

    Linus Torvalds