1. 05 Apr, 2021 3 commits
  2. 28 Mar, 2021 2 commits
  3. 24 Mar, 2021 2 commits
  4. 22 Mar, 2021 11 commits
    • Bhaskar Chowdhury's avatar
    • Julian Wiedmann's avatar
      s390/qdio: let driver manage the QAOB · 396c1004
      Julian Wiedmann authored
      We are spending way too much effort on qdio-internal bookkeeping for
      QAOB management & caching, and it's still not robust. Once qdio's
      TX path has detached the QAOB from a PENDING buffer, we lost all
      track of it until it shows up in a CQ notification again. So if the
      device is torn down before that notification arrives, we leak the QAOB.
      
      Just have the driver take care of it, and simply pass down a QAOB if
      they want a TX with async-completion capability. For a buffer in PENDING
      state that requires the QAOB for final completion, qeth can now also try
      to recycle the buffer's QAOB rather than unconditionally freeing it.
      
      This also eliminates the qdio_outbuf_state array, which was only needed
      to transfer the aob->user1 tag from the driver to the qdio layer.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Acked-by: default avatarBenjamin Block <bblock@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      396c1004
    • Niklas Schnelle's avatar
      s390/pci: move zpci_remove_device() to bus code · 95b3a8b4
      Niklas Schnelle authored
      The zpci_remove_device() function removes the device from the PCI common
      code core which is an operation dealing primarily with the zbus and PCI
      bus code. With that and to match an upcoming refactoring of the
      symmetric scanning part move it to the bus code.
      Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
      Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      95b3a8b4
    • Niklas Schnelle's avatar
      s390/pci: unify de-/configure for slots and events · 2631f6b6
      Niklas Schnelle authored
      A zPCI event with PEC 0x0301 for an existing zPCI device goes through
      the same actions as enable_slot(). Similarly a zPCI event with PEC
      0x0303 does the same steps as disable_slot().
      We can thus unify both actions as zpci_configure_device() respectively
      zpci_deconfigure_device().
      Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
      Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      2631f6b6
    • Vineeth Vijayan's avatar
      s390/cio: add CRW inject functionality · a4f17cc7
      Vineeth Vijayan authored
      This patch introduces the mechanism to inject artificial events to the
      CIO layer.
      
      One of the main-event type which triggers the CommonIO operations are
      Channel Report events. When a malfunction or other condition affecting
      channel-subsystem operation is recognized, a Channel Report Word
      (consisting of one or more CRWs) describing the condition is made
      pending for retrieval and analysis by the program. The CRW contains
      information concerning the identity and state of a facility following
      the detection of the malfunction or other condition.
      
      The patch introduces two debugfs interfaces which can be used to inject
      'artificial' events from the userspace. It is intended to provide an easy
      means to increase the test coverage for CIO code. And this functionality
      can be enabled via a new configuration option CONFIG_CIO_INJECT.
      
      The newly introduces debugfs interfaces can be used as mentioned below
      to generate different fake-events. To use the crw_inject, first we should
      enable it by using enable_inject interface.
      i.e
      
      echo 1 > /sys/kernel/debug/s390/cio/enable_inject
      
      After the first step, user can simulate CRW as follows:
      
      echo <solicited> <overflow> <chaining> <rsc> <ancillary> <erc> <rsid> \
                                     > /sys/kernel/debug/s390/cio/crw_inject
      
      Example:
      A permanent error ERC on CHPID 0x60 would look like this:
      
        echo 0 0 0 4 0 6 0x60 > /sys/kernel/debug/s390/cio/crw_inject
      
      and an initialized ERC on the same CHPID:
      
        echo 0 0 0 4 0 2 0x60 > /sys/kernel/debug/s390/cio/crw_inject
      Signed-off-by: default avatarVineeth Vijayan <vneethv@linux.ibm.com>
      Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      a4f17cc7
    • Vineeth Vijayan's avatar
      s390/cio: introduce CIO debugfs directory · 64a715ab
      Vineeth Vijayan authored
      This patch introduces an s390 Common I/O layer debugfs directory that is
      intended to provide access to debugging-related CIO functions and data.
      The directory is created as /sys/kernel/debug/s390/cio
      Signed-off-by: default avatarVineeth Vijayan <vneethv@linux.ibm.com>
      Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      64a715ab
    • Niklas Schnelle's avatar
      s390/pci: add zpci_event_hard_deconfigured() · dee60c0d
      Niklas Schnelle authored
      Extract the handling of PEC 0x0304 into a function and make sure we only
      attempt to disable the function if it is enabled. Also check for errors
      returned by zpci_disable_device() and leave the function alone if there
      are any.
      Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
      Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      dee60c0d
    • Niklas Schnelle's avatar
      s390/pci: deconfigure device on release · a9045c22
      Niklas Schnelle authored
      When zpci_release_device() is called on a zPCI function that is still
      configured it would not be deconfigured. Until now this hasn't caused
      any problems because zpci_zdev_put() is only ever called for devices
      in Standby or Reserved. Fix it by adding sclp_pci_deconfigure() to the
      switch when in Configured state.
      Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
      Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      a9045c22
    • Niklas Schnelle's avatar
      s390/pci: refactor zpci function states · f6576a1b
      Niklas Schnelle authored
      The current zdev->state mixes the configuration states supported by CLP
      with an additional Online state which is used inconsistently to include
      enabled zPCI functions which are not yet visible to the common PCI
      subsytem. In preparation for a clean separation between architected
      configuration states and fine grained function states remove the Online
      function state.
      
      Where we previously checked for Online it is more accurate to check if
      the function is enabled to avoid an edge case where a disabled device
      was still treated as Online. This also simplifies checks whether
      a function is configured as this is now directly reflected by its
      function state.
      Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
      Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      f6576a1b
    • Peter Oberparleiter's avatar
      s390/sclp: increase sclp console line length · 98ce70b7
      Peter Oberparleiter authored
      Kernel and console/TTY messages written to the SCLP line mode console
      are wrapped at 80 characters per line by the associated SCLP driver.
      This makes long lines of output difficult to read, and requires editing
      of wrapped lines copied from the output device.
      
      Neither the firmware interface used to access the SCLP console, nor the
      HMC "Operating System Messages" web interface that displays these
      messages require such a length limit. Also other operating systems such
      as z/VM do not impose similar limits on messages they emit to the same
      console device.
      
      This patch therefore increases the limit to 320 characters per line to
      make SCLP line mode console output more readable. As a result 99% of
      lines written during a typical boot will not be wrapped, compared to
      about 50% wrapped lines at 80 characters per line. Another positive
      side-effect of this change is that the HMC console interface is able to
      keep more messages in its history buffer due to fewer line-breaks being
      generated.
      
      In a worst case scenario this means that a 4k console buffer is emitted
      with the last ~400 bytes empty (320 text + 78 headers). This is more
      than offset by the fact that each line that is not truncated saves 78
      header bytes in the buffer. As a result the actual number of emitted
      buffers should be about the same as with the 80 character limit.
      
      This patch also removes the differentiation between line lengths of
      SCLP line mode output on z/VM and non-z/VM systems. While the z/VM
      hypervisor adds a prefix in front of each line ('xx: ' where xx is the
      number of the CPU issuing the message), adjusting Linux line lengths did
      not significantly increase readability of console output, and makes even
      less of a difference with longer lines.
      Signed-off-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
      Tested-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
      Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      98ce70b7
    • Janosch Frank's avatar
      s390/uv: add prot virt guest/host indication files · 37564ed8
      Janosch Frank authored
      Let's export the prot_virt_guest and prot_virt_host variables into the
      UV sysfs firmware interface to make them easily consumable by
      administrators.
      
      prot_virt_host being 1 indicates that we did the UV
      initialization (opt-in)
      
      prot_virt_guest being 1 indicates that the UV indicates the share and
      unshare ultravisor calls which is an indication that we are running as
      a protected guest.
      Signed-off-by: default avatarJanosch Frank <frankja@linux.ibm.com>
      Acked-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      37564ed8
  5. 21 Mar, 2021 22 commits
    • Linus Torvalds's avatar
      Linux 5.12-rc4 · 0d02ec6b
      Linus Torvalds authored
      0d02ec6b
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · d7f5f1bd
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Miscellaneous ext4 bug fixes for v5.12"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: initialize ret to suppress smatch warning
        ext4: stop inode update before return
        ext4: fix rename whiteout with fast commit
        ext4: fix timer use-after-free on failed mount
        ext4: fix potential error in ext4_do_update_inode
        ext4: do not try to set xattr into ea_inode if value is empty
        ext4: do not iput inode under running transaction in ext4_rename()
        ext4: find old entry again if failed to rename whiteout
        ext4: fix error handling in ext4_end_enable_verity()
        ext4: fix bh ref count on error paths
        fs/ext4: fix integer overflow in s_log_groups_per_flex
        ext4: add reclaim checks to xattr code
        ext4: shrink race window in ext4_should_retry_alloc()
      d7f5f1bd
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.12-2021-03-21' of git://git.kernel.dk/linux-block · 2c41fab1
      Linus Torvalds authored
      Pull io_uring followup fixes from Jens Axboe:
      
       - The SIGSTOP change from Eric, so we properly ignore that for
         PF_IO_WORKER threads.
      
       - Disallow sending signals to PF_IO_WORKER threads in general, we're
         not interested in having them funnel back to the io_uring owning
         task.
      
       - Stable fix from Stefan, ensuring we properly break links for short
         send/sendmsg recv/recvmsg if MSG_WAITALL is set.
      
       - Catch and loop when needing to run task_work before a PF_IO_WORKER
         threads goes to sleep.
      
      * tag 'io_uring-5.12-2021-03-21' of git://git.kernel.dk/linux-block:
        io_uring: call req_set_fail_links() on short send[msg]()/recv[msg]() with MSG_WAITALL
        io-wq: ensure task is running before processing task_work
        signal: don't allow STOP on PF_IO_WORKER threads
        signal: don't allow sending any signals to PF_IO_WORKER threads
      2c41fab1
    • Linus Torvalds's avatar
      Merge tag 'staging-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 1d4345eb
      Linus Torvalds authored
      Pull staging and IIO driver fixes from Greg KH:
       "Some small staging and IIO driver fixes:
      
         - MAINTAINERS changes for the move of the staging mailing list
      
         - comedi driver fixes to get request_irq() to work correctly
      
         - counter driver fixes for reported issues with iio devices
      
         - tiny iio driver fixes for reported issues.
      
        All of these have been in linux-next with no reported problems"
      
      * tag 'staging-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: vt665x: fix alignment constraints
        staging: comedi: cb_pcidas64: fix request_irq() warn
        staging: comedi: cb_pcidas: fix request_irq() warn
        MAINTAINERS: move the staging subsystem to lists.linux.dev
        MAINTAINERS: move some real subsystems off of the staging mailing list
        iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler
        iio: hid-sensor-temperature: Fix issues of timestamp channel
        iio: hid-sensor-humidity: Fix alignment issue of timestamp channel
        counter: stm32-timer-cnt: fix ceiling miss-alignment with reload register
        counter: stm32-timer-cnt: fix ceiling write max value
        counter: stm32-timer-cnt: Report count function when SLAVE_MODE_DISABLED
        iio: adc: ab8500-gpadc: Fix off by 10 to 3
        iio:adc:stm32-adc: Add HAS_IOMEM dependency
        iio: adis16400: Fix an error code in adis16400_initial_setup()
        iio: adc: adi-axi-adc: add proper Kconfig dependencies
        iio: adc: ad7949: fix wrong ADC result due to incorrect bit mask
        iio: hid-sensor-prox: Fix scale not correct issue
        iio:adc:qcom-spmi-vadc: add default scale to LR_MUX2_BAT_ID channel
      1d4345eb
    • Linus Torvalds's avatar
      Merge tag 'usb-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 3001c355
      Linus Torvalds authored
      Pull USB and Thunderbolt driver fixes from Greg KH:
       "Here are some small Thunderbolt and USB driver fixes for some reported
        issues:
      
         - thunderbolt fixes for minor problems
      
         - typec fixes for power issues
      
         - usb-storage quirk addition
      
         - usbip bugfix
      
         - dwc3 bugfix when stopping transfers
      
         - cdnsp bugfix for isoc transfers
      
         - gadget use-after-free fix
      
        All have been in linux-next this week with no reported issues"
      
      * tag 'usb-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: typec: tcpm: Skip sink_cap query only when VDM sm is busy
        usb: dwc3: gadget: Prevent EP queuing while stopping transfers
        usb: typec: tcpm: Invoke power_supply_changed for tcpm-source-psy-
        usb: typec: Remove vdo[3] part of tps6598x_rx_identity_reg struct
        usb-storage: Add quirk to defeat Kindle's automatic unload
        usb: gadget: configfs: Fix KASAN use-after-free
        usbip: Fix incorrect double assignment to udc->ud.tcp_rx
        usb: cdnsp: Fixes incorrect value in ISOC TRB
        thunderbolt: Increase runtime PM reference count on DP tunnel discovery
        thunderbolt: Initialize HopID IDAs in tb_switch_alloc()
      3001c355
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5ee96fa9
      Linus Torvalds authored
      Pull irq fix from Ingo Molnar:
       "A change to robustify force-threaded IRQ handlers to always disable
        interrupts, plus a DocBook fix.
      
        The force-threaded IRQ handler change has been accelerated from the
        normal schedule of such a change to keep the bad pattern/workaround of
        spin_lock_irqsave() in handlers or IRQF_NOTHREAD as a kludge from
        spreading"
      
      * tag 'irq-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq: Disable interrupts for force threaded handlers
        genirq/irq_sim: Fix typos in kernel doc (fnode -> fwnode)
      5ee96fa9
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1c74516c
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "Boundary condition fixes for bugs unearthed by the perf fuzzer"
      
      * tag 'perf-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel: Fix unchecked MSR access error caused by VLBR_EVENT
        perf/x86/intel: Fix a crash caused by zero PEBS status
      1c74516c
    • Linus Torvalds's avatar
      Merge tag 'locking-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5ba33b48
      Linus Torvalds authored
      Pull locking fixes from Ingo Molnar:
      
       - Get static calls & modules right. Hopefully.
      
       - WW mutex fixes
      
      * tag 'locking-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        static_call: Fix static_call_update() sanity check
        static_call: Align static_call_is_init() patching condition
        static_call: Fix static_call_set_init()
        locking/ww_mutex: Fix acquire/release imbalance in ww_acquire_init()/ww_acquire_fini()
        locking/ww_mutex: Simplify use_ww_ctx & ww_ctx handling
      5ba33b48
    • Linus Torvalds's avatar
      Merge tag 'efi-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 92ed88cb
      Linus Torvalds authored
      Pull EFI fixes from Ingo Molnar:
      
       - another missing RT_PROP table related fix, to ensure that the
         efivarfs pseudo filesystem fails gracefully if variable services
         are unsupported
      
       - use the correct alignment for literal EFI GUIDs
      
       - fix a use after unmap issue in the memreserve code
      
      * tag 'efi-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi: use 32-bit alignment for efi_guid_t literals
        firmware/efi: Fix a use after bug in efi_mem_reserve_persistent
        efivars: respect EFI_UNSUPPORTED return from firmware
      92ed88cb
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5e3ddf96
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
       "The freshest pile of shiny x86 fixes for 5.12:
      
         - Add the arch-specific mapping between physical and logical CPUs to
           fix devicetree-node lookups
      
         - Restore the IRQ2 ignore logic
      
         - Fix get_nr_restart_syscall() to return the correct restart syscall
           number. Split in a 4-patches set to avoid kABI breakage when
           backporting to dead kernels"
      
      * tag 'x86_urgent_for_v5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/apic/of: Fix CPU devicetree-node lookups
        x86/ioapic: Ignore IRQ2 again
        x86: Introduce restart_block->arch_data to remove TS_COMPAT_RESTART
        x86: Introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall()
        x86: Move TS_COMPAT back to asm/thread_info.h
        kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data()
      5e3ddf96
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · b35660a7
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix a possible stack corruption and subsequent DLPAR failure in the
         rpadlpar_io PCI hotplug driver
      
       - Two build fixes for uncommon configurations
      
      Thanks to Christophe Leroy and Tyrel Datwyler.
      
      * tag 'powerpc-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        PCI: rpadlpar: Fix potential drc_name corruption in store functions
        powerpc: Force inlining of cpu_has_feature() to avoid build failure
        powerpc/vdso32: Add missing _restgpr_31_x to fix build failure
      b35660a7
    • Stefan Metzmacher's avatar
      io_uring: call req_set_fail_links() on short send[msg]()/recv[msg]() with MSG_WAITALL · 0031275d
      Stefan Metzmacher authored
      Without that it's not safe to use them in a linked combination with
      others.
      
      Now combinations like IORING_OP_SENDMSG followed by IORING_OP_SPLICE
      should be possible.
      
      We already handle short reads and writes for the following opcodes:
      
      - IORING_OP_READV
      - IORING_OP_READ_FIXED
      - IORING_OP_READ
      - IORING_OP_WRITEV
      - IORING_OP_WRITE_FIXED
      - IORING_OP_WRITE
      - IORING_OP_SPLICE
      - IORING_OP_TEE
      
      Now we have it for these as well:
      
      - IORING_OP_SENDMSG
      - IORING_OP_SEND
      - IORING_OP_RECVMSG
      - IORING_OP_RECV
      
      For IORING_OP_RECVMSG we also check for the MSG_TRUNC and MSG_CTRUNC
      flags in order to call req_set_fail_links().
      
      There might be applications arround depending on the behavior
      that even short send[msg]()/recv[msg]() retuns continue an
      IOSQE_IO_LINK chain.
      
      It's very unlikely that such applications pass in MSG_WAITALL,
      which is only defined in 'man 2 recvmsg', but not in 'man 2 sendmsg'.
      
      It's expected that the low level sock_sendmsg() call just ignores
      MSG_WAITALL, as MSG_ZEROCOPY is also ignored without explicitly set
      SO_ZEROCOPY.
      
      We also expect the caller to know about the implicit truncation to
      MAX_RW_COUNT, which we don't detect.
      
      cc: netdev@vger.kernel.org
      Link: https://lore.kernel.org/r/c4e1a4cc0d905314f4d5dc567e65a7b09621aab3.1615908477.git.metze@samba.orgSigned-off-by: default avatarStefan Metzmacher <metze@samba.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      0031275d
    • Jens Axboe's avatar
      io-wq: ensure task is running before processing task_work · 00ddff43
      Jens Axboe authored
      Mark the current task as running if we need to run task_work from the
      io-wq threads as part of work handling. If that is the case, then return
      as such so that the caller can appropriately loop back and reset if it
      was part of a going-to-sleep flush.
      
      Fixes: 3bfe6106 ("io-wq: fork worker threads from original task")
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      00ddff43
    • Eric W. Biederman's avatar
      signal: don't allow STOP on PF_IO_WORKER threads · 4db4b1a0
      Eric W. Biederman authored
      Just like we don't allow normal signals to IO threads, don't deliver a
      STOP to a task that has PF_IO_WORKER set. The IO threads don't take
      signals in general, and have no means of flushing out a stop either.
      
      Longer term, we may want to look into allowing stop of these threads,
      as it relates to eg process freezing. For now, this prevents a spin
      issue if a SIGSTOP is delivered to the parent task.
      Reported-by: default avatarStefan Metzmacher <metze@samba.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      4db4b1a0
    • Jens Axboe's avatar
      signal: don't allow sending any signals to PF_IO_WORKER threads · 5be28c8f
      Jens Axboe authored
      They don't take signals individually, and even if they share signals with
      the parent task, don't allow them to be delivered through the worker
      thread. Linux does allow this kind of behavior for regular threads, but
      it's really a compatability thing that we need not care about for the IO
      threads.
      Reported-by: default avatarStefan Metzmacher <metze@samba.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      5be28c8f
    • Theodore Ts'o's avatar
      64395d95
    • Pan Bian's avatar
      ext4: stop inode update before return · 512c15ef
      Pan Bian authored
      The inode update should be stopped before returing the error code.
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Link: https://lore.kernel.org/r/20210117085732.93788-1-bianpan2016@163.com
      Fixes: 8016e29f ("ext4: fast commit recovery path")
      Cc: stable@kernel.org
      Reviewed-by: default avatarHarshad Shirwadkar <harshadshirwadkar@gmail.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      512c15ef
    • Harshad Shirwadkar's avatar
      ext4: fix rename whiteout with fast commit · 8210bb29
      Harshad Shirwadkar authored
      This patch adds rename whiteout support in fast commits. Note that the
      whiteout object that gets created is actually char device. Which
      imples, the function ext4_inode_journal_mode(struct inode *inode)
      would return "JOURNAL_DATA" for this inode. This has a consequence in
      fast commit code that it will make creation of the whiteout object a
      fast-commit ineligible behavior and thus will fall back to full
      commits. With this patch, this can be observed by running fast commits
      with rename whiteout and seeing the stats generated by ext4_fc_stats
      tracepoint as follows:
      
      ext4_fc_stats: dev 254:32 fc ineligible reasons:
      XATTR:0, CROSS_RENAME:0, JOURNAL_FLAG_CHANGE:0, NO_MEM:0, SWAP_BOOT:0,
      RESIZE:0, RENAME_DIR:0, FALLOC_RANGE:0, INODE_JOURNAL_DATA:16;
      num_commits:6, ineligible: 6, numblks: 3
      
      So in short, this patch guarantees that in case of rename whiteout, we
      fall back to full commits.
      
      Amir mentioned that instead of creating a new whiteout object for
      every rename, we can create a static whiteout object with irrelevant
      nlink. That will make fast commits to not fall back to full
      commit. But until this happens, this patch will ensure correctness by
      falling back to full commits.
      
      Fixes: 8016e29f ("ext4: fast commit recovery path")
      Cc: stable@kernel.org
      Signed-off-by: default avatarHarshad Shirwadkar <harshadshirwadkar@gmail.com>
      Link: https://lore.kernel.org/r/20210316221921.1124955-1-harshadshirwadkar@gmail.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      8210bb29
    • Jan Kara's avatar
      ext4: fix timer use-after-free on failed mount · 2a4ae3bc
      Jan Kara authored
      When filesystem mount fails because of corrupted filesystem we first
      cancel the s_err_report timer reminding fs errors every day and only
      then we flush s_error_work. However s_error_work may report another fs
      error and re-arm timer thus resulting in timer use-after-free. Fix the
      problem by first flushing the work and only after that canceling the
      s_err_report timer.
      
      Reported-by: syzbot+628472a2aac693ab0fcd@syzkaller.appspotmail.com
      Fixes: 2d01ddc8 ("ext4: save error info to sb through journal if available")
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Link: https://lore.kernel.org/r/20210315165906.2175-1-jack@suse.czSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      2a4ae3bc
    • Shijie Luo's avatar
      ext4: fix potential error in ext4_do_update_inode · 7d8bd3c7
      Shijie Luo authored
      If set_large_file = 1 and errors occur in ext4_handle_dirty_metadata(),
      the error code will be overridden, go to out_brelse to avoid this
      situation.
      Signed-off-by: default avatarShijie Luo <luoshijie1@huawei.com>
      Link: https://lore.kernel.org/r/20210312065051.36314-1-luoshijie1@huawei.com
      Cc: stable@kernel.org
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      7d8bd3c7
    • zhangyi (F)'s avatar
      ext4: do not try to set xattr into ea_inode if value is empty · 6b224899
      zhangyi (F) authored
      Syzbot report a warning that ext4 may create an empty ea_inode if set
      an empty extent attribute to a file on the file system which is no free
      blocks left.
      
        WARNING: CPU: 6 PID: 10667 at fs/ext4/xattr.c:1640 ext4_xattr_set_entry+0x10f8/0x1114 fs/ext4/xattr.c:1640
        ...
        Call trace:
         ext4_xattr_set_entry+0x10f8/0x1114 fs/ext4/xattr.c:1640
         ext4_xattr_block_set+0x1d0/0x1b1c fs/ext4/xattr.c:1942
         ext4_xattr_set_handle+0x8a0/0xf1c fs/ext4/xattr.c:2390
         ext4_xattr_set+0x120/0x1f0 fs/ext4/xattr.c:2491
         ext4_xattr_trusted_set+0x48/0x5c fs/ext4/xattr_trusted.c:37
         __vfs_setxattr+0x208/0x23c fs/xattr.c:177
        ...
      
      Now, ext4 try to store extent attribute into an external inode if
      ext4_xattr_block_set() return -ENOSPC, but for the case of store an
      empty extent attribute, store the extent entry into the extent
      attribute block is enough. A simple reproduce below.
      
        fallocate test.img -l 1M
        mkfs.ext4 -F -b 2048 -O ea_inode test.img
        mount test.img /mnt
        dd if=/dev/zero of=/mnt/foo bs=2048 count=500
        setfattr -n "user.test" /mnt/foo
      
      Reported-by: syzbot+98b881fdd8ebf45ab4ae@syzkaller.appspotmail.com
      Fixes: 9c6e7853 ("ext4: reserve space for xattr entries/names")
      Cc: stable@kernel.org
      Signed-off-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
      Link: https://lore.kernel.org/r/20210305120508.298465-1-yi.zhang@huawei.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      6b224899
    • zhangyi (F)'s avatar
      ext4: do not iput inode under running transaction in ext4_rename() · 5dccdc5a
      zhangyi (F) authored
      In ext4_rename(), when RENAME_WHITEOUT failed to add new entry into
      directory, it ends up dropping new created whiteout inode under the
      running transaction. After commit <9b88f9fb> ("ext4: Do not iput inode
      under running transaction"), we follow the assumptions that evict() does
      not get called from a transaction context but in ext4_rename() it breaks
      this suggestion. Although it's not a real problem, better to obey it, so
      this patch add inode to orphan list and stop transaction before final
      iput().
      Signed-off-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
      Link: https://lore.kernel.org/r/20210303131703.330415-2-yi.zhang@huawei.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      5dccdc5a