1. 03 Mar, 2022 3 commits
    • Ye Bin's avatar
      ext4: fix fs corruption when tring to remove a non-empty directory with IO error · 7aab5c84
      Ye Bin authored
      We inject IO error when rmdir non empty direcory, then got issue as follows:
      step1: mkfs.ext4 -F /dev/sda
      step2: mount /dev/sda  test
      step3: cd test
      step4: mkdir -p 1/2
      step5: rmdir 1
      	[  110.920551] ext4_empty_dir: inject fault
      	[  110.921926] EXT4-fs warning (device sda): ext4_rmdir:3113: inode #12:
      	comm rmdir: empty directory '1' has too many links (3)
      step6: cd ..
      step7: umount test
      step8: fsck.ext4 -f /dev/sda
      	e2fsck 1.42.9 (28-Dec-2013)
      	Pass 1: Checking inodes, blocks, and sizes
      	Pass 2: Checking directory structure
      	Entry '..' in .../??? (13) has deleted/unused inode 12.  Clear<y>? yes
      	Pass 3: Checking directory connectivity
      	Unconnected directory inode 13 (...)
      	Connect to /lost+found<y>? yes
      	Pass 4: Checking reference counts
      	Inode 13 ref count is 3, should be 2.  Fix<y>? yes
      	Pass 5: Checking group summary information
      
      	/dev/sda: ***** FILE SYSTEM WAS MODIFIED *****
      	/dev/sda: 12/131072 files (0.0% non-contiguous), 26157/524288 blocks
      
      ext4_rmdir
      	if (!ext4_empty_dir(inode))
      		goto end_rmdir;
      ext4_empty_dir
      	bh = ext4_read_dirblock(inode, 0, DIRENT_HTREE);
      	if (IS_ERR(bh))
      		return true;
      Now if read directory block failed, 'ext4_empty_dir' will return true, assume
      directory is empty. Obviously, it will lead to above issue.
      To solve this issue, if read directory block failed 'ext4_empty_dir' just
      return false. To avoid making things worse when file system is already
      corrupted, 'ext4_empty_dir' also return false.
      Signed-off-by: default avatarYe Bin <yebin10@huawei.com>
      Cc: stable@kernel.org
      Link: https://lore.kernel.org/r/20220228024815.3952506-1-yebin10@huawei.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      7aab5c84
    • Wang Qing's avatar
      ext4: use time_is_before_jiffies() instead of open coding it · a861fb9f
      Wang Qing authored
      Use the helper function time_is_{before,after}_jiffies() to improve
      code readability.
      Signed-off-by: default avatarWang Qing <wangqing@vivo.com>
      Link: https://lore.kernel.org/r/1646018120-61462-1-git-send-email-wangqing@vivo.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      a861fb9f
    • Ritesh Harjani's avatar
      ext4: improve fast_commit performance and scalability · b3998b3b
      Ritesh Harjani authored
      Currently ext4_fc_commit_dentry_updates() is of quadratic time
      complexity, which is causing performance bottlenecks with high
      threads/file/dir count with fs_mark.
      
      This patch makes commit dentry updates (and hence ext4_fc_commit()) path
      to linear time complexity. Hence improves the performance of workloads
      which does fsync on multiple threads/open files one-by-one.
      
      Absolute numbers in avg file creates per sec (from fs_mark in 1K order)
      =======================================================================
      no.     Order   without-patch(K)   with-patch(K)   Diff(%)
      1       1        16.90              17.51           +3.60
      2       2,2      32.08              31.80           -0.87
      3       3,3      53.97              55.01           +1.92
      4       4,4      78.94              76.90           -2.58
      5       5,5      95.82              95.37           -0.46
      6       6,6      87.92              103.38          +17.58
      7       6,10      0.73              126.13          +17178.08
      8       6,14      2.33              143.19          +6045.49
      
      workload type
      ==============
      For e.g. 7th row order of 6,10 (2^6 == 64 && 2^10 == 1024)
      echo /run/riteshh/mnt/{1..64} |sed -E 's/[[:space:]]+/ -d /g' \
        | xargs -I {} bash -c "sudo fs_mark -L 100 -D 1024 -n 1024 -s0 -S5 -d {}"
      
      Perf profile
      (w/o patches)
      =============================
      87.15%  [kernel]  [k] ext4_fc_commit           --> Heavy contention/bottleneck
       1.98%  [kernel]  [k] perf_event_interrupt
       0.96%  [kernel]  [k] power_pmu_enable
       0.91%  [kernel]  [k] update_sd_lb_stats.constprop.0
       0.67%  [kernel]  [k] ktime_get
      Signed-off-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
      Reviewed-by: default avatarHarshad Shirwadkar <harshadshirwadkar@gmail.com>
      Link: https://lore.kernel.org/r/930f35d4fd5f83e2673c868781d9ebf15e91bf4e.1645426817.git.riteshh@linux.ibm.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      b3998b3b
  2. 26 Feb, 2022 13 commits
  3. 20 Feb, 2022 13 commits
  4. 19 Feb, 2022 5 commits
  5. 18 Feb, 2022 6 commits
    • Dmitry Torokhov's avatar
      Input: psmouse - set up dependency between PS/2 and SMBus companions · 7b1f781f
      Dmitry Torokhov authored
      When we switch from emulated PS/2 to native (RMI4 or Elan) protocols, we
      create SMBus companion devices that are attached to I2C/SMBus controllers.
      However, when suspending and resuming, we also need to make sure that we
      take into account the PS/2 device they are associated with, so that PS/2
      device is suspended after the companion and resumed before it, otherwise
      companions will not work properly. Before I2C devices were marked for
      asynchronous suspend/resume, this ordering happened naturally, but now we
      need to enforce it by establishing device links, with PS/2 devices being
      suppliers and SMBus companions being consumers.
      
      Fixes: 172d9319 ("i2c: enable async suspend/resume on i2c client devices")
      Reported-and-tested-by: default avatarHugh Dickins <hughd@google.com>
      Tested-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
      Link: https://lore.kernel.org/r/89456fcd-a113-4c82-4b10-a9bcaefac68f@google.com
      Link: https://lore.kernel.org/r/YgwQN8ynO88CPMju@google.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      7b1f781f
    • Rafael J. Wysocki's avatar
      Merge branch 'acpi-processor' · 82926564
      Rafael J. Wysocki authored
      Merge fix for a recent boot lockup regression on 32-bit ThinkPad T40.
      
      * acpi-processor:
        ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40
      82926564
    • Linus Torvalds's avatar
      Merge tag 'mtd/fixes-for-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · 7993e65f
      Linus Torvalds authored
      Pull MTD fixes from Miquel Raynal:
       "MTD changes:
      
         - Qcom:
            - Don't print error message on -EPROBE_DEFER
            - Fix kernel panic on skipped partition
            - Fix missing free for pparts in cleanup
      
         - phram: Prevent divide by zero bug in phram_setup()
      
        Raw NAND controller changes:
      
         - ingenic: Fix missing put_device in ingenic_ecc_get
      
         - qcom: Fix clock sequencing in qcom_nandc_probe()
      
         - omap2: Prevent invalid configuration and build error
      
         - gpmi: Don't leak PM reference in error path
      
         - brcmnand: Fix incorrect sub-page ECC status"
      
      * tag 'mtd/fixes-for-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
        mtd: rawnand: brcmnand: Fixed incorrect sub-page ECC status
        mtd: rawnand: gpmi: don't leak PM reference in error path
        mtd: phram: Prevent divide by zero bug in phram_setup()
        mtd: rawnand: omap2: Prevent invalid configuration and build error
        mtd: parsers: qcom: Fix missing free for pparts in cleanup
        mtd: parsers: qcom: Fix kernel panic on skipped partition
        mtd: parsers: qcom: Don't print error message on -EPROBE_DEFER
        mtd: rawnand: qcom: Fix clock sequencing in qcom_nandc_probe()
        mtd: rawnand: ingenic: Fix missing put_device in ingenic_ecc_get
      7993e65f
    • Linus Torvalds's avatar
      Merge tag 'block-5.17-2022-02-17' of git://git.kernel.dk/linux-block · b9889768
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - Surprise removal fix (Christoph)
      
       - Ensure that pages are zeroed before submitted for userspace IO
         (Haimin)
      
       - Fix blk-wbt accounting issue with BFQ (Laibin)
      
       - Use bsize for discard granularity in loop (Ming)
      
       - Fix missing zone handling in blk_complete_request() (Pankaj)
      
      * tag 'block-5.17-2022-02-17' of git://git.kernel.dk/linux-block:
        block/wbt: fix negative inflight counter when remove scsi device
        block: fix surprise removal for drivers calling blk_set_queue_dying
        block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern
        block: loop:use kstatfs.f_bsize of backing file to set discard granularity
        block: Add handling for zone append command in blk_complete_request
      b9889768
    • Linus Torvalds's avatar
      Merge tag 'sound-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 2848551b
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of small patches, mostly for old and new regressions and
        device-specific fixes.
      
         - Regression fixes regarding ALSA core SG-buffer helpers
      
         - Regression fix for Realtek HD-audio mutex deadlock
      
         - Regression fix for USB-audio PM resume error
      
         - More coverage of ASoC core control API notification fixes
      
         - Old regression fixes for HD-audio probe mask
      
         - Fixes for ASoC Realtek codec work handling
      
         - Other device-specific quirks / fixes"
      
      * tag 'sound-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits)
        ASoC: intel: skylake: Set max DMA segment size
        ASoC: SOF: hda: Set max DMA segment size
        ALSA: hda: Set max DMA segment size
        ALSA: hda/realtek: Fix deadlock by COEF mutex
        ALSA: usb-audio: Don't abort resume upon errors
        ALSA: hda: Fix missing codec probe on Shenker Dock 15
        ALSA: hda: Fix regression on forced probe mask option
        ALSA: hda/realtek: Add quirk for Legion Y9000X 2019
        ALSA: usb-audio: revert to IMPLICIT_FB_FIXED_DEV for M-Audio FastTrack Ultra
        ASoC: wm_adsp: Correct control read size when parsing compressed buffer
        ASoC: qcom: Actually clear DMA interrupt register for HDMI
        ALSA: memalloc: invalidate SG pages before sync
        ALSA: memalloc: Fix dma_need_sync() checks
        MAINTAINERS: update cros_ec_codec maintainers
        ASoC: rt5682: do not block workqueue if card is unbound
        ASoC: rt5668: do not block workqueue if card is unbound
        ASoC: rt5682s: do not block workqueue if card is unbound
        ASoC: tas2770: Insert post reset delay
        ASoC: Revert "ASoC: mediatek: Check for error clk pointer"
        ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
        ...
      2848551b
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 45a98a71
      Linus Torvalds authored
      Pull arm64 fix from Catalin Marinas:
       "Fix wrong branch label in the EL2 GICv3 initialisation code"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Correct wrong label in macro __init_el2_gicv3
      45a98a71