1. 09 Sep, 2021 1 commit
  2. 05 Sep, 2021 4 commits
    • Zhang Yi's avatar
      ext4: drop unnecessary journal handle in delalloc write · cc883236
      Zhang Yi authored
      After we factor out the inline data write procedure from
      ext4_da_write_end(), we don't need to start journal handle for the cases
      of both buffer overwrite and append-write. If we need to update
      i_disksize, mark_inode_dirty() do start handle and update inode buffer.
      So we could just remove all the journal handle codes in the delalloc
      write procedure.
      
      After this patch, we could get a lot of performance improvement. Below
      is the Unixbench comparison data test on my machine with 'Intel Xeon
      Gold 5120' CPU and nvme SSD backend.
      
      Test cmd:
      
        ./Run -c 56 -i 3 fstime fsbuffer fsdisk
      
      Before this patch:
      
        System Benchmarks Partial Index           BASELINE       RESULT   INDEX
        File Copy 1024 bufsize 2000 maxblocks       3960.0     422965.0   1068.1
        File Copy 256 bufsize 500 maxblocks         1655.0     105077.0   634.9
        File Copy 4096 bufsize 8000 maxblocks       5800.0    1429092.0   2464.0
                                                                          ======
        System Benchmarks Index Score (Partial Only)                      1186.6
      
      After this patch:
      
        System Benchmarks Partial Index           BASELINE       RESULT   INDEX
        File Copy 1024 bufsize 2000 maxblocks       3960.0     732716.0   1850.3
        File Copy 256 bufsize 500 maxblocks         1655.0     184940.0   1117.5
        File Copy 4096 bufsize 8000 maxblocks       5800.0    2427152.0   4184.7
                                                                          ======
        System Benchmarks Index Score (Partial Only)                      2053.0
      Signed-off-by: default avatarZhang Yi <yi.zhang@huawei.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20210716122024.1105856-5-yi.zhang@huawei.com
      cc883236
    • Zhang Yi's avatar
      ext4: factor out write end code of inline file · 6984aef5
      Zhang Yi authored
      Now that the inline_data file write end procedure are falled into the
      common write end functions, it is not clear. Factor them out and do
      some cleanup. This patch also drop ext4_da_write_inline_data_end()
      and switch to use ext4_write_inline_data_end() instead because we also
      need to do the same error processing if we failed to write data into
      inline entry.
      Signed-off-by: default avatarZhang Yi <yi.zhang@huawei.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20210716122024.1105856-4-yi.zhang@huawei.com
      6984aef5
    • Zhang Yi's avatar
      ext4: correct the error path of ext4_write_inline_data_end() · 55ce2f64
      Zhang Yi authored
      Current error path of ext4_write_inline_data_end() is not correct.
      
      Firstly, it should pass out the error value if ext4_get_inode_loc()
      return fail, or else it could trigger infinite loop if we inject error
      here. And then it's better to add inode to orphan list if it return fail
      in ext4_journal_stop(), otherwise we could not restore inline xattr
      entry after power failure. Finally, we need to reset the 'ret' value if
      ext4_write_inline_data_end() return success in ext4_write_end() and
      ext4_journalled_write_end(), otherwise we could not get the error return
      value of ext4_journal_stop().
      Signed-off-by: default avatarZhang Yi <yi.zhang@huawei.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20210716122024.1105856-3-yi.zhang@huawei.com
      55ce2f64
    • Zhang Yi's avatar
      ext4: check and update i_disksize properly · 4df031ff
      Zhang Yi authored
      After commit 3da40c7b ("ext4: only call ext4_truncate when size <=
      isize"), i_disksize could always be updated to i_size in ext4_setattr(),
      and we could sure that i_disksize <= i_size since holding inode lock and
      if i_disksize < i_size there are delalloc writes pending in the range
      upto i_size. If the end of the current write is <= i_size, there's no
      need to touch i_disksize since writeback will push i_disksize upto
      i_size eventually. So we can switch to check i_size instead of
      i_disksize in ext4_da_write_end() when write to the end of the file.
      we also could remove ext4_mark_inode_dirty() together because we defer
      inode dirtying to generic_write_end() or ext4_da_write_inline_data_end().
      Signed-off-by: default avatarZhang Yi <yi.zhang@huawei.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20210716122024.1105856-2-yi.zhang@huawei.com
      4df031ff
  3. 02 Sep, 2021 1 commit
    • Theodore Ts'o's avatar
      ext4: add error checking to ext4_ext_replay_set_iblocks() · 1fd95c05
      Theodore Ts'o authored
      If the call to ext4_map_blocks() fails due to an corrupted file
      system, ext4_ext_replay_set_iblocks() can get stuck in an infinite
      loop.  This could be reproduced by running generic/526 with a file
      system that has inline_data and fast_commit enabled.  The system will
      repeatedly log to the console:
      
      EXT4-fs warning (device dm-3): ext4_block_to_path:105: block 1074800922 > max in inode 131076
      
      and the stack that it gets stuck in is:
      
         ext4_block_to_path+0xe3/0x130
         ext4_ind_map_blocks+0x93/0x690
         ext4_map_blocks+0x100/0x660
         skip_hole+0x47/0x70
         ext4_ext_replay_set_iblocks+0x223/0x440
         ext4_fc_replay_inode+0x29e/0x3b0
         ext4_fc_replay+0x278/0x550
         do_one_pass+0x646/0xc10
         jbd2_journal_recover+0x14a/0x270
         jbd2_journal_load+0xc4/0x150
         ext4_load_journal+0x1f3/0x490
         ext4_fill_super+0x22d4/0x2c00
      
      With this patch, generic/526 still fails, but system is no longer
      locking up in a tight loop.  It's likely the root casue is that
      fast_commit replay is corrupting file systems with inline_data, and we
      probably need to add better error handling in the fast commit replay
      code path beyond what is done here, which essentially just breaks the
      infinite loop without reporting the to the higher levels of the code.
      
      Fixes: 8016E29F4362 ("ext4: fast commit recovery path")
      Cc: stable@kernel.org
      Cc: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      1fd95c05
  4. 31 Aug, 2021 17 commits
  5. 12 Aug, 2021 3 commits
  6. 10 Aug, 2021 3 commits
  7. 06 Aug, 2021 1 commit
  8. 23 Jul, 2021 2 commits
  9. 18 Jul, 2021 8 commits
    • Linus Torvalds's avatar
      Linux 5.14-rc2 · 2734d6c1
      Linus Torvalds authored
      2734d6c1
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.14-2021-07-18' of... · 8c25c447
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.14-2021-07-18' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Skip invalid hybrid PMU on hybrid systems when the atom (little) CPUs
         are offlined.
      
       - Fix 'perf test' problems related to the recently added hybrid
         (BIG/little) code.
      
       - Split ARM's coresight (hw tracing) decode by aux records to avoid
         fatal decoding errors.
      
       - Fix add event failure in 'perf probe' when running 32-bit perf in a
         64-bit kernel.
      
       - Fix 'perf sched record' failure when CONFIG_SCHEDSTATS is not set.
      
       - Fix memory and refcount leaks detected by ASAn when running 'perf
         test', should be clean of warnings now.
      
       - Remove broken definition of __LITTLE_ENDIAN from tools'
         linux/kconfig.h, which was breaking the build in some systems.
      
       - Cast PTHREAD_STACK_MIN to int as it may turn into 'long
         sysconf(__SC_THREAD_STACK_MIN_VALUE), breaking the build in some
         systems.
      
       - Fix libperf build error with LIBPFM4=1.
      
       - Sync UAPI files changed by the memfd_secret new syscall.
      
      * tag 'perf-tools-fixes-for-v5.14-2021-07-18' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (35 commits)
        perf sched: Fix record failure when CONFIG_SCHEDSTATS is not set
        perf probe: Fix add event failure when running 32-bit perf in a 64-bit kernel
        perf data: Close all files in close_dir()
        perf probe-file: Delete namelist in del_events() on the error path
        perf test bpf: Free obj_buf
        perf trace: Free strings in trace__parse_events_option()
        perf trace: Free syscall tp fields in evsel->priv
        perf trace: Free syscall->arg_fmt
        perf trace: Free malloc'd trace fields on exit
        perf lzma: Close lzma stream on exit
        perf script: Fix memory 'threads' and 'cpus' leaks on exit
        perf script: Release zstd data
        perf session: Cleanup trace_event
        perf inject: Close inject.output on exit
        perf report: Free generated help strings for sort option
        perf env: Fix memory leak of cpu_pmu_caps
        perf test maps__merge_in: Fix memory leak of maps
        perf dso: Fix memory leak in dso__new_map()
        perf test event_update: Fix memory leak of unit
        perf test event_update: Fix memory leak of evlist
        ...
      8c25c447
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.14-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · f0eb870a
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
       "A few fixes for issues in the new online shrink code, additional
        corrections for my recent bug-hunt w.r.t. extent size hints on
        realtime, and improved input checking of the GROWFSRT ioctl.
      
        IOW, the usual 'I somehow got bored during the merge window and
        resumed auditing the farther reaches of xfs':
      
         - Fix shrink eligibility checking when sparse inode clusters enabled
      
         - Reset '..' directory entries when unlinking directories to prevent
           verifier errors if fs is shrinked later
      
         - Don't report unusable extent size hints to FSGETXATTR
      
         - Don't warn when extent size hints are unusable because the sysadmin
           configured them that way
      
         - Fix insufficient parameter validation in GROWFSRT ioctl
      
         - Fix integer overflow when adding rt volumes to filesystem"
      
      * tag 'xfs-5.14-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: detect misaligned rtinherit directory extent size hints
        xfs: fix an integer overflow error in xfs_growfs_rt
        xfs: improve FSGROWFSRT precondition checking
        xfs: don't expose misaligned extszinherit hints to userspace
        xfs: correct the narrative around misaligned rtinherit/extszinherit dirs
        xfs: reset child dir '..' entry when unlinking child
        xfs: check for sparse inode clusters that cross new EOAG when shrinking
      f0eb870a
    • Linus Torvalds's avatar
      Merge tag 'iomap-5.14-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · fbf1bddc
      Linus Torvalds authored
      Pull iomap fixes from Darrick Wong:
       "A handful of bugfixes for the iomap code.
      
        There's nothing especially exciting here, just fixes for UBSAN (not
        KASAN as I erroneously wrote in the tag message) warnings about
        undefined behavior in the SEEK_DATA/SEEK_HOLE code, and some
        reshuffling of per-page block state info to fix some problems with
        gfs2.
      
         - Fix KASAN warnings due to integer overflow in SEEK_DATA/SEEK_HOLE
      
         - Fix assertion errors when using inlinedata files on gfs2"
      
      * tag 'iomap-5.14-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        iomap: Don't create iomap_page objects in iomap_page_mkwrite_actor
        iomap: Don't create iomap_page objects for inline files
        iomap: Permit pages without an iop to enter writeback
        iomap: remove the length variable in iomap_seek_hole
        iomap: remove the length variable in iomap_seek_data
      fbf1bddc
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v5.14' of... · 6750691a
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Restore the original behavior of scripts/setlocalversion when
         LOCALVERSION is set to empty.
      
       - Show Kconfig prompts even for 'make -s'
      
       - Fix the combination of COFNIG_LTO_CLANG=y and CONFIG_MODVERSIONS=y
         for older GNU Make versions
      
      * tag 'kbuild-fixes-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        Documentation: Fix intiramfs script name
        Kbuild: lto: fix module versionings mismatch in GNU make 3.X
        kbuild: do not suppress Kconfig prompts for silent build
        scripts/setlocalversion: fix a bug when LOCALVERSION is empty
      6750691a
    • Robert Richter's avatar
      Documentation: Fix intiramfs script name · 5e60f363
      Robert Richter authored
      Documentation was not changed when renaming the script in commit
      80e715a0 ("initramfs: rename gen_initramfs_list.sh to
      gen_initramfs.sh"). Fixing this.
      
      Basically does:
      
       $ sed -i -e s/gen_initramfs_list.sh/gen_initramfs.sh/g $(git grep -l gen_initramfs_list.sh)
      
      Fixes: 80e715a0 ("initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh")
      Signed-off-by: default avatarRobert Richter <rrichter@amd.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      5e60f363
    • Lecopzer Chen's avatar
      Kbuild: lto: fix module versionings mismatch in GNU make 3.X · 1d11053d
      Lecopzer Chen authored
      When building modules(CONFIG_...=m), I found some of module versions
      are incorrect and set to 0.
      This can be found in build log for first clean build which shows
      
      WARNING: EXPORT symbol "XXXX" [drivers/XXX/XXX.ko] version generation failed,
      symbol will not be versioned.
      
      But in second build(incremental build), the WARNING disappeared and the
      module version becomes valid CRC and make someone who want to change
      modules without updating kernel image can't insert their modules.
      
      The problematic code is
      +	$(foreach n, $(filter-out FORCE,$^),				\
      +		$(if $(wildcard $(n).symversions),			\
      +			; cat $(n).symversions >> $@.symversions))
      
      For example:
        rm -f fs/notify/built-in.a.symversions    ; rm -f fs/notify/built-in.a; \
      llvm-ar cDPrST fs/notify/built-in.a fs/notify/fsnotify.o \
      fs/notify/notification.o fs/notify/group.o ...
      
      `foreach n` shows nothing to `cat` into $(n).symversions because
      `if $(wildcard $(n).symversions)` return nothing, but actually
      they do exist during this line was executed.
      
      -rw-r--r-- 1 root root 168580 Jun 13 19:10 fs/notify/fsnotify.o
      -rw-r--r-- 1 root root    111 Jun 13 19:10 fs/notify/fsnotify.o.symversions
      
      The reason is the $(n).symversions are generated at runtime, but
      Makefile wildcard function expends and checks the file exist or not
      during parsing the Makefile.
      
      Thus fix this by use `test` shell command to check the file
      existence in runtime.
      
      Rebase from both:
      1. [https://lore.kernel.org/lkml/20210616080252.32046-1-lecopzer.chen@mediatek.com/]
      2. [https://lore.kernel.org/lkml/20210702032943.7865-1-lecopzer.chen@mediatek.com/]
      
      Fixes: 38e89184 ("kbuild: lto: fix module versioning")
      Co-developed-by: default avatarSami Tolvanen <samitolvanen@google.com>
      Signed-off-by: default avatarLecopzer Chen <lecopzer.chen@mediatek.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      1d11053d
    • Masahiro Yamada's avatar
      kbuild: do not suppress Kconfig prompts for silent build · d952cfaf
      Masahiro Yamada authored
      When a new CONFIG option is available, Kbuild shows a prompt to get
      the user input.
      
        $ make
        [ snip ]
        Core Scheduling for SMT (SCHED_CORE) [N/y/?] (NEW)
      
      This is the only interactive place in the build process.
      
      Commit 174a1dcc ("kbuild: sink stdout from cmd for silent build")
      suppressed Kconfig prompts as well because syncconfig is invoked by
      the 'cmd' macro. You cannot notice the fact that Kconfig is waiting
      for the user input.
      
      Use 'kecho' to show the equivalent short log without suppressing stdout
      from sub-make.
      
      Fixes: 174a1dcc ("kbuild: sink stdout from cmd for silent build")
      Reported-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      d952cfaf