]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Merge tag 'mm-nonmm-stable-2022-08-06-2' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 7 Aug 2022 17:03:24 +0000 (10:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 7 Aug 2022 17:03:24 +0000 (10:03 -0700)
Pull misc updates from Andrew Morton:
 "Updates to various subsystems which I help look after. lib, ocfs2,
  fatfs, autofs, squashfs, procfs, etc. A relatively small amount of
  material this time"

* tag 'mm-nonmm-stable-2022-08-06-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (72 commits)
  scripts/gdb: ensure the absolute path is generated on initial source
  MAINTAINERS: kunit: add David Gow as a maintainer of KUnit
  mailmap: add linux.dev alias for Brendan Higgins
  mailmap: update Kirill's email
  profile: setup_profiling_timer() is moslty not implemented
  ocfs2: fix a typo in a comment
  ocfs2: use the bitmap API to simplify code
  ocfs2: remove some useless functions
  lib/mpi: fix typo 'the the' in comment
  proc: add some (hopefully) insightful comments
  bdi: remove enum wb_congested_state
  kernel/hung_task: fix address space of proc_dohung_task_timeout_secs
  lib/lzo/lzo1x_compress.c: replace ternary operator with min() and min_t()
  squashfs: support reading fragments in readahead call
  squashfs: implement readahead
  squashfs: always build "file direct" version of page actor
  Revert "squashfs: provide backing_dev_info in order to disable read-ahead"
  fs/ocfs2: Fix spelling typo in comment
  ia64: old_rr4 added under CONFIG_HUGETLB_PAGE
  proc: fix test for "vsyscall=xonly" boot option
  ...

15 files changed:
1  2 
.mailmap
Documentation/admin-guide/kernel-parameters.txt
MAINTAINERS
arch/powerpc/kernel/smp.c
arch/riscv/kernel/smp.c
arch/x86/kernel/apic/apic.c
fs/squashfs/file.c
include/linux/cpumask.h
include/linux/net.h
kernel/kallsyms.c
kernel/kexec_file.c
lib/Kconfig
lib/Kconfig.debug
lib/Makefile
tools/testing/selftests/Makefile

diff --cc .mailmap
Simple merge
diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
index 7f0904b203294c61281bc588011981ba56937818,7ff0b03cceab017f9f86c7fae3343363e388b98d..98e64fec75b77e09048757fc28ea04f2f81bf53c
                SetPageUptodate(page);
        unlock_page(page);
  
 -      return 0;
 +      return res;
  }
  
+ static int squashfs_readahead_fragment(struct page **page,
+       unsigned int pages, unsigned int expected)
+ {
+       struct inode *inode = page[0]->mapping->host;
+       struct squashfs_cache_entry *buffer = squashfs_get_fragment(inode->i_sb,
+               squashfs_i(inode)->fragment_block,
+               squashfs_i(inode)->fragment_size);
+       struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
+       unsigned int n, mask = (1 << (msblk->block_log - PAGE_SHIFT)) - 1;
+       if (buffer->error)
+               goto out;
+       expected += squashfs_i(inode)->fragment_offset;
+       for (n = 0; n < pages; n++) {
+               unsigned int base = (page[n]->index & mask) << PAGE_SHIFT;
+               unsigned int offset = base + squashfs_i(inode)->fragment_offset;
+               if (expected > offset) {
+                       unsigned int avail = min_t(unsigned int, expected -
+                               offset, PAGE_SIZE);
+                       squashfs_fill_page(page[n], buffer, offset, avail);
+               }
+               unlock_page(page[n]);
+               put_page(page[n]);
+       }
+ out:
+       squashfs_cache_put(buffer);
+       return buffer->error;
+ }
+ static void squashfs_readahead(struct readahead_control *ractl)
+ {
+       struct inode *inode = ractl->mapping->host;
+       struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
+       size_t mask = (1UL << msblk->block_log) - 1;
+       unsigned short shift = msblk->block_log - PAGE_SHIFT;
+       loff_t start = readahead_pos(ractl) & ~mask;
+       size_t len = readahead_length(ractl) + readahead_pos(ractl) - start;
+       struct squashfs_page_actor *actor;
+       unsigned int nr_pages = 0;
+       struct page **pages;
+       int i, file_end = i_size_read(inode) >> msblk->block_log;
+       unsigned int max_pages = 1UL << shift;
+       readahead_expand(ractl, start, (len | mask) + 1);
+       pages = kmalloc_array(max_pages, sizeof(void *), GFP_KERNEL);
+       if (!pages)
+               return;
+       for (;;) {
+               pgoff_t index;
+               int res, bsize;
+               u64 block = 0;
+               unsigned int expected;
+               nr_pages = __readahead_batch(ractl, pages, max_pages);
+               if (!nr_pages)
+                       break;
+               if (readahead_pos(ractl) >= i_size_read(inode))
+                       goto skip_pages;
+               index = pages[0]->index >> shift;
+               if ((pages[nr_pages - 1]->index >> shift) != index)
+                       goto skip_pages;
+               expected = index == file_end ?
+                          (i_size_read(inode) & (msblk->block_size - 1)) :
+                           msblk->block_size;
+               if (index == file_end && squashfs_i(inode)->fragment_block !=
+                                               SQUASHFS_INVALID_BLK) {
+                       res = squashfs_readahead_fragment(pages, nr_pages,
+                                                         expected);
+                       if (res)
+                               goto skip_pages;
+                       continue;
+               }
+               bsize = read_blocklist(inode, index, &block);
+               if (bsize == 0)
+                       goto skip_pages;
+               actor = squashfs_page_actor_init_special(msblk, pages, nr_pages,
+                                                        expected);
+               if (!actor)
+                       goto skip_pages;
+               res = squashfs_read_data(inode->i_sb, block, bsize, NULL, actor);
+               kfree(actor);
+               if (res == expected) {
+                       int bytes;
+                       /* Last page (if present) may have trailing bytes not filled */
+                       bytes = res % PAGE_SIZE;
+                       if (pages[nr_pages - 1]->index == file_end && bytes)
+                               memzero_page(pages[nr_pages - 1], bytes,
+                                            PAGE_SIZE - bytes);
+                       for (i = 0; i < nr_pages; i++) {
+                               flush_dcache_page(pages[i]);
+                               SetPageUptodate(pages[i]);
+                       }
+               }
+               for (i = 0; i < nr_pages; i++) {
+                       unlock_page(pages[i]);
+                       put_page(pages[i]);
+               }
+       }
+       kfree(pages);
+       return;
+ skip_pages:
+       for (i = 0; i < nr_pages; i++) {
+               unlock_page(pages[i]);
+               put_page(pages[i]);
+       }
+       kfree(pages);
+ }
  
  const struct address_space_operations squashfs_aops = {
-       .read_folio = squashfs_read_folio
+       .read_folio = squashfs_read_folio,
+       .readahead = squashfs_readahead
  };
Simple merge
Simple merge
index 79a85834ce9d4a93bdfc70757f6b015588a0f3f5,510fba0ba5b4a52e680ab94dbe18d4918b2ad3a3..3e7e2c2ad2f75ef603c32750e94c7afe5fdef994
  #include <linux/module.h>
  #include <linux/kernel.h>
  #include <linux/bsearch.h>
 +#include <linux/btf_ids.h>
  
- /*
-  * These will be re-linked against their real values
-  * during the second link stage.
-  */
- extern const unsigned long kallsyms_addresses[] __weak;
- extern const int kallsyms_offsets[] __weak;
- extern const u8 kallsyms_names[] __weak;
- /*
-  * Tell the compiler that the count isn't in the small data section if the arch
-  * has one (eg: FRV).
-  */
- extern const unsigned int kallsyms_num_syms
- __section(".rodata") __attribute__((weak));
- extern const unsigned long kallsyms_relative_base
- __section(".rodata") __attribute__((weak));
- extern const char kallsyms_token_table[] __weak;
- extern const u16 kallsyms_token_index[] __weak;
- extern const unsigned int kallsyms_markers[] __weak;
+ #include "kallsyms_internal.h"
  
  /*
   * Expand a compressed symbol data into the resulting uncompressed string,
index a7b411c22f19cdbc99ba60eb3c1447039eabf9c0,9b2839775c837ba55199fa9c8526fde67b04c8ca..1d546dc97c5023a9aa148277acd45ba026609c22
  #include <linux/vmalloc.h>
  #include "kexec_internal.h"
  
 +#ifdef CONFIG_KEXEC_SIG
 +static bool sig_enforce = IS_ENABLED(CONFIG_KEXEC_SIG_FORCE);
 +
 +void set_kexec_sig_enforced(void)
 +{
 +      sig_enforce = true;
 +}
 +#endif
 +
  static int kexec_calculate_store_digests(struct kimage *image);
  
+ /* Maximum size in bytes for kernel/initrd files. */
+ #define KEXEC_FILE_SIZE_MAX   min_t(s64, 4LL << 30, SSIZE_MAX)
  /*
   * Currently this is the only default function that is exported as some
   * architectures need it to do additional handlings.
diff --cc lib/Kconfig
Simple merge
Simple merge
diff --cc lib/Makefile
Simple merge
Simple merge