1. 08 May, 2024 7 commits
    • Kent Overstreet's avatar
      bcachefs: printbuf improvements · acce32a5
      Kent Overstreet authored
      - fix assorted (harmless) off-by-one errors
      - we were inconsistent on whether out->pos stays <= out->size on
        overflow; now it does, and printbuf.overflow exists to indicate if a
        printbuf has overflowed
      - factor out printbuf_advance_pos()
      - printbuf_nul_terminate_reserved(); use this to reduce the number of
        printbuf_make_room() calls
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      acce32a5
    • Kent Overstreet's avatar
      bcachefs: Run upgrade/downgrade even in -o nochanges mode · 62606398
      Kent Overstreet authored
      We need to be able to test these paths in dry run mode.
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      62606398
    • Kent Overstreet's avatar
      bcachefs: Better write_super() error messages · 6d828691
      Kent Overstreet authored
      When a superblock write is silently dropped or it's been modified by
      another process we need to know which device it was.
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      6d828691
    • Kent Overstreet's avatar
      74768337
    • Kent Overstreet's avatar
      bcachefs: bch2_bkey_format_field_overflows() · 61692c78
      Kent Overstreet authored
      Fix another shift-by-64 by factoring out a common helper for
      bch2_bkey_format_invalid() and bformat_needs_redo() (where it was
      already fixed).
      
      Reported-by: syzbot+9833a1d29d4a44361e2c@syzkaller.appspotmail.com
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      61692c78
    • Kent Overstreet's avatar
      bcachefs: Fix needs_whiteout BUG_ON() in bkey_sort() · 5dfd3746
      Kent Overstreet authored
      Btree nodes are log structured; thus, we need to emit whiteouts when
      we're deleting a key that's been written out to disk.
      
      k->needs_whiteout tracks whether a key will need a whiteout when it's
      deleted, and this requires some careful handling; e.g. the key we're
      deleting may not have been written out to disk, but it may have
      overwritten a key that was - thus we need to carry this flag around on
      overwrites.
      
      Invariants:
      There may be multiple key for the same position in a given node (because
      of overwrites), but only one of them will be a live (non deleted) key,
      and only one key for a given position will have the needs_whiteout flag
      set.
      
      Additionally, we don't want to carry around whiteouts that need to be
      written in the main searchable part of a btree node - btree_iter_peek()
      will have to skip past them, and this can lead to an O(n^2) issues when
      doing sequential deletions (e.g. inode rm/truncate). So there's a
      separate region in the btree node buffer for unwritten whiteouts; these
      are merge sorted with the rest of the keys we're writing in the btree
      node write path.
      
      The unwritten whiteouts was a later optimization that bch2_sort_keys()
      didn't take into account; the unwritten whiteouts area means that we
      never have deleted keys with needs_whiteout set in the main searchable
      part of a btree node.
      
      That means we can simplify and optimize some sort paths, and eliminate
      an assertion that syzbot found:
      
      - Unless we're in the btree node write path, it's always ok to drop
        whiteouts when sorting
      - When sorting for a btree node write, we drop the whiteout if it's not
        from the unwritten whiteouts area, or if it's overwritten by a real
        key at the same position.
      
      This completely eliminates some tricky logic for propagating the
      needs_whiteout flag: syzbot was able to hit the assertion that checked
      that there shouldn't be more than one key at the same pos with
      needs_whiteout set, likely due to a combination of flipping on
      needs_whiteout on all written keys (they need whiteouts if overwritten),
      combined with not always dropping unneeded whiteouts, and the tricky
      logic in the sort path for preserving needs_whiteout that wasn't really
      needed.
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      5dfd3746
    • Kent Overstreet's avatar
  2. 07 May, 2024 2 commits
  3. 06 May, 2024 18 commits
  4. 29 Apr, 2024 3 commits
  5. 28 Apr, 2024 6 commits
  6. 27 Apr, 2024 4 commits
    • Linus Torvalds's avatar
      Merge tag 'rust-fixes-6.9' of https://github.com/Rust-for-Linux/linux · 2c815938
      Linus Torvalds authored
      Pull Rust fixes from Miguel Ojeda:
      
       - Soundness: make internal functions generated by the 'module!' macro
         inaccessible, do not implement 'Zeroable' for 'Infallible' and
         require 'Send' for the 'Module' trait.
      
       - Build: avoid errors with "empty" files and workaround 'rustdoc' ICE.
      
       - Kconfig: depend on '!CFI_CLANG' and avoid selecting 'CONSTRUCTORS'.
      
       - Code docs: remove non-existing key from 'module!' macro example.
      
       - Docs: trivial rendering fix in arch table.
      
      * tag 'rust-fixes-6.9' of https://github.com/Rust-for-Linux/linux:
        rust: remove `params` from `module` macro example
        kbuild: rust: force `alloc` extern to allow "empty" Rust files
        kbuild: rust: remove unneeded `@rustc_cfg` to avoid ICE
        rust: kernel: require `Send` for `Module` implementations
        rust: phy: implement `Send` for `Registration`
        rust: make mutually exclusive with CFI_CLANG
        rust: macros: fix soundness issue in `module!` macro
        rust: init: remove impl Zeroable for Infallible
        docs: rust: fix improper rendering in Arch Support page
        rust: don't select CONSTRUCTORS
      2c815938
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 57865f39
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A fix for TASK_SIZE on rv64/NOMMU, to reflect the lack of user/kernel
         separation
      
       - A fix to avoid loading rv64/NOMMU kernel past the start of RAM
      
       - A fix for RISCV_HWPROBE_EXT_ZVFHMIN on ilp32 to avoid signed integer
         overflow in the bitmask
      
       - The sud_test kselftest has been fixed to properly swizzle the syscall
         number into the return register, which are not the same on RISC-V
      
       - A fix for a build warning in the perf tools on rv32
      
       - A fix for the CBO selftests, to avoid non-constants leaking into the
         inline asm
      
       - A pair of fixes for T-Head PBMT errata probing, which has been
         renamed MAE by the vendor
      
      * tag 'riscv-for-linus-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        RISC-V: selftests: cbo: Ensure asm operands match constraints, take 2
        perf riscv: Fix the warning due to the incompatible type
        riscv: T-Head: Test availability bit before enabling MAE errata
        riscv: thead: Rename T-Head PBMT to MAE
        selftests: sud_test: return correct emulated syscall value on RISC-V
        riscv: hwprobe: fix invalid sign extension for RISCV_HWPROBE_EXT_ZVFHMIN
        riscv: Fix loading 64-bit NOMMU kernels past the start of RAM
        riscv: Fix TASK_SIZE on 64-bit NOMMU
      57865f39
    • Linus Torvalds's avatar
      Merge tag '6.9-rc5-cifs-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · d43df69f
      Linus Torvalds authored
      Pull smb client fixes from Steve French:
       "Three smb3 client fixes, all also for stable:
      
         - two small locking fixes spotted by Coverity
      
         - FILE_ALL_INFO and network_open_info packing fix"
      
      * tag '6.9-rc5-cifs-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        smb3: fix lock ordering potential deadlock in cifs_sync_mid_result
        smb3: missing lock when picking channel
        smb: client: Fix struct_group() usage in __packed structs
      d43df69f
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 5d12ed4b
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Fix a race condition in the at24 eeprom handler, a NULL pointer
        exception in the I2C core for controllers only using target modes,
        drop a MAINTAINERS entry, and fix an incorrect DT binding for at24"
      
      * tag 'i2c-for-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: smbus: fix NULL function pointer dereference
        MAINTAINERS: Drop entry for PCA9541 bus master selector
        eeprom: at24: fix memory corruption race condition
        dt-bindings: eeprom: at24: Fix ST M24C64-D compatible schema
      5d12ed4b