ID Workflow Result Correct Bug Created Started Finished Revision
b075f2b7 patching ❓ BUG: spinlock bad magic in release_metapage 2026/06/26 19:52 2026/06/26 20:26 2026/06/26 22:14 7ff32d8b
Agent: prod-syz-agent-3
External Bug ID: ---

Inputs:
BaseBranch master
BaseCommit RC
BaseRepository git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
BugTitle BUG: spinlock bad magic in release_metapage
CrashLogID 5507181589299200
CrashReportID 6633081496141824
KernelCommit 01a412d06bc5786eb4e44a6c8f0f4659bd4c9864
KernelConfig
Show (274422 bytes)
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 6.16.0-rc7 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132)"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=200107
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=200107
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=200107
CONFIG_RUSTC_VERSION=108700
CONFIG_RUST_IS_AVAILABLE=y
CONFIG_RUSTC_LLVM_VERSION=200101
CONFIG_CC_CAN_LINK=y
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
CONFIG_TOOLS_SUPPORT_RELR=y
CONFIG_CC_HAS_ASM_INLINE=y
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
CONFIG_CC_HAS_COUNTED_BY=y
CONFIG_RUSTC_HAS_COERCE_POINTEE=y
CONFIG_PAHOLE_VERSION=124
CONFIG_CONSTRUCTORS=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
# CONFIG_WERROR is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
CONFIG_HAVE_KERNEL_ZSTD=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
# CONFIG_KERNEL_ZSTD is not set
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_WATCH_QUEUE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y
CONFIG_GENERIC_IRQ_RESERVATION_MODE=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
# CONFIG_GENERIC_IRQ_DEBUGFS is not set
# end of IRQ subsystem

CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_INIT=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST_IDLE=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_HAVE_POSIX_CPU_TIMERS_TASK_WORK=y
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
CONFIG_CONTEXT_TRACKING=y
CONFIG_CONTEXT_TRACKING_IDLE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
CONFIG_CONTEXT_TRACKING_USER=y
# CONFIG_CONTEXT_TRACKING_USER_FORCE is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US=125
# end of Timers subsystem

CONFIG_BPF=y
CONFIG_HAVE_EBPF_JIT=y
CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y

#
# BPF subsystem
#
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT=y
CONFIG_BPF_JIT_ALWAYS_ON=y
CONFIG_BPF_JIT_DEFAULT_ON=y
# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set
CONFIG_USERMODE_DRIVER=y
CONFIG_BPF_PRELOAD=y
CONFIG_BPF_PRELOAD_UMD=y
CONFIG_BPF_LSM=y
# end of BPF subsystem

CONFIG_PREEMPT_BUILD=y
CONFIG_ARCH_HAS_PREEMPT_LAZY=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
# CONFIG_PREEMPT_LAZY is not set
# CONFIG_PREEMPT_RT is not set
CONFIG_PREEMPT_COUNT=y
CONFIG_PREEMPTION=y
CONFIG_PREEMPT_DYNAMIC=y
CONFIG_SCHED_CORE=y

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_SCHED_AVG_IRQ=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_PSI=y
# CONFIG_PSI_DEFAULT_DISABLED is not set
# end of CPU/Task time and stats accounting

CONFIG_CPU_ISOLATION=y

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
CONFIG_PREEMPT_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_TREE_SRCU=y
CONFIG_TASKS_RCU_GENERIC=y
CONFIG_NEED_TASKS_RCU=y
CONFIG_TASKS_RCU=y
CONFIG_TASKS_TRACE_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_NEED_SEGCBLIST=y
# end of RCU Subsystem

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
# CONFIG_PRINTK_INDEX is not set
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y

#
# Scheduler features
#
# CONFIG_UCLAMP_TASK is not set
# end of Scheduler features

CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y
CONFIG_CC_HAS_INT128=y
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough"
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_GCC_NO_STRINGOP_OVERFLOW=y
CONFIG_ARCH_SUPPORTS_INT128=y
CONFIG_NUMA_BALANCING=y
CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y
CONFIG_SLAB_OBJ_EXT=y
CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
# CONFIG_CGROUP_FAVOR_DYNMODS is not set
CONFIG_MEMCG=y
CONFIG_MEMCG_V1=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_GROUP_SCHED_WEIGHT=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_SCHED_MM_CID=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
# CONFIG_CGROUP_DMEM is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
# CONFIG_CPUSETS_V1 is not set
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
# CONFIG_CGROUP_BPF is not set
CONFIG_CGROUP_MISC=y
CONFIG_CGROUP_DEBUG=y
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_TIME_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_CHECKPOINT_RESTORE=y
# CONFIG_SCHED_AUTOGROUP is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
# CONFIG_BOOT_CONFIG is not set
CONFIG_INITRAMFS_PRESERVE_MTIME=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_LD_ORPHAN_WARN=y
CONFIG_LD_ORPHAN_WARN_LEVEL="warn"
CONFIG_SYSCTL=y
CONFIG_HAVE_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
# CONFIG_BASE_SMALL is not set
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_FUTEX_MPOL=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KCMP=y
CONFIG_RSEQ=y
# CONFIG_DEBUG_RSEQ is not set
CONFIG_CACHESTAT_SYSCALL=y
# CONFIG_PC104 is not set
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_SELFTEST is not set
CONFIG_KALLSYMS_ALL=y
CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
CONFIG_ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_GUEST_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
# end of Kernel Performance Events And Counters

CONFIG_SYSTEM_DATA_VERIFICATION=y
CONFIG_PROFILING=y
# CONFIG_RUST is not set
CONFIG_TRACEPOINTS=y

#
# Kexec and crash features
#
CONFIG_CRASH_RESERVE=y
CONFIG_VMCORE_INFO=y
CONFIG_KEXEC_CORE=y
CONFIG_KEXEC=y
# CONFIG_KEXEC_FILE is not set
# CONFIG_KEXEC_JUMP is not set
# CONFIG_KEXEC_HANDOVER is not set
CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y
CONFIG_CRASH_MAX_MEMORY_RANGES=8192
# end of Kexec and crash features
# end of General setup

CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=28
CONFIG_ARCH_MMAP_RND_BITS_MAX=32
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_CSUM=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_AUDIT_ARCH=y
CONFIG_KASAN_SHADOW_OFFSET=0xdffffc0000000000
CONFIG_HAVE_INTEL_TXT=y
CONFIG_X86_64_SMP=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=5

#
# Processor type and features
#
CONFIG_SMP=y
CONFIG_X86_X2APIC=y
# CONFIG_X86_POSTED_MSI is not set
CONFIG_X86_MPPARSE=y
# CONFIG_X86_CPU_RESCTRL is not set
# CONFIG_X86_FRED is not set
CONFIG_X86_EXTENDED_PLATFORM=y
# CONFIG_X86_NUMACHIP is not set
# CONFIG_X86_VSMP is not set
# CONFIG_X86_INTEL_MID is not set
# CONFIG_X86_GOLDFISH is not set
# CONFIG_X86_INTEL_LPSS is not set
# CONFIG_X86_AMD_PLATFORM_DEVICE is not set
CONFIG_IOSF_MBI=y
# CONFIG_IOSF_MBI_DEBUG is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_HYPERVISOR_GUEST=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_DEBUG=y
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_X86_HV_CALLBACK_VECTOR=y
# CONFIG_XEN is not set
CONFIG_KVM_GUEST=y
CONFIG_ARCH_CPUIDLE_HALTPOLL=y
CONFIG_PVH=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_JAILHOUSE_GUEST is not set
# CONFIG_ACRN_GUEST is not set
CONFIG_CC_HAS_MARCH_NATIVE=y
# CONFIG_X86_NATIVE_CPU is not set
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_TSC=y
CONFIG_X86_HAVE_PAE=y
CONFIG_X86_CX8=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_IA32_FEAT_CTL=y
CONFIG_X86_VMX_FEATURE_NAMES=y
CONFIG_PROCESSOR_SELECT=y
CONFIG_BROADCAST_TLB_FLUSH=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
# CONFIG_CPU_SUP_HYGON is not set
# CONFIG_CPU_SUP_CENTAUR is not set
# CONFIG_CPU_SUP_ZHAOXIN is not set
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
# CONFIG_GART_IOMMU is not set
CONFIG_BOOT_VESA_SUPPORT=y
# CONFIG_MAXSMP is not set
CONFIG_NR_CPUS_RANGE_BEGIN=2
CONFIG_NR_CPUS_RANGE_END=512
CONFIG_NR_CPUS_DEFAULT=64
CONFIG_NR_CPUS=8
CONFIG_SCHED_CLUSTER=y
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
CONFIG_SCHED_MC_PRIO=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_ACPI_MADT_WAKEUP=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
# CONFIG_X86_MCELOG_LEGACY is not set
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
# CONFIG_X86_MCE_INJECT is not set

#
# Performance monitoring
#
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_PERF_EVENTS_INTEL_RAPL=y
CONFIG_PERF_EVENTS_INTEL_CSTATE=y
# CONFIG_PERF_EVENTS_AMD_POWER is not set
CONFIG_PERF_EVENTS_AMD_UNCORE=y
# CONFIG_PERF_EVENTS_AMD_BRS is not set
# end of Performance monitoring

CONFIG_X86_16BIT=y
CONFIG_X86_ESPFIX64=y
CONFIG_X86_VSYSCALL_EMULATION=y
CONFIG_X86_IOPL_IOPERM=y
CONFIG_MICROCODE=y
# CONFIG_MICROCODE_LATE_LOADING is not set
CONFIG_X86_MSR=y
CONFIG_X86_CPUID=y
CONFIG_X86_DIRECT_GBPAGES=y
# CONFIG_X86_CPA_STATISTICS is not set
CONFIG_NUMA=y
CONFIG_AMD_NUMA=y
CONFIG_X86_64_ACPI_NUMA=y
CONFIG_NODES_SHIFT=6
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
# CONFIG_ARCH_MEMORY_PROBE is not set
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
# CONFIG_X86_PMEM_LEGACY is not set
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_MTRR=y
# CONFIG_MTRR_SANITIZER is not set
CONFIG_X86_PAT=y
CONFIG_X86_UMIP=y
CONFIG_CC_HAS_IBT=y
CONFIG_X86_CET=y
CONFIG_X86_KERNEL_IBT=y
CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y
CONFIG_ARCH_PKEY_BITS=4
# CONFIG_X86_INTEL_TSX_MODE_OFF is not set
CONFIG_X86_INTEL_TSX_MODE_ON=y
# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set
CONFIG_X86_SGX=y
CONFIG_X86_USER_SHADOW_STACK=y
# CONFIG_EFI is not set
CONFIG_HZ_100=y
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=100
CONFIG_SCHED_HRTICK=y
CONFIG_ARCH_SUPPORTS_KEXEC=y
CONFIG_ARCH_SUPPORTS_KEXEC_FILE=y
CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY=y
CONFIG_ARCH_SUPPORTS_KEXEC_SIG=y
CONFIG_ARCH_SUPPORTS_KEXEC_SIG_FORCE=y
CONFIG_ARCH_SUPPORTS_KEXEC_BZIMAGE_VERIFY_SIG=y
CONFIG_ARCH_SUPPORTS_KEXEC_JUMP=y
CONFIG_ARCH_SUPPORTS_KEXEC_HANDOVER=y
CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y
CONFIG_ARCH_DEFAULT_CRASH_DUMP=y
CONFIG_ARCH_SUPPORTS_CRASH_HOTPLUG=y
CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION=y
CONFIG_PHYSICAL_START=0x1000000
# CONFIG_RELOCATABLE is not set
CONFIG_PHYSICAL_ALIGN=0x200000
CONFIG_HOTPLUG_CPU=y
# CONFIG_COMPAT_VDSO is not set
CONFIG_LEGACY_VSYSCALL_XONLY=y
# CONFIG_LEGACY_VSYSCALL_NONE is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="earlyprintk=serial net.ifnames=0 sysctl.kernel.hung_task_all_cpu_backtrace=1 ima_policy=tcb nf-conntrack-ftp.ports=20000 nf-conntrack-tftp.ports=20000 nf-conntrack-sip.ports=20000 nf-conntrack-irc.ports=20000 nf-conntrack-sane.ports=20000 binder.debug_mask=0 rcupdate.rcu_expedited=1 rcupdate.rcu_cpu_stall_cputime=1 no_hash_pointers page_owner=on sysctl.vm.nr_hugepages=4 sysctl.vm.nr_overcommit_hugepages=4 secretmem.enable=1 sysctl.max_rcu_stall_to_panic=1 msr.allow_writes=off coredump_filter=0xffff root=/dev/sda console=ttyS0 vsyscall=native numa=fake=2 kvm-intel.nested=1 spec_store_bypass_disable=prctl nopcid vivid.n_devs=64 vivid.multiplanar=1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 netrom.nr_ndevs=32 rose.rose_ndevs=32 smp.csd_lock_timeout=100000 watchdog_thresh=55 workqueue.watchdog_thresh=140 sysctl.net.core.netdev_unregister_timeout_secs=140 dummy_hcd.num=32 max_loop=32 nbds_max=32 comedi.comedi_num_legacy_minors=4 panic_on_warn=1"
# CONFIG_CMDLINE_OVERRIDE is not set
CONFIG_MODIFY_LDT_SYSCALL=y
# CONFIG_STRICT_SIGALTSTACK_SIZE is not set
CONFIG_HAVE_LIVEPATCH=y
CONFIG_X86_BUS_LOCK_DETECT=y
# end of Processor type and features

CONFIG_CC_HAS_SLS=y
CONFIG_CC_HAS_RETURN_THUNK=y
CONFIG_CC_HAS_ENTRY_PADDING=y
CONFIG_FUNCTION_PADDING_CFI=11
CONFIG_FUNCTION_PADDING_BYTES=16
CONFIG_CALL_PADDING=y
CONFIG_HAVE_CALL_THUNKS=y
CONFIG_CALL_THUNKS=y
CONFIG_PREFIX_SYMBOLS=y
CONFIG_CPU_MITIGATIONS=y
CONFIG_MITIGATION_PAGE_TABLE_ISOLATION=y
CONFIG_MITIGATION_RETPOLINE=y
CONFIG_MITIGATION_RETHUNK=y
CONFIG_MITIGATION_UNRET_ENTRY=y
CONFIG_MITIGATION_CALL_DEPTH_TRACKING=y
# CONFIG_CALL_THUNKS_DEBUG is not set
CONFIG_MITIGATION_IBPB_ENTRY=y
CONFIG_MITIGATION_IBRS_ENTRY=y
CONFIG_MITIGATION_SRSO=y
# CONFIG_MITIGATION_SLS is not set
CONFIG_MITIGATION_GDS=y
CONFIG_MITIGATION_RFDS=y
CONFIG_MITIGATION_SPECTRE_BHI=y
CONFIG_MITIGATION_MDS=y
CONFIG_MITIGATION_TAA=y
CONFIG_MITIGATION_MMIO_STALE_DATA=y
CONFIG_MITIGATION_L1TF=y
CONFIG_MITIGATION_RETBLEED=y
CONFIG_MITIGATION_SPECTRE_V1=y
CONFIG_MITIGATION_SPECTRE_V2=y
CONFIG_MITIGATION_SRBDS=y
CONFIG_MITIGATION_SSB=y
CONFIG_MITIGATION_ITS=y
CONFIG_MITIGATION_TSA=y
CONFIG_ARCH_HAS_ADD_PAGES=y

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
# CONFIG_SUSPEND_SKIP_SYNC is not set
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_HIBERNATION_SNAPSHOT_DEV=y
CONFIG_HIBERNATION_COMP_LZO=y
# CONFIG_HIBERNATION_COMP_LZ4 is not set
CONFIG_HIBERNATION_DEF_COMP="lzo"
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_USERSPACE_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM=y
CONFIG_PM_DEBUG=y
# CONFIG_PM_ADVANCED_DEBUG is not set
# CONFIG_PM_TEST_SUSPEND is not set
CONFIG_PM_SLEEP_DEBUG=y
# CONFIG_DPM_WATCHDOG is not set
CONFIG_PM_TRACE=y
CONFIG_PM_TRACE_RTC=y
CONFIG_PM_CLK=y
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
# CONFIG_ENERGY_MODEL is not set
CONFIG_ARCH_SUPPORTS_ACPI=y
CONFIG_ACPI=y
CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
CONFIG_ACPI_THERMAL_LIB=y
# CONFIG_ACPI_DEBUGGER is not set
CONFIG_ACPI_SPCR_TABLE=y
# CONFIG_ACPI_FPDT is not set
CONFIG_ACPI_LPIT=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
CONFIG_ACPI_EC=y
# CONFIG_ACPI_EC_DEBUGFS is not set
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=y
CONFIG_ACPI_FAN=y
# CONFIG_ACPI_TAD is not set
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_CPU_FREQ_PSS=y
CONFIG_ACPI_PROCESSOR_CSTATE=y
CONFIG_ACPI_PROCESSOR_IDLE=y
CONFIG_ACPI_CPPC_LIB=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_PLATFORM_PROFILE=y
CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y
CONFIG_ACPI_TABLE_UPGRADE=y
# CONFIG_ACPI_DEBUG is not set
# CONFIG_ACPI_PCI_SLOT is not set
CONFIG_ACPI_CONTAINER=y
# CONFIG_ACPI_HOTPLUG_MEMORY is not set
CONFIG_ACPI_HOTPLUG_IOAPIC=y
# CONFIG_ACPI_SBS is not set
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
CONFIG_ACPI_NHLT=y
CONFIG_ACPI_NFIT=y
# CONFIG_NFIT_SECURITY_DEBUG is not set
CONFIG_ACPI_NUMA=y
# CONFIG_ACPI_HMAT is not set
CONFIG_HAVE_ACPI_APEI=y
CONFIG_HAVE_ACPI_APEI_NMI=y
# CONFIG_ACPI_APEI is not set
# CONFIG_ACPI_DPTF is not set
# CONFIG_ACPI_EXTLOG is not set
# CONFIG_ACPI_CONFIGFS is not set
# CONFIG_ACPI_PFRUT is not set
CONFIG_ACPI_PCC=y
# CONFIG_ACPI_FFH is not set
CONFIG_ACPI_MRRM=y
CONFIG_PMIC_OPREGION=y
CONFIG_BXT_WC_PMIC_OPREGION=y
# CONFIG_CHT_WC_PMIC_OPREGION is not set
CONFIG_X86_PM_TIMER=y

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
# CONFIG_CPU_FREQ_STAT is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

#
# CPU frequency scaling drivers
#
# CONFIG_CPUFREQ_DT is not set
# CONFIG_CPUFREQ_DT_PLATDEV is not set
CONFIG_X86_INTEL_PSTATE=y
# CONFIG_X86_PCC_CPUFREQ is not set
CONFIG_X86_AMD_PSTATE=y
CONFIG_X86_AMD_PSTATE_DEFAULT_MODE=3
# CONFIG_X86_AMD_PSTATE_UT is not set
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ_CPB=y
# CONFIG_X86_POWERNOW_K8 is not set
# CONFIG_X86_AMD_FREQ_SENSITIVITY is not set
# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
# CONFIG_X86_P4_CLOCKMOD is not set

#
# shared options
#
CONFIG_CPUFREQ_ARCH_CUR_FREQ=y
# end of CPU Frequency scaling

#
# CPU Idle
#
CONFIG_CPU_IDLE=y
# CONFIG_CPU_IDLE_GOV_LADDER is not set
CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_CPU_IDLE_GOV_TEO is not set
CONFIG_CPU_IDLE_GOV_HALTPOLL=y
CONFIG_HALTPOLL_CPUIDLE=y
# end of CPU Idle

CONFIG_INTEL_IDLE=y
# end of Power management and ACPI options

#
# Bus options (PCI etc.)
#
CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_MMCONF_FAM10H=y
CONFIG_ISA_BUS=y
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
CONFIG_AMD_NODE=y
# end of Bus options (PCI etc.)

#
# Binary Emulations
#
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_EMULATION_DEFAULT_DISABLED is not set
CONFIG_COMPAT_32=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
# end of Binary Emulations

CONFIG_KVM_COMMON=y
CONFIG_HAVE_KVM_PFNCACHE=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_DIRTY_RING=y
CONFIG_HAVE_KVM_DIRTY_RING_TSO=y
CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_READONLY_MEM=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_GENERIC_PRE_FAULT_MEMORY=y
CONFIG_KVM_COMPAT=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_HAVE_KVM_NO_POLL=y
CONFIG_KVM_XFER_TO_GUEST_WORK=y
CONFIG_HAVE_KVM_PM_NOTIFIER=y
CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y
CONFIG_KVM_GENERIC_MMU_NOTIFIER=y
CONFIG_KVM_ELIDE_TLB_FLUSH_IF_YOUNG=y
CONFIG_KVM_MMU_LOCKLESS_AGING=y
CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES=y
CONFIG_KVM_PRIVATE_MEM=y
CONFIG_KVM_GENERIC_PRIVATE_MEM=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM_X86=y
CONFIG_KVM=y
CONFIG_KVM_SW_PROTECTED_VM=y
CONFIG_KVM_INTEL=y
# CONFIG_KVM_INTEL_PROVE_VE is not set
CONFIG_X86_SGX_KVM=y
CONFIG_KVM_AMD=y
# CONFIG_KVM_SMM is not set
CONFIG_KVM_HYPERV=y
CONFIG_KVM_XEN=y
CONFIG_KVM_PROVE_MMU=y
CONFIG_KVM_MAX_NR_VCPUS=1024
CONFIG_X86_REQUIRED_FEATURE_ALWAYS=y
CONFIG_X86_REQUIRED_FEATURE_NOPL=y
CONFIG_X86_REQUIRED_FEATURE_CX8=y
CONFIG_X86_REQUIRED_FEATURE_CMOV=y
CONFIG_X86_REQUIRED_FEATURE_CPUID=y
CONFIG_X86_REQUIRED_FEATURE_FPU=y
CONFIG_X86_REQUIRED_FEATURE_PAE=y
CONFIG_X86_REQUIRED_FEATURE_PSE=y
CONFIG_X86_REQUIRED_FEATURE_PGE=y
CONFIG_X86_REQUIRED_FEATURE_MSR=y
CONFIG_X86_REQUIRED_FEATURE_FXSR=y
CONFIG_X86_REQUIRED_FEATURE_XMM=y
CONFIG_X86_REQUIRED_FEATURE_XMM2=y
CONFIG_X86_REQUIRED_FEATURE_LM=y
CONFIG_X86_DISABLED_FEATURE_VME=y
CONFIG_X86_DISABLED_FEATURE_K6_MTRR=y
CONFIG_X86_DISABLED_FEATURE_CYRIX_ARR=y
CONFIG_X86_DISABLED_FEATURE_CENTAUR_MCR=y
CONFIG_X86_DISABLED_FEATURE_LAM=y
CONFIG_X86_DISABLED_FEATURE_XENPV=y
CONFIG_X86_DISABLED_FEATURE_TDX_GUEST=y
CONFIG_X86_DISABLED_FEATURE_FRED=y
CONFIG_X86_DISABLED_FEATURE_SEV_SNP=y
CONFIG_AS_AVX512=y
CONFIG_AS_GFNI=y
CONFIG_AS_VAES=y
CONFIG_AS_VPCLMULQDQ=y
CONFIG_AS_WRUSS=y
CONFIG_ARCH_CONFIGURES_CPU_MITIGATIONS=y

#
# General architecture-dependent options
#
CONFIG_HOTPLUG_SMT=y
CONFIG_HOTPLUG_CORE_SYNC=y
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
CONFIG_HOTPLUG_CORE_SYNC_FULL=y
CONFIG_HOTPLUG_SPLIT_STARTUP=y
CONFIG_HOTPLUG_PARALLEL=y
CONFIG_GENERIC_ENTRY=y
# CONFIG_KPROBES is not set
CONFIG_JUMP_LABEL=y
# CONFIG_STATIC_KEYS_SELFTEST is not set
# CONFIG_STATIC_CALL_SELFTEST is not set
CONFIG_UPROBES=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_KPROBES_ON_FTRACE=y
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y
CONFIG_HAVE_NMI=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_CONTIGUOUS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
CONFIG_ARCH_HAS_SET_MEMORY=y
CONFIG_ARCH_HAS_SET_DIRECT_MAP=y
CONFIG_ARCH_HAS_CPU_FINALIZE_INIT=y
CONFIG_ARCH_HAS_CPU_PASID=y
CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y
CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y
CONFIG_ARCH_WANTS_NO_INSTR=y
CONFIG_HAVE_ASM_MODVERSIONS=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_RSEQ=y
CONFIG_HAVE_RUST=y
CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y
CONFIG_MMU_GATHER_TABLE_FREE=y
CONFIG_MMU_GATHER_RCU_TABLE_FREE=y
CONFIG_MMU_GATHER_MERGE_VMAS=y
CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM=y
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_ARCH_HAVE_EXTRA_ELF_NOTES=y
CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS=y
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
CONFIG_HAVE_ARCH_SECCOMP=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP=y
CONFIG_SECCOMP_FILTER=y
# CONFIG_SECCOMP_CACHE_DEBUG is not set
CONFIG_HAVE_ARCH_STACKLEAK=y
CONFIG_HAVE_STACKPROTECTOR=y
CONFIG_STACKPROTECTOR=y
CONFIG_STACKPROTECTOR_STRONG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y
CONFIG_HAS_LTO_CLANG=y
CONFIG_LTO_NONE=y
# CONFIG_LTO_CLANG_FULL is not set
# CONFIG_LTO_CLANG_THIN is not set
CONFIG_ARCH_SUPPORTS_AUTOFDO_CLANG=y
# CONFIG_AUTOFDO_CLANG is not set
CONFIG_ARCH_SUPPORTS_PROPELLER_CLANG=y
# CONFIG_PROPELLER_CLANG is not set
CONFIG_ARCH_SUPPORTS_CFI_CLANG=y
# CONFIG_CFI_CLANG is not set
CONFIG_HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG=y
CONFIG_HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC=y
CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y
CONFIG_HAVE_CONTEXT_TRACKING_USER=y
CONFIG_HAVE_CONTEXT_TRACKING_USER_OFFSTACK=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_MOVE_PUD=y
CONFIG_HAVE_MOVE_PMD=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
CONFIG_HAVE_ARCH_HUGE_VMAP=y
CONFIG_HAVE_ARCH_HUGE_VMALLOC=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_PMD_MKWRITE=y
CONFIG_HAVE_ARCH_SOFT_DIRTY=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_ARCH_HAS_EXECMEM_ROX=y
CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y
CONFIG_SOFTIRQ_ON_OWN_STACK=y
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
CONFIG_HAVE_EXIT_THREAD=y
CONFIG_ARCH_MMAP_RND_BITS=28
CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8
CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES=y
CONFIG_HAVE_PAGE_SIZE_4KB=y
CONFIG_PAGE_SIZE_4KB=y
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
CONFIG_PAGE_SHIFT=12
CONFIG_HAVE_OBJTOOL=y
CONFIG_HAVE_JUMP_LABEL_HACK=y
CONFIG_HAVE_NOINSTR_HACK=y
CONFIG_HAVE_NOINSTR_VALIDATION=y
CONFIG_HAVE_UACCESS_VALIDATION=y
CONFIG_HAVE_STACK_VALIDATION=y
CONFIG_HAVE_RELIABLE_STACKTRACE=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_COMPAT_OLD_SIGACTION=y
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_ARCH_SUPPORTS_RT=y
CONFIG_HAVE_ARCH_VMAP_STACK=y
CONFIG_VMAP_STACK=y
CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y
CONFIG_RANDOMIZE_KSTACK_OFFSET=y
# CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set
CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
CONFIG_STRICT_KERNEL_RWX=y
CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
CONFIG_STRICT_MODULE_RWX=y
CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y
# CONFIG_LOCK_EVENT_COUNTS is not set
CONFIG_ARCH_HAS_MEM_ENCRYPT=y
CONFIG_HAVE_STATIC_CALL=y
CONFIG_HAVE_STATIC_CALL_INLINE=y
CONFIG_HAVE_PREEMPT_DYNAMIC=y
CONFIG_HAVE_PREEMPT_DYNAMIC_CALL=y
CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y
CONFIG_ARCH_HAS_ELFCORE_COMPAT=y
CONFIG_ARCH_HAS_PARANOID_L1D_FLUSH=y
CONFIG_DYNAMIC_SIGFRAME=y
CONFIG_HAVE_ARCH_NODE_DEV_GROUP=y
CONFIG_ARCH_HAS_HW_PTE_YOUNG=y
CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y
CONFIG_ARCH_HAS_KERNEL_FPU_SUPPORT=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
# end of GCOV-based kernel profiling

CONFIG_HAVE_GCC_PLUGINS=y
CONFIG_FUNCTION_ALIGNMENT_4B=y
CONFIG_FUNCTION_ALIGNMENT_16B=y
CONFIG_FUNCTION_ALIGNMENT=16
CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT=y
# end of General architecture-dependent options

CONFIG_RT_MUTEXES=y
CONFIG_MODULE_SIG_FORMAT=y
CONFIG_MODULES=y
# CONFIG_MODULE_DEBUG is not set
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODULE_UNLOAD_TAINT_TRACKING is not set
CONFIG_MODVERSIONS=y
# CONFIG_GENKSYMS is not set
CONFIG_GENDWARFKSYMS=y
CONFIG_ASM_MODVERSIONS=y
# CONFIG_EXTENDED_MODVERSIONS is not set
# CONFIG_BASIC_MODVERSIONS is not set
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_MODULE_SIG=y
# CONFIG_MODULE_SIG_FORCE is not set
# CONFIG_MODULE_SIG_ALL is not set
CONFIG_MODULE_SIG_SHA1=y
# CONFIG_MODULE_SIG_SHA256 is not set
# CONFIG_MODULE_SIG_SHA384 is not set
# CONFIG_MODULE_SIG_SHA512 is not set
# CONFIG_MODULE_SIG_SHA3_256 is not set
# CONFIG_MODULE_SIG_SHA3_384 is not set
# CONFIG_MODULE_SIG_SHA3_512 is not set
CONFIG_MODULE_SIG_HASH="sha1"
# CONFIG_MODULE_COMPRESS is not set
# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set
CONFIG_MODPROBE_PATH="/sbin/modprobe"
# CONFIG_TRIM_UNUSED_KSYMS is not set
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
CONFIG_BLOCK_LEGACY_AUTOLOAD=y
CONFIG_BLK_RQ_ALLOC_TIME=y
CONFIG_BLK_CGROUP_RWSTAT=y
CONFIG_BLK_CGROUP_PUNT_BIO=y
CONFIG_BLK_DEV_BSG_COMMON=y
CONFIG_BLK_ICQ=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
# CONFIG_BLK_DEV_WRITE_MOUNTED is not set
CONFIG_BLK_DEV_ZONED=y
CONFIG_BLK_DEV_THROTTLING=y
CONFIG_BLK_WBT=y
CONFIG_BLK_WBT_MQ=y
CONFIG_BLK_CGROUP_IOLATENCY=y
# CONFIG_BLK_CGROUP_FC_APPID is not set
CONFIG_BLK_CGROUP_IOCOST=y
CONFIG_BLK_CGROUP_IOPRIO=y
CONFIG_BLK_DEBUG_FS=y
# CONFIG_BLK_SED_OPAL is not set
CONFIG_BLK_INLINE_ENCRYPTION=y
CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
CONFIG_ACORN_PARTITION_CUMANA=y
CONFIG_ACORN_PARTITION_EESOX=y
CONFIG_ACORN_PARTITION_ICS=y
CONFIG_ACORN_PARTITION_ADFS=y
CONFIG_ACORN_PARTITION_POWERTEC=y
CONFIG_ACORN_PARTITION_RISCIX=y
CONFIG_AIX_PARTITION=y
CONFIG_OSF_PARTITION=y
CONFIG_AMIGA_PARTITION=y
CONFIG_ATARI_PARTITION=y
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
CONFIG_SOLARIS_X86_PARTITION=y
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
# CONFIG_LDM_DEBUG is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_SYSV68_PARTITION=y
CONFIG_CMDLINE_PARTITION=y
# CONFIG_OF_PARTITION is not set
# end of Partition Types

CONFIG_BLK_PM=y
CONFIG_BLOCK_HOLDER_DEPRECATED=y
CONFIG_BLK_MQ_STACKING=y

#
# IO Schedulers
#
CONFIG_MQ_IOSCHED_DEADLINE=y
CONFIG_MQ_IOSCHED_KYBER=y
CONFIG_IOSCHED_BFQ=y
CONFIG_BFQ_GROUP_IOSCHED=y
CONFIG_BFQ_CGROUP_DEBUG=y
# end of IO Schedulers

CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_PADATA=y
CONFIG_ASN1=y
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
CONFIG_QUEUED_SPINLOCKS=y
CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
CONFIG_QUEUED_RWLOCKS=y
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y
CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y
CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y
CONFIG_FREEZER=y

#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ELFCORE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_BINFMT_SCRIPT=y
CONFIG_BINFMT_MISC=y
CONFIG_COREDUMP=y
# end of Executable file formats

#
# Memory Management options
#
CONFIG_ZPOOL=y
CONFIG_SWAP=y
CONFIG_ZSWAP=y
CONFIG_ZSWAP_DEFAULT_ON=y
CONFIG_ZSWAP_SHRINKER_DEFAULT_ON=y
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_DEFLATE is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZO is not set
CONFIG_ZSWAP_COMPRESSOR_DEFAULT_842=y
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4HC is not set
# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD is not set
CONFIG_ZSWAP_COMPRESSOR_DEFAULT="842"
CONFIG_ZSWAP_ZPOOL_DEFAULT_ZSMALLOC=y
CONFIG_ZSWAP_ZPOOL_DEFAULT="zsmalloc"
CONFIG_ZSMALLOC=y
# CONFIG_ZSMALLOC_STAT is not set
CONFIG_ZSMALLOC_CHAIN_SIZE=8

#
# Slab allocator options
#
CONFIG_SLUB=y
CONFIG_KVFREE_RCU_BATCHED=y
# CONFIG_SLUB_TINY is not set
CONFIG_SLAB_MERGE_DEFAULT=y
# CONFIG_SLAB_FREELIST_RANDOM is not set
# CONFIG_SLAB_FREELIST_HARDENED is not set
# CONFIG_SLAB_BUCKETS is not set
# CONFIG_SLUB_STATS is not set
CONFIG_SLUB_CPU_PARTIAL=y
# CONFIG_RANDOM_KMALLOC_CACHES is not set
# end of Slab allocator options

# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SPARSEMEM=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_SPARSEMEM_VMEMMAP_PREINIT=y
CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=y
CONFIG_ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP=y
CONFIG_ARCH_WANT_HUGETLB_VMEMMAP_PREINIT=y
CONFIG_HAVE_GUP_FAST=y
CONFIG_NUMA_KEEP_MEMINFO=y
CONFIG_MEMORY_ISOLATION=y
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
CONFIG_HAVE_BOOTMEM_INFO_NODE=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_MEMORY_HOTPLUG=y
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_OFFLINE is not set
CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO=y
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_KERNEL is not set
# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE is not set
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_MHP_MEMMAP_ON_MEMORY=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
CONFIG_SPLIT_PTE_PTLOCKS=y
CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y
CONFIG_SPLIT_PMD_PTLOCKS=y
CONFIG_MEMORY_BALLOON=y
# CONFIG_BALLOON_COMPACTION is not set
CONFIG_COMPACTION=y
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
CONFIG_PAGE_REPORTING=y
CONFIG_MIGRATION=y
CONFIG_DEVICE_MIGRATION=y
CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y
CONFIG_ARCH_ENABLE_THP_MIGRATION=y
CONFIG_CONTIG_ALLOC=y
CONFIG_PCP_BATCH_SCALE_MAX=5
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
# CONFIG_MEMORY_FAILURE is not set
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ARCH_WANTS_THP_SWAP=y
CONFIG_MM_ID=y
CONFIG_TRANSPARENT_HUGEPAGE=y
# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set
CONFIG_THP_SWAP=y
CONFIG_READ_ONLY_THP_FOR_FS=y
# CONFIG_NO_PAGE_MAPCOUNT is not set
CONFIG_PAGE_MAPCOUNT=y
CONFIG_PGTABLE_HAS_HUGE_LEAVES=y
CONFIG_ARCH_SUPPORTS_HUGE_PFNMAP=y
CONFIG_ARCH_SUPPORTS_PMD_PFNMAP=y
CONFIG_ARCH_SUPPORTS_PUD_PFNMAP=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_USE_PERCPU_NUMA_NODE_ID=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_CMA=y
# CONFIG_CMA_DEBUGFS is not set
# CONFIG_CMA_SYSFS is not set
CONFIG_CMA_AREAS=20
CONFIG_PAGE_BLOCK_ORDER=10
CONFIG_MEM_SOFT_DIRTY=y
CONFIG_GENERIC_EARLY_IOREMAP=y
# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set
CONFIG_PAGE_IDLE_FLAG=y
# CONFIG_IDLE_PAGE_TRACKING is not set
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CURRENT_STACK_POINTER=y
CONFIG_ARCH_HAS_PTE_DEVMAP=y
CONFIG_ARCH_HAS_ZONE_DMA_SET=y
CONFIG_ZONE_DMA=y
CONFIG_ZONE_DMA32=y
CONFIG_ZONE_DEVICE=y
CONFIG_HMM_MIRROR=y
CONFIG_GET_FREE_REGION=y
CONFIG_DEVICE_PRIVATE=y
CONFIG_VMAP_PFN=y
CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y
CONFIG_ARCH_HAS_PKEYS=y
CONFIG_ARCH_USES_PG_ARCH_2=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PERCPU_STATS=y
# CONFIG_GUP_TEST is not set
# CONFIG_DMAPOOL_TEST is not set
CONFIG_ARCH_HAS_PTE_SPECIAL=y
CONFIG_MAPPING_DIRTY_HELPERS=y
CONFIG_KMAP_LOCAL=y
CONFIG_MEMFD_CREATE=y
CONFIG_SECRETMEM=y
CONFIG_ANON_VMA_NAME=y
CONFIG_HAVE_ARCH_USERFAULTFD_WP=y
CONFIG_HAVE_ARCH_USERFAULTFD_MINOR=y
CONFIG_USERFAULTFD=y
# CONFIG_PTE_MARKER_UFFD_WP is not set
CONFIG_LRU_GEN=y
CONFIG_LRU_GEN_ENABLED=y
# CONFIG_LRU_GEN_STATS is not set
CONFIG_LRU_GEN_WALKS_MMU=y
CONFIG_ARCH_SUPPORTS_PER_VMA_LOCK=y
CONFIG_PER_VMA_LOCK=y
CONFIG_LOCK_MM_AND_FIND_VMA=y
CONFIG_IOMMU_MM_DATA=y
CONFIG_EXECMEM=y
CONFIG_NUMA_MEMBLKS=y
CONFIG_NUMA_EMU=y
CONFIG_ARCH_HAS_USER_SHADOW_STACK=y
CONFIG_ARCH_SUPPORTS_PT_RECLAIM=y
CONFIG_PT_RECLAIM=y

#
# Data Access Monitoring
#
CONFIG_DAMON=y
CONFIG_DAMON_VADDR=y
CONFIG_DAMON_PADDR=y
# CONFIG_DAMON_SYSFS is not set
CONFIG_DAMON_RECLAIM=y
# CONFIG_DAMON_LRU_SORT is not set
# end of Data Access Monitoring
# end of Memory Management options

CONFIG_NET=y
CONFIG_WANT_COMPAT_NETLINK_MESSAGES=y
CONFIG_COMPAT_NETLINK_MESSAGES=y
CONFIG_NET_INGRESS=y
CONFIG_NET_EGRESS=y
CONFIG_NET_XGRESS=y
CONFIG_NET_REDIRECT=y
CONFIG_SKB_DECRYPTED=y
CONFIG_SKB_EXTENSIONS=y
CONFIG_NET_DEVMEM=y
CONFIG_NET_SHAPER=y
CONFIG_NET_CRC32C=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_DIAG=y
CONFIG_UNIX=y
CONFIG_AF_UNIX_OOB=y
CONFIG_UNIX_DIAG=y
CONFIG_TLS=y
CONFIG_TLS_DEVICE=y
CONFIG_TLS_TOE=y
CONFIG_XFRM=y
CONFIG_XFRM_OFFLOAD=y
CONFIG_XFRM_ALGO=y
CONFIG_XFRM_USER=y
CONFIG_XFRM_USER_COMPAT=y
CONFIG_XFRM_INTERFACE=y
CONFIG_XFRM_SUB_POLICY=y
CONFIG_XFRM_MIGRATE=y
CONFIG_XFRM_STATISTICS=y
CONFIG_XFRM_AH=y
CONFIG_XFRM_ESP=y
CONFIG_XFRM_IPCOMP=y
CONFIG_NET_KEY=y
CONFIG_NET_KEY_MIGRATE=y
# CONFIG_XFRM_IPTFS is not set
CONFIG_XFRM_ESPINTCP=y
CONFIG_SMC=y
CONFIG_SMC_DIAG=y
# CONFIG_SMC_LO is not set
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_NET_HANDSHAKE=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_FIB_TRIE_STATS=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_ROUTE_CLASSID=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IP_TUNNEL=y
CONFIG_NET_IPGRE=y
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE_COMMON=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_SYN_COOKIES=y
CONFIG_NET_IPVTI=y
CONFIG_NET_UDP_TUNNEL=y
CONFIG_NET_FOU=y
CONFIG_NET_FOU_IP_TUNNELS=y
CONFIG_INET_AH=y
CONFIG_INET_ESP=y
CONFIG_INET_ESP_OFFLOAD=y
CONFIG_INET_ESPINTCP=y
CONFIG_INET_IPCOMP=y
CONFIG_INET_TABLE_PERTURB_ORDER=16
CONFIG_INET_XFRM_TUNNEL=y
CONFIG_INET_TUNNEL=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
CONFIG_INET_UDP_DIAG=y
CONFIG_INET_RAW_DIAG=y
CONFIG_INET_DIAG_DESTROY=y
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_BIC=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_TCP_CONG_WESTWOOD=y
CONFIG_TCP_CONG_HTCP=y
CONFIG_TCP_CONG_HSTCP=y
CONFIG_TCP_CONG_HYBLA=y
CONFIG_TCP_CONG_VEGAS=y
CONFIG_TCP_CONG_NV=y
CONFIG_TCP_CONG_SCALABLE=y
CONFIG_TCP_CONG_LP=y
CONFIG_TCP_CONG_VENO=y
CONFIG_TCP_CONG_YEAH=y
CONFIG_TCP_CONG_ILLINOIS=y
CONFIG_TCP_CONG_DCTCP=y
CONFIG_TCP_CONG_CDG=y
CONFIG_TCP_CONG_BBR=y
# CONFIG_DEFAULT_BIC is not set
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_HTCP is not set
# CONFIG_DEFAULT_HYBLA is not set
# CONFIG_DEFAULT_VEGAS is not set
# CONFIG_DEFAULT_VENO is not set
# CONFIG_DEFAULT_WESTWOOD is not set
# CONFIG_DEFAULT_DCTCP is not set
# CONFIG_DEFAULT_CDG is not set
# CONFIG_DEFAULT_BBR is not set
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
CONFIG_TCP_SIGPOOL=y
# CONFIG_TCP_AO is not set
CONFIG_TCP_MD5SIG=y
CONFIG_IPV6=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_INET6_AH=y
CONFIG_INET6_ESP=y
CONFIG_INET6_ESP_OFFLOAD=y
CONFIG_INET6_ESPINTCP=y
CONFIG_INET6_IPCOMP=y
CONFIG_IPV6_MIP6=y
CONFIG_IPV6_ILA=y
CONFIG_INET6_XFRM_TUNNEL=y
CONFIG_INET6_TUNNEL=y
CONFIG_IPV6_VTI=y
CONFIG_IPV6_SIT=y
CONFIG_IPV6_SIT_6RD=y
CONFIG_IPV6_NDISC_NODETYPE=y
CONFIG_IPV6_TUNNEL=y
CONFIG_IPV6_GRE=y
CONFIG_IPV6_FOU=y
CONFIG_IPV6_FOU_TUNNEL=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_IPV6_SEG6_LWTUNNEL=y
CONFIG_IPV6_SEG6_HMAC=y
CONFIG_IPV6_SEG6_BPF=y
CONFIG_IPV6_RPL_LWTUNNEL=y
# CONFIG_IPV6_IOAM6_LWTUNNEL is not set
CONFIG_NETLABEL=y
CONFIG_MPTCP=y
CONFIG_INET_MPTCP_DIAG=y
CONFIG_MPTCP_IPV6=y
CONFIG_NETWORK_SECMARK=y
CONFIG_NET_PTP_CLASSIFY=y
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
CONFIG_NETFILTER=y
CONFIG_NETFILTER_ADVANCED=y
CONFIG_BRIDGE_NETFILTER=y

#
# Core Netfilter Configuration
#
CONFIG_NETFILTER_INGRESS=y
CONFIG_NETFILTER_EGRESS=y
CONFIG_NETFILTER_SKIP_EGRESS=y
CONFIG_NETFILTER_NETLINK=y
CONFIG_NETFILTER_FAMILY_BRIDGE=y
CONFIG_NETFILTER_FAMILY_ARP=y
CONFIG_NETFILTER_BPF_LINK=y
# CONFIG_NETFILTER_NETLINK_HOOK is not set
CONFIG_NETFILTER_NETLINK_ACCT=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NETFILTER_NETLINK_OSF=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_LOG_SYSLOG=y
CONFIG_NETFILTER_CONNCOUNT=y
CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_ZONES=y
# CONFIG_NF_CONNTRACK_PROCFS is not set
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_TIMEOUT=y
CONFIG_NF_CONNTRACK_TIMESTAMP=y
CONFIG_NF_CONNTRACK_LABELS=y
CONFIG_NF_CONNTRACK_OVS=y
CONFIG_NF_CT_PROTO_DCCP=y
CONFIG_NF_CT_PROTO_GRE=y
CONFIG_NF_CT_PROTO_SCTP=y
CONFIG_NF_CT_PROTO_UDPLITE=y
CONFIG_NF_CONNTRACK_AMANDA=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_CONNTRACK_H323=y
CONFIG_NF_CONNTRACK_IRC=y
CONFIG_NF_CONNTRACK_BROADCAST=y
CONFIG_NF_CONNTRACK_NETBIOS_NS=y
CONFIG_NF_CONNTRACK_SNMP=y
CONFIG_NF_CONNTRACK_PPTP=y
CONFIG_NF_CONNTRACK_SANE=y
CONFIG_NF_CONNTRACK_SIP=y
CONFIG_NF_CONNTRACK_TFTP=y
CONFIG_NF_CT_NETLINK=y
CONFIG_NF_CT_NETLINK_TIMEOUT=y
CONFIG_NF_CT_NETLINK_HELPER=y
CONFIG_NETFILTER_NETLINK_GLUE_CT=y
CONFIG_NF_NAT=y
CONFIG_NF_NAT_AMANDA=y
CONFIG_NF_NAT_FTP=y
CONFIG_NF_NAT_IRC=y
CONFIG_NF_NAT_SIP=y
CONFIG_NF_NAT_TFTP=y
CONFIG_NF_NAT_REDIRECT=y
CONFIG_NF_NAT_MASQUERADE=y
CONFIG_NF_NAT_OVS=y
CONFIG_NETFILTER_SYNPROXY=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_NUMGEN=y
CONFIG_NFT_CT=y
CONFIG_NFT_FLOW_OFFLOAD=y
CONFIG_NFT_CONNLIMIT=y
CONFIG_NFT_LOG=y
CONFIG_NFT_LIMIT=y
CONFIG_NFT_MASQ=y
CONFIG_NFT_REDIR=y
CONFIG_NFT_NAT=y
CONFIG_NFT_TUNNEL=y
CONFIG_NFT_QUEUE=y
CONFIG_NFT_QUOTA=y
CONFIG_NFT_REJECT=y
CONFIG_NFT_REJECT_INET=y
CONFIG_NFT_COMPAT=y
CONFIG_NFT_HASH=y
CONFIG_NFT_FIB=y
CONFIG_NFT_FIB_INET=y
CONFIG_NFT_XFRM=y
CONFIG_NFT_SOCKET=y
CONFIG_NFT_OSF=y
CONFIG_NFT_TPROXY=y
CONFIG_NFT_SYNPROXY=y
CONFIG_NF_DUP_NETDEV=y
CONFIG_NFT_DUP_NETDEV=y
CONFIG_NFT_FWD_NETDEV=y
CONFIG_NFT_FIB_NETDEV=y
CONFIG_NFT_REJECT_NETDEV=y
CONFIG_NF_FLOW_TABLE_INET=y
CONFIG_NF_FLOW_TABLE=y
# CONFIG_NF_FLOW_TABLE_PROCFS is not set
CONFIG_NETFILTER_XTABLES=y
CONFIG_NETFILTER_XTABLES_COMPAT=y

#
# Xtables combined modules
#
CONFIG_NETFILTER_XT_MARK=y
CONFIG_NETFILTER_XT_CONNMARK=y
CONFIG_NETFILTER_XT_SET=y

#
# Xtables targets
#
CONFIG_NETFILTER_XT_TARGET_AUDIT=y
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=y
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
CONFIG_NETFILTER_XT_TARGET_CT=y
CONFIG_NETFILTER_XT_TARGET_DSCP=y
CONFIG_NETFILTER_XT_TARGET_HL=y
CONFIG_NETFILTER_XT_TARGET_HMARK=y
CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
CONFIG_NETFILTER_XT_TARGET_LED=y
CONFIG_NETFILTER_XT_TARGET_LOG=y
CONFIG_NETFILTER_XT_TARGET_MARK=y
CONFIG_NETFILTER_XT_NAT=y
CONFIG_NETFILTER_XT_TARGET_NETMAP=y
CONFIG_NETFILTER_XT_TARGET_NFLOG=y
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
CONFIG_NETFILTER_XT_TARGET_NOTRACK=y
CONFIG_NETFILTER_XT_TARGET_RATEEST=y
CONFIG_NETFILTER_XT_TARGET_REDIRECT=y
CONFIG_NETFILTER_XT_TARGET_MASQUERADE=y
CONFIG_NETFILTER_XT_TARGET_TEE=y
CONFIG_NETFILTER_XT_TARGET_TPROXY=y
CONFIG_NETFILTER_XT_TARGET_TRACE=y
CONFIG_NETFILTER_XT_TARGET_SECMARK=y
CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=y

#
# Xtables matches
#
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
CONFIG_NETFILTER_XT_MATCH_BPF=y
CONFIG_NETFILTER_XT_MATCH_CGROUP=y
CONFIG_NETFILTER_XT_MATCH_CLUSTER=y
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=y
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
CONFIG_NETFILTER_XT_MATCH_CPU=y
CONFIG_NETFILTER_XT_MATCH_DCCP=y
CONFIG_NETFILTER_XT_MATCH_DEVGROUP=y
CONFIG_NETFILTER_XT_MATCH_DSCP=y
CONFIG_NETFILTER_XT_MATCH_ECN=y
CONFIG_NETFILTER_XT_MATCH_ESP=y
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
CONFIG_NETFILTER_XT_MATCH_HELPER=y
CONFIG_NETFILTER_XT_MATCH_HL=y
CONFIG_NETFILTER_XT_MATCH_IPCOMP=y
CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
CONFIG_NETFILTER_XT_MATCH_IPVS=y
CONFIG_NETFILTER_XT_MATCH_L2TP=y
CONFIG_NETFILTER_XT_MATCH_LENGTH=y
CONFIG_NETFILTER_XT_MATCH_LIMIT=y
CONFIG_NETFILTER_XT_MATCH_MAC=y
CONFIG_NETFILTER_XT_MATCH_MARK=y
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
CONFIG_NETFILTER_XT_MATCH_NFACCT=y
CONFIG_NETFILTER_XT_MATCH_OSF=y
CONFIG_NETFILTER_XT_MATCH_OWNER=y
CONFIG_NETFILTER_XT_MATCH_POLICY=y
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
CONFIG_NETFILTER_XT_MATCH_QUOTA=y
CONFIG_NETFILTER_XT_MATCH_RATEEST=y
CONFIG_NETFILTER_XT_MATCH_REALM=y
CONFIG_NETFILTER_XT_MATCH_RECENT=y
CONFIG_NETFILTER_XT_MATCH_SCTP=y
CONFIG_NETFILTER_XT_MATCH_SOCKET=y
CONFIG_NETFILTER_XT_MATCH_STATE=y
CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
CONFIG_NETFILTER_XT_MATCH_STRING=y
CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
CONFIG_NETFILTER_XT_MATCH_TIME=y
CONFIG_NETFILTER_XT_MATCH_U32=y
# end of Core Netfilter Configuration

CONFIG_IP_SET=y
CONFIG_IP_SET_MAX=256
CONFIG_IP_SET_BITMAP_IP=y
CONFIG_IP_SET_BITMAP_IPMAC=y
CONFIG_IP_SET_BITMAP_PORT=y
CONFIG_IP_SET_HASH_IP=y
CONFIG_IP_SET_HASH_IPMARK=y
CONFIG_IP_SET_HASH_IPPORT=y
CONFIG_IP_SET_HASH_IPPORTIP=y
CONFIG_IP_SET_HASH_IPPORTNET=y
CONFIG_IP_SET_HASH_IPMAC=y
CONFIG_IP_SET_HASH_MAC=y
CONFIG_IP_SET_HASH_NETPORTNET=y
CONFIG_IP_SET_HASH_NET=y
CONFIG_IP_SET_HASH_NETNET=y
CONFIG_IP_SET_HASH_NETPORT=y
CONFIG_IP_SET_HASH_NETIFACE=y
CONFIG_IP_SET_LIST_SET=y
CONFIG_IP_VS=y
CONFIG_IP_VS_IPV6=y
# CONFIG_IP_VS_DEBUG is not set
CONFIG_IP_VS_TAB_BITS=12

#
# IPVS transport protocol load balancing support
#
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_AH_ESP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y
CONFIG_IP_VS_PROTO_SCTP=y

#
# IPVS scheduler
#
CONFIG_IP_VS_RR=y
CONFIG_IP_VS_WRR=y
CONFIG_IP_VS_LC=y
CONFIG_IP_VS_WLC=y
CONFIG_IP_VS_FO=y
CONFIG_IP_VS_OVF=y
CONFIG_IP_VS_LBLC=y
CONFIG_IP_VS_LBLCR=y
CONFIG_IP_VS_DH=y
CONFIG_IP_VS_SH=y
CONFIG_IP_VS_MH=y
CONFIG_IP_VS_SED=y
CONFIG_IP_VS_NQ=y
CONFIG_IP_VS_TWOS=y

#
# IPVS SH scheduler
#
CONFIG_IP_VS_SH_TAB_BITS=8

#
# IPVS MH scheduler
#
CONFIG_IP_VS_MH_TAB_INDEX=12

#
# IPVS application helper
#
CONFIG_IP_VS_FTP=y
CONFIG_IP_VS_NFCT=y
CONFIG_IP_VS_PE_SIP=y

#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=y
CONFIG_IP_NF_IPTABLES_LEGACY=y
CONFIG_NF_SOCKET_IPV4=y
CONFIG_NF_TPROXY_IPV4=y
CONFIG_NF_TABLES_IPV4=y
CONFIG_NFT_REJECT_IPV4=y
CONFIG_NFT_DUP_IPV4=y
CONFIG_NFT_FIB_IPV4=y
CONFIG_NF_TABLES_ARP=y
CONFIG_NF_DUP_IPV4=y
CONFIG_NF_LOG_ARP=y
CONFIG_NF_LOG_IPV4=y
CONFIG_NF_REJECT_IPV4=y
CONFIG_NF_NAT_SNMP_BASIC=y
CONFIG_NF_NAT_PPTP=y
CONFIG_NF_NAT_H323=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_AH=y
CONFIG_IP_NF_MATCH_ECN=y
CONFIG_IP_NF_MATCH_RPFILTER=y
CONFIG_IP_NF_MATCH_TTL=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y
CONFIG_IP_NF_TARGET_SYNPROXY=y
CONFIG_IP_NF_NAT=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_MANGLE=y
CONFIG_IP_NF_TARGET_ECN=y
CONFIG_IP_NF_TARGET_TTL=y
CONFIG_IP_NF_RAW=y
CONFIG_IP_NF_SECURITY=y
CONFIG_IP_NF_ARPTABLES=y
CONFIG_NFT_COMPAT_ARP=y
CONFIG_IP_NF_ARPFILTER=y
CONFIG_IP_NF_ARP_MANGLE=y
# end of IP: Netfilter Configuration

#
# IPv6: Netfilter Configuration
#
CONFIG_IP6_NF_IPTABLES_LEGACY=y
CONFIG_NF_SOCKET_IPV6=y
CONFIG_NF_TPROXY_IPV6=y
CONFIG_NF_TABLES_IPV6=y
CONFIG_NFT_REJECT_IPV6=y
CONFIG_NFT_DUP_IPV6=y
CONFIG_NFT_FIB_IPV6=y
CONFIG_NF_DUP_IPV6=y
CONFIG_NF_REJECT_IPV6=y
CONFIG_NF_LOG_IPV6=y
CONFIG_IP6_NF_IPTABLES=y
CONFIG_IP6_NF_MATCH_AH=y
CONFIG_IP6_NF_MATCH_EUI64=y
CONFIG_IP6_NF_MATCH_FRAG=y
CONFIG_IP6_NF_MATCH_OPTS=y
CONFIG_IP6_NF_MATCH_HL=y
CONFIG_IP6_NF_MATCH_IPV6HEADER=y
CONFIG_IP6_NF_MATCH_MH=y
CONFIG_IP6_NF_MATCH_RPFILTER=y
CONFIG_IP6_NF_MATCH_RT=y
CONFIG_IP6_NF_MATCH_SRH=y
CONFIG_IP6_NF_TARGET_HL=y
CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_TARGET_SYNPROXY=y
CONFIG_IP6_NF_MANGLE=y
CONFIG_IP6_NF_RAW=y
CONFIG_IP6_NF_SECURITY=y
CONFIG_IP6_NF_NAT=y
CONFIG_IP6_NF_TARGET_MASQUERADE=y
CONFIG_IP6_NF_TARGET_NPT=y
# end of IPv6: Netfilter Configuration

CONFIG_NF_DEFRAG_IPV6=y
CONFIG_NF_TABLES_BRIDGE=y
CONFIG_NFT_BRIDGE_META=y
CONFIG_NFT_BRIDGE_REJECT=y
CONFIG_NF_CONNTRACK_BRIDGE=y
CONFIG_BRIDGE_NF_EBTABLES_LEGACY=y
CONFIG_BRIDGE_NF_EBTABLES=y
CONFIG_BRIDGE_EBT_BROUTE=y
CONFIG_BRIDGE_EBT_T_FILTER=y
CONFIG_BRIDGE_EBT_T_NAT=y
CONFIG_BRIDGE_EBT_802_3=y
CONFIG_BRIDGE_EBT_AMONG=y
CONFIG_BRIDGE_EBT_ARP=y
CONFIG_BRIDGE_EBT_IP=y
CONFIG_BRIDGE_EBT_IP6=y
CONFIG_BRIDGE_EBT_LIMIT=y
CONFIG_BRIDGE_EBT_MARK=y
CONFIG_BRIDGE_EBT_PKTTYPE=y
CONFIG_BRIDGE_EBT_STP=y
CONFIG_BRIDGE_EBT_VLAN=y
CONFIG_BRIDGE_EBT_ARPREPLY=y
CONFIG_BRIDGE_EBT_DNAT=y
CONFIG_BRIDGE_EBT_MARK_T=y
CONFIG_BRIDGE_EBT_REDIRECT=y
CONFIG_BRIDGE_EBT_SNAT=y
CONFIG_BRIDGE_EBT_LOG=y
CONFIG_BRIDGE_EBT_NFLOG=y
CONFIG_IP_SCTP=y
# CONFIG_SCTP_DBG_OBJCNT is not set
CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y
# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set
# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set
CONFIG_SCTP_COOKIE_HMAC_MD5=y
CONFIG_SCTP_COOKIE_HMAC_SHA1=y
CONFIG_INET_SCTP_DIAG=y
CONFIG_RDS=y
CONFIG_RDS_RDMA=y
CONFIG_RDS_TCP=y
# CONFIG_RDS_DEBUG is not set
CONFIG_TIPC=y
CONFIG_TIPC_MEDIA_IB=y
CONFIG_TIPC_MEDIA_UDP=y
CONFIG_TIPC_CRYPTO=y
CONFIG_TIPC_DIAG=y
CONFIG_ATM=y
CONFIG_ATM_CLIP=y
# CONFIG_ATM_CLIP_NO_ICMP is not set
CONFIG_ATM_LANE=y
CONFIG_ATM_MPOA=y
CONFIG_ATM_BR2684=y
# CONFIG_ATM_BR2684_IPFILTER is not set
CONFIG_L2TP=y
# CONFIG_L2TP_DEBUGFS is not set
CONFIG_L2TP_V3=y
CONFIG_L2TP_IP=y
CONFIG_L2TP_ETH=y
CONFIG_STP=y
CONFIG_GARP=y
CONFIG_MRP=y
CONFIG_BRIDGE=y
CONFIG_BRIDGE_IGMP_SNOOPING=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
CONFIG_BRIDGE_CFM=y
CONFIG_NET_DSA=y
# CONFIG_NET_DSA_TAG_NONE is not set
# CONFIG_NET_DSA_TAG_AR9331 is not set
CONFIG_NET_DSA_TAG_BRCM_COMMON=y
CONFIG_NET_DSA_TAG_BRCM=y
# CONFIG_NET_DSA_TAG_BRCM_LEGACY is not set
CONFIG_NET_DSA_TAG_BRCM_PREPEND=y
# CONFIG_NET_DSA_TAG_HELLCREEK is not set
# CONFIG_NET_DSA_TAG_GSWIP is not set
# CONFIG_NET_DSA_TAG_DSA is not set
# CONFIG_NET_DSA_TAG_EDSA is not set
CONFIG_NET_DSA_TAG_MTK=y
# CONFIG_NET_DSA_TAG_KSZ is not set
# CONFIG_NET_DSA_TAG_OCELOT is not set
# CONFIG_NET_DSA_TAG_OCELOT_8021Q is not set
CONFIG_NET_DSA_TAG_QCA=y
CONFIG_NET_DSA_TAG_RTL4_A=y
# CONFIG_NET_DSA_TAG_RTL8_4 is not set
# CONFIG_NET_DSA_TAG_RZN1_A5PSW is not set
# CONFIG_NET_DSA_TAG_LAN9303 is not set
# CONFIG_NET_DSA_TAG_SJA1105 is not set
# CONFIG_NET_DSA_TAG_TRAILER is not set
# CONFIG_NET_DSA_TAG_VSC73XX_8021Q is not set
# CONFIG_NET_DSA_TAG_XRS700X is not set
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_LLC=y
CONFIG_LLC2=y
# CONFIG_ATALK is not set
CONFIG_X25=y
CONFIG_LAPB=y
CONFIG_PHONET=y
CONFIG_6LOWPAN=y
# CONFIG_6LOWPAN_DEBUGFS is not set
CONFIG_6LOWPAN_NHC=y
CONFIG_6LOWPAN_NHC_DEST=y
CONFIG_6LOWPAN_NHC_FRAGMENT=y
CONFIG_6LOWPAN_NHC_HOP=y
CONFIG_6LOWPAN_NHC_IPV6=y
CONFIG_6LOWPAN_NHC_MOBILITY=y
CONFIG_6LOWPAN_NHC_ROUTING=y
CONFIG_6LOWPAN_NHC_UDP=y
CONFIG_6LOWPAN_GHC_EXT_HDR_HOP=y
CONFIG_6LOWPAN_GHC_UDP=y
CONFIG_6LOWPAN_GHC_ICMPV6=y
CONFIG_6LOWPAN_GHC_EXT_HDR_DEST=y
CONFIG_6LOWPAN_GHC_EXT_HDR_FRAG=y
CONFIG_6LOWPAN_GHC_EXT_HDR_ROUTE=y
CONFIG_IEEE802154=y
CONFIG_IEEE802154_NL802154_EXPERIMENTAL=y
CONFIG_IEEE802154_SOCKET=y
CONFIG_IEEE802154_6LOWPAN=y
CONFIG_MAC802154=y
CONFIG_NET_SCHED=y

#
# Queueing/Scheduling
#
CONFIG_NET_SCH_HTB=y
CONFIG_NET_SCH_HFSC=y
CONFIG_NET_SCH_PRIO=y
CONFIG_NET_SCH_MULTIQ=y
CONFIG_NET_SCH_RED=y
CONFIG_NET_SCH_SFB=y
CONFIG_NET_SCH_SFQ=y
CONFIG_NET_SCH_TEQL=y
CONFIG_NET_SCH_TBF=y
CONFIG_NET_SCH_CBS=y
CONFIG_NET_SCH_ETF=y
CONFIG_NET_SCH_MQPRIO_LIB=y
CONFIG_NET_SCH_TAPRIO=y
CONFIG_NET_SCH_GRED=y
CONFIG_NET_SCH_NETEM=y
CONFIG_NET_SCH_DRR=y
CONFIG_NET_SCH_MQPRIO=y
CONFIG_NET_SCH_SKBPRIO=y
CONFIG_NET_SCH_CHOKE=y
CONFIG_NET_SCH_QFQ=y
CONFIG_NET_SCH_CODEL=y
CONFIG_NET_SCH_FQ_CODEL=y
CONFIG_NET_SCH_CAKE=y
CONFIG_NET_SCH_FQ=y
CONFIG_NET_SCH_HHF=y
CONFIG_NET_SCH_PIE=y
CONFIG_NET_SCH_FQ_PIE=y
CONFIG_NET_SCH_INGRESS=y
CONFIG_NET_SCH_PLUG=y
CONFIG_NET_SCH_ETS=y
CONFIG_NET_SCH_DEFAULT=y
# CONFIG_DEFAULT_FQ is not set
CONFIG_DEFAULT_CODEL=y
# CONFIG_DEFAULT_FQ_CODEL is not set
# CONFIG_DEFAULT_FQ_PIE is not set
# CONFIG_DEFAULT_SFQ is not set
# CONFIG_DEFAULT_PFIFO_FAST is not set
CONFIG_DEFAULT_NET_SCH="pfifo_fast"

#
# Classification
#
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_ROUTE4=y
CONFIG_NET_CLS_FW=y
CONFIG_NET_CLS_U32=y
CONFIG_CLS_U32_PERF=y
CONFIG_CLS_U32_MARK=y
CONFIG_NET_CLS_FLOW=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_CLS_BPF=y
CONFIG_NET_CLS_FLOWER=y
CONFIG_NET_CLS_MATCHALL=y
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
CONFIG_NET_EMATCH_CMP=y
CONFIG_NET_EMATCH_NBYTE=y
CONFIG_NET_EMATCH_U32=y
CONFIG_NET_EMATCH_META=y
CONFIG_NET_EMATCH_TEXT=y
CONFIG_NET_EMATCH_CANID=y
CONFIG_NET_EMATCH_IPSET=y
CONFIG_NET_EMATCH_IPT=y
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_POLICE=y
CONFIG_NET_ACT_GACT=y
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=y
CONFIG_NET_ACT_SAMPLE=y
CONFIG_NET_ACT_NAT=y
CONFIG_NET_ACT_PEDIT=y
CONFIG_NET_ACT_SIMP=y
CONFIG_NET_ACT_SKBEDIT=y
CONFIG_NET_ACT_CSUM=y
CONFIG_NET_ACT_MPLS=y
CONFIG_NET_ACT_VLAN=y
CONFIG_NET_ACT_BPF=y
CONFIG_NET_ACT_CONNMARK=y
CONFIG_NET_ACT_CTINFO=y
CONFIG_NET_ACT_SKBMOD=y
CONFIG_NET_ACT_IFE=y
CONFIG_NET_ACT_TUNNEL_KEY=y
CONFIG_NET_ACT_CT=y
CONFIG_NET_ACT_GATE=y
CONFIG_NET_IFE_SKBMARK=y
CONFIG_NET_IFE_SKBPRIO=y
CONFIG_NET_IFE_SKBTCINDEX=y
CONFIG_NET_TC_SKB_EXT=y
CONFIG_NET_SCH_FIFO=y
CONFIG_DCB=y
CONFIG_DNS_RESOLVER=y
CONFIG_BATMAN_ADV=y
CONFIG_BATMAN_ADV_BATMAN_V=y
CONFIG_BATMAN_ADV_BLA=y
CONFIG_BATMAN_ADV_DAT=y
CONFIG_BATMAN_ADV_NC=y
CONFIG_BATMAN_ADV_MCAST=y
# CONFIG_BATMAN_ADV_DEBUG is not set
# CONFIG_BATMAN_ADV_TRACING is not set
CONFIG_OPENVSWITCH=y
CONFIG_OPENVSWITCH_GRE=y
CONFIG_OPENVSWITCH_VXLAN=y
CONFIG_OPENVSWITCH_GENEVE=y
CONFIG_VSOCKETS=y
CONFIG_VSOCKETS_DIAG=y
CONFIG_VSOCKETS_LOOPBACK=y
# CONFIG_VMWARE_VMCI_VSOCKETS is not set
CONFIG_VIRTIO_VSOCKETS=y
CONFIG_VIRTIO_VSOCKETS_COMMON=y
CONFIG_NETLINK_DIAG=y
CONFIG_MPLS=y
CONFIG_NET_MPLS_GSO=y
CONFIG_MPLS_ROUTING=y
CONFIG_MPLS_IPTUNNEL=y
CONFIG_NET_NSH=y
CONFIG_HSR=y
CONFIG_NET_SWITCHDEV=y
CONFIG_NET_L3_MASTER_DEV=y
CONFIG_QRTR=y
CONFIG_QRTR_TUN=y
# CONFIG_QRTR_MHI is not set
CONFIG_NET_NCSI=y
# CONFIG_NCSI_OEM_CMD_GET_MAC is not set
# CONFIG_NCSI_OEM_CMD_KEEP_PHY is not set
# CONFIG_PCPU_DEV_REFCNT is not set
CONFIG_MAX_SKB_FRAGS=17
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_SOCK_RX_QUEUE_MAPPING=y
CONFIG_XPS=y
CONFIG_CGROUP_NET_PRIO=y
CONFIG_CGROUP_NET_CLASSID=y
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y
CONFIG_NET_FLOW_LIMIT=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
CONFIG_NET_DROP_MONITOR=y
# end of Network testing
# end of Networking options

CONFIG_HAMRADIO=y

#
# Packet Radio protocols
#
CONFIG_AX25=y
CONFIG_AX25_DAMA_SLAVE=y
CONFIG_NETROM=y
CONFIG_ROSE=y

#
# AX.25 network device drivers
#
CONFIG_MKISS=y
CONFIG_6PACK=y
CONFIG_BPQETHER=y
# CONFIG_BAYCOM_SER_FDX is not set
# CONFIG_BAYCOM_SER_HDX is not set
# CONFIG_BAYCOM_PAR is not set
# CONFIG_YAM is not set
# end of AX.25 network device drivers

CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_CAN_BCM=y
CONFIG_CAN_GW=y
CONFIG_CAN_J1939=y
CONFIG_CAN_ISOTP=y
CONFIG_BT=y
CONFIG_BT_BREDR=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y
CONFIG_BT_LE=y
CONFIG_BT_LE_L2CAP_ECRED=y
CONFIG_BT_6LOWPAN=y
CONFIG_BT_LEDS=y
CONFIG_BT_MSFTEXT=y
# CONFIG_BT_AOSPEXT is not set
# CONFIG_BT_DEBUGFS is not set
# CONFIG_BT_SELFTEST is not set

#
# Bluetooth device drivers
#
CONFIG_BT_INTEL=y
CONFIG_BT_BCM=y
CONFIG_BT_RTL=y
CONFIG_BT_QCA=y
CONFIG_BT_MTK=y
CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y
CONFIG_BT_HCIBTUSB_POLL_SYNC=y
CONFIG_BT_HCIBTUSB_BCM=y
CONFIG_BT_HCIBTUSB_MTK=y
CONFIG_BT_HCIBTUSB_RTL=y
# CONFIG_BT_HCIBTSDIO is not set
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_SERDEV=y
CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_NOKIA is not set
CONFIG_BT_HCIUART_BCSP=y
# CONFIG_BT_HCIUART_ATH3K is not set
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_3WIRE=y
# CONFIG_BT_HCIUART_INTEL is not set
# CONFIG_BT_HCIUART_BCM is not set
# CONFIG_BT_HCIUART_RTL is not set
CONFIG_BT_HCIUART_QCA=y
CONFIG_BT_HCIUART_AG6XX=y
CONFIG_BT_HCIUART_MRVL=y
# CONFIG_BT_HCIUART_AML is not set
CONFIG_BT_HCIBCM203X=y
# CONFIG_BT_HCIBCM4377 is not set
CONFIG_BT_HCIBPA10X=y
CONFIG_BT_HCIBFUSB=y
# CONFIG_BT_HCIDTL1 is not set
# CONFIG_BT_HCIBT3C is not set
# CONFIG_BT_HCIBLUECARD is not set
CONFIG_BT_HCIVHCI=y
CONFIG_BT_MRVL=y
CONFIG_BT_MRVL_SDIO=y
CONFIG_BT_ATH3K=y
CONFIG_BT_MTKSDIO=y
CONFIG_BT_MTKUART=y
# CONFIG_BT_VIRTIO is not set
# CONFIG_BT_NXPUART is not set
# CONFIG_BT_INTEL_PCIE is not set
# end of Bluetooth device drivers

CONFIG_AF_RXRPC=y
CONFIG_AF_RXRPC_IPV6=y
# CONFIG_AF_RXRPC_INJECT_LOSS is not set
# CONFIG_AF_RXRPC_INJECT_RX_DELAY is not set
# CONFIG_AF_RXRPC_DEBUG is not set
CONFIG_RXKAD=y
# CONFIG_RXGK is not set
# CONFIG_RXPERF is not set
CONFIG_AF_KCM=y
CONFIG_STREAM_PARSER=y
CONFIG_MCTP=y
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_CFG80211=y
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y
CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y
CONFIG_CFG80211_DEFAULT_PS=y
CONFIG_CFG80211_DEBUGFS=y
CONFIG_CFG80211_CRDA_SUPPORT=y
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
CONFIG_MAC80211_HAS_RC=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
CONFIG_MAC80211_MESH=y
CONFIG_MAC80211_LEDS=y
CONFIG_MAC80211_DEBUGFS=y
# CONFIG_MAC80211_MESSAGE_TRACING is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
CONFIG_RFKILL=y
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
# CONFIG_RFKILL_GPIO is not set
CONFIG_NET_9P=y
CONFIG_NET_9P_FD=y
CONFIG_NET_9P_VIRTIO=y
# CONFIG_NET_9P_USBG is not set
CONFIG_NET_9P_RDMA=y
# CONFIG_NET_9P_DEBUG is not set
CONFIG_CAIF=y
CONFIG_CAIF_DEBUG=y
CONFIG_CAIF_NETDEV=y
CONFIG_CAIF_USB=y
CONFIG_CEPH_LIB=y
# CONFIG_CEPH_LIB_PRETTYDEBUG is not set
CONFIG_CEPH_LIB_USE_DNS_RESOLVER=y
CONFIG_NFC=y
CONFIG_NFC_DIGITAL=y
CONFIG_NFC_NCI=y
# CONFIG_NFC_NCI_SPI is not set
CONFIG_NFC_NCI_UART=y
CONFIG_NFC_HCI=y
CONFIG_NFC_SHDLC=y

#
# Near Field Communication (NFC) devices
#
# CONFIG_NFC_TRF7970A is not set
# CONFIG_NFC_MEI_PHY is not set
CONFIG_NFC_SIM=y
CONFIG_NFC_PORT100=y
CONFIG_NFC_VIRTUAL_NCI=y
CONFIG_NFC_FDP=y
# CONFIG_NFC_FDP_I2C is not set
# CONFIG_NFC_PN544_I2C is not set
CONFIG_NFC_PN533=y
CONFIG_NFC_PN533_USB=y
# CONFIG_NFC_PN533_I2C is not set
# CONFIG_NFC_PN532_UART is not set
# CONFIG_NFC_MICROREAD_I2C is not set
CONFIG_NFC_MRVL=y
CONFIG_NFC_MRVL_USB=y
# CONFIG_NFC_MRVL_UART is not set
# CONFIG_NFC_MRVL_I2C is not set
# CONFIG_NFC_ST21NFCA_I2C is not set
# CONFIG_NFC_ST_NCI_I2C is not set
# CONFIG_NFC_ST_NCI_SPI is not set
# CONFIG_NFC_NXP_NCI is not set
# CONFIG_NFC_S3FWRN5_I2C is not set
# CONFIG_NFC_S3FWRN82_UART is not set
# CONFIG_NFC_ST95HF is not set
# end of Near Field Communication (NFC) devices

CONFIG_PSAMPLE=y
CONFIG_NET_IFE=y
CONFIG_LWTUNNEL=y
CONFIG_LWTUNNEL_BPF=y
CONFIG_DST_CACHE=y
CONFIG_GRO_CELLS=y
CONFIG_SOCK_VALIDATE_XMIT=y
CONFIG_NET_SELFTESTS=y
CONFIG_NET_SOCK_MSG=y
CONFIG_NET_DEVLINK=y
CONFIG_PAGE_POOL=y
# CONFIG_PAGE_POOL_STATS is not set
CONFIG_FAILOVER=y
CONFIG_ETHTOOL_NETLINK=y

#
# Device Drivers
#
CONFIG_HAVE_PCI=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=y
CONFIG_PCIEAER=y
# CONFIG_PCIEAER_INJECT is not set
# CONFIG_PCIE_ECRC is not set
CONFIG_PCIEASPM=y
CONFIG_PCIEASPM_DEFAULT=y
# CONFIG_PCIEASPM_POWERSAVE is not set
# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set
# CONFIG_PCIEASPM_PERFORMANCE is not set
CONFIG_PCIE_PME=y
# CONFIG_PCIE_DPC is not set
# CONFIG_PCIE_PTM is not set
CONFIG_PCI_MSI=y
CONFIG_PCI_QUIRKS=y
# CONFIG_PCI_DEBUG is not set
# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set
# CONFIG_PCI_STUB is not set
# CONFIG_PCI_PF_STUB is not set
CONFIG_PCI_ATS=y
# CONFIG_PCI_DOE is not set
CONFIG_PCI_ECAM=y
CONFIG_PCI_LOCKLESS_CONFIG=y
CONFIG_PCI_IOV=y
# CONFIG_PCI_NPEM is not set
CONFIG_PCI_PRI=y
CONFIG_PCI_PASID=y
# CONFIG_PCIE_TPH is not set
# CONFIG_PCI_P2PDMA is not set
CONFIG_PCI_LABEL=y
# CONFIG_PCI_DYNAMIC_OF_NODES is not set
# CONFIG_PCIE_BUS_TUNE_OFF is not set
CONFIG_PCIE_BUS_DEFAULT=y
# CONFIG_PCIE_BUS_SAFE is not set
# CONFIG_PCIE_BUS_PERFORMANCE is not set
# CONFIG_PCIE_BUS_PEER2PEER is not set
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
CONFIG_HOTPLUG_PCI=y
# CONFIG_HOTPLUG_PCI_ACPI is not set
# CONFIG_HOTPLUG_PCI_CPCI is not set
# CONFIG_HOTPLUG_PCI_OCTEONEP is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set

#
# PCI controller drivers
#
CONFIG_PCI_HOST_COMMON=y
# CONFIG_PCI_FTPCI100 is not set
CONFIG_PCI_HOST_GENERIC=y
# CONFIG_VMD is not set
# CONFIG_PCIE_XILINX is not set

#
# Cadence-based PCIe controllers
#
# CONFIG_PCIE_CADENCE_PLAT_HOST is not set
# CONFIG_PCIE_CADENCE_PLAT_EP is not set
# end of Cadence-based PCIe controllers

#
# DesignWare-based PCIe controllers
#
# CONFIG_PCI_MESON is not set
# CONFIG_PCIE_INTEL_GW is not set
# CONFIG_PCIE_DW_PLAT_HOST is not set
# CONFIG_PCIE_DW_PLAT_EP is not set
# end of DesignWare-based PCIe controllers

#
# Mobiveil-based PCIe controllers
#
# end of Mobiveil-based PCIe controllers

#
# PLDA-based PCIe controllers
#
# CONFIG_PCIE_MICROCHIP_HOST is not set
# end of PLDA-based PCIe controllers
# end of PCI controller drivers

#
# PCI Endpoint
#
CONFIG_PCI_ENDPOINT=y
# CONFIG_PCI_ENDPOINT_CONFIGFS is not set
# CONFIG_PCI_EPF_TEST is not set
# CONFIG_PCI_EPF_NTB is not set
# end of PCI Endpoint

#
# PCI switch controller drivers
#
# CONFIG_PCI_SW_SWITCHTEC is not set
# end of PCI switch controller drivers

# CONFIG_PCI_PWRCTRL_SLOT is not set
# CONFIG_CXL_BUS is not set
CONFIG_PCCARD=y
CONFIG_PCMCIA=y
CONFIG_PCMCIA_LOAD_CIS=y
CONFIG_CARDBUS=y

#
# PC-card bridges
#
CONFIG_YENTA=y
CONFIG_YENTA_O2=y
CONFIG_YENTA_RICOH=y
CONFIG_YENTA_TI=y
CONFIG_YENTA_ENE_TUNE=y
CONFIG_YENTA_TOSHIBA=y
# CONFIG_PD6729 is not set
# CONFIG_I82092 is not set
CONFIG_PCCARD_NONSTATIC=y
# CONFIG_RAPIDIO is not set

#
# Generic Driver Options
#
CONFIG_AUXILIARY_BUS=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_DEVTMPFS_SAFE is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y

#
# Firmware loader
#
CONFIG_FW_LOADER=y
# CONFIG_FW_LOADER_DEBUG is not set
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
CONFIG_FW_LOADER_COMPRESS=y
# CONFIG_FW_LOADER_COMPRESS_XZ is not set
# CONFIG_FW_LOADER_COMPRESS_ZSTD is not set
CONFIG_FW_CACHE=y
# CONFIG_FW_UPLOAD is not set
# end of Firmware loader

CONFIG_WANT_DEV_COREDUMP=y
CONFIG_ALLOW_DEV_COREDUMP=y
CONFIG_DEV_COREDUMP=y
# CONFIG_DEBUG_DRIVER is not set
CONFIG_DEBUG_DEVRES=y
# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set
CONFIG_GENERIC_CPU_DEVICES=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_CPU_VULNERABILITIES=y
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_MMIO=y
CONFIG_REGMAP_IRQ=y
CONFIG_DMA_SHARED_BUFFER=y
# CONFIG_DMA_FENCE_TRACE is not set
# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set
# end of Generic Driver Options

#
# Bus devices
#
# CONFIG_MOXTET is not set
CONFIG_MHI_BUS=y
# CONFIG_MHI_BUS_DEBUG is not set
# CONFIG_MHI_BUS_PCI_GENERIC is not set
# CONFIG_MHI_BUS_EP is not set
# end of Bus devices

#
# Cache Drivers
#
# end of Cache Drivers

CONFIG_CONNECTOR=y
CONFIG_PROC_EVENTS=y

#
# Firmware Drivers
#

#
# ARM System Control and Management Interface Protocol
#
# end of ARM System Control and Management Interface Protocol

# CONFIG_EDD is not set
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_DMIID=y
# CONFIG_DMI_SYSFS is not set
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
# CONFIG_ISCSI_IBFT is not set
# CONFIG_FW_CFG_SYSFS is not set
CONFIG_SYSFB=y
# CONFIG_SYSFB_SIMPLEFB is not set
CONFIG_GOOGLE_FIRMWARE=y
# CONFIG_GOOGLE_SMI is not set
# CONFIG_GOOGLE_CBMEM is not set
CONFIG_GOOGLE_COREBOOT_TABLE=y
CONFIG_GOOGLE_MEMCONSOLE=y
# CONFIG_GOOGLE_MEMCONSOLE_X86_LEGACY is not set
# CONFIG_GOOGLE_FRAMEBUFFER_COREBOOT is not set
CONFIG_GOOGLE_MEMCONSOLE_COREBOOT=y
CONFIG_GOOGLE_VPD=y

#
# Qualcomm firmware drivers
#
# end of Qualcomm firmware drivers

#
# Tegra firmware driver
#
# end of Tegra firmware driver
# end of Firmware Drivers

# CONFIG_FWCTL is not set
CONFIG_GNSS=y
# CONFIG_GNSS_MTK_SERIAL is not set
# CONFIG_GNSS_SIRF_SERIAL is not set
# CONFIG_GNSS_UBX_SERIAL is not set
CONFIG_GNSS_USB=y
CONFIG_MTD=y
# CONFIG_MTD_TESTS is not set

#
# Partition parsers
#
# CONFIG_MTD_CMDLINE_PARTS is not set
# CONFIG_MTD_OF_PARTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# end of Partition parsers

#
# User Modules And Translation Layers
#
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y

#
# Note that in some cases UBI block is preferred. See MTD_UBI_BLOCK.
#
CONFIG_FTL=y
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set
# CONFIG_SM_FTL is not set
# CONFIG_MTD_OOPS is not set
# CONFIG_MTD_SWAP is not set
# CONFIG_MTD_PARTITIONED_MASTER is not set

#
# RAM/ROM/Flash chip drivers
#
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# end of RAM/ROM/Flash chip drivers

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PLATRAM is not set
# end of Mapping drivers for chip access

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_DATAFLASH is not set
# CONFIG_MTD_MCHP23K256 is not set
# CONFIG_MTD_MCHP48L640 is not set
# CONFIG_MTD_SST25L is not set
CONFIG_MTD_SLRAM=y
CONFIG_MTD_PHRAM=y
CONFIG_MTD_MTDRAM=y
CONFIG_MTDRAM_TOTAL_SIZE=128
CONFIG_MTDRAM_ERASE_SIZE=4
CONFIG_MTD_BLOCK2MTD=y

#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOCG3 is not set
# end of Self-contained MTD device drivers

#
# NAND
#
# CONFIG_MTD_ONENAND is not set
# CONFIG_MTD_RAW_NAND is not set
# CONFIG_MTD_SPI_NAND is not set

#
# ECC engine support
#
# CONFIG_MTD_NAND_ECC_SW_HAMMING is not set
# CONFIG_MTD_NAND_ECC_SW_BCH is not set
# CONFIG_MTD_NAND_ECC_MXIC is not set
# end of ECC engine support
# end of NAND

#
# LPDDR & LPDDR2 PCM memory drivers
#
# CONFIG_MTD_LPDDR is not set
# end of LPDDR & LPDDR2 PCM memory drivers

# CONFIG_MTD_SPI_NOR is not set
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20
# CONFIG_MTD_UBI_FASTMAP is not set
# CONFIG_MTD_UBI_GLUEBI is not set
# CONFIG_MTD_UBI_BLOCK is not set
# CONFIG_MTD_UBI_FAULT_INJECTION is not set
# CONFIG_MTD_UBI_NVMEM is not set
# CONFIG_MTD_HYPERBUS is not set
CONFIG_DTC=y
CONFIG_OF=y
# CONFIG_OF_UNITTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_KOBJ=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_IRQ=y
CONFIG_OF_RESERVED_MEM=y
# CONFIG_OF_OVERLAY is not set
CONFIG_OF_NUMA=y
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
CONFIG_PARPORT=y
# CONFIG_PARPORT_PC is not set
# CONFIG_PARPORT_1284 is not set
CONFIG_PARPORT_NOT_PC=y
CONFIG_PNP=y
CONFIG_PNP_DEBUG_MESSAGES=y

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION=y
# CONFIG_BLK_DEV_FD is not set
CONFIG_CDROM=y
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
CONFIG_ZRAM=y
# CONFIG_ZRAM_BACKEND_LZ4 is not set
# CONFIG_ZRAM_BACKEND_LZ4HC is not set
# CONFIG_ZRAM_BACKEND_ZSTD is not set
# CONFIG_ZRAM_BACKEND_DEFLATE is not set
# CONFIG_ZRAM_BACKEND_842 is not set
CONFIG_ZRAM_BACKEND_FORCE_LZO=y
CONFIG_ZRAM_BACKEND_LZO=y
# CONFIG_ZRAM_DEF_COMP_LZORLE is not set
CONFIG_ZRAM_DEF_COMP_LZO=y
CONFIG_ZRAM_DEF_COMP="lzo"
# CONFIG_ZRAM_WRITEBACK is not set
# CONFIG_ZRAM_TRACK_ENTRY_ACTIME is not set
# CONFIG_ZRAM_MEMORY_TRACKING is not set
# CONFIG_ZRAM_MULTI_COMP is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
# CONFIG_BLK_DEV_DRBD is not set
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
# CONFIG_CDROM_PKTCDVD is not set
CONFIG_ATA_OVER_ETH=y
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_RBD is not set
# CONFIG_BLK_DEV_UBLK is not set
CONFIG_BLK_DEV_RNBD=y
CONFIG_BLK_DEV_RNBD_CLIENT=y
# CONFIG_BLK_DEV_ZONED_LOOP is not set

#
# NVME Support
#
CONFIG_NVME_CORE=y
CONFIG_BLK_DEV_NVME=y
CONFIG_NVME_MULTIPATH=y
# CONFIG_NVME_VERBOSE_ERRORS is not set
# CONFIG_NVME_HWMON is not set
CONFIG_NVME_FABRICS=y
CONFIG_NVME_RDMA=y
CONFIG_NVME_FC=y
CONFIG_NVME_TCP=y
# CONFIG_NVME_TCP_TLS is not set
# CONFIG_NVME_HOST_AUTH is not set
CONFIG_NVME_TARGET=y
# CONFIG_NVME_TARGET_DEBUGFS is not set
# CONFIG_NVME_TARGET_PASSTHRU is not set
CONFIG_NVME_TARGET_LOOP=y
CONFIG_NVME_TARGET_RDMA=y
CONFIG_NVME_TARGET_FC=y
CONFIG_NVME_TARGET_FCLOOP=y
CONFIG_NVME_TARGET_TCP=y
# CONFIG_NVME_TARGET_TCP_TLS is not set
# CONFIG_NVME_TARGET_AUTH is not set
# CONFIG_NVME_TARGET_PCI_EPF is not set
# end of NVME Support

#
# Misc devices
#
# CONFIG_AD525X_DPOT is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_IBM_ASM is not set
# CONFIG_PHANTOM is not set
# CONFIG_RPMB is not set
# CONFIG_TI_FPC202 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
# CONFIG_SENSORS_TSL2550 is not set
# CONFIG_SENSORS_BH1770 is not set
# CONFIG_SENSORS_APDS990X is not set
# CONFIG_HMC6352 is not set
# CONFIG_DS1682 is not set
# CONFIG_VMWARE_BALLOON is not set
# CONFIG_LATTICE_ECP3_CONFIG is not set
# CONFIG_SRAM is not set
# CONFIG_DW_XDATA_PCIE is not set
# CONFIG_PCI_ENDPOINT_TEST is not set
# CONFIG_XILINX_SDFEC is not set
CONFIG_MISC_RTSX=y
# CONFIG_HISI_HIKEY_USB is not set
# CONFIG_OPEN_DICE is not set
# CONFIG_NTSYNC is not set
# CONFIG_VCPU_STALL_DETECTOR is not set
# CONFIG_NSM is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_AT25 is not set
# CONFIG_EEPROM_MAX6875 is not set
CONFIG_EEPROM_93CX6=y
# CONFIG_EEPROM_93XX46 is not set
# CONFIG_EEPROM_IDT_89HPESX is not set
# CONFIG_EEPROM_EE1004 is not set
# end of EEPROM support

# CONFIG_CB710_CORE is not set
# CONFIG_SENSORS_LIS3_I2C is not set
# CONFIG_ALTERA_STAPL is not set
CONFIG_INTEL_MEI=y
CONFIG_INTEL_MEI_ME=y
# CONFIG_INTEL_MEI_TXE is not set
# CONFIG_INTEL_MEI_GSC is not set
# CONFIG_INTEL_MEI_VSC_HW is not set
# CONFIG_INTEL_MEI_HDCP is not set
# CONFIG_INTEL_MEI_PXP is not set
# CONFIG_INTEL_MEI_GSC_PROXY is not set
CONFIG_VMWARE_VMCI=y
# CONFIG_GENWQE is not set
# CONFIG_BCM_VK is not set
# CONFIG_MISC_ALCOR_PCI is not set
# CONFIG_MISC_RTSX_PCI is not set
CONFIG_MISC_RTSX_USB=y
# CONFIG_UACCE is not set
# CONFIG_PVPANIC is not set
# CONFIG_GP_PCI1XXXX is not set
# CONFIG_KEBA_CP500 is not set
# CONFIG_AMD_SBRMI_I2C is not set
# end of Misc devices

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
CONFIG_RAID_ATTRS=y
CONFIG_SCSI_COMMON=y
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_SCSI_NETLINK=y
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
CONFIG_BLK_DEV_BSG=y
# CONFIG_CHR_DEV_SCH is not set
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_FC_ATTRS=y
CONFIG_SCSI_ISCSI_ATTRS=y
CONFIG_SCSI_SAS_ATTRS=y
CONFIG_SCSI_SAS_LIBSAS=y
CONFIG_SCSI_SAS_ATA=y
# CONFIG_SCSI_SAS_HOST_SMP is not set
CONFIG_SCSI_SRP_ATTRS=y
# end of SCSI Transports

CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_ISCSI_BOOT_SYSFS is not set
# CONFIG_SCSI_CXGB3_ISCSI is not set
# CONFIG_SCSI_CXGB4_ISCSI is not set
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_BE2ISCSI is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
CONFIG_SCSI_HPSA=y
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_3W_SAS is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_MVUMI is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_SCSI_ESAS2R is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT3SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_MPI3MR is not set
# CONFIG_SCSI_SMARTPQI is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_MYRB is not set
# CONFIG_SCSI_MYRS is not set
# CONFIG_VMWARE_PVSCSI is not set
# CONFIG_LIBFC is not set
# CONFIG_SCSI_SNIC is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_FDOMAIN_PCI is not set
# CONFIG_SCSI_ISCI is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_FC is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_EFCT is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_WD719X is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
# CONFIG_SCSI_BFA_FC is not set
CONFIG_SCSI_VIRTIO=y
# CONFIG_SCSI_CHELSIO_FCOE is not set
# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
# CONFIG_SCSI_DH is not set
# end of SCSI device support

CONFIG_ATA=y
CONFIG_SATA_HOST=y
CONFIG_PATA_TIMINGS=y
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_FORCE=y
CONFIG_ATA_ACPI=y
# CONFIG_SATA_ZPODD is not set
CONFIG_SATA_PMP=y

#
# Controllers with non-SFF native interface
#
CONFIG_SATA_AHCI=y
CONFIG_SATA_MOBILE_LPM_POLICY=3
# CONFIG_SATA_AHCI_PLATFORM is not set
# CONFIG_AHCI_DWC is not set
# CONFIG_AHCI_CEVA is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_SATA_ACARD_AHCI is not set
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y

#
# SFF controllers with custom DMA interface
#
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_SX4 is not set
CONFIG_ATA_BMDMA=y

#
# SATA SFF controllers with BMDMA
#
CONFIG_ATA_PIIX=y
# CONFIG_SATA_DWC is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set

#
# PATA SFF controllers with BMDMA
#
# CONFIG_PATA_ALI is not set
CONFIG_PATA_AMD=y
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87415 is not set
CONFIG_PATA_OLDPIIX=y
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
CONFIG_PATA_SCH=y
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set

#
# PIO-only SFF controllers
#
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_PCMCIA is not set
# CONFIG_PATA_OF_PLATFORM is not set
# CONFIG_PATA_RZ1000 is not set

#
# Generic fallback / legacy drivers
#
# CONFIG_PATA_ACPI is not set
CONFIG_ATA_GENERIC=y
# CONFIG_PATA_LEGACY is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_AUTODETECT=y
CONFIG_MD_BITMAP_FILE=y
# CONFIG_MD_LINEAR is not set
CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y
CONFIG_MD_RAID10=y
CONFIG_MD_RAID456=y
# CONFIG_MD_CLUSTER is not set
CONFIG_BCACHE=y
# CONFIG_BCACHE_DEBUG is not set
# CONFIG_BCACHE_ASYNC_REGISTRATION is not set
CONFIG_BLK_DEV_DM_BUILTIN=y
CONFIG_BLK_DEV_DM=y
# CONFIG_DM_DEBUG is not set
CONFIG_DM_BUFIO=y
# CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set
CONFIG_DM_BIO_PRISON=y
CONFIG_DM_PERSISTENT_DATA=y
# CONFIG_DM_UNSTRIPED is not set
CONFIG_DM_CRYPT=y
CONFIG_DM_SNAPSHOT=y
CONFIG_DM_THIN_PROVISIONING=y
CONFIG_DM_CACHE=y
CONFIG_DM_CACHE_SMQ=y
CONFIG_DM_WRITECACHE=y
# CONFIG_DM_EBS is not set
# CONFIG_DM_ERA is not set
CONFIG_DM_CLONE=y
CONFIG_DM_MIRROR=y
# CONFIG_DM_LOG_USERSPACE is not set
CONFIG_DM_RAID=y
CONFIG_DM_ZERO=y
CONFIG_DM_MULTIPATH=y
CONFIG_DM_MULTIPATH_QL=y
CONFIG_DM_MULTIPATH_ST=y
# CONFIG_DM_MULTIPATH_HST is not set
# CONFIG_DM_MULTIPATH_IOA is not set
# CONFIG_DM_DELAY is not set
# CONFIG_DM_DUST is not set
# CONFIG_DM_INIT is not set
CONFIG_DM_UEVENT=y
CONFIG_DM_FLAKEY=y
CONFIG_DM_VERITY=y
# CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG is not set
CONFIG_DM_VERITY_FEC=y
# CONFIG_DM_SWITCH is not set
# CONFIG_DM_LOG_WRITES is not set
CONFIG_DM_INTEGRITY=y
CONFIG_DM_ZONED=y
CONFIG_DM_AUDIT=y
# CONFIG_DM_VDO is not set
CONFIG_TARGET_CORE=y
# CONFIG_TCM_IBLOCK is not set
# CONFIG_TCM_FILEIO is not set
# CONFIG_TCM_PSCSI is not set
# CONFIG_LOOPBACK_TARGET is not set
# CONFIG_ISCSI_TARGET is not set
# CONFIG_SBP_TARGET is not set
# CONFIG_REMOTE_TARGET is not set
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#
CONFIG_FIREWIRE=y
CONFIG_FIREWIRE_OHCI=y
CONFIG_FIREWIRE_SBP2=y
CONFIG_FIREWIRE_NET=y
# CONFIG_FIREWIRE_NOSY is not set
# end of IEEE 1394 (FireWire) support

# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
CONFIG_MII=y
CONFIG_NET_CORE=y
CONFIG_BONDING=y
CONFIG_DUMMY=y
CONFIG_WIREGUARD=y
# CONFIG_WIREGUARD_DEBUG is not set
# CONFIG_OVPN is not set
CONFIG_EQUALIZER=y
CONFIG_NET_FC=y
CONFIG_IFB=y
CONFIG_NET_TEAM=y
CONFIG_NET_TEAM_MODE_BROADCAST=y
CONFIG_NET_TEAM_MODE_ROUNDROBIN=y
CONFIG_NET_TEAM_MODE_RANDOM=y
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y
CONFIG_NET_TEAM_MODE_LOADBALANCE=y
CONFIG_MACVLAN=y
CONFIG_MACVTAP=y
CONFIG_IPVLAN_L3S=y
CONFIG_IPVLAN=y
CONFIG_IPVTAP=y
CONFIG_VXLAN=y
CONFIG_GENEVE=y
CONFIG_BAREUDP=y
CONFIG_GTP=y
# CONFIG_PFCP is not set
# CONFIG_AMT is not set
CONFIG_MACSEC=y
CONFIG_NETCONSOLE=y
# CONFIG_NETCONSOLE_DYNAMIC is not set
# CONFIG_NETCONSOLE_EXTENDED_LOG is not set
CONFIG_NETPOLL=y
CONFIG_NET_POLL_CONTROLLER=y
CONFIG_TUN=y
CONFIG_TAP=y
CONFIG_TUN_VNET_CROSS_LE=y
CONFIG_VETH=y
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
# CONFIG_NETKIT is not set
CONFIG_NET_VRF=y
CONFIG_VSOCKMON=y
# CONFIG_MHI_NET is not set
# CONFIG_ARCNET is not set
CONFIG_ATM_DRIVERS=y
# CONFIG_ATM_DUMMY is not set
CONFIG_ATM_TCP=y
# CONFIG_ATM_LANAI is not set
# CONFIG_ATM_ENI is not set
# CONFIG_ATM_NICSTAR is not set
# CONFIG_ATM_IDT77252 is not set
# CONFIG_ATM_IA is not set
# CONFIG_ATM_FORE200E is not set
# CONFIG_ATM_HE is not set
# CONFIG_ATM_SOLOS is not set
CONFIG_CAIF_DRIVERS=y
CONFIG_CAIF_TTY=y
CONFIG_CAIF_VIRTIO=y

#
# Distributed Switch Architecture drivers
#
# CONFIG_B53 is not set
# CONFIG_NET_DSA_BCM_SF2 is not set
# CONFIG_NET_DSA_LOOP is not set
# CONFIG_NET_DSA_HIRSCHMANN_HELLCREEK is not set
# CONFIG_NET_DSA_LANTIQ_GSWIP is not set
# CONFIG_NET_DSA_MT7530 is not set
# CONFIG_NET_DSA_MV88E6060 is not set
# CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON is not set
# CONFIG_NET_DSA_MV88E6XXX is not set
# CONFIG_NET_DSA_AR9331 is not set
# CONFIG_NET_DSA_QCA8K is not set
# CONFIG_NET_DSA_SJA1105 is not set
# CONFIG_NET_DSA_XRS700X_I2C is not set
# CONFIG_NET_DSA_XRS700X_MDIO is not set
# CONFIG_NET_DSA_REALTEK is not set
# CONFIG_NET_DSA_SMSC_LAN9303_I2C is not set
# CONFIG_NET_DSA_SMSC_LAN9303_MDIO is not set
# CONFIG_NET_DSA_VITESSE_VSC73XX_SPI is not set
# CONFIG_NET_DSA_VITESSE_VSC73XX_PLATFORM is not set
# end of Distributed Switch Architecture drivers

CONFIG_ETHERNET=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
# CONFIG_NET_VENDOR_AGERE is not set
# CONFIG_NET_VENDOR_ALACRITECH is not set
CONFIG_NET_VENDOR_ALTEON=y
# CONFIG_ACENIC is not set
# CONFIG_ALTERA_TSE is not set
CONFIG_NET_VENDOR_AMAZON=y
# CONFIG_ENA_ETHERNET is not set
# CONFIG_NET_VENDOR_AMD is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
CONFIG_NET_VENDOR_ASIX=y
# CONFIG_SPI_AX88796C is not set
# CONFIG_NET_VENDOR_ATHEROS is not set
# CONFIG_CX_ECAT is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CADENCE is not set
# CONFIG_NET_VENDOR_CAVIUM is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
CONFIG_NET_VENDOR_CISCO=y
# CONFIG_ENIC is not set
# CONFIG_NET_VENDOR_CORTINA is not set
CONFIG_NET_VENDOR_DAVICOM=y
# CONFIG_DM9051 is not set
# CONFIG_DNET is not set
# CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set
CONFIG_NET_VENDOR_ENGLEDER=y
# CONFIG_TSNEP is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_FUJITSU is not set
CONFIG_NET_VENDOR_FUNGIBLE=y
# CONFIG_FUN_ETH is not set
CONFIG_NET_VENDOR_GOOGLE=y
CONFIG_GVE=y
CONFIG_NET_VENDOR_HISILICON=y
# CONFIG_HIBMCGE is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
CONFIG_NET_VENDOR_I825XX=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E100=y
CONFIG_E1000=y
CONFIG_E1000E=y
CONFIG_E1000E_HWTS=y
# CONFIG_IGB is not set
# CONFIG_IGBVF is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set
# CONFIG_I40E is not set
# CONFIG_I40EVF is not set
# CONFIG_ICE is not set
# CONFIG_FM10K is not set
# CONFIG_IGC is not set
# CONFIG_IDPF is not set
# CONFIG_JME is not set
# CONFIG_NET_VENDOR_ADI is not set
CONFIG_NET_VENDOR_LITEX=y
# CONFIG_LITEX_LITEETH is not set
# CONFIG_NET_VENDOR_MARVELL is not set
CONFIG_NET_VENDOR_MELLANOX=y
# CONFIG_MLX4_EN is not set
CONFIG_MLX4_CORE=y
# CONFIG_MLX4_DEBUG is not set
# CONFIG_MLX4_CORE_GEN2 is not set
# CONFIG_MLX5_CORE is not set
# CONFIG_MLXSW_CORE is not set
# CONFIG_MLXFW is not set
CONFIG_NET_VENDOR_META=y
# CONFIG_FBNIC is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_MICROSEMI is not set
CONFIG_NET_VENDOR_MICROSOFT=y
# CONFIG_NET_VENDOR_MYRI is not set
# CONFIG_FEALNX is not set
# CONFIG_NET_VENDOR_NI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETERION is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NVIDIA is not set
# CONFIG_NET_VENDOR_OKI is not set
# CONFIG_ETHOC is not set
# CONFIG_NET_VENDOR_PACKET_ENGINES is not set
# CONFIG_NET_VENDOR_PENSANDO is not set
# CONFIG_NET_VENDOR_QLOGIC is not set
# CONFIG_NET_VENDOR_BROCADE is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RDC is not set
# CONFIG_NET_VENDOR_REALTEK is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SILAN is not set
# CONFIG_NET_VENDOR_SIS is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOCIONEXT is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SUN is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_TEHUTI is not set
# CONFIG_NET_VENDOR_TI is not set
CONFIG_NET_VENDOR_VERTEXCOM=y
# CONFIG_MSE102X is not set
# CONFIG_NET_VENDOR_VIA is not set
CONFIG_NET_VENDOR_WANGXUN=y
# CONFIG_NGBE is not set
# CONFIG_TXGBE is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
# CONFIG_NET_VENDOR_XIRCOM is not set
CONFIG_FDDI=y
# CONFIG_DEFXX is not set
# CONFIG_SKFP is not set
# CONFIG_HIPPI is not set
CONFIG_PHYLINK=y
CONFIG_PHYLIB=y
CONFIG_SWPHY=y
# CONFIG_LED_TRIGGER_PHY is not set
CONFIG_PHYLIB_LEDS=y
CONFIG_FIXED_PHY=y
# CONFIG_SFP is not set

#
# MII PHY device drivers
#
# CONFIG_AS21XXX_PHY is not set
# CONFIG_AIR_EN8811H_PHY is not set
# CONFIG_AMD_PHY is not set
# CONFIG_ADIN_PHY is not set
# CONFIG_ADIN1100_PHY is not set
# CONFIG_AQUANTIA_PHY is not set
CONFIG_AX88796B_PHY=y
# CONFIG_BROADCOM_PHY is not set
# CONFIG_BCM54140_PHY is not set
# CONFIG_BCM7XXX_PHY is not set
# CONFIG_BCM84881_PHY is not set
# CONFIG_BCM87XX_PHY is not set
# CONFIG_CICADA_PHY is not set
# CONFIG_CORTINA_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_ICPLUS_PHY is not set
# CONFIG_LXT_PHY is not set
# CONFIG_INTEL_XWAY_PHY is not set
# CONFIG_LSI_ET1011C_PHY is not set
# CONFIG_MARVELL_PHY is not set
# CONFIG_MARVELL_10G_PHY is not set
# CONFIG_MARVELL_88Q2XXX_PHY is not set
# CONFIG_MARVELL_88X2222_PHY is not set
# CONFIG_MAXLINEAR_GPHY is not set
# CONFIG_MAXLINEAR_86110_PHY is not set
# CONFIG_MEDIATEK_GE_PHY is not set
# CONFIG_MICREL_PHY is not set
# CONFIG_MICROCHIP_T1S_PHY is not set
CONFIG_MICROCHIP_PHY=y
# CONFIG_MICROCHIP_T1_PHY is not set
# CONFIG_MICROSEMI_PHY is not set
# CONFIG_MOTORCOMM_PHY is not set
# CONFIG_NATIONAL_PHY is not set
# CONFIG_NXP_CBTX_PHY is not set
# CONFIG_NXP_C45_TJA11XX_PHY is not set
# CONFIG_NXP_TJA11XX_PHY is not set
# CONFIG_NCN26000_PHY is not set
# CONFIG_AT803X_PHY is not set
# CONFIG_QCA83XX_PHY is not set
# CONFIG_QCA808X_PHY is not set
# CONFIG_QCA807X_PHY is not set
# CONFIG_QSEMI_PHY is not set
CONFIG_REALTEK_PHY=y
# CONFIG_REALTEK_PHY_HWMON is not set
# CONFIG_RENESAS_PHY is not set
# CONFIG_ROCKCHIP_PHY is not set
CONFIG_SMSC_PHY=y
# CONFIG_STE10XP is not set
# CONFIG_TERANETICS_PHY is not set
# CONFIG_DP83822_PHY is not set
# CONFIG_DP83TC811_PHY is not set
# CONFIG_DP83848_PHY is not set
# CONFIG_DP83867_PHY is not set
# CONFIG_DP83869_PHY is not set
# CONFIG_DP83TD510_PHY is not set
# CONFIG_DP83TG720_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_XILINX_GMII2RGMII is not set
# CONFIG_MICREL_KS8995MA is not set
# CONFIG_PSE_CONTROLLER is not set
CONFIG_CAN_DEV=y
CONFIG_CAN_VCAN=y
CONFIG_CAN_VXCAN=y
CONFIG_CAN_NETLINK=y
CONFIG_CAN_CALC_BITTIMING=y
CONFIG_CAN_RX_OFFLOAD=y
# CONFIG_CAN_CAN327 is not set
# CONFIG_CAN_FLEXCAN is not set
# CONFIG_CAN_GRCAN is not set
# CONFIG_CAN_KVASER_PCIEFD is not set
CONFIG_CAN_SLCAN=y
# CONFIG_CAN_C_CAN is not set
# CONFIG_CAN_CC770 is not set
# CONFIG_CAN_CTUCANFD_PCI is not set
# CONFIG_CAN_CTUCANFD_PLATFORM is not set
# CONFIG_CAN_ESD_402_PCI is not set
CONFIG_CAN_IFI_CANFD=y
# CONFIG_CAN_M_CAN is not set
# CONFIG_CAN_PEAK_PCIEFD is not set
# CONFIG_CAN_SJA1000 is not set
# CONFIG_CAN_SOFTING is not set

#
# CAN SPI interfaces
#
# CONFIG_CAN_HI311X is not set
# CONFIG_CAN_MCP251X is not set
# CONFIG_CAN_MCP251XFD is not set
# end of CAN SPI interfaces

#
# CAN USB interfaces
#
CONFIG_CAN_8DEV_USB=y
CONFIG_CAN_EMS_USB=y
CONFIG_CAN_ESD_USB=y
CONFIG_CAN_ETAS_ES58X=y
CONFIG_CAN_F81604=y
CONFIG_CAN_GS_USB=y
CONFIG_CAN_KVASER_USB=y
CONFIG_CAN_MCBA_USB=y
CONFIG_CAN_PEAK_USB=y
CONFIG_CAN_UCAN=y
# end of CAN USB interfaces

# CONFIG_CAN_DEBUG_DEVICES is not set

#
# MCTP Device Drivers
#
# CONFIG_MCTP_SERIAL is not set
# CONFIG_MCTP_TRANSPORT_I2C is not set
# CONFIG_MCTP_TRANSPORT_USB is not set
# end of MCTP Device Drivers

CONFIG_MDIO_BUS=y
CONFIG_FWNODE_MDIO=y
CONFIG_OF_MDIO=y
CONFIG_ACPI_MDIO=y
# CONFIG_MDIO_BITBANG is not set
# CONFIG_MDIO_BCM_UNIMAC is not set
# CONFIG_MDIO_HISI_FEMAC is not set
CONFIG_MDIO_MVUSB=y
# CONFIG_MDIO_MSCC_MIIM is not set
# CONFIG_MDIO_OCTEON is not set
# CONFIG_MDIO_IPQ4019 is not set
# CONFIG_MDIO_IPQ8064 is not set
# CONFIG_MDIO_THUNDER is not set

#
# MDIO Multiplexers
#
# CONFIG_MDIO_BUS_MUX_GPIO is not set
# CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set
# CONFIG_MDIO_BUS_MUX_MMIOREG is not set

#
# PCS device drivers
#
# CONFIG_PCS_XPCS is not set
# end of PCS device drivers

# CONFIG_PLIP is not set
CONFIG_PPP=y
CONFIG_PPP_BSDCOMP=y
CONFIG_PPP_DEFLATE=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_MPPE=y
CONFIG_PPP_MULTILINK=y
CONFIG_PPPOATM=y
CONFIG_PPPOE=y
CONFIG_PPPOE_HASH_BITS_1=y
# CONFIG_PPPOE_HASH_BITS_2 is not set
# CONFIG_PPPOE_HASH_BITS_4 is not set
# CONFIG_PPPOE_HASH_BITS_8 is not set
CONFIG_PPPOE_HASH_BITS=1
CONFIG_PPTP=y
CONFIG_PPPOL2TP=y
CONFIG_PPP_ASYNC=y
CONFIG_PPP_SYNC_TTY=y
CONFIG_SLIP=y
CONFIG_SLHC=y
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLIP_SMART=y
CONFIG_SLIP_MODE_SLIP6=y
CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_CATC=y
CONFIG_USB_KAWETH=y
CONFIG_USB_PEGASUS=y
CONFIG_USB_RTL8150=y
CONFIG_USB_RTL8152=y
CONFIG_USB_LAN78XX=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_AX88179_178A=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_CDC_EEM=y
CONFIG_USB_NET_CDC_NCM=y
CONFIG_USB_NET_HUAWEI_CDC_NCM=y
CONFIG_USB_NET_CDC_MBIM=y
CONFIG_USB_NET_DM9601=y
CONFIG_USB_NET_SR9700=y
CONFIG_USB_NET_SR9800=y
CONFIG_USB_NET_SMSC75XX=y
CONFIG_USB_NET_SMSC95XX=y
CONFIG_USB_NET_GL620A=y
CONFIG_USB_NET_NET1080=y
CONFIG_USB_NET_PLUSB=y
CONFIG_USB_NET_MCS7830=y
CONFIG_USB_NET_RNDIS_HOST=y
CONFIG_USB_NET_CDC_SUBSET_ENABLE=y
CONFIG_USB_NET_CDC_SUBSET=y
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_ZAURUS=y
CONFIG_USB_NET_CX82310_ETH=y
CONFIG_USB_NET_KALMIA=y
CONFIG_USB_NET_QMI_WWAN=y
CONFIG_USB_HSO=y
CONFIG_USB_NET_INT51X1=y
CONFIG_USB_CDC_PHONET=y
CONFIG_USB_IPHETH=y
CONFIG_USB_SIERRA_NET=y
CONFIG_USB_VL600=y
CONFIG_USB_NET_CH9200=y
CONFIG_USB_NET_AQC111=y
CONFIG_USB_RTL8153_ECM=y
CONFIG_WLAN=y
CONFIG_WLAN_VENDOR_ADMTEK=y
# CONFIG_ADM8211 is not set
CONFIG_ATH_COMMON=y
CONFIG_WLAN_VENDOR_ATH=y
# CONFIG_ATH_DEBUG is not set
# CONFIG_ATH5K is not set
# CONFIG_ATH5K_PCI is not set
CONFIG_ATH9K_HW=y
CONFIG_ATH9K_COMMON=y
CONFIG_ATH9K_COMMON_DEBUG=y
CONFIG_ATH9K_BTCOEX_SUPPORT=y
CONFIG_ATH9K=y
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
CONFIG_ATH9K_DEBUGFS=y
# CONFIG_ATH9K_STATION_STATISTICS is not set
CONFIG_ATH9K_DYNACK=y
# CONFIG_ATH9K_WOW is not set
CONFIG_ATH9K_RFKILL=y
CONFIG_ATH9K_CHANNEL_CONTEXT=y
CONFIG_ATH9K_PCOEM=y
# CONFIG_ATH9K_PCI_NO_EEPROM is not set
CONFIG_ATH9K_HTC=y
CONFIG_ATH9K_HTC_DEBUGFS=y
# CONFIG_ATH9K_HWRNG is not set
CONFIG_ATH9K_COMMON_SPECTRAL=y
CONFIG_CARL9170=y
CONFIG_CARL9170_LEDS=y
# CONFIG_CARL9170_DEBUGFS is not set
CONFIG_CARL9170_WPC=y
CONFIG_CARL9170_HWRNG=y
CONFIG_ATH6KL=y
# CONFIG_ATH6KL_SDIO is not set
CONFIG_ATH6KL_USB=y
# CONFIG_ATH6KL_DEBUG is not set
# CONFIG_ATH6KL_TRACING is not set
CONFIG_AR5523=y
# CONFIG_WIL6210 is not set
CONFIG_ATH10K=y
CONFIG_ATH10K_CE=y
CONFIG_ATH10K_PCI=y
# CONFIG_ATH10K_AHB is not set
# CONFIG_ATH10K_SDIO is not set
CONFIG_ATH10K_USB=y
# CONFIG_ATH10K_DEBUG is not set
# CONFIG_ATH10K_DEBUGFS is not set
CONFIG_ATH10K_LEDS=y
# CONFIG_ATH10K_TRACING is not set
# CONFIG_WCN36XX is not set
CONFIG_ATH11K=y
# CONFIG_ATH11K_PCI is not set
# CONFIG_ATH11K_DEBUG is not set
# CONFIG_ATH11K_DEBUGFS is not set
# CONFIG_ATH11K_TRACING is not set
# CONFIG_ATH12K is not set
# CONFIG_WLAN_VENDOR_ATMEL is not set
# CONFIG_WLAN_VENDOR_BROADCOM is not set
# CONFIG_WLAN_VENDOR_INTEL is not set
# CONFIG_WLAN_VENDOR_INTERSIL is not set
# CONFIG_WLAN_VENDOR_MARVELL is not set
# CONFIG_WLAN_VENDOR_MEDIATEK is not set
# CONFIG_WLAN_VENDOR_MICROCHIP is not set
CONFIG_WLAN_VENDOR_PURELIFI=y
CONFIG_PLFXLC=y
# CONFIG_WLAN_VENDOR_RALINK is not set
# CONFIG_WLAN_VENDOR_REALTEK is not set
# CONFIG_WLAN_VENDOR_RSI is not set
CONFIG_WLAN_VENDOR_SILABS=y
# CONFIG_WFX is not set
# CONFIG_WLAN_VENDOR_ST is not set
# CONFIG_WLAN_VENDOR_TI is not set
# CONFIG_WLAN_VENDOR_ZYDAS is not set
# CONFIG_WLAN_VENDOR_QUANTENNA is not set
CONFIG_MAC80211_HWSIM=y
CONFIG_VIRT_WIFI=y
CONFIG_WAN=y
CONFIG_HDLC=y
CONFIG_HDLC_RAW=y
CONFIG_HDLC_RAW_ETH=y
CONFIG_HDLC_CISCO=y
CONFIG_HDLC_FR=y
CONFIG_HDLC_PPP=y
CONFIG_HDLC_X25=y
# CONFIG_FRAMER is not set
# CONFIG_PCI200SYN is not set
# CONFIG_WANXL is not set
# CONFIG_PC300TOO is not set
# CONFIG_FARSYNC is not set
CONFIG_LAPBETHER=y
CONFIG_IEEE802154_DRIVERS=y
# CONFIG_IEEE802154_FAKELB is not set
# CONFIG_IEEE802154_AT86RF230 is not set
# CONFIG_IEEE802154_MRF24J40 is not set
# CONFIG_IEEE802154_CC2520 is not set
CONFIG_IEEE802154_ATUSB=y
# CONFIG_IEEE802154_ADF7242 is not set
# CONFIG_IEEE802154_CA8210 is not set
# CONFIG_IEEE802154_MCR20A is not set
CONFIG_IEEE802154_HWSIM=y

#
# Wireless WAN
#
CONFIG_WWAN=y
# CONFIG_WWAN_DEBUGFS is not set
# CONFIG_WWAN_HWSIM is not set
CONFIG_MHI_WWAN_CTRL=y
# CONFIG_MHI_WWAN_MBIM is not set
# CONFIG_IOSM is not set
# CONFIG_MTK_T7XX is not set
# end of Wireless WAN

CONFIG_VMXNET3=y
# CONFIG_FUJITSU_ES is not set
CONFIG_USB4_NET=y
CONFIG_NETDEVSIM=y
CONFIG_NET_FAILOVER=y
CONFIG_ISDN=y
CONFIG_ISDN_CAPI=y
CONFIG_MISDN=y
CONFIG_MISDN_DSP=y
CONFIG_MISDN_L1OIP=y

#
# mISDN hardware drivers
#
# CONFIG_MISDN_HFCPCI is not set
# CONFIG_MISDN_HFCMULTI is not set
CONFIG_MISDN_HFCUSB=y
# CONFIG_MISDN_AVMFRITZ is not set
# CONFIG_MISDN_SPEEDFAX is not set
# CONFIG_MISDN_INFINEON is not set
# CONFIG_MISDN_W6692 is not set
# CONFIG_MISDN_NETJET is not set

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_LEDS=y
CONFIG_INPUT_FF_MEMLESS=y
CONFIG_INPUT_SPARSEKMAP=y
# CONFIG_INPUT_MATRIXKMAP is not set
CONFIG_INPUT_VIVALDIFMAP=y

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_JOYDEV=y
CONFIG_INPUT_EVDEV=y

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADC is not set
# CONFIG_KEYBOARD_ADP5588 is not set
# CONFIG_KEYBOARD_ADP5589 is not set
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_QT1050 is not set
# CONFIG_KEYBOARD_QT1070 is not set
# CONFIG_KEYBOARD_QT2160 is not set
# CONFIG_KEYBOARD_DLINK_DIR685 is not set
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_KEYBOARD_GPIO_POLLED is not set
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_LM8333 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_MPR121 is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_OPENCORES is not set
# CONFIG_KEYBOARD_PINEPHONE is not set
# CONFIG_KEYBOARD_SAMSUNG is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_OMAP4 is not set
# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set
# CONFIG_KEYBOARD_TWL4030 is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_CAP11XX is not set
# CONFIG_KEYBOARD_BCM is not set
# CONFIG_KEYBOARD_CYPRESS_SF is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=y
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_BYD=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y
CONFIG_MOUSE_PS2_CYPRESS=y
CONFIG_MOUSE_PS2_LIFEBOOK=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
# CONFIG_MOUSE_PS2_ELANTECH is not set
# CONFIG_MOUSE_PS2_SENTELIC is not set
# CONFIG_MOUSE_PS2_TOUCHKIT is not set
CONFIG_MOUSE_PS2_FOCALTECH=y
# CONFIG_MOUSE_PS2_VMMOUSE is not set
CONFIG_MOUSE_PS2_SMBUS=y
# CONFIG_MOUSE_SERIAL is not set
CONFIG_MOUSE_APPLETOUCH=y
CONFIG_MOUSE_BCM5974=y
# CONFIG_MOUSE_CYAPA is not set
# CONFIG_MOUSE_ELAN_I2C is not set
# CONFIG_MOUSE_VSXXXAA is not set
# CONFIG_MOUSE_GPIO is not set
# CONFIG_MOUSE_SYNAPTICS_I2C is not set
CONFIG_MOUSE_SYNAPTICS_USB=y
CONFIG_INPUT_JOYSTICK=y
# CONFIG_JOYSTICK_ANALOG is not set
# CONFIG_JOYSTICK_A3D is not set
# CONFIG_JOYSTICK_ADC is not set
# CONFIG_JOYSTICK_ADI is not set
# CONFIG_JOYSTICK_COBRA is not set
# CONFIG_JOYSTICK_GF2K is not set
# CONFIG_JOYSTICK_GRIP is not set
# CONFIG_JOYSTICK_GRIP_MP is not set
# CONFIG_JOYSTICK_GUILLEMOT is not set
# CONFIG_JOYSTICK_INTERACT is not set
# CONFIG_JOYSTICK_SIDEWINDER is not set
# CONFIG_JOYSTICK_TMDC is not set
CONFIG_JOYSTICK_IFORCE=y
CONFIG_JOYSTICK_IFORCE_USB=y
# CONFIG_JOYSTICK_IFORCE_232 is not set
# CONFIG_JOYSTICK_WARRIOR is not set
# CONFIG_JOYSTICK_MAGELLAN is not set
# CONFIG_JOYSTICK_SPACEORB is not set
# CONFIG_JOYSTICK_SPACEBALL is not set
# CONFIG_JOYSTICK_STINGER is not set
# CONFIG_JOYSTICK_TWIDJOY is not set
# CONFIG_JOYSTICK_ZHENHUA is not set
# CONFIG_JOYSTICK_DB9 is not set
# CONFIG_JOYSTICK_GAMECON is not set
# CONFIG_JOYSTICK_TURBOGRAFX is not set
# CONFIG_JOYSTICK_AS5011 is not set
# CONFIG_JOYSTICK_JOYDUMP is not set
CONFIG_JOYSTICK_XPAD=y
CONFIG_JOYSTICK_XPAD_FF=y
CONFIG_JOYSTICK_XPAD_LEDS=y
# CONFIG_JOYSTICK_WALKERA0701 is not set
# CONFIG_JOYSTICK_PSXPAD_SPI is not set
CONFIG_JOYSTICK_PXRC=y
# CONFIG_JOYSTICK_QWIIC is not set
# CONFIG_JOYSTICK_FSIA6B is not set
# CONFIG_JOYSTICK_SENSEHAT is not set
# CONFIG_JOYSTICK_SEESAW is not set
CONFIG_INPUT_TABLET=y
CONFIG_TABLET_USB_ACECAD=y
CONFIG_TABLET_USB_AIPTEK=y
CONFIG_TABLET_USB_HANWANG=y
CONFIG_TABLET_USB_KBTAB=y
CONFIG_TABLET_USB_PEGASUS=y
# CONFIG_TABLET_SERIAL_WACOM4 is not set
CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_ADS7846 is not set
# CONFIG_TOUCHSCREEN_AD7877 is not set
# CONFIG_TOUCHSCREEN_AD7879 is not set
# CONFIG_TOUCHSCREEN_ADC is not set
# CONFIG_TOUCHSCREEN_AR1021_I2C is not set
# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
# CONFIG_TOUCHSCREEN_BU21013 is not set
# CONFIG_TOUCHSCREEN_BU21029 is not set
# CONFIG_TOUCHSCREEN_CHIPONE_ICN8318 is not set
# CONFIG_TOUCHSCREEN_CHIPONE_ICN8505 is not set
# CONFIG_TOUCHSCREEN_CY8CTMA140 is not set
# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set
# CONFIG_TOUCHSCREEN_CYTTSP5 is not set
# CONFIG_TOUCHSCREEN_DYNAPRO is not set
# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
# CONFIG_TOUCHSCREEN_EETI is not set
# CONFIG_TOUCHSCREEN_EGALAX is not set
# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set
# CONFIG_TOUCHSCREEN_EXC3000 is not set
# CONFIG_TOUCHSCREEN_FUJITSU is not set
# CONFIG_TOUCHSCREEN_GOODIX is not set
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_I2C is not set
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_SPI is not set
# CONFIG_TOUCHSCREEN_HIDEEP is not set
# CONFIG_TOUCHSCREEN_HYCON_HY46XX is not set
# CONFIG_TOUCHSCREEN_HYNITRON_CSTXXX is not set
# CONFIG_TOUCHSCREEN_ILI210X is not set
# CONFIG_TOUCHSCREEN_ILITEK is not set
# CONFIG_TOUCHSCREEN_S6SY761 is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
# CONFIG_TOUCHSCREEN_EKTF2127 is not set
# CONFIG_TOUCHSCREEN_ELAN is not set
# CONFIG_TOUCHSCREEN_ELO is not set
# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
# CONFIG_TOUCHSCREEN_WACOM_I2C is not set
# CONFIG_TOUCHSCREEN_MAX11801 is not set
# CONFIG_TOUCHSCREEN_MMS114 is not set
# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set
# CONFIG_TOUCHSCREEN_MSG2638 is not set
# CONFIG_TOUCHSCREEN_MTOUCH is not set
# CONFIG_TOUCHSCREEN_NOVATEK_NVT_TS is not set
# CONFIG_TOUCHSCREEN_IMAGIS is not set
# CONFIG_TOUCHSCREEN_IMX6UL_TSC is not set
# CONFIG_TOUCHSCREEN_INEXIO is not set
# CONFIG_TOUCHSCREEN_PENMOUNT is not set
# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
# CONFIG_TOUCHSCREEN_PIXCIR is not set
# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
CONFIG_TOUCHSCREEN_USB_EGALAX=y
CONFIG_TOUCHSCREEN_USB_PANJIT=y
CONFIG_TOUCHSCREEN_USB_3M=y
CONFIG_TOUCHSCREEN_USB_ITM=y
CONFIG_TOUCHSCREEN_USB_ETURBO=y
CONFIG_TOUCHSCREEN_USB_GUNZE=y
CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y
CONFIG_TOUCHSCREEN_USB_IRTOUCH=y
CONFIG_TOUCHSCREEN_USB_IDEALTEK=y
CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y
CONFIG_TOUCHSCREEN_USB_GOTOP=y
CONFIG_TOUCHSCREEN_USB_JASTEC=y
CONFIG_TOUCHSCREEN_USB_ELO=y
CONFIG_TOUCHSCREEN_USB_E2I=y
CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y
CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y
CONFIG_TOUCHSCREEN_USB_NEXIO=y
CONFIG_TOUCHSCREEN_USB_EASYTOUCH=y
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
# CONFIG_TOUCHSCREEN_TSC_SERIO is not set
# CONFIG_TOUCHSCREEN_TSC2004 is not set
# CONFIG_TOUCHSCREEN_TSC2005 is not set
# CONFIG_TOUCHSCREEN_TSC2007 is not set
# CONFIG_TOUCHSCREEN_RM_TS is not set
# CONFIG_TOUCHSCREEN_SILEAD is not set
# CONFIG_TOUCHSCREEN_SIS_I2C is not set
# CONFIG_TOUCHSCREEN_ST1232 is not set
# CONFIG_TOUCHSCREEN_STMFTS is not set
CONFIG_TOUCHSCREEN_SUR40=y
# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set
# CONFIG_TOUCHSCREEN_SX8654 is not set
# CONFIG_TOUCHSCREEN_TPS6507X is not set
# CONFIG_TOUCHSCREEN_ZET6223 is not set
# CONFIG_TOUCHSCREEN_ZFORCE is not set
# CONFIG_TOUCHSCREEN_COLIBRI_VF50 is not set
# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set
# CONFIG_TOUCHSCREEN_IQS5XX is not set
# CONFIG_TOUCHSCREEN_IQS7211 is not set
# CONFIG_TOUCHSCREEN_ZINITIX is not set
# CONFIG_TOUCHSCREEN_HIMAX_HX83112B is not set
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_AD714X is not set
# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
# CONFIG_INPUT_BMA150 is not set
# CONFIG_INPUT_E3X0_BUTTON is not set
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_MMA8450 is not set
# CONFIG_INPUT_APANEL is not set
# CONFIG_INPUT_GPIO_BEEPER is not set
# CONFIG_INPUT_GPIO_DECODER is not set
# CONFIG_INPUT_GPIO_VIBRA is not set
# CONFIG_INPUT_ATLAS_BTNS is not set
CONFIG_INPUT_ATI_REMOTE2=y
CONFIG_INPUT_KEYSPAN_REMOTE=y
# CONFIG_INPUT_KXTJ9 is not set
CONFIG_INPUT_POWERMATE=y
CONFIG_INPUT_YEALINK=y
CONFIG_INPUT_CM109=y
# CONFIG_INPUT_REGULATOR_HAPTIC is not set
# CONFIG_INPUT_RETU_PWRBUTTON is not set
# CONFIG_INPUT_TWL4030_PWRBUTTON is not set
# CONFIG_INPUT_TWL4030_VIBRA is not set
CONFIG_INPUT_UINPUT=y
# CONFIG_INPUT_PCF8574 is not set
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
# CONFIG_INPUT_DA7280_HAPTICS is not set
# CONFIG_INPUT_ADXL34X is not set
# CONFIG_INPUT_IBM_PANEL is not set
CONFIG_INPUT_IMS_PCU=y
# CONFIG_INPUT_IQS269A is not set
# CONFIG_INPUT_IQS626A is not set
# CONFIG_INPUT_IQS7222 is not set
# CONFIG_INPUT_CMA3000 is not set
# CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set
# CONFIG_INPUT_DRV260X_HAPTICS is not set
# CONFIG_INPUT_DRV2665_HAPTICS is not set
# CONFIG_INPUT_DRV2667_HAPTICS is not set
CONFIG_RMI4_CORE=y
# CONFIG_RMI4_I2C is not set
# CONFIG_RMI4_SPI is not set
# CONFIG_RMI4_SMB is not set
CONFIG_RMI4_F03=y
CONFIG_RMI4_F03_SERIO=y
CONFIG_RMI4_2D_SENSOR=y
CONFIG_RMI4_F11=y
CONFIG_RMI4_F12=y
CONFIG_RMI4_F30=y
# CONFIG_RMI4_F34 is not set
CONFIG_RMI4_F3A=y
# CONFIG_RMI4_F54 is not set
# CONFIG_RMI4_F55 is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=y
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
# CONFIG_SERIO_PCIPS2 is not set
CONFIG_SERIO_LIBPS2=y
# CONFIG_SERIO_RAW is not set
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set
# CONFIG_SERIO_ARC_PS2 is not set
# CONFIG_SERIO_APBPS2 is not set
# CONFIG_SERIO_GPIO_PS2 is not set
CONFIG_USERIO=y
# CONFIG_GAMEPORT is not set
# end of Hardware I/O ports
# end of Input device support

#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
CONFIG_LEGACY_TIOCSTI=y
CONFIG_LDISC_AUTOLOAD=y

#
# Serial drivers
#
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_PNP=y
# CONFIG_SERIAL_8250_16550A_VARIANTS is not set
# CONFIG_SERIAL_8250_FINTEK is not set
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCILIB=y
CONFIG_SERIAL_8250_PCI=y
# CONFIG_SERIAL_8250_EXAR is not set
# CONFIG_SERIAL_8250_CS is not set
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
# CONFIG_SERIAL_8250_PCI1XXXX is not set
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_8250_DWLIB=y
# CONFIG_SERIAL_8250_DW is not set
# CONFIG_SERIAL_8250_RT288X is not set
CONFIG_SERIAL_8250_LPSS=y
CONFIG_SERIAL_8250_MID=y
CONFIG_SERIAL_8250_PERICOM=y
# CONFIG_SERIAL_8250_NI is not set
# CONFIG_SERIAL_OF_PLATFORM is not set

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_MAX3100 is not set
# CONFIG_SERIAL_MAX310X is not set
# CONFIG_SERIAL_UARTLITE is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
# CONFIG_SERIAL_SIFIVE is not set
# CONFIG_SERIAL_LANTIQ is not set
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_SC16IS7XX is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
# CONFIG_SERIAL_FSL_LPUART is not set
# CONFIG_SERIAL_FSL_LINFLEXUART is not set
# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
# CONFIG_SERIAL_SPRD is not set
# end of Serial drivers

CONFIG_SERIAL_MCTRL_GPIO=y
CONFIG_SERIAL_NONSTANDARD=y
# CONFIG_MOXA_INTELLIO is not set
# CONFIG_MOXA_SMARTIO is not set
CONFIG_N_HDLC=y
# CONFIG_IPWIRELESS is not set
CONFIG_N_GSM=y
CONFIG_NOZOMI=y
CONFIG_NULL_TTY=y
CONFIG_HVC_DRIVER=y
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
CONFIG_TTY_PRINTK=y
CONFIG_TTY_PRINTK_LEVEL=6
# CONFIG_PRINTER is not set
# CONFIG_PPDEV is not set
CONFIG_VIRTIO_CONSOLE=y
# CONFIG_IPMI_HANDLER is not set
# CONFIG_SSIF_IPMI_BMC is not set
# CONFIG_IPMB_DEVICE_INTERFACE is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
# CONFIG_HW_RANDOM_BA431 is not set
# CONFIG_HW_RANDOM_VIA is not set
CONFIG_HW_RANDOM_VIRTIO=y
# CONFIG_HW_RANDOM_CCTRNG is not set
# CONFIG_HW_RANDOM_XIPHERA is not set
# CONFIG_APPLICOM is not set
# CONFIG_MWAVE is not set
# CONFIG_DEVMEM is not set
CONFIG_NVRAM=y
# CONFIG_DEVPORT is not set
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
CONFIG_HPET_MMAP_DEFAULT=y
# CONFIG_HANGCHECK_TIMER is not set
CONFIG_TCG_TPM=y
# CONFIG_TCG_TPM2_HMAC is not set
# CONFIG_HW_RANDOM_TPM is not set
CONFIG_TCG_TIS_CORE=y
CONFIG_TCG_TIS=y
# CONFIG_TCG_TIS_SPI is not set
# CONFIG_TCG_TIS_I2C is not set
# CONFIG_TCG_TIS_I2C_CR50 is not set
# CONFIG_TCG_TIS_I2C_ATMEL is not set
# CONFIG_TCG_TIS_I2C_INFINEON is not set
# CONFIG_TCG_TIS_I2C_NUVOTON is not set
# CONFIG_TCG_NSC is not set
# CONFIG_TCG_ATMEL is not set
# CONFIG_TCG_INFINEON is not set
CONFIG_TCG_CRB=y
# CONFIG_TCG_VTPM_PROXY is not set
# CONFIG_TCG_TIS_ST33ZP24_I2C is not set
# CONFIG_TCG_TIS_ST33ZP24_SPI is not set
# CONFIG_TELCLOCK is not set
CONFIG_XILLYBUS_CLASS=y
# CONFIG_XILLYBUS is not set
CONFIG_XILLYUSB=y
# end of Character devices

#
# I2C support
#
CONFIG_I2C=y
CONFIG_ACPI_I2C_OPREGION=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y

#
# Multiplexer I2C Chip support
#
# CONFIG_I2C_ARB_GPIO_CHALLENGE is not set
# CONFIG_I2C_MUX_GPIO is not set
# CONFIG_I2C_MUX_GPMUX is not set
# CONFIG_I2C_MUX_LTC4306 is not set
# CONFIG_I2C_MUX_PCA9541 is not set
# CONFIG_I2C_MUX_PCA954x is not set
CONFIG_I2C_MUX_REG=y
# CONFIG_I2C_MUX_MLXCPLD is not set
# end of Multiplexer I2C Chip support

CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_SMBUS=y
CONFIG_I2C_ALGOBIT=y

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_AMD_MP2 is not set
CONFIG_I2C_I801=y
# CONFIG_I2C_ISCH is not set
# CONFIG_I2C_ISMT is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_CHT_WC is not set
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_NVIDIA_GPU is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set
# CONFIG_I2C_ZHAOXIN is not set

#
# ACPI drivers
#
# CONFIG_I2C_SCMI is not set

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_CBUS_GPIO is not set
CONFIG_I2C_DESIGNWARE_CORE=y
# CONFIG_I2C_DESIGNWARE_SLAVE is not set
CONFIG_I2C_DESIGNWARE_PLATFORM=y
# CONFIG_I2C_DESIGNWARE_BAYTRAIL is not set
# CONFIG_I2C_DESIGNWARE_PCI is not set
# CONFIG_I2C_EMEV2 is not set
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_RK3X is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set

#
# External I2C/SMBus adapter drivers
#
CONFIG_I2C_DIOLAN_U2C=y
CONFIG_I2C_DLN2=y
CONFIG_I2C_LJCA=y
CONFIG_I2C_CP2615=y
# CONFIG_I2C_PARPORT is not set
# CONFIG_I2C_PCI1XXXX is not set
CONFIG_I2C_ROBOTFUZZ_OSIF=y
# CONFIG_I2C_TAOS_EVM is not set
CONFIG_I2C_TINY_USB=y
CONFIG_I2C_VIPERBOARD=y

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_MLXCPLD is not set
# CONFIG_I2C_VIRTIO is not set
# end of I2C Hardware Bus support

# CONFIG_I2C_STUB is not set
CONFIG_I2C_SLAVE=y
CONFIG_I2C_SLAVE_EEPROM=y
# CONFIG_I2C_SLAVE_TESTUNIT is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# end of I2C support

# CONFIG_I3C is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
# CONFIG_SPI_MEM is not set

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_AXI_SPI_ENGINE is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_BUTTERFLY is not set
# CONFIG_SPI_CADENCE is not set
# CONFIG_SPI_CADENCE_QUADSPI is not set
# CONFIG_SPI_CH341 is not set
# CONFIG_SPI_DESIGNWARE is not set
CONFIG_SPI_DLN2=y
# CONFIG_SPI_GPIO is not set
# CONFIG_SPI_LM70_LLP is not set
# CONFIG_SPI_FSL_SPI is not set
CONFIG_SPI_LJCA=y
# CONFIG_SPI_MICROCHIP_CORE is not set
# CONFIG_SPI_MICROCHIP_CORE_QSPI is not set
# CONFIG_SPI_LANTIQ_SSC is not set
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PCI1XXXX is not set
# CONFIG_SPI_PXA2XX is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_SIFIVE is not set
# CONFIG_SPI_MXIC is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set

#
# SPI Multiplexer support
#
# CONFIG_SPI_MUX is not set

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_LOOPBACK_TEST is not set
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_SPI_SLAVE is not set
CONFIG_SPI_DYNAMIC=y
# CONFIG_SPMI is not set
# CONFIG_HSI is not set
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set

#
# PPS clients support
#
# CONFIG_PPS_CLIENT_KTIMER is not set
# CONFIG_PPS_CLIENT_LDISC is not set
# CONFIG_PPS_CLIENT_PARPORT is not set
# CONFIG_PPS_CLIENT_GPIO is not set
# CONFIG_PPS_GENERATOR is not set

#
# PTP clock support
#
CONFIG_PTP_1588_CLOCK=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_PTP_1588_CLOCK_KVM=y
CONFIG_PTP_1588_CLOCK_VMCLOCK=y
# CONFIG_PTP_1588_CLOCK_IDT82P33 is not set
# CONFIG_PTP_1588_CLOCK_IDTCM is not set
# CONFIG_PTP_1588_CLOCK_FC3W is not set
# CONFIG_PTP_1588_CLOCK_MOCK is not set
# CONFIG_PTP_1588_CLOCK_VMW is not set
# CONFIG_PTP_1588_CLOCK_OCP is not set
# end of PTP clock support

# CONFIG_PINCTRL is not set
CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_FASTPATH_LIMIT=512
CONFIG_OF_GPIO=y
CONFIG_GPIO_ACPI=y
CONFIG_GPIOLIB_IRQCHIP=y
# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set
# CONFIG_GPIO_CDEV is not set

#
# Memory mapped GPIO drivers
#
# CONFIG_GPIO_74XX_MMIO is not set
# CONFIG_GPIO_ALTERA is not set
# CONFIG_GPIO_AMDPT is not set
# CONFIG_GPIO_CADENCE is not set
# CONFIG_GPIO_DWAPB is not set
# CONFIG_GPIO_FTGPIO010 is not set
# CONFIG_GPIO_GENERIC_PLATFORM is not set
# CONFIG_GPIO_GRANITERAPIDS is not set
# CONFIG_GPIO_GRGPIO is not set
# CONFIG_GPIO_HLWD is not set
# CONFIG_GPIO_ICH is not set
# CONFIG_GPIO_LOGICVC is not set
# CONFIG_GPIO_MB86S7X is not set
# CONFIG_GPIO_POLARFIRE_SOC is not set
# CONFIG_GPIO_SIFIVE is not set
# CONFIG_GPIO_SYSCON is not set
# CONFIG_GPIO_XILINX is not set
# CONFIG_GPIO_AMD_FCH is not set
# end of Memory mapped GPIO drivers

#
# Port-mapped I/O GPIO drivers
#
# CONFIG_GPIO_VX855 is not set
# CONFIG_GPIO_F7188X is not set
# CONFIG_GPIO_IT87 is not set
# CONFIG_GPIO_SCH311X is not set
# CONFIG_GPIO_WINBOND is not set
# CONFIG_GPIO_WS16C48 is not set
# end of Port-mapped I/O GPIO drivers

#
# I2C GPIO expanders
#
# CONFIG_GPIO_ADNP is not set
# CONFIG_GPIO_FXL6408 is not set
# CONFIG_GPIO_DS4520 is not set
# CONFIG_GPIO_GW_PLD is not set
# CONFIG_GPIO_MAX7300 is not set
# CONFIG_GPIO_MAX732X is not set
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCA9570 is not set
# CONFIG_GPIO_PCF857X is not set
# CONFIG_GPIO_TPIC2810 is not set
# end of I2C GPIO expanders

#
# MFD GPIO expanders
#
CONFIG_GPIO_DLN2=y
# CONFIG_GPIO_ELKHARTLAKE is not set
CONFIG_GPIO_LJCA=y
# CONFIG_GPIO_TWL4030 is not set
# CONFIG_GPIO_WHISKEY_COVE is not set
# end of MFD GPIO expanders

#
# PCI GPIO expanders
#
# CONFIG_GPIO_AMD8111 is not set
# CONFIG_GPIO_BT8XX is not set
# CONFIG_GPIO_ML_IOH is not set
# CONFIG_GPIO_PCI_IDIO_16 is not set
# CONFIG_GPIO_PCIE_IDIO_24 is not set
# CONFIG_GPIO_RDC321X is not set
# CONFIG_GPIO_SODAVILLE is not set
# end of PCI GPIO expanders

#
# SPI GPIO expanders
#
# CONFIG_GPIO_74X164 is not set
# CONFIG_GPIO_MAX3191X is not set
# CONFIG_GPIO_MAX7301 is not set
# CONFIG_GPIO_MC33880 is not set
# CONFIG_GPIO_PISOSR is not set
# CONFIG_GPIO_XRA1403 is not set
# end of SPI GPIO expanders

#
# USB GPIO expanders
#
CONFIG_GPIO_VIPERBOARD=y
# CONFIG_GPIO_MPSSE is not set
# end of USB GPIO expanders

#
# Virtual GPIO drivers
#
# CONFIG_GPIO_AGGREGATOR is not set
# CONFIG_GPIO_LATCH is not set
# CONFIG_GPIO_MOCKUP is not set
# CONFIG_GPIO_VIRTIO is not set
# CONFIG_GPIO_SIM is not set
# end of Virtual GPIO drivers

#
# GPIO Debugging utilities
#
# CONFIG_GPIO_SLOPPY_LOGIC_ANALYZER is not set
# CONFIG_GPIO_VIRTUSER is not set
# end of GPIO Debugging utilities

# CONFIG_W1 is not set
# CONFIG_POWER_RESET is not set
# CONFIG_POWER_SEQUENCING is not set
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_POWER_SUPPLY_HWMON=y
# CONFIG_GENERIC_ADC_BATTERY is not set
# CONFIG_IP5XXX_POWER is not set
# CONFIG_TEST_POWER is not set
# CONFIG_CHARGER_ADP5061 is not set
# CONFIG_BATTERY_CHAGALL is not set
# CONFIG_BATTERY_CW2015 is not set
# CONFIG_BATTERY_DS2780 is not set
# CONFIG_BATTERY_DS2781 is not set
# CONFIG_BATTERY_DS2782 is not set
# CONFIG_BATTERY_SAMSUNG_SDI is not set
# CONFIG_BATTERY_SBS is not set
# CONFIG_CHARGER_SBS is not set
# CONFIG_MANAGER_SBS is not set
# CONFIG_BATTERY_BQ27XXX is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
# CONFIG_BATTERY_MAX1720X is not set
CONFIG_CHARGER_ISP1704=y
# CONFIG_CHARGER_MAX8903 is not set
# CONFIG_CHARGER_TWL4030 is not set
# CONFIG_CHARGER_TWL6030 is not set
# CONFIG_CHARGER_LP8727 is not set
# CONFIG_CHARGER_GPIO is not set
# CONFIG_CHARGER_MANAGER is not set
# CONFIG_CHARGER_LT3651 is not set
# CONFIG_CHARGER_LTC4162L is not set
# CONFIG_CHARGER_DETECTOR_MAX14656 is not set
# CONFIG_CHARGER_MAX77976 is not set
# CONFIG_CHARGER_MAX8971 is not set
# CONFIG_CHARGER_MT6360 is not set
# CONFIG_CHARGER_MT6370 is not set
# CONFIG_CHARGER_BQ2415X is not set
CONFIG_CHARGER_BQ24190=y
# CONFIG_CHARGER_BQ24257 is not set
# CONFIG_CHARGER_BQ24735 is not set
# CONFIG_CHARGER_BQ2515X is not set
# CONFIG_CHARGER_BQ25890 is not set
# CONFIG_CHARGER_BQ25980 is not set
# CONFIG_CHARGER_BQ256XX is not set
# CONFIG_CHARGER_SMB347 is not set
# CONFIG_BATTERY_GAUGE_LTC2941 is not set
# CONFIG_BATTERY_GOLDFISH is not set
# CONFIG_BATTERY_RT5033 is not set
# CONFIG_CHARGER_RT9455 is not set
# CONFIG_CHARGER_RT9467 is not set
# CONFIG_CHARGER_RT9471 is not set
# CONFIG_FUEL_GAUGE_STC3117 is not set
# CONFIG_CHARGER_UCS1002 is not set
# CONFIG_CHARGER_BD99954 is not set
# CONFIG_BATTERY_SURFACE is not set
# CONFIG_CHARGER_SURFACE is not set
# CONFIG_BATTERY_UG3105 is not set
# CONFIG_FUEL_GAUGE_MM8013 is not set
CONFIG_HWMON=y
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
# CONFIG_SENSORS_ABITUGURU is not set
# CONFIG_SENSORS_ABITUGURU3 is not set
# CONFIG_SENSORS_AD7314 is not set
# CONFIG_SENSORS_AD7414 is not set
# CONFIG_SENSORS_AD7418 is not set
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
# CONFIG_SENSORS_ADM1029 is not set
# CONFIG_SENSORS_ADM1031 is not set
# CONFIG_SENSORS_ADM1177 is not set
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ADT7310 is not set
# CONFIG_SENSORS_ADT7410 is not set
# CONFIG_SENSORS_ADT7411 is not set
# CONFIG_SENSORS_ADT7462 is not set
# CONFIG_SENSORS_ADT7470 is not set
# CONFIG_SENSORS_ADT7475 is not set
# CONFIG_SENSORS_AHT10 is not set
CONFIG_SENSORS_AQUACOMPUTER_D5NEXT=y
# CONFIG_SENSORS_AS370 is not set
# CONFIG_SENSORS_ASC7621 is not set
# CONFIG_SENSORS_ASUS_ROG_RYUJIN is not set
# CONFIG_SENSORS_AXI_FAN_CONTROL is not set
# CONFIG_SENSORS_K8TEMP is not set
# CONFIG_SENSORS_K10TEMP is not set
# CONFIG_SENSORS_FAM15H_POWER is not set
# CONFIG_SENSORS_APPLESMC is not set
# CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_ATXP1 is not set
# CONFIG_SENSORS_CHIPCAP2 is not set
CONFIG_SENSORS_CORSAIR_CPRO=y
CONFIG_SENSORS_CORSAIR_PSU=y
# CONFIG_SENSORS_DRIVETEMP is not set
# CONFIG_SENSORS_DS620 is not set
# CONFIG_SENSORS_DS1621 is not set
# CONFIG_SENSORS_DELL_SMM is not set
# CONFIG_SENSORS_I5K_AMB is not set
# CONFIG_SENSORS_F71805F is not set
# CONFIG_SENSORS_F71882FG is not set
# CONFIG_SENSORS_F75375S is not set
# CONFIG_SENSORS_FSCHMD is not set
# CONFIG_SENSORS_FTSTEUTATES is not set
CONFIG_SENSORS_GIGABYTE_WATERFORCE=y
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_GL520SM is not set
# CONFIG_SENSORS_G760A is not set
# CONFIG_SENSORS_G762 is not set
# CONFIG_SENSORS_GPIO_FAN is not set
# CONFIG_SENSORS_HIH6130 is not set
# CONFIG_SENSORS_HS3001 is not set
# CONFIG_SENSORS_HTU31 is not set
# CONFIG_SENSORS_IIO_HWMON is not set
# CONFIG_SENSORS_I5500 is not set
# CONFIG_SENSORS_CORETEMP is not set
# CONFIG_SENSORS_ISL28022 is not set
# CONFIG_SENSORS_IT87 is not set
# CONFIG_SENSORS_JC42 is not set
CONFIG_SENSORS_POWERZ=y
# CONFIG_SENSORS_POWR1220 is not set
# CONFIG_SENSORS_LENOVO_EC is not set
# CONFIG_SENSORS_LINEAGE is not set
# CONFIG_SENSORS_LTC2945 is not set
# CONFIG_SENSORS_LTC2947_I2C is not set
# CONFIG_SENSORS_LTC2947_SPI is not set
# CONFIG_SENSORS_LTC2990 is not set
# CONFIG_SENSORS_LTC2991 is not set
# CONFIG_SENSORS_LTC2992 is not set
# CONFIG_SENSORS_LTC4151 is not set
# CONFIG_SENSORS_LTC4215 is not set
# CONFIG_SENSORS_LTC4222 is not set
# CONFIG_SENSORS_LTC4245 is not set
# CONFIG_SENSORS_LTC4260 is not set
# CONFIG_SENSORS_LTC4261 is not set
# CONFIG_SENSORS_LTC4282 is not set
# CONFIG_SENSORS_MAX1111 is not set
# CONFIG_SENSORS_MAX127 is not set
# CONFIG_SENSORS_MAX16065 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_MAX1668 is not set
# CONFIG_SENSORS_MAX197 is not set
# CONFIG_SENSORS_MAX31722 is not set
# CONFIG_SENSORS_MAX31730 is not set
# CONFIG_SENSORS_MAX31760 is not set
# CONFIG_MAX31827 is not set
# CONFIG_SENSORS_MAX6620 is not set
# CONFIG_SENSORS_MAX6621 is not set
# CONFIG_SENSORS_MAX6639 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_MAX6697 is not set
# CONFIG_SENSORS_MAX31790 is not set
# CONFIG_SENSORS_MC34VR500 is not set
# CONFIG_SENSORS_MCP3021 is not set
# CONFIG_SENSORS_TC654 is not set
# CONFIG_SENSORS_TPS23861 is not set
# CONFIG_SENSORS_MR75203 is not set
# CONFIG_SENSORS_ADCXX is not set
# CONFIG_SENSORS_LM63 is not set
# CONFIG_SENSORS_LM70 is not set
# CONFIG_SENSORS_LM73 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
# CONFIG_SENSORS_LM95234 is not set
# CONFIG_SENSORS_LM95241 is not set
# CONFIG_SENSORS_LM95245 is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_NTC_THERMISTOR is not set
# CONFIG_SENSORS_NCT6683 is not set
# CONFIG_SENSORS_NCT6775 is not set
# CONFIG_SENSORS_NCT6775_I2C is not set
# CONFIG_SENSORS_NCT7363 is not set
# CONFIG_SENSORS_NCT7802 is not set
# CONFIG_SENSORS_NCT7904 is not set
# CONFIG_SENSORS_NPCM7XX is not set
CONFIG_SENSORS_NZXT_KRAKEN2=y
# CONFIG_SENSORS_NZXT_KRAKEN3 is not set
CONFIG_SENSORS_NZXT_SMART2=y
# CONFIG_SENSORS_OCC_P8_I2C is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_PMBUS is not set
# CONFIG_SENSORS_PT5161L is not set
# CONFIG_SENSORS_SBTSI is not set
# CONFIG_SENSORS_SHT15 is not set
# CONFIG_SENSORS_SHT21 is not set
# CONFIG_SENSORS_SHT3x is not set
# CONFIG_SENSORS_SHT4x is not set
# CONFIG_SENSORS_SHTC1 is not set
# CONFIG_SENSORS_SIS5595 is not set
# CONFIG_SENSORS_DME1737 is not set
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC2305 is not set
# CONFIG_SENSORS_EMC6W201 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47M192 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
# CONFIG_SENSORS_SCH5627 is not set
# CONFIG_SENSORS_SCH5636 is not set
# CONFIG_SENSORS_STTS751 is not set
# CONFIG_SENSORS_SURFACE_FAN is not set
# CONFIG_SENSORS_SURFACE_TEMP is not set
# CONFIG_SENSORS_ADC128D818 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_ADS7871 is not set
# CONFIG_SENSORS_AMC6821 is not set
# CONFIG_SENSORS_INA209 is not set
# CONFIG_SENSORS_INA2XX is not set
# CONFIG_SENSORS_INA238 is not set
# CONFIG_SENSORS_INA3221 is not set
# CONFIG_SENSORS_SPD5118 is not set
# CONFIG_SENSORS_TC74 is not set
# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_TMP102 is not set
# CONFIG_SENSORS_TMP103 is not set
# CONFIG_SENSORS_TMP108 is not set
# CONFIG_SENSORS_TMP401 is not set
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_TMP464 is not set
# CONFIG_SENSORS_TMP513 is not set
# CONFIG_SENSORS_VIA_CPUTEMP is not set
# CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_VT1211 is not set
# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83773G is not set
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
# CONFIG_SENSORS_W83793 is not set
# CONFIG_SENSORS_W83795 is not set
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_SENSORS_XGENE is not set

#
# ACPI drivers
#
# CONFIG_SENSORS_ACPI_POWER is not set
# CONFIG_SENSORS_ATK0110 is not set
# CONFIG_SENSORS_ASUS_WMI is not set
# CONFIG_SENSORS_ASUS_EC is not set
# CONFIG_SENSORS_HP_WMI is not set
CONFIG_THERMAL=y
CONFIG_THERMAL_NETLINK=y
# CONFIG_THERMAL_STATISTICS is not set
# CONFIG_THERMAL_DEBUGFS is not set
# CONFIG_THERMAL_CORE_TESTING is not set
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
CONFIG_THERMAL_HWMON=y
# CONFIG_THERMAL_OF is not set
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_GOV_STEP_WISE=y
# CONFIG_THERMAL_GOV_BANG_BANG is not set
# CONFIG_THERMAL_GOV_USER_SPACE is not set
# CONFIG_PCIE_THERMAL is not set
# CONFIG_THERMAL_EMULATION is not set
# CONFIG_THERMAL_MMIO is not set

#
# Intel thermal drivers
#
# CONFIG_INTEL_POWERCLAMP is not set
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_X86_PKG_TEMP_THERMAL is not set
# CONFIG_INTEL_SOC_DTS_THERMAL is not set

#
# ACPI INT340X thermal drivers
#
# CONFIG_INT340X_THERMAL is not set
# end of ACPI INT340X thermal drivers

# CONFIG_INTEL_BXT_PMIC_THERMAL is not set
# CONFIG_INTEL_PCH_THERMAL is not set
# CONFIG_INTEL_TCC_COOLING is not set
# CONFIG_INTEL_HFI_THERMAL is not set
# end of Intel thermal drivers

# CONFIG_GENERIC_ADC_THERMAL is not set
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_CORE is not set
# CONFIG_WATCHDOG_NOWAYOUT is not set
CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y
CONFIG_WATCHDOG_OPEN_TIMEOUT=0
# CONFIG_WATCHDOG_SYSFS is not set
# CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT is not set

#
# Watchdog Pretimeout Governors
#

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_GPIO_WATCHDOG is not set
# CONFIG_LENOVO_SE10_WDT is not set
# CONFIG_LENOVO_SE30_WDT is not set
# CONFIG_WDAT_WDT is not set
# CONFIG_XILINX_WATCHDOG is not set
# CONFIG_ZIIRAVE_WATCHDOG is not set
# CONFIG_CADENCE_WATCHDOG is not set
# CONFIG_DW_WATCHDOG is not set
# CONFIG_TWL4030_WATCHDOG is not set
# CONFIG_MAX63XX_WATCHDOG is not set
# CONFIG_RETU_WATCHDOG is not set
# CONFIG_ACQUIRE_WDT is not set
# CONFIG_ADVANTECH_WDT is not set
# CONFIG_ADVANTECH_EC_WDT is not set
# CONFIG_ALIM1535_WDT is not set
# CONFIG_ALIM7101_WDT is not set
# CONFIG_EBC_C384_WDT is not set
# CONFIG_EXAR_WDT is not set
# CONFIG_F71808E_WDT is not set
# CONFIG_SP5100_TCO is not set
# CONFIG_SBC_FITPC2_WATCHDOG is not set
# CONFIG_EUROTECH_WDT is not set
# CONFIG_IB700_WDT is not set
# CONFIG_IBMASR is not set
# CONFIG_WAFER_WDT is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_IE6XX_WDT is not set
# CONFIG_INTEL_OC_WATCHDOG is not set
# CONFIG_ITCO_WDT is not set
# CONFIG_IT8712F_WDT is not set
# CONFIG_IT87_WDT is not set
# CONFIG_HP_WATCHDOG is not set
# CONFIG_SC1200_WDT is not set
# CONFIG_PC87413_WDT is not set
# CONFIG_NV_TCO is not set
# CONFIG_60XX_WDT is not set
# CONFIG_SMSC_SCH311X_WDT is not set
# CONFIG_SMSC37B787_WDT is not set
# CONFIG_TQMX86_WDT is not set
# CONFIG_VIA_WDT is not set
# CONFIG_W83627HF_WDT is not set
# CONFIG_W83877F_WDT is not set
# CONFIG_W83977F_WDT is not set
# CONFIG_MACHZ_WDT is not set
# CONFIG_SBC_EPX_C3_WATCHDOG is not set
# CONFIG_INTEL_MEI_WDT is not set
# CONFIG_NI903X_WDT is not set
# CONFIG_NIC7018_WDT is not set
# CONFIG_MEN_A21_WDT is not set

#
# PCI-based Watchdog Cards
#
# CONFIG_PCIPCWATCHDOG is not set
# CONFIG_WDTPCI is not set

#
# USB-based Watchdog Cards
#
CONFIG_USBPCWATCHDOG=y
CONFIG_SSB_POSSIBLE=y
CONFIG_SSB=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
# CONFIG_SSB_PCIHOST is not set
CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
# CONFIG_SSB_PCMCIAHOST is not set
CONFIG_SSB_SDIOHOST_POSSIBLE=y
# CONFIG_SSB_SDIOHOST is not set
# CONFIG_SSB_DRIVER_GPIO is not set
CONFIG_BCMA_POSSIBLE=y
CONFIG_BCMA=y
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
# CONFIG_BCMA_HOST_PCI is not set
# CONFIG_BCMA_HOST_SOC is not set
# CONFIG_BCMA_DRIVER_PCI is not set
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
# CONFIG_BCMA_DRIVER_GPIO is not set
# CONFIG_BCMA_DEBUG is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_ADP5585 is not set
# CONFIG_MFD_ACT8945A is not set
# CONFIG_MFD_AS3711 is not set
# CONFIG_MFD_SMPRO is not set
# CONFIG_MFD_AS3722 is not set
# CONFIG_PMIC_ADP5520 is not set
# CONFIG_MFD_AAT2870_CORE is not set
# CONFIG_MFD_ATMEL_FLEXCOM is not set
# CONFIG_MFD_ATMEL_HLCDC is not set
# CONFIG_MFD_BCM590XX is not set
# CONFIG_MFD_BD9571MWV is not set
# CONFIG_MFD_AXP20X_I2C is not set
# CONFIG_MFD_CGBC is not set
# CONFIG_MFD_CS42L43_I2C is not set
# CONFIG_MFD_CS42L43_SDW is not set
# CONFIG_MFD_MADERA is not set
# CONFIG_MFD_MAX5970 is not set
# CONFIG_PMIC_DA903X is not set
# CONFIG_MFD_DA9052_SPI is not set
# CONFIG_MFD_DA9052_I2C is not set
# CONFIG_MFD_DA9055 is not set
# CONFIG_MFD_DA9062 is not set
# CONFIG_MFD_DA9063 is not set
# CONFIG_MFD_DA9150 is not set
CONFIG_MFD_DLN2=y
# CONFIG_MFD_GATEWORKS_GSC is not set
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_MFD_MP2629 is not set
# CONFIG_MFD_HI6421_PMIC is not set
# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set
CONFIG_LPC_ICH=y
# CONFIG_LPC_SCH is not set
# CONFIG_INTEL_SOC_PMIC is not set
CONFIG_INTEL_SOC_PMIC_BXTWC=y
CONFIG_INTEL_SOC_PMIC_CHTWC=y
# CONFIG_INTEL_SOC_PMIC_CHTDC_TI is not set
# CONFIG_MFD_INTEL_LPSS_ACPI is not set
# CONFIG_MFD_INTEL_LPSS_PCI is not set
CONFIG_MFD_INTEL_PMC_BXT=y
# CONFIG_MFD_IQS62X is not set
# CONFIG_MFD_JANZ_CMODIO is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_88PM800 is not set
# CONFIG_MFD_88PM805 is not set
# CONFIG_MFD_88PM860X is not set
# CONFIG_MFD_88PM886_PMIC is not set
# CONFIG_MFD_MAX14577 is not set
# CONFIG_MFD_MAX77541 is not set
# CONFIG_MFD_MAX77620 is not set
# CONFIG_MFD_MAX77650 is not set
# CONFIG_MFD_MAX77686 is not set
# CONFIG_MFD_MAX77693 is not set
# CONFIG_MFD_MAX77705 is not set
# CONFIG_MFD_MAX77714 is not set
# CONFIG_MFD_MAX77759 is not set
# CONFIG_MFD_MAX77843 is not set
# CONFIG_MFD_MAX8907 is not set
# CONFIG_MFD_MAX8925 is not set
# CONFIG_MFD_MAX8997 is not set
# CONFIG_MFD_MAX8998 is not set
CONFIG_MFD_MT6360=y
CONFIG_MFD_MT6370=y
# CONFIG_MFD_MT6397 is not set
# CONFIG_MFD_MENF21BMC is not set
# CONFIG_MFD_OCELOT is not set
# CONFIG_EZX_PCAP is not set
# CONFIG_MFD_CPCAP is not set
CONFIG_MFD_VIPERBOARD=y
# CONFIG_MFD_NTXEC is not set
CONFIG_MFD_RETU=y
# CONFIG_MFD_SY7636A is not set
# CONFIG_MFD_RDC321X is not set
# CONFIG_MFD_RT4831 is not set
# CONFIG_MFD_RT5033 is not set
# CONFIG_MFD_RT5120 is not set
# CONFIG_MFD_RC5T583 is not set
# CONFIG_MFD_RK8XX_I2C is not set
# CONFIG_MFD_RK8XX_SPI is not set
# CONFIG_MFD_RN5T618 is not set
# CONFIG_MFD_SEC_I2C is not set
# CONFIG_MFD_SI476X_CORE is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_MFD_SKY81452 is not set
# CONFIG_MFD_STMPE is not set
CONFIG_MFD_SYSCON=y
# CONFIG_MFD_LP3943 is not set
# CONFIG_MFD_LP8788 is not set
# CONFIG_MFD_TI_LMU is not set
# CONFIG_MFD_PALMAS is not set
# CONFIG_TPS6105X is not set
# CONFIG_TPS65010 is not set
# CONFIG_TPS6507X is not set
# CONFIG_MFD_TPS65086 is not set
# CONFIG_MFD_TPS65090 is not set
# CONFIG_MFD_TPS65217 is not set
# CONFIG_MFD_TI_LP873X is not set
# CONFIG_MFD_TI_LP87565 is not set
# CONFIG_MFD_TPS65218 is not set
# CONFIG_MFD_TPS65219 is not set
# CONFIG_MFD_TPS6586X is not set
# CONFIG_MFD_TPS65910 is not set
# CONFIG_MFD_TPS65912_I2C is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_TPS6594_I2C is not set
# CONFIG_MFD_TPS6594_SPI is not set
CONFIG_TWL4030_CORE=y
# CONFIG_MFD_TWL4030_AUDIO is not set
# CONFIG_TWL6040_CORE is not set
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_MFD_LM3533 is not set
# CONFIG_MFD_TC3589X is not set
# CONFIG_MFD_TQMX86 is not set
# CONFIG_MFD_VX855 is not set
# CONFIG_MFD_LOCHNAGAR is not set
# CONFIG_MFD_ARIZONA_I2C is not set
# CONFIG_MFD_ARIZONA_SPI is not set
# CONFIG_MFD_WM8400 is not set
# CONFIG_MFD_WM831X_I2C is not set
# CONFIG_MFD_WM831X_SPI is not set
# CONFIG_MFD_WM8350_I2C is not set
# CONFIG_MFD_WM8994 is not set
# CONFIG_MFD_ROHM_BD718XX is not set
# CONFIG_MFD_ROHM_BD71828 is not set
# CONFIG_MFD_ROHM_BD957XMUF is not set
# CONFIG_MFD_ROHM_BD96801 is not set
# CONFIG_MFD_STPMIC1 is not set
# CONFIG_MFD_STMFX is not set
# CONFIG_MFD_ATC260X_I2C is not set
# CONFIG_MFD_QCOM_PM8008 is not set
# CONFIG_MFD_CS40L50_I2C is not set
# CONFIG_MFD_CS40L50_SPI is not set
# CONFIG_RAVE_SP_CORE is not set
# CONFIG_MFD_INTEL_M10_BMC_SPI is not set
# CONFIG_MFD_QNAP_MCU is not set
# CONFIG_MFD_RSMU_I2C is not set
# CONFIG_MFD_RSMU_SPI is not set
# CONFIG_MFD_UPBOARD_FPGA is not set
# end of Multifunction device drivers

CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
# CONFIG_REGULATOR_NETLINK_EVENTS is not set
# CONFIG_REGULATOR_88PG86X is not set
# CONFIG_REGULATOR_ACT8865 is not set
# CONFIG_REGULATOR_AD5398 is not set
# CONFIG_REGULATOR_ADP5055 is not set
# CONFIG_REGULATOR_AW37503 is not set
# CONFIG_REGULATOR_DA9121 is not set
# CONFIG_REGULATOR_DA9210 is not set
# CONFIG_REGULATOR_DA9211 is not set
# CONFIG_REGULATOR_FAN53555 is not set
# CONFIG_REGULATOR_FAN53880 is not set
# CONFIG_REGULATOR_GPIO is not set
# CONFIG_REGULATOR_ISL9305 is not set
# CONFIG_REGULATOR_ISL6271A is not set
# CONFIG_REGULATOR_LP3971 is not set
# CONFIG_REGULATOR_LP3972 is not set
# CONFIG_REGULATOR_LP872X is not set
# CONFIG_REGULATOR_LP8755 is not set
# CONFIG_REGULATOR_LTC3589 is not set
# CONFIG_REGULATOR_LTC3676 is not set
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_MAX77503 is not set
# CONFIG_REGULATOR_MAX77857 is not set
# CONFIG_REGULATOR_MAX8649 is not set
# CONFIG_REGULATOR_MAX8660 is not set
# CONFIG_REGULATOR_MAX8893 is not set
# CONFIG_REGULATOR_MAX8952 is not set
# CONFIG_REGULATOR_MAX20086 is not set
# CONFIG_REGULATOR_MAX20411 is not set
# CONFIG_REGULATOR_MAX77826 is not set
# CONFIG_REGULATOR_MCP16502 is not set
# CONFIG_REGULATOR_MP5416 is not set
# CONFIG_REGULATOR_MP8859 is not set
# CONFIG_REGULATOR_MP886X is not set
# CONFIG_REGULATOR_MPQ7920 is not set
# CONFIG_REGULATOR_MT6311 is not set
# CONFIG_REGULATOR_MT6360 is not set
# CONFIG_REGULATOR_MT6370 is not set
# CONFIG_REGULATOR_PCA9450 is not set
# CONFIG_REGULATOR_PF9453 is not set
# CONFIG_REGULATOR_PF8X00 is not set
# CONFIG_REGULATOR_PFUZE100 is not set
# CONFIG_REGULATOR_PV88060 is not set
# CONFIG_REGULATOR_PV88080 is not set
# CONFIG_REGULATOR_PV88090 is not set
# CONFIG_REGULATOR_RAA215300 is not set
# CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY is not set
# CONFIG_REGULATOR_RT4801 is not set
# CONFIG_REGULATOR_RT4803 is not set
# CONFIG_REGULATOR_RT5190A is not set
# CONFIG_REGULATOR_RT5739 is not set
# CONFIG_REGULATOR_RT5759 is not set
# CONFIG_REGULATOR_RT6160 is not set
# CONFIG_REGULATOR_RT6190 is not set
# CONFIG_REGULATOR_RT6245 is not set
# CONFIG_REGULATOR_RTQ2134 is not set
# CONFIG_REGULATOR_RTMV20 is not set
# CONFIG_REGULATOR_RTQ6752 is not set
# CONFIG_REGULATOR_RTQ2208 is not set
# CONFIG_REGULATOR_SLG51000 is not set
# CONFIG_REGULATOR_SY8106A is not set
# CONFIG_REGULATOR_SY8824X is not set
# CONFIG_REGULATOR_SY8827N is not set
# CONFIG_REGULATOR_TPS51632 is not set
# CONFIG_REGULATOR_TPS62360 is not set
# CONFIG_REGULATOR_TPS6286X is not set
# CONFIG_REGULATOR_TPS6287X is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
# CONFIG_REGULATOR_TPS65132 is not set
# CONFIG_REGULATOR_TPS6524X is not set
CONFIG_REGULATOR_TWL4030=y
# CONFIG_REGULATOR_VCTRL is not set
CONFIG_RC_CORE=y
# CONFIG_LIRC is not set
# CONFIG_RC_MAP is not set
# CONFIG_RC_DECODERS is not set
CONFIG_RC_DEVICES=y
# CONFIG_IR_ENE is not set
# CONFIG_IR_FINTEK is not set
# CONFIG_IR_GPIO_CIR is not set
# CONFIG_IR_HIX5HD2 is not set
CONFIG_IR_IGORPLUGUSB=y
CONFIG_IR_IGUANA=y
CONFIG_IR_IMON=y
CONFIG_IR_IMON_RAW=y
# CONFIG_IR_ITE_CIR is not set
CONFIG_IR_MCEUSB=y
# CONFIG_IR_NUVOTON is not set
CONFIG_IR_REDRAT3=y
# CONFIG_IR_SERIAL is not set
CONFIG_IR_STREAMZAP=y
CONFIG_IR_TOY=y
CONFIG_IR_TTUSBIR=y
# CONFIG_IR_WINBOND_CIR is not set
CONFIG_RC_ATI_REMOTE=y
# CONFIG_RC_LOOPBACK is not set
CONFIG_RC_XBOX_DVD=y
CONFIG_CEC_CORE=y

#
# CEC support
#
# CONFIG_MEDIA_CEC_RC is not set
CONFIG_MEDIA_CEC_SUPPORT=y
# CONFIG_CEC_CH7322 is not set
# CONFIG_CEC_NXP_TDA9950 is not set
# CONFIG_CEC_GPIO is not set
# CONFIG_CEC_SECO is not set
# CONFIG_USB_EXTRON_DA_HD_4K_PLUS_CEC is not set
CONFIG_USB_PULSE8_CEC=y
CONFIG_USB_RAINSHADOW_CEC=y
# end of CEC support

CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_SUPPORT_FILTER=y
# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set

#
# Media device types
#
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
CONFIG_MEDIA_SDR_SUPPORT=y
CONFIG_MEDIA_PLATFORM_SUPPORT=y
CONFIG_MEDIA_TEST_SUPPORT=y
# end of Media device types

CONFIG_VIDEO_DEV=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_DVB_CORE=y

#
# Video4Linux options
#
CONFIG_VIDEO_V4L2_I2C=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_TUNER=y
CONFIG_V4L2_MEM2MEM_DEV=y
# end of Video4Linux options

#
# Media controller options
#
CONFIG_MEDIA_CONTROLLER_DVB=y
# end of Media controller options

#
# Digital TV options
#
# CONFIG_DVB_MMAP is not set
# CONFIG_DVB_NET is not set
CONFIG_DVB_MAX_ADAPTERS=16
# CONFIG_DVB_DYNAMIC_MINORS is not set
# CONFIG_DVB_DEMUX_SECTION_LOSS_LOG is not set
# CONFIG_DVB_ULE_DEBUG is not set
# end of Digital TV options

#
# Media drivers
#

#
# Drivers filtered as selected at 'Filter media drivers'
#

#
# Media drivers
#
CONFIG_MEDIA_USB_SUPPORT=y

#
# Webcam devices
#
CONFIG_USB_GSPCA=y
CONFIG_USB_GSPCA_BENQ=y
CONFIG_USB_GSPCA_CONEX=y
CONFIG_USB_GSPCA_CPIA1=y
CONFIG_USB_GSPCA_DTCS033=y
CONFIG_USB_GSPCA_ETOMS=y
CONFIG_USB_GSPCA_FINEPIX=y
CONFIG_USB_GSPCA_JEILINJ=y
CONFIG_USB_GSPCA_JL2005BCD=y
CONFIG_USB_GSPCA_KINECT=y
CONFIG_USB_GSPCA_KONICA=y
CONFIG_USB_GSPCA_MARS=y
CONFIG_USB_GSPCA_MR97310A=y
CONFIG_USB_GSPCA_NW80X=y
CONFIG_USB_GSPCA_OV519=y
CONFIG_USB_GSPCA_OV534=y
CONFIG_USB_GSPCA_OV534_9=y
CONFIG_USB_GSPCA_PAC207=y
CONFIG_USB_GSPCA_PAC7302=y
CONFIG_USB_GSPCA_PAC7311=y
CONFIG_USB_GSPCA_SE401=y
CONFIG_USB_GSPCA_SN9C2028=y
CONFIG_USB_GSPCA_SN9C20X=y
CONFIG_USB_GSPCA_SONIXB=y
CONFIG_USB_GSPCA_SONIXJ=y
CONFIG_USB_GSPCA_SPCA1528=y
CONFIG_USB_GSPCA_SPCA500=y
CONFIG_USB_GSPCA_SPCA501=y
CONFIG_USB_GSPCA_SPCA505=y
CONFIG_USB_GSPCA_SPCA506=y
CONFIG_USB_GSPCA_SPCA508=y
CONFIG_USB_GSPCA_SPCA561=y
CONFIG_USB_GSPCA_SQ905=y
CONFIG_USB_GSPCA_SQ905C=y
CONFIG_USB_GSPCA_SQ930X=y
CONFIG_USB_GSPCA_STK014=y
CONFIG_USB_GSPCA_STK1135=y
CONFIG_USB_GSPCA_STV0680=y
CONFIG_USB_GSPCA_SUNPLUS=y
CONFIG_USB_GSPCA_T613=y
CONFIG_USB_GSPCA_TOPRO=y
CONFIG_USB_GSPCA_TOUPTEK=y
CONFIG_USB_GSPCA_TV8532=y
CONFIG_USB_GSPCA_VC032X=y
CONFIG_USB_GSPCA_VICAM=y
CONFIG_USB_GSPCA_XIRLINK_CIT=y
CONFIG_USB_GSPCA_ZC3XX=y
CONFIG_USB_GL860=y
CONFIG_USB_M5602=y
CONFIG_USB_STV06XX=y
CONFIG_USB_PWC=y
# CONFIG_USB_PWC_DEBUG is not set
CONFIG_USB_PWC_INPUT_EVDEV=y
CONFIG_USB_S2255=y
CONFIG_VIDEO_USBTV=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y

#
# Analog TV USB devices
#
CONFIG_VIDEO_GO7007=y
CONFIG_VIDEO_GO7007_USB=y
CONFIG_VIDEO_GO7007_LOADER=y
CONFIG_VIDEO_GO7007_USB_S2250_BOARD=y
CONFIG_VIDEO_HDPVR=y
CONFIG_VIDEO_PVRUSB2=y
CONFIG_VIDEO_PVRUSB2_SYSFS=y
CONFIG_VIDEO_PVRUSB2_DVB=y
# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
CONFIG_VIDEO_STK1160=y

#
# Analog/digital TV USB devices
#
CONFIG_VIDEO_AU0828=y
CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_AU0828_RC=y
CONFIG_VIDEO_CX231XX=y
CONFIG_VIDEO_CX231XX_RC=y
CONFIG_VIDEO_CX231XX_ALSA=y
CONFIG_VIDEO_CX231XX_DVB=y

#
# Digital TV USB devices
#
CONFIG_DVB_AS102=y
CONFIG_DVB_B2C2_FLEXCOP_USB=y
# CONFIG_DVB_B2C2_FLEXCOP_USB_DEBUG is not set
CONFIG_DVB_USB_V2=y
CONFIG_DVB_USB_AF9015=y
CONFIG_DVB_USB_AF9035=y
CONFIG_DVB_USB_ANYSEE=y
CONFIG_DVB_USB_AU6610=y
CONFIG_DVB_USB_AZ6007=y
CONFIG_DVB_USB_CE6230=y
CONFIG_DVB_USB_DVBSKY=y
CONFIG_DVB_USB_EC168=y
CONFIG_DVB_USB_GL861=y
CONFIG_DVB_USB_LME2510=y
CONFIG_DVB_USB_MXL111SF=y
CONFIG_DVB_USB_RTL28XXU=y
CONFIG_DVB_USB_ZD1301=y
CONFIG_DVB_USB=y
# CONFIG_DVB_USB_DEBUG is not set
CONFIG_DVB_USB_A800=y
CONFIG_DVB_USB_AF9005=y
CONFIG_DVB_USB_AF9005_REMOTE=y
CONFIG_DVB_USB_AZ6027=y
CONFIG_DVB_USB_CINERGY_T2=y
CONFIG_DVB_USB_CXUSB=y
CONFIG_DVB_USB_CXUSB_ANALOG=y
CONFIG_DVB_USB_DIB0700=y
CONFIG_DVB_USB_DIB3000MC=y
CONFIG_DVB_USB_DIBUSB_MB=y
# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
CONFIG_DVB_USB_DIBUSB_MC=y
CONFIG_DVB_USB_DIGITV=y
CONFIG_DVB_USB_DTT200U=y
CONFIG_DVB_USB_DTV5100=y
CONFIG_DVB_USB_DW2102=y
CONFIG_DVB_USB_GP8PSK=y
CONFIG_DVB_USB_M920X=y
CONFIG_DVB_USB_NOVA_T_USB2=y
CONFIG_DVB_USB_OPERA1=y
CONFIG_DVB_USB_PCTV452E=y
CONFIG_DVB_USB_TECHNISAT_USB2=y
CONFIG_DVB_USB_TTUSB2=y
CONFIG_DVB_USB_UMT_010=y
CONFIG_DVB_USB_VP702X=y
CONFIG_DVB_USB_VP7045=y
CONFIG_SMS_USB_DRV=y
CONFIG_DVB_TTUSB_BUDGET=y
CONFIG_DVB_TTUSB_DEC=y

#
# Webcam, TV (analog/digital) USB devices
#
CONFIG_VIDEO_EM28XX=y
CONFIG_VIDEO_EM28XX_V4L2=y
CONFIG_VIDEO_EM28XX_ALSA=y
CONFIG_VIDEO_EM28XX_DVB=y
CONFIG_VIDEO_EM28XX_RC=y

#
# Software defined radio USB devices
#
CONFIG_USB_AIRSPY=y
CONFIG_USB_HACKRF=y
CONFIG_USB_MSI2500=y
# CONFIG_MEDIA_PCI_SUPPORT is not set
CONFIG_RADIO_ADAPTERS=y
# CONFIG_RADIO_MAXIRADIO is not set
# CONFIG_RADIO_SAA7706H is not set
CONFIG_RADIO_SHARK=y
CONFIG_RADIO_SHARK2=y
CONFIG_RADIO_SI4713=y
CONFIG_RADIO_TEA575X=y
# CONFIG_RADIO_TEA5764 is not set
# CONFIG_RADIO_TEF6862 is not set
# CONFIG_RADIO_WL1273 is not set
CONFIG_USB_DSBR=y
CONFIG_USB_KEENE=y
CONFIG_USB_MA901=y
CONFIG_USB_MR800=y
CONFIG_USB_RAREMONO=y
CONFIG_RADIO_SI470X=y
CONFIG_USB_SI470X=y
# CONFIG_I2C_SI470X is not set
CONFIG_USB_SI4713=y
# CONFIG_PLATFORM_SI4713 is not set
CONFIG_I2C_SI4713=y
# CONFIG_MEDIA_PLATFORM_DRIVERS is not set

#
# MMC/SDIO DVB adapters
#
CONFIG_SMS_SDIO_DRV=y
CONFIG_V4L_TEST_DRIVERS=y
CONFIG_VIDEO_VIM2M=y
CONFIG_VIDEO_VICODEC=y
CONFIG_VIDEO_VIMC=y
CONFIG_VIDEO_VIVID=y
CONFIG_VIDEO_VIVID_CEC=y
# CONFIG_VIDEO_VIVID_OSD is not set
CONFIG_VIDEO_VIVID_MAX_DEVS=64
# CONFIG_VIDEO_VISL is not set
CONFIG_DVB_TEST_DRIVERS=y
CONFIG_DVB_VIDTV=y

#
# FireWire (IEEE 1394) Adapters
#
# CONFIG_DVB_FIREDTV is not set
CONFIG_MEDIA_COMMON_OPTIONS=y

#
# common driver options
#
CONFIG_CYPRESS_FIRMWARE=y
CONFIG_TTPCI_EEPROM=y
CONFIG_UVC_COMMON=y
CONFIG_VIDEO_CX2341X=y
CONFIG_VIDEO_TVEEPROM=y
CONFIG_DVB_B2C2_FLEXCOP=y
CONFIG_SMS_SIANO_MDTV=y
CONFIG_SMS_SIANO_RC=y
CONFIG_SMS_SIANO_DEBUGFS=y
CONFIG_VIDEO_V4L2_TPG=y
CONFIG_VIDEOBUF2_CORE=y
CONFIG_VIDEOBUF2_V4L2=y
CONFIG_VIDEOBUF2_MEMOPS=y
CONFIG_VIDEOBUF2_DMA_CONTIG=y
CONFIG_VIDEOBUF2_VMALLOC=y
CONFIG_VIDEOBUF2_DMA_SG=y
# end of Media drivers

#
# Media ancillary drivers
#
CONFIG_MEDIA_ATTACH=y
# CONFIG_VIDEO_IR_I2C is not set
# CONFIG_VIDEO_CAMERA_SENSOR is not set

#
# Camera ISPs
#
# CONFIG_VIDEO_THP7312 is not set
# end of Camera ISPs

#
# Lens drivers
#
# CONFIG_VIDEO_AD5820 is not set
# CONFIG_VIDEO_AK7375 is not set
# CONFIG_VIDEO_DW9714 is not set
# CONFIG_VIDEO_DW9719 is not set
# CONFIG_VIDEO_DW9768 is not set
# CONFIG_VIDEO_DW9807_VCM is not set
# end of Lens drivers

#
# Flash devices
#
# CONFIG_VIDEO_ADP1653 is not set
# CONFIG_VIDEO_LM3560 is not set
# CONFIG_VIDEO_LM3646 is not set
# end of Flash devices

#
# Audio decoders, processors and mixers
#
# CONFIG_VIDEO_CS3308 is not set
# CONFIG_VIDEO_CS5345 is not set
CONFIG_VIDEO_CS53L32A=y
CONFIG_VIDEO_MSP3400=y
# CONFIG_VIDEO_SONY_BTF_MPX is not set
# CONFIG_VIDEO_TDA1997X is not set
# CONFIG_VIDEO_TDA7432 is not set
# CONFIG_VIDEO_TDA9840 is not set
# CONFIG_VIDEO_TEA6415C is not set
# CONFIG_VIDEO_TEA6420 is not set
# CONFIG_VIDEO_TLV320AIC23B is not set
# CONFIG_VIDEO_TVAUDIO is not set
# CONFIG_VIDEO_UDA1342 is not set
# CONFIG_VIDEO_VP27SMPX is not set
# CONFIG_VIDEO_WM8739 is not set
CONFIG_VIDEO_WM8775=y
# end of Audio decoders, processors and mixers

#
# RDS decoders
#
# CONFIG_VIDEO_SAA6588 is not set
# end of RDS decoders

#
# Video decoders
#
# CONFIG_VIDEO_ADV7180 is not set
# CONFIG_VIDEO_ADV7183 is not set
# CONFIG_VIDEO_ADV748X is not set
# CONFIG_VIDEO_ADV7604 is not set
# CONFIG_VIDEO_ADV7842 is not set
# CONFIG_VIDEO_BT819 is not set
# CONFIG_VIDEO_BT856 is not set
# CONFIG_VIDEO_BT866 is not set
# CONFIG_VIDEO_ISL7998X is not set
# CONFIG_VIDEO_LT6911UXE is not set
# CONFIG_VIDEO_KS0127 is not set
# CONFIG_VIDEO_MAX9286 is not set
# CONFIG_VIDEO_ML86V7667 is not set
# CONFIG_VIDEO_SAA7110 is not set
CONFIG_VIDEO_SAA711X=y
# CONFIG_VIDEO_TC358743 is not set
# CONFIG_VIDEO_TC358746 is not set
# CONFIG_VIDEO_TVP514X is not set
# CONFIG_VIDEO_TVP5150 is not set
# CONFIG_VIDEO_TVP7002 is not set
# CONFIG_VIDEO_TW2804 is not set
# CONFIG_VIDEO_TW9900 is not set
# CONFIG_VIDEO_TW9903 is not set
# CONFIG_VIDEO_TW9906 is not set
# CONFIG_VIDEO_TW9910 is not set
# CONFIG_VIDEO_VPX3220 is not set

#
# Video and audio decoders
#
# CONFIG_VIDEO_SAA717X is not set
CONFIG_VIDEO_CX25840=y
# end of Video decoders

#
# Video encoders
#
# CONFIG_VIDEO_ADV7170 is not set
# CONFIG_VIDEO_ADV7175 is not set
# CONFIG_VIDEO_ADV7343 is not set
# CONFIG_VIDEO_ADV7393 is not set
# CONFIG_VIDEO_ADV7511 is not set
# CONFIG_VIDEO_AK881X is not set
# CONFIG_VIDEO_SAA7127 is not set
# CONFIG_VIDEO_SAA7185 is not set
# CONFIG_VIDEO_THS8200 is not set
# end of Video encoders

#
# Video improvement chips
#
# CONFIG_VIDEO_UPD64031A is not set
# CONFIG_VIDEO_UPD64083 is not set
# end of Video improvement chips

#
# Audio/Video compression chips
#
# CONFIG_VIDEO_SAA6752HS is not set
# end of Audio/Video compression chips

#
# SDR tuner chips
#
# CONFIG_SDR_MAX2175 is not set
# end of SDR tuner chips

#
# Miscellaneous helper chips
#
# CONFIG_VIDEO_I2C is not set
# CONFIG_VIDEO_M52790 is not set
# CONFIG_VIDEO_ST_MIPID02 is not set
# CONFIG_VIDEO_THS7303 is not set
# end of Miscellaneous helper chips

#
# Video serializers and deserializers
#
# CONFIG_VIDEO_DS90UB913 is not set
# CONFIG_VIDEO_DS90UB953 is not set
# CONFIG_VIDEO_DS90UB960 is not set
# CONFIG_VIDEO_MAX96714 is not set
# CONFIG_VIDEO_MAX96717 is not set
# end of Video serializers and deserializers

#
# Media SPI Adapters
#
# CONFIG_CXD2880_SPI_DRV is not set
# CONFIG_VIDEO_GS1662 is not set
# end of Media SPI Adapters

CONFIG_MEDIA_TUNER=y

#
# Customize TV tuners
#
# CONFIG_MEDIA_TUNER_E4000 is not set
# CONFIG_MEDIA_TUNER_FC0011 is not set
# CONFIG_MEDIA_TUNER_FC0012 is not set
# CONFIG_MEDIA_TUNER_FC0013 is not set
# CONFIG_MEDIA_TUNER_FC2580 is not set
# CONFIG_MEDIA_TUNER_IT913X is not set
# CONFIG_MEDIA_TUNER_M88RS6000T is not set
# CONFIG_MEDIA_TUNER_MAX2165 is not set
# CONFIG_MEDIA_TUNER_MC44S803 is not set
CONFIG_MEDIA_TUNER_MSI001=y
# CONFIG_MEDIA_TUNER_MT2060 is not set
# CONFIG_MEDIA_TUNER_MT2063 is not set
# CONFIG_MEDIA_TUNER_MT20XX is not set
# CONFIG_MEDIA_TUNER_MT2131 is not set
# CONFIG_MEDIA_TUNER_MT2266 is not set
# CONFIG_MEDIA_TUNER_MXL301RF is not set
# CONFIG_MEDIA_TUNER_MXL5005S is not set
# CONFIG_MEDIA_TUNER_MXL5007T is not set
# CONFIG_MEDIA_TUNER_QM1D1B0004 is not set
# CONFIG_MEDIA_TUNER_QM1D1C0042 is not set
# CONFIG_MEDIA_TUNER_QT1010 is not set
# CONFIG_MEDIA_TUNER_R820T is not set
# CONFIG_MEDIA_TUNER_SI2157 is not set
# CONFIG_MEDIA_TUNER_SIMPLE is not set
# CONFIG_MEDIA_TUNER_TDA18212 is not set
# CONFIG_MEDIA_TUNER_TDA18218 is not set
# CONFIG_MEDIA_TUNER_TDA18250 is not set
# CONFIG_MEDIA_TUNER_TDA18271 is not set
# CONFIG_MEDIA_TUNER_TDA827X is not set
# CONFIG_MEDIA_TUNER_TDA8290 is not set
# CONFIG_MEDIA_TUNER_TDA9887 is not set
# CONFIG_MEDIA_TUNER_TEA5761 is not set
# CONFIG_MEDIA_TUNER_TEA5767 is not set
# CONFIG_MEDIA_TUNER_TUA9001 is not set
# CONFIG_MEDIA_TUNER_XC2028 is not set
# CONFIG_MEDIA_TUNER_XC4000 is not set
# CONFIG_MEDIA_TUNER_XC5000 is not set
# end of Customize TV tuners

#
# Customise DVB Frontends
#

#
# Multistandard (satellite) frontends
#
# CONFIG_DVB_M88DS3103 is not set
# CONFIG_DVB_MXL5XX is not set
# CONFIG_DVB_STB0899 is not set
# CONFIG_DVB_STB6100 is not set
# CONFIG_DVB_STV090x is not set
# CONFIG_DVB_STV0910 is not set
# CONFIG_DVB_STV6110x is not set
# CONFIG_DVB_STV6111 is not set

#
# Multistandard (cable + terrestrial) frontends
#
# CONFIG_DVB_DRXK is not set
# CONFIG_DVB_MN88472 is not set
# CONFIG_DVB_MN88473 is not set
# CONFIG_DVB_SI2165 is not set
# CONFIG_DVB_TDA18271C2DD is not set

#
# DVB-S (satellite) frontends
#
# CONFIG_DVB_CX24110 is not set
# CONFIG_DVB_CX24116 is not set
# CONFIG_DVB_CX24117 is not set
# CONFIG_DVB_CX24120 is not set
# CONFIG_DVB_CX24123 is not set
# CONFIG_DVB_DS3000 is not set
# CONFIG_DVB_MB86A16 is not set
# CONFIG_DVB_MT312 is not set
# CONFIG_DVB_S5H1420 is not set
# CONFIG_DVB_SI21XX is not set
# CONFIG_DVB_STB6000 is not set
# CONFIG_DVB_STV0288 is not set
# CONFIG_DVB_STV0299 is not set
# CONFIG_DVB_STV0900 is not set
# CONFIG_DVB_STV6110 is not set
# CONFIG_DVB_TDA10071 is not set
# CONFIG_DVB_TDA10086 is not set
# CONFIG_DVB_TDA8083 is not set
# CONFIG_DVB_TDA8261 is not set
# CONFIG_DVB_TDA826X is not set
# CONFIG_DVB_TS2020 is not set
# CONFIG_DVB_TUA6100 is not set
# CONFIG_DVB_TUNER_CX24113 is not set
# CONFIG_DVB_TUNER_ITD1000 is not set
# CONFIG_DVB_VES1X93 is not set
# CONFIG_DVB_ZL10036 is not set
# CONFIG_DVB_ZL10039 is not set

#
# DVB-T (terrestrial) frontends
#
CONFIG_DVB_AF9013=y
CONFIG_DVB_AS102_FE=y
# CONFIG_DVB_CX22700 is not set
# CONFIG_DVB_CX22702 is not set
# CONFIG_DVB_CXD2820R is not set
# CONFIG_DVB_CXD2841ER is not set
CONFIG_DVB_DIB3000MB=y
CONFIG_DVB_DIB3000MC=y
# CONFIG_DVB_DIB7000M is not set
# CONFIG_DVB_DIB7000P is not set
# CONFIG_DVB_DIB9000 is not set
# CONFIG_DVB_DRXD is not set
CONFIG_DVB_EC100=y
CONFIG_DVB_GP8PSK_FE=y
# CONFIG_DVB_L64781 is not set
# CONFIG_DVB_MT352 is not set
# CONFIG_DVB_NXT6000 is not set
CONFIG_DVB_RTL2830=y
CONFIG_DVB_RTL2832=y
CONFIG_DVB_RTL2832_SDR=y
# CONFIG_DVB_S5H1432 is not set
# CONFIG_DVB_SI2168 is not set
# CONFIG_DVB_SP887X is not set
# CONFIG_DVB_STV0367 is not set
# CONFIG_DVB_TDA10048 is not set
# CONFIG_DVB_TDA1004X is not set
# CONFIG_DVB_ZD1301_DEMOD is not set
CONFIG_DVB_ZL10353=y
# CONFIG_DVB_CXD2880 is not set

#
# DVB-C (cable) frontends
#
# CONFIG_DVB_STV0297 is not set
# CONFIG_DVB_TDA10021 is not set
# CONFIG_DVB_TDA10023 is not set
# CONFIG_DVB_VES1820 is not set

#
# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
#
# CONFIG_DVB_AU8522_DTV is not set
# CONFIG_DVB_AU8522_V4L is not set
# CONFIG_DVB_BCM3510 is not set
# CONFIG_DVB_LG2160 is not set
# CONFIG_DVB_LGDT3305 is not set
# CONFIG_DVB_LGDT3306A is not set
# CONFIG_DVB_LGDT330X is not set
# CONFIG_DVB_MXL692 is not set
# CONFIG_DVB_NXT200X is not set
# CONFIG_DVB_OR51132 is not set
# CONFIG_DVB_OR51211 is not set
# CONFIG_DVB_S5H1409 is not set
# CONFIG_DVB_S5H1411 is not set

#
# ISDB-T (terrestrial) frontends
#
# CONFIG_DVB_DIB8000 is not set
# CONFIG_DVB_MB86A20S is not set
# CONFIG_DVB_S921 is not set

#
# ISDB-S (satellite) & ISDB-T (terrestrial) frontends
#
# CONFIG_DVB_MN88443X is not set
# CONFIG_DVB_TC90522 is not set

#
# Digital terrestrial only tuners/PLL
#
# CONFIG_DVB_PLL is not set
# CONFIG_DVB_TUNER_DIB0070 is not set
# CONFIG_DVB_TUNER_DIB0090 is not set

#
# SEC control devices for DVB-S
#
# CONFIG_DVB_A8293 is not set
CONFIG_DVB_AF9033=y
# CONFIG_DVB_ASCOT2E is not set
# CONFIG_DVB_ATBM8830 is not set
# CONFIG_DVB_HELENE is not set
# CONFIG_DVB_HORUS3A is not set
# CONFIG_DVB_ISL6405 is not set
# CONFIG_DVB_ISL6421 is not set
# CONFIG_DVB_ISL6423 is not set
# CONFIG_DVB_IX2505V is not set
# CONFIG_DVB_LGS8GL5 is not set
# CONFIG_DVB_LGS8GXX is not set
# CONFIG_DVB_LNBH25 is not set
# CONFIG_DVB_LNBH29 is not set
# CONFIG_DVB_LNBP21 is not set
# CONFIG_DVB_LNBP22 is not set
# CONFIG_DVB_M88RS2000 is not set
# CONFIG_DVB_TDA665x is not set
# CONFIG_DVB_DRX39XYJ is not set

#
# Common Interface (EN50221) controller drivers
#
# CONFIG_DVB_CXD2099 is not set
# CONFIG_DVB_SP2 is not set
# end of Customise DVB Frontends

#
# Tools to develop new frontends
#
# CONFIG_DVB_DUMMY_FE is not set
# end of Media ancillary drivers

#
# Graphics support
#
CONFIG_APERTURE_HELPERS=y
CONFIG_SCREEN_INFO=y
CONFIG_VIDEO=y
# CONFIG_AUXDISPLAY is not set
# CONFIG_PANEL is not set
CONFIG_AGP=y
CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
# CONFIG_AGP_SIS is not set
# CONFIG_AGP_VIA is not set
CONFIG_INTEL_GTT=y
# CONFIG_VGA_SWITCHEROO is not set
CONFIG_DRM=y

#
# DRM debugging options
#
# CONFIG_DRM_WERROR is not set
CONFIG_DRM_DEBUG_MM=y
# end of DRM debugging options

CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_KMS_HELPER=y
# CONFIG_DRM_PANIC is not set
# CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set
# CONFIG_DRM_DEBUG_MODESET_LOCK is not set
CONFIG_DRM_CLIENT=y
CONFIG_DRM_CLIENT_LIB=y
CONFIG_DRM_CLIENT_SELECTION=y
CONFIG_DRM_CLIENT_SETUP=y

#
# Supported DRM clients
#
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_DRM_FBDEV_OVERALLOC=100
# CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set
# CONFIG_DRM_CLIENT_LOG is not set
CONFIG_DRM_CLIENT_DEFAULT_FBDEV=y
CONFIG_DRM_CLIENT_DEFAULT="fbdev"
# end of Supported DRM clients

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
CONFIG_DRM_DISPLAY_DP_AUX_BUS=y
CONFIG_DRM_DISPLAY_HELPER=y
# CONFIG_DRM_DISPLAY_DP_AUX_CEC is not set
# CONFIG_DRM_DISPLAY_DP_AUX_CHARDEV is not set
CONFIG_DRM_DISPLAY_DP_HELPER=y
CONFIG_DRM_DISPLAY_DSC_HELPER=y
CONFIG_DRM_DISPLAY_HDCP_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_HELPER=y
CONFIG_DRM_TTM=y
CONFIG_DRM_BUDDY=y
CONFIG_DRM_TTM_HELPER=y
CONFIG_DRM_GEM_SHMEM_HELPER=y

#
# Drivers for system framebuffers
#
CONFIG_DRM_SYSFB_HELPER=y
CONFIG_DRM_SIMPLEDRM=y
# CONFIG_DRM_VESADRM is not set
# end of Drivers for system framebuffers

#
# ARM devices
#
# CONFIG_DRM_KOMEDA is not set
# end of ARM devices

# CONFIG_DRM_RADEON is not set
# CONFIG_DRM_AMDGPU is not set
# CONFIG_DRM_NOUVEAU is not set
CONFIG_DRM_I915=y
CONFIG_DRM_I915_FORCE_PROBE=""
CONFIG_DRM_I915_CAPTURE_ERROR=y
CONFIG_DRM_I915_COMPRESS_ERROR=y
CONFIG_DRM_I915_USERPTR=y
# CONFIG_DRM_I915_GVT_KVMGT is not set
# CONFIG_DRM_I915_DP_TUNNEL is not set

#
# drm/i915 Debugging
#
# CONFIG_DRM_I915_WERROR is not set
# CONFIG_DRM_I915_REPLAY_GPU_HANGS_API is not set
# CONFIG_DRM_I915_DEBUG is not set
# CONFIG_DRM_I915_DEBUG_MMIO is not set
# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set
# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set
# CONFIG_DRM_I915_DEBUG_GUC is not set
# CONFIG_DRM_I915_SELFTEST is not set
# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set
# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set
# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set
# CONFIG_DRM_I915_DEBUG_WAKEREF is not set
# end of drm/i915 Debugging

#
# drm/i915 Profile Guided Optimisation
#
CONFIG_DRM_I915_REQUEST_TIMEOUT=20000
CONFIG_DRM_I915_FENCE_TIMEOUT=10000
CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250
CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500
CONFIG_DRM_I915_PREEMPT_TIMEOUT=640
CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500
CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000
CONFIG_DRM_I915_STOP_TIMEOUT=100
CONFIG_DRM_I915_TIMESLICE_DURATION=1
# end of drm/i915 Profile Guided Optimisation

# CONFIG_DRM_XE is not set
CONFIG_DRM_VGEM=y
CONFIG_DRM_VKMS=y
CONFIG_DRM_VMWGFX=y
# CONFIG_DRM_VMWGFX_MKSSTATS is not set
# CONFIG_DRM_GMA500 is not set
CONFIG_DRM_UDL=y
# CONFIG_DRM_AST is not set
# CONFIG_DRM_MGAG200 is not set
# CONFIG_DRM_QXL is not set
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_DRM_VIRTIO_GPU_KMS=y
CONFIG_DRM_PANEL=y

#
# Display Panels
#
# CONFIG_DRM_PANEL_ABT_Y030XX067A is not set
# CONFIG_DRM_PANEL_ARM_VERSATILE is not set
# CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 is not set
# CONFIG_DRM_PANEL_AUO_A030JTN01 is not set
# CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0 is not set
# CONFIG_DRM_PANEL_BOE_HIMAX8279D is not set
# CONFIG_DRM_PANEL_BOE_TD4320 is not set
# CONFIG_DRM_PANEL_BOE_TH101MB31UIG002_28A is not set
# CONFIG_DRM_PANEL_BOE_TV101WUM_NL6 is not set
# CONFIG_DRM_PANEL_BOE_TV101WUM_LL2 is not set
# CONFIG_DRM_PANEL_EBBG_FT8719 is not set
# CONFIG_DRM_PANEL_ELIDA_KD35T133 is not set
# CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02 is not set
# CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D is not set
# CONFIG_DRM_PANEL_DSI_CM is not set
# CONFIG_DRM_PANEL_LVDS is not set
# CONFIG_DRM_PANEL_HIMAX_HX8279 is not set
# CONFIG_DRM_PANEL_HIMAX_HX83102 is not set
# CONFIG_DRM_PANEL_HIMAX_HX83112A is not set
# CONFIG_DRM_PANEL_HIMAX_HX8394 is not set
# CONFIG_DRM_PANEL_ILITEK_IL9322 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9341 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9805 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9806E is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9881C is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9882T is not set
# CONFIG_DRM_PANEL_INNOLUX_EJ030NA is not set
# CONFIG_DRM_PANEL_INNOLUX_P079ZCA is not set
# CONFIG_DRM_PANEL_JADARD_JD9365DA_H3 is not set
# CONFIG_DRM_PANEL_JDI_LPM102A188A is not set
# CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set
# CONFIG_DRM_PANEL_JDI_R63452 is not set
# CONFIG_DRM_PANEL_KHADAS_TS050 is not set
# CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04 is not set
# CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W is not set
# CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829 is not set
# CONFIG_DRM_PANEL_LINCOLNTECH_LCD197 is not set
# CONFIG_DRM_PANEL_LG_LB035Q02 is not set
# CONFIG_DRM_PANEL_LG_LG4573 is not set
# CONFIG_DRM_PANEL_LG_SW43408 is not set
# CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966 is not set
# CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set
# CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3051D is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3052C is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35510 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35560 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35950 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36523 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36672A is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36672E is not set
# CONFIG_DRM_PANEL_NOVATEK_NT37801 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT39016 is not set
# CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set
# CONFIG_DRM_PANEL_ORISETECH_OTA5601A is not set
# CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set
# CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS is not set
# CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set
# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM67191 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM67200 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM68200 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM692E5 is not set
# CONFIG_DRM_PANEL_RAYDIUM_RM69380 is not set
# CONFIG_DRM_PANEL_RONBO_RB070D30 is not set
# CONFIG_DRM_PANEL_SAMSUNG_AMS581VF01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_AMS639RQ08 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS427AP24 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20 is not set
# CONFIG_DRM_PANEL_SAMSUNG_DB7430 is not set
# CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D27A1 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E63M0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_SOFEF00 is not set
# CONFIG_DRM_PANEL_SEIKO_43WVF1G is not set
# CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set
# CONFIG_DRM_PANEL_SHARP_LS037V7DW01 is not set
# CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set
# CONFIG_DRM_PANEL_SHARP_LS060T1SX01 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7701 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7703 is not set
# CONFIG_DRM_PANEL_SITRONIX_ST7789V is not set
# CONFIG_DRM_PANEL_SONY_ACX565AKM is not set
# CONFIG_DRM_PANEL_SONY_TD4353_JDI is not set
# CONFIG_DRM_PANEL_SONY_TULIP_TRULY_NT35521 is not set
# CONFIG_DRM_PANEL_STARTEK_KD070FHFID015 is not set
CONFIG_DRM_PANEL_EDP=y
# CONFIG_DRM_PANEL_SIMPLE is not set
# CONFIG_DRM_PANEL_SUMMIT is not set
# CONFIG_DRM_PANEL_SYNAPTICS_R63353 is not set
# CONFIG_DRM_PANEL_TDO_TL070WSH30 is not set
# CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set
# CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set
# CONFIG_DRM_PANEL_TPO_TPG110 is not set
# CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set
# CONFIG_DRM_PANEL_VISIONOX_G2647FB105 is not set
# CONFIG_DRM_PANEL_VISIONOX_R66451 is not set
# CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set
# CONFIG_DRM_PANEL_VISIONOX_RM692E5 is not set
# CONFIG_DRM_PANEL_VISIONOX_VTDR6130 is not set
# CONFIG_DRM_PANEL_WIDECHIPS_WS2401 is not set
# CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set
# end of Display Panels

CONFIG_DRM_BRIDGE=y
CONFIG_DRM_PANEL_BRIDGE=y
CONFIG_DRM_AUX_BRIDGE=y

#
# Display Interface Bridges
#
# CONFIG_DRM_CHIPONE_ICN6211 is not set
# CONFIG_DRM_CHRONTEL_CH7033 is not set
# CONFIG_DRM_DISPLAY_CONNECTOR is not set
# CONFIG_DRM_I2C_NXP_TDA998X is not set
# CONFIG_DRM_ITE_IT6263 is not set
# CONFIG_DRM_ITE_IT6505 is not set
# CONFIG_DRM_LONTIUM_LT8912B is not set
# CONFIG_DRM_LONTIUM_LT9211 is not set
# CONFIG_DRM_LONTIUM_LT9611 is not set
# CONFIG_DRM_LONTIUM_LT9611UXC is not set
# CONFIG_DRM_ITE_IT66121 is not set
# CONFIG_DRM_LVDS_CODEC is not set
# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set
# CONFIG_DRM_NWL_MIPI_DSI is not set
# CONFIG_DRM_NXP_PTN3460 is not set
# CONFIG_DRM_PARADE_PS8622 is not set
# CONFIG_DRM_PARADE_PS8640 is not set
# CONFIG_DRM_SAMSUNG_DSIM is not set
# CONFIG_DRM_SIL_SII8620 is not set
# CONFIG_DRM_SII902X is not set
# CONFIG_DRM_SII9234 is not set
# CONFIG_DRM_SIMPLE_BRIDGE is not set
# CONFIG_DRM_THINE_THC63LVD1024 is not set
# CONFIG_DRM_TOSHIBA_TC358762 is not set
# CONFIG_DRM_TOSHIBA_TC358764 is not set
# CONFIG_DRM_TOSHIBA_TC358767 is not set
# CONFIG_DRM_TOSHIBA_TC358768 is not set
# CONFIG_DRM_TOSHIBA_TC358775 is not set
# CONFIG_DRM_TI_DLPC3433 is not set
# CONFIG_DRM_TI_TDP158 is not set
# CONFIG_DRM_TI_TFP410 is not set
# CONFIG_DRM_TI_SN65DSI83 is not set
# CONFIG_DRM_TI_SN65DSI86 is not set
# CONFIG_DRM_TI_TPD12S015 is not set
# CONFIG_DRM_ANALOGIX_ANX6345 is not set
# CONFIG_DRM_ANALOGIX_ANX78XX is not set
# CONFIG_DRM_ANALOGIX_ANX7625 is not set
# CONFIG_DRM_I2C_ADV7511 is not set
# CONFIG_DRM_CDNS_DSI is not set
# CONFIG_DRM_CDNS_MHDP8546 is not set
# end of Display Interface Bridges

# CONFIG_DRM_ETNAVIV is not set
# CONFIG_DRM_HISI_HIBMC is not set
# CONFIG_DRM_LOGICVC is not set
# CONFIG_DRM_APPLETBDRM is not set
# CONFIG_DRM_ARCPGU is not set
CONFIG_DRM_BOCHS=y
CONFIG_DRM_CIRRUS_QEMU=y
CONFIG_DRM_GM12U320=y
# CONFIG_DRM_PANEL_MIPI_DBI is not set
# CONFIG_TINYDRM_HX8357D is not set
# CONFIG_TINYDRM_ILI9163 is not set
# CONFIG_TINYDRM_ILI9225 is not set
# CONFIG_TINYDRM_ILI9341 is not set
# CONFIG_TINYDRM_ILI9486 is not set
# CONFIG_TINYDRM_MI0283QT is not set
# CONFIG_TINYDRM_REPAPER is not set
# CONFIG_TINYDRM_SHARP_MEMORY is not set
# CONFIG_DRM_VBOXVIDEO is not set
CONFIG_DRM_GUD=y
# CONFIG_DRM_ST7571_I2C is not set
# CONFIG_DRM_ST7586 is not set
# CONFIG_DRM_ST7735R is not set
# CONFIG_DRM_SSD130X is not set
CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y

#
# Frame buffer Devices
#
CONFIG_FB=y
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
CONFIG_FB_VGA16=y
# CONFIG_FB_UVESA is not set
CONFIG_FB_VESA=y
# CONFIG_FB_N411 is not set
# CONFIG_FB_HGA is not set
# CONFIG_FB_OPENCORES is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_NVIDIA is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I740 is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_VIA is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_IBM_GXT4500 is not set
CONFIG_FB_VIRTUAL=y
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_SSD1307 is not set
# CONFIG_FB_SM712 is not set
CONFIG_FB_CORE=y
CONFIG_FB_NOTIFY=y
# CONFIG_FIRMWARE_EDID is not set
CONFIG_FB_DEVICE=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_IMAGEBLIT=y
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYSMEM_FOPS=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_IOMEM_FOPS=y
CONFIG_FB_IOMEM_HELPERS=y
CONFIG_FB_SYSMEM_HELPERS=y
CONFIG_FB_SYSMEM_HELPERS_DEFERRED=y
# CONFIG_FB_MODE_HELPERS is not set
CONFIG_FB_TILEBLITTING=y
# end of Frame buffer Devices

#
# Backlight & LCD device support
#
CONFIG_LCD_CLASS_DEVICE=y
# CONFIG_LCD_L4F00242T03 is not set
# CONFIG_LCD_LMS283GF05 is not set
# CONFIG_LCD_LTV350QV is not set
# CONFIG_LCD_ILI922X is not set
# CONFIG_LCD_ILI9320 is not set
# CONFIG_LCD_TDO24M is not set
# CONFIG_LCD_VGG2432A4 is not set
# CONFIG_LCD_PLATFORM is not set
# CONFIG_LCD_AMS369FG06 is not set
# CONFIG_LCD_LMS501KF03 is not set
# CONFIG_LCD_HX8357 is not set
# CONFIG_LCD_OTM3225A is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_KTD253 is not set
# CONFIG_BACKLIGHT_KTD2801 is not set
# CONFIG_BACKLIGHT_KTZ8866 is not set
# CONFIG_BACKLIGHT_MT6370 is not set
# CONFIG_BACKLIGHT_APPLE is not set
# CONFIG_BACKLIGHT_QCOM_WLED is not set
# CONFIG_BACKLIGHT_SAHARA is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_ADP8870 is not set
# CONFIG_BACKLIGHT_LM3509 is not set
# CONFIG_BACKLIGHT_LM3639 is not set
# CONFIG_BACKLIGHT_PANDORA is not set
# CONFIG_BACKLIGHT_GPIO is not set
# CONFIG_BACKLIGHT_LV5207LP is not set
# CONFIG_BACKLIGHT_BD6107 is not set
# CONFIG_BACKLIGHT_ARCXCNN is not set
# CONFIG_BACKLIGHT_LED is not set
# end of Backlight & LCD device support

CONFIG_VGASTATE=y
CONFIG_VIDEOMODE_HELPERS=y
CONFIG_HDMI=y

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=80
CONFIG_DUMMY_CONSOLE_ROWS=25
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set
# end of Console display driver support

CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
# CONFIG_LOGO_LINUX_CLUT224 is not set
# end of Graphics support

# CONFIG_DRM_ACCEL is not set
CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_PCM_ELD=y
CONFIG_SND_HWDEP=y
CONFIG_SND_SEQ_DEVICE=y
CONFIG_SND_RAWMIDI=y
CONFIG_SND_UMP=y
CONFIG_SND_UMP_LEGACY_RAWMIDI=y
CONFIG_SND_JACK=y
CONFIG_SND_JACK_INPUT_DEV=y
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_PCM_TIMER=y
CONFIG_SND_HRTIMER=y
CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_MAX_CARDS=32
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_PROC_FS=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_CTL_FAST_LOOKUP=y
CONFIG_SND_DEBUG=y
# CONFIG_SND_DEBUG_VERBOSE is not set
CONFIG_SND_PCM_XRUN_DEBUG=y
# CONFIG_SND_CTL_INPUT_VALIDATION is not set
# CONFIG_SND_CTL_DEBUG is not set
# CONFIG_SND_JACK_INJECTION_DEBUG is not set
# CONFIG_SND_UTIMER is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_CTL_LED=y
CONFIG_SND_SEQUENCER=y
CONFIG_SND_SEQ_DUMMY=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
CONFIG_SND_SEQ_MIDI_EVENT=y
CONFIG_SND_SEQ_MIDI=y
CONFIG_SND_SEQ_VIRMIDI=y
# CONFIG_SND_SEQ_UMP is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_PCSP is not set
CONFIG_SND_DUMMY=y
CONFIG_SND_ALOOP=y
# CONFIG_SND_PCMTEST is not set
CONFIG_SND_VIRMIDI=y
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_MTS64 is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_SERIAL_GENERIC is not set
# CONFIG_SND_MPU401 is not set
# CONFIG_SND_PORTMAN2X4 is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ASIHPI is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LOLA is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SE6X is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set

#
# HD-Audio
#
CONFIG_SND_HDA=y
CONFIG_SND_HDA_GENERIC_LEDS=y
CONFIG_SND_HDA_INTEL=y
# CONFIG_SND_HDA_ACPI is not set
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=1
CONFIG_SND_HDA_PATCH_LOADER=y
CONFIG_SND_HDA_SCODEC_COMPONENT=y
# CONFIG_SND_HDA_SCODEC_CS35L56_I2C is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_SPI is not set
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_HDMI=y
CONFIG_SND_HDA_CODEC_CIRRUS=y
# CONFIG_SND_HDA_CODEC_CS8409 is not set
CONFIG_SND_HDA_CODEC_CONEXANT=y
# CONFIG_SND_HDA_CODEC_SENARYTECH is not set
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CA0132=y
# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set
CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM is not set
# CONFIG_SND_HDA_CTL_DEV_ID is not set
# end of HD-Audio

CONFIG_SND_HDA_CORE=y
CONFIG_SND_HDA_COMPONENT=y
CONFIG_SND_HDA_I915=y
CONFIG_SND_HDA_PREALLOC_SIZE=0
CONFIG_SND_INTEL_NHLT=y
CONFIG_SND_INTEL_DSP_CONFIG=y
CONFIG_SND_INTEL_SOUNDWIRE_ACPI=y
# CONFIG_SND_SPI is not set
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_USB_AUDIO_MIDI_V2=y
CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER=y
CONFIG_SND_USB_UA101=y
CONFIG_SND_USB_USX2Y=y
CONFIG_SND_USB_CAIAQ=y
CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_USB_US122L=y
CONFIG_SND_USB_6FIRE=y
CONFIG_SND_USB_HIFACE=y
CONFIG_SND_BCD2000=y
CONFIG_SND_USB_LINE6=y
CONFIG_SND_USB_POD=y
CONFIG_SND_USB_PODHD=y
CONFIG_SND_USB_TONEPORT=y
CONFIG_SND_USB_VARIAX=y
# CONFIG_SND_FIREWIRE is not set
CONFIG_SND_PCMCIA=y
# CONFIG_SND_VXPOCKET is not set
# CONFIG_SND_PDAUDIOCF is not set
CONFIG_SND_SOC=y
# CONFIG_SND_SOC_USB is not set
# CONFIG_SND_SOC_ADI is not set
# CONFIG_SND_SOC_AMD_ACP is not set
# CONFIG_SND_SOC_AMD_ACP3x is not set
# CONFIG_SND_SOC_AMD_RENOIR is not set
# CONFIG_SND_SOC_AMD_ACP5x is not set
# CONFIG_SND_SOC_AMD_ACP6x is not set
# CONFIG_SND_AMD_ACP_CONFIG is not set
# CONFIG_SND_SOC_AMD_ACP_COMMON is not set
# CONFIG_SND_SOC_AMD_RPL_ACP6x is not set
# CONFIG_SND_ATMEL_SOC is not set
# CONFIG_SND_BCM63XX_I2S_WHISTLER is not set
# CONFIG_SND_DESIGNWARE_I2S is not set

#
# SoC Audio for Freescale CPUs
#

#
# Common SoC Audio options for Freescale CPUs:
#
# CONFIG_SND_SOC_FSL_ASRC is not set
# CONFIG_SND_SOC_FSL_SAI is not set
# CONFIG_SND_SOC_FSL_AUDMIX is not set
# CONFIG_SND_SOC_FSL_SSI is not set
# CONFIG_SND_SOC_FSL_SPDIF is not set
# CONFIG_SND_SOC_FSL_ESAI is not set
# CONFIG_SND_SOC_FSL_MICFIL is not set
# CONFIG_SND_SOC_FSL_XCVR is not set
# CONFIG_SND_SOC_IMX_AUDMUX is not set
# end of SoC Audio for Freescale CPUs

# CONFIG_SND_SOC_CHV3_I2S is not set
# CONFIG_SND_I2S_HI6210_I2S is not set

#
# SoC Audio for Loongson CPUs
#
# end of SoC Audio for Loongson CPUs

# CONFIG_SND_SOC_IMG is not set
# CONFIG_SND_SOC_INTEL_SST_TOPLEVEL is not set
# CONFIG_SND_SOC_INTEL_AVS is not set
# CONFIG_SND_SOC_MTK_BTCVSD is not set
CONFIG_SND_SOC_SDCA_OPTIONAL=y
# CONFIG_SND_SOC_SOF_TOPLEVEL is not set

#
# STMicroelectronics STM32 SOC audio support
#
# end of STMicroelectronics STM32 SOC audio support

# CONFIG_SND_SOC_XILINX_I2S is not set
# CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER is not set
# CONFIG_SND_SOC_XILINX_SPDIF is not set
# CONFIG_SND_SOC_XTFPGA_I2S is not set
CONFIG_SND_SOC_I2C_AND_SPI=y

#
# CODEC drivers
#
# CONFIG_SND_SOC_AC97_CODEC is not set
# CONFIG_SND_SOC_ADAU1372_I2C is not set
# CONFIG_SND_SOC_ADAU1372_SPI is not set
# CONFIG_SND_SOC_ADAU1373 is not set
# CONFIG_SND_SOC_ADAU1701 is not set
# CONFIG_SND_SOC_ADAU1761_I2C is not set
# CONFIG_SND_SOC_ADAU1761_SPI is not set
# CONFIG_SND_SOC_ADAU7002 is not set
# CONFIG_SND_SOC_ADAU7118_HW is not set
# CONFIG_SND_SOC_ADAU7118_I2C is not set
# CONFIG_SND_SOC_AK4104 is not set
# CONFIG_SND_SOC_AK4118 is not set
# CONFIG_SND_SOC_AK4375 is not set
# CONFIG_SND_SOC_AK4458 is not set
# CONFIG_SND_SOC_AK4554 is not set
# CONFIG_SND_SOC_AK4613 is not set
# CONFIG_SND_SOC_AK4619 is not set
# CONFIG_SND_SOC_AK4642 is not set
# CONFIG_SND_SOC_AK5386 is not set
# CONFIG_SND_SOC_AK5558 is not set
# CONFIG_SND_SOC_ALC5623 is not set
# CONFIG_SND_SOC_AUDIO_IIO_AUX is not set
# CONFIG_SND_SOC_AW8738 is not set
# CONFIG_SND_SOC_AW88395 is not set
# CONFIG_SND_SOC_AW88166 is not set
# CONFIG_SND_SOC_AW88261 is not set
# CONFIG_SND_SOC_AW88081 is not set
# CONFIG_SND_SOC_AW87390 is not set
# CONFIG_SND_SOC_AW88399 is not set
# CONFIG_SND_SOC_BD28623 is not set
# CONFIG_SND_SOC_BT_SCO is not set
# CONFIG_SND_SOC_CHV3_CODEC is not set
# CONFIG_SND_SOC_CS35L32 is not set
# CONFIG_SND_SOC_CS35L33 is not set
# CONFIG_SND_SOC_CS35L34 is not set
# CONFIG_SND_SOC_CS35L35 is not set
# CONFIG_SND_SOC_CS35L36 is not set
# CONFIG_SND_SOC_CS35L41_SPI is not set
# CONFIG_SND_SOC_CS35L41_I2C is not set
# CONFIG_SND_SOC_CS35L45_SPI is not set
# CONFIG_SND_SOC_CS35L45_I2C is not set
# CONFIG_SND_SOC_CS35L56_I2C is not set
# CONFIG_SND_SOC_CS35L56_SPI is not set
# CONFIG_SND_SOC_CS35L56_SDW is not set
# CONFIG_SND_SOC_CS42L42 is not set
# CONFIG_SND_SOC_CS42L42_SDW is not set
# CONFIG_SND_SOC_CS42L51_I2C is not set
# CONFIG_SND_SOC_CS42L52 is not set
# CONFIG_SND_SOC_CS42L56 is not set
# CONFIG_SND_SOC_CS42L73 is not set
# CONFIG_SND_SOC_CS42L83 is not set
# CONFIG_SND_SOC_CS42L84 is not set
# CONFIG_SND_SOC_CS4234 is not set
# CONFIG_SND_SOC_CS4265 is not set
# CONFIG_SND_SOC_CS4270 is not set
# CONFIG_SND_SOC_CS4271_I2C is not set
# CONFIG_SND_SOC_CS4271_SPI is not set
# CONFIG_SND_SOC_CS42XX8_I2C is not set
# CONFIG_SND_SOC_CS43130 is not set
# CONFIG_SND_SOC_CS4341 is not set
# CONFIG_SND_SOC_CS4349 is not set
# CONFIG_SND_SOC_CS48L32 is not set
# CONFIG_SND_SOC_CS53L30 is not set
# CONFIG_SND_SOC_CS530X_I2C is not set
# CONFIG_SND_SOC_CX2072X is not set
# CONFIG_SND_SOC_DA7213 is not set
# CONFIG_SND_SOC_DMIC is not set
# CONFIG_SND_SOC_ES7134 is not set
# CONFIG_SND_SOC_ES7241 is not set
# CONFIG_SND_SOC_ES8311 is not set
# CONFIG_SND_SOC_ES8316 is not set
# CONFIG_SND_SOC_ES8323 is not set
# CONFIG_SND_SOC_ES8326 is not set
# CONFIG_SND_SOC_ES8328_I2C is not set
# CONFIG_SND_SOC_ES8328_SPI is not set
# CONFIG_SND_SOC_ES8375 is not set
# CONFIG_SND_SOC_ES8389 is not set
# CONFIG_SND_SOC_GTM601 is not set
# CONFIG_SND_SOC_HDA is not set
# CONFIG_SND_SOC_ICS43432 is not set
# CONFIG_SND_SOC_IDT821034 is not set
# CONFIG_SND_SOC_MAX98088 is not set
# CONFIG_SND_SOC_MAX98090 is not set
# CONFIG_SND_SOC_MAX98357A is not set
# CONFIG_SND_SOC_MAX98504 is not set
# CONFIG_SND_SOC_MAX9867 is not set
# CONFIG_SND_SOC_MAX98927 is not set
# CONFIG_SND_SOC_MAX98520 is not set
# CONFIG_SND_SOC_MAX98363 is not set
# CONFIG_SND_SOC_MAX98373_I2C is not set
# CONFIG_SND_SOC_MAX98373_SDW is not set
# CONFIG_SND_SOC_MAX98388 is not set
# CONFIG_SND_SOC_MAX98390 is not set
# CONFIG_SND_SOC_MAX98396 is not set
# CONFIG_SND_SOC_MAX9860 is not set
# CONFIG_SND_SOC_MSM8916_WCD_DIGITAL is not set
# CONFIG_SND_SOC_PCM1681 is not set
# CONFIG_SND_SOC_PCM1789_I2C is not set
# CONFIG_SND_SOC_PCM179X_I2C is not set
# CONFIG_SND_SOC_PCM179X_SPI is not set
# CONFIG_SND_SOC_PCM186X_I2C is not set
# CONFIG_SND_SOC_PCM186X_SPI is not set
# CONFIG_SND_SOC_PCM3060_I2C is not set
# CONFIG_SND_SOC_PCM3060_SPI is not set
# CONFIG_SND_SOC_PCM3168A_I2C is not set
# CONFIG_SND_SOC_PCM3168A_SPI is not set
# CONFIG_SND_SOC_PCM5102A is not set
# CONFIG_SND_SOC_PCM512x_I2C is not set
# CONFIG_SND_SOC_PCM512x_SPI is not set
# CONFIG_SND_SOC_PCM6240 is not set
# CONFIG_SND_SOC_PEB2466 is not set
# CONFIG_SND_SOC_RT1017_SDCA_SDW is not set
# CONFIG_SND_SOC_RT1308_SDW is not set
# CONFIG_SND_SOC_RT1316_SDW is not set
# CONFIG_SND_SOC_RT1318_SDW is not set
# CONFIG_SND_SOC_RT1320_SDW is not set
# CONFIG_SND_SOC_RT5616 is not set
# CONFIG_SND_SOC_RT5631 is not set
# CONFIG_SND_SOC_RT5640 is not set
# CONFIG_SND_SOC_RT5659 is not set
# CONFIG_SND_SOC_RT5682_SDW is not set
# CONFIG_SND_SOC_RT700_SDW is not set
# CONFIG_SND_SOC_RT711_SDW is not set
# CONFIG_SND_SOC_RT711_SDCA_SDW is not set
# CONFIG_SND_SOC_RT712_SDCA_SDW is not set
# CONFIG_SND_SOC_RT712_SDCA_DMIC_SDW is not set
# CONFIG_SND_SOC_RT721_SDCA_SDW is not set
# CONFIG_SND_SOC_RT722_SDCA_SDW is not set
# CONFIG_SND_SOC_RT715_SDW is not set
# CONFIG_SND_SOC_RT715_SDCA_SDW is not set
# CONFIG_SND_SOC_RT9120 is not set
# CONFIG_SND_SOC_RT9123 is not set
# CONFIG_SND_SOC_RT9123P is not set
# CONFIG_SND_SOC_RTQ9128 is not set
# CONFIG_SND_SOC_SDW_MOCKUP is not set
# CONFIG_SND_SOC_SGTL5000 is not set
# CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set
# CONFIG_SND_SOC_SIMPLE_MUX is not set
# CONFIG_SND_SOC_SMA1303 is not set
# CONFIG_SND_SOC_SMA1307 is not set
# CONFIG_SND_SOC_SPDIF is not set
# CONFIG_SND_SOC_SRC4XXX_I2C is not set
# CONFIG_SND_SOC_SSM2305 is not set
# CONFIG_SND_SOC_SSM2518 is not set
# CONFIG_SND_SOC_SSM2602_SPI is not set
# CONFIG_SND_SOC_SSM2602_I2C is not set
# CONFIG_SND_SOC_SSM3515 is not set
# CONFIG_SND_SOC_SSM4567 is not set
# CONFIG_SND_SOC_STA32X is not set
# CONFIG_SND_SOC_STA350 is not set
# CONFIG_SND_SOC_STI_SAS is not set
# CONFIG_SND_SOC_TAS2552 is not set
# CONFIG_SND_SOC_TAS2562 is not set
# CONFIG_SND_SOC_TAS2764 is not set
# CONFIG_SND_SOC_TAS2770 is not set
# CONFIG_SND_SOC_TAS2780 is not set
# CONFIG_SND_SOC_TAS2781_I2C is not set
# CONFIG_SND_SOC_TAS5086 is not set
# CONFIG_SND_SOC_TAS571X is not set
# CONFIG_SND_SOC_TAS5720 is not set
# CONFIG_SND_SOC_TAS5805M is not set
# CONFIG_SND_SOC_TAS6424 is not set
# CONFIG_SND_SOC_TDA7419 is not set
# CONFIG_SND_SOC_TFA9879 is not set
# CONFIG_SND_SOC_TFA989X is not set
# CONFIG_SND_SOC_TLV320ADC3XXX is not set
# CONFIG_SND_SOC_TLV320AIC23_I2C is not set
# CONFIG_SND_SOC_TLV320AIC23_SPI is not set
# CONFIG_SND_SOC_TLV320AIC31XX is not set
# CONFIG_SND_SOC_TLV320AIC32X4_I2C is not set
# CONFIG_SND_SOC_TLV320AIC32X4_SPI is not set
# CONFIG_SND_SOC_TLV320AIC3X_I2C is not set
# CONFIG_SND_SOC_TLV320AIC3X_SPI is not set
# CONFIG_SND_SOC_TLV320ADCX140 is not set
# CONFIG_SND_SOC_TS3A227E is not set
# CONFIG_SND_SOC_TSCS42XX is not set
# CONFIG_SND_SOC_TSCS454 is not set
# CONFIG_SND_SOC_UDA1334 is not set
# CONFIG_SND_SOC_UDA1342 is not set
# CONFIG_SND_SOC_WCD937X_SDW is not set
# CONFIG_SND_SOC_WCD938X_SDW is not set
# CONFIG_SND_SOC_WCD939X_SDW is not set
# CONFIG_SND_SOC_WM8510 is not set
# CONFIG_SND_SOC_WM8523 is not set
# CONFIG_SND_SOC_WM8524 is not set
# CONFIG_SND_SOC_WM8580 is not set
# CONFIG_SND_SOC_WM8711 is not set
# CONFIG_SND_SOC_WM8728 is not set
# CONFIG_SND_SOC_WM8731_I2C is not set
# CONFIG_SND_SOC_WM8731_SPI is not set
# CONFIG_SND_SOC_WM8737 is not set
# CONFIG_SND_SOC_WM8741 is not set
# CONFIG_SND_SOC_WM8750 is not set
# CONFIG_SND_SOC_WM8753 is not set
# CONFIG_SND_SOC_WM8770 is not set
# CONFIG_SND_SOC_WM8776 is not set
# CONFIG_SND_SOC_WM8782 is not set
# CONFIG_SND_SOC_WM8804_I2C is not set
# CONFIG_SND_SOC_WM8804_SPI is not set
# CONFIG_SND_SOC_WM8903 is not set
# CONFIG_SND_SOC_WM8904 is not set
# CONFIG_SND_SOC_WM8940 is not set
# CONFIG_SND_SOC_WM8960 is not set
# CONFIG_SND_SOC_WM8961 is not set
# CONFIG_SND_SOC_WM8962 is not set
# CONFIG_SND_SOC_WM8974 is not set
# CONFIG_SND_SOC_WM8978 is not set
# CONFIG_SND_SOC_WM8985 is not set
# CONFIG_SND_SOC_WSA881X is not set
# CONFIG_SND_SOC_WSA883X is not set
# CONFIG_SND_SOC_WSA884X is not set
# CONFIG_SND_SOC_ZL38060 is not set
# CONFIG_SND_SOC_MAX9759 is not set
# CONFIG_SND_SOC_MT6351 is not set
# CONFIG_SND_SOC_MT6357 is not set
# CONFIG_SND_SOC_MT6358 is not set
# CONFIG_SND_SOC_MT6660 is not set
# CONFIG_SND_SOC_NAU8315 is not set
# CONFIG_SND_SOC_NAU8540 is not set
# CONFIG_SND_SOC_NAU8810 is not set
# CONFIG_SND_SOC_NAU8821 is not set
# CONFIG_SND_SOC_NAU8822 is not set
# CONFIG_SND_SOC_NAU8824 is not set
# CONFIG_SND_SOC_NTP8918 is not set
# CONFIG_SND_SOC_NTP8835 is not set
# CONFIG_SND_SOC_TPA6130A2 is not set
# CONFIG_SND_SOC_LPASS_WSA_MACRO is not set
# CONFIG_SND_SOC_LPASS_VA_MACRO is not set
# CONFIG_SND_SOC_LPASS_RX_MACRO is not set
# CONFIG_SND_SOC_LPASS_TX_MACRO is not set
# end of CODEC drivers

# CONFIG_SND_SIMPLE_CARD is not set
# CONFIG_SND_AUDIO_GRAPH_CARD is not set
# CONFIG_SND_AUDIO_GRAPH_CARD2 is not set
# CONFIG_SND_TEST_COMPONENT is not set
CONFIG_SND_X86=y
# CONFIG_HDMI_LPE_AUDIO is not set
CONFIG_SND_VIRTIO=y
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
CONFIG_HID_BATTERY_STRENGTH=y
CONFIG_HIDRAW=y
CONFIG_UHID=y
CONFIG_HID_GENERIC=y

#
# Special HID drivers
#
CONFIG_HID_A4TECH=y
CONFIG_HID_ACCUTOUCH=y
CONFIG_HID_ACRUX=y
CONFIG_HID_ACRUX_FF=y
CONFIG_HID_APPLE=y
CONFIG_HID_APPLEIR=y
# CONFIG_HID_APPLETB_BL is not set
# CONFIG_HID_APPLETB_KBD is not set
CONFIG_HID_ASUS=y
CONFIG_HID_AUREAL=y
CONFIG_HID_BELKIN=y
CONFIG_HID_BETOP_FF=y
CONFIG_HID_BIGBEN_FF=y
CONFIG_HID_CHERRY=y
CONFIG_HID_CHICONY=y
CONFIG_HID_CORSAIR=y
CONFIG_HID_COUGAR=y
CONFIG_HID_MACALLY=y
CONFIG_HID_PRODIKEYS=y
CONFIG_HID_CMEDIA=y
CONFIG_HID_CP2112=y
CONFIG_HID_CREATIVE_SB0540=y
CONFIG_HID_CYPRESS=y
CONFIG_HID_DRAGONRISE=y
CONFIG_DRAGONRISE_FF=y
CONFIG_HID_EMS_FF=y
CONFIG_HID_ELAN=y
CONFIG_HID_ELECOM=y
CONFIG_HID_ELO=y
CONFIG_HID_EVISION=y
CONFIG_HID_EZKEY=y
CONFIG_HID_FT260=y
CONFIG_HID_GEMBIRD=y
CONFIG_HID_GFRM=y
CONFIG_HID_GLORIOUS=y
CONFIG_HID_HOLTEK=y
CONFIG_HOLTEK_FF=y
CONFIG_HID_VIVALDI_COMMON=y
# CONFIG_HID_GOODIX_SPI is not set
CONFIG_HID_GOOGLE_STADIA_FF=y
CONFIG_HID_VIVALDI=y
CONFIG_HID_GT683R=y
CONFIG_HID_KEYTOUCH=y
CONFIG_HID_KYE=y
# CONFIG_HID_KYSONA is not set
CONFIG_HID_UCLOGIC=y
CONFIG_HID_WALTOP=y
CONFIG_HID_VIEWSONIC=y
CONFIG_HID_VRC2=y
CONFIG_HID_XIAOMI=y
CONFIG_HID_GYRATION=y
CONFIG_HID_ICADE=y
CONFIG_HID_ITE=y
CONFIG_HID_JABRA=y
CONFIG_HID_TWINHAN=y
CONFIG_HID_KENSINGTON=y
CONFIG_HID_LCPOWER=y
CONFIG_HID_LED=y
CONFIG_HID_LENOVO=y
CONFIG_HID_LETSKETCH=y
CONFIG_HID_LOGITECH=y
CONFIG_HID_LOGITECH_DJ=y
CONFIG_HID_LOGITECH_HIDPP=y
CONFIG_LOGITECH_FF=y
CONFIG_LOGIRUMBLEPAD2_FF=y
CONFIG_LOGIG940_FF=y
CONFIG_LOGIWHEELS_FF=y
CONFIG_HID_MAGICMOUSE=y
CONFIG_HID_MALTRON=y
CONFIG_HID_MAYFLASH=y
CONFIG_HID_MEGAWORLD_FF=y
CONFIG_HID_REDRAGON=y
CONFIG_HID_MICROSOFT=y
CONFIG_HID_MONTEREY=y
CONFIG_HID_MULTITOUCH=y
CONFIG_HID_NINTENDO=y
CONFIG_NINTENDO_FF=y
CONFIG_HID_NTI=y
CONFIG_HID_NTRIG=y
CONFIG_HID_NVIDIA_SHIELD=y
CONFIG_NVIDIA_SHIELD_FF=y
CONFIG_HID_ORTEK=y
CONFIG_HID_PANTHERLORD=y
CONFIG_PANTHERLORD_FF=y
CONFIG_HID_PENMOUNT=y
CONFIG_HID_PETALYNX=y
CONFIG_HID_PICOLCD=y
CONFIG_HID_PICOLCD_FB=y
CONFIG_HID_PICOLCD_BACKLIGHT=y
CONFIG_HID_PICOLCD_LCD=y
CONFIG_HID_PICOLCD_LEDS=y
CONFIG_HID_PICOLCD_CIR=y
CONFIG_HID_PLANTRONICS=y
CONFIG_HID_PLAYSTATION=y
CONFIG_PLAYSTATION_FF=y
CONFIG_HID_PXRC=y
CONFIG_HID_RAZER=y
CONFIG_HID_PRIMAX=y
CONFIG_HID_RETRODE=y
CONFIG_HID_ROCCAT=y
CONFIG_HID_SAITEK=y
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SEMITEK=y
CONFIG_HID_SIGMAMICRO=y
CONFIG_HID_SONY=y
CONFIG_SONY_FF=y
CONFIG_HID_SPEEDLINK=y
CONFIG_HID_STEAM=y
CONFIG_STEAM_FF=y
CONFIG_HID_STEELSERIES=y
CONFIG_HID_SUNPLUS=y
CONFIG_HID_RMI=y
CONFIG_HID_GREENASIA=y
CONFIG_GREENASIA_FF=y
CONFIG_HID_SMARTJOYPLUS=y
CONFIG_SMARTJOYPLUS_FF=y
CONFIG_HID_TIVO=y
CONFIG_HID_TOPSEED=y
CONFIG_HID_TOPRE=y
CONFIG_HID_THINGM=y
CONFIG_HID_THRUSTMASTER=y
CONFIG_THRUSTMASTER_FF=y
CONFIG_HID_UDRAW_PS3=y
CONFIG_HID_U2FZERO=y
# CONFIG_HID_UNIVERSAL_PIDFF is not set
CONFIG_HID_WACOM=y
CONFIG_HID_WIIMOTE=y
# CONFIG_HID_WINWING is not set
CONFIG_HID_XINMO=y
CONFIG_HID_ZEROPLUS=y
CONFIG_ZEROPLUS_FF=y
CONFIG_HID_ZYDACRON=y
CONFIG_HID_SENSOR_HUB=y
CONFIG_HID_SENSOR_CUSTOM_SENSOR=y
CONFIG_HID_ALPS=y
CONFIG_HID_MCP2200=y
CONFIG_HID_MCP2221=y
# end of Special HID drivers

#
# HID-BPF support
#
# end of HID-BPF support

CONFIG_I2C_HID=y
CONFIG_I2C_HID_ACPI=y
CONFIG_I2C_HID_OF=y
# CONFIG_I2C_HID_OF_ELAN is not set
# CONFIG_I2C_HID_OF_GOODIX is not set
CONFIG_I2C_HID_CORE=y

#
# Intel ISH HID support
#
CONFIG_INTEL_ISH_HID=y
CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER=y
# end of Intel ISH HID support

#
# AMD SFH HID Support
#
CONFIG_AMD_SFH_HID=y
# end of AMD SFH HID Support

#
# Surface System Aggregator Module HID support
#
CONFIG_SURFACE_HID=y
CONFIG_SURFACE_KBD=y
# end of Surface System Aggregator Module HID support

CONFIG_SURFACE_HID_CORE=y

#
# Intel THC HID Support
#
# CONFIG_INTEL_THC_HID is not set
# end of Intel THC HID Support

#
# USB HID support
#
CONFIG_USB_HID=y
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y
# end of USB HID support

CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_LED_TRIG=y
CONFIG_USB_ULPI_BUS=y
CONFIG_USB_CONN_GPIO=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
CONFIG_USB_PCI=y
CONFIG_USB_PCI_AMD=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DEFAULT_PERSIST=y
CONFIG_USB_FEW_INIT_RETRIES=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_OTG=y
# CONFIG_USB_OTG_PRODUCTLIST is not set
# CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set
CONFIG_USB_OTG_FSM=y
CONFIG_USB_LEDS_TRIGGER_USBPORT=y
CONFIG_USB_AUTOSUSPEND_DELAY=2
CONFIG_USB_DEFAULT_AUTHORIZATION_MODE=1
CONFIG_USB_MON=y

#
# USB Host Controller Drivers
#
CONFIG_USB_C67X00_HCD=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DBGCAP=y
CONFIG_USB_XHCI_PCI=y
CONFIG_USB_XHCI_PCI_RENESAS=y
CONFIG_USB_XHCI_PLATFORM=y
# CONFIG_USB_XHCI_SIDEBAND is not set
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
CONFIG_USB_EHCI_FSL=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OXU210HP_HCD=y
CONFIG_USB_ISP116X_HCD=y
CONFIG_USB_MAX3421_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PCI=y
# CONFIG_USB_OHCI_HCD_SSB is not set
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_SL811_HCD=y
CONFIG_USB_SL811_HCD_ISO=y
CONFIG_USB_SL811_CS=y
CONFIG_USB_R8A66597_HCD=y
CONFIG_USB_HCD_BCMA=y
CONFIG_USB_HCD_SSB=y
# CONFIG_USB_HCD_TEST_MODE is not set

#
# USB Device Class drivers
#
CONFIG_USB_ACM=y
CONFIG_USB_PRINTER=y
CONFIG_USB_WDM=y
CONFIG_USB_TMC=y

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
# CONFIG_USB_STORAGE_DEBUG is not set
CONFIG_USB_STORAGE_REALTEK=y
CONFIG_REALTEK_AUTOPM=y
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y
CONFIG_USB_STORAGE_USBAT=y
CONFIG_USB_STORAGE_SDDR09=y
CONFIG_USB_STORAGE_SDDR55=y
CONFIG_USB_STORAGE_JUMPSHOT=y
CONFIG_USB_STORAGE_ALAUDA=y
CONFIG_USB_STORAGE_ONETOUCH=y
CONFIG_USB_STORAGE_KARMA=y
CONFIG_USB_STORAGE_CYPRESS_ATACB=y
CONFIG_USB_STORAGE_ENE_UB6250=y
CONFIG_USB_UAS=y

#
# USB Imaging devices
#
CONFIG_USB_MDC800=y
CONFIG_USB_MICROTEK=y
CONFIG_USBIP_CORE=y
CONFIG_USBIP_VHCI_HCD=y
CONFIG_USBIP_VHCI_HC_PORTS=8
CONFIG_USBIP_VHCI_NR_HCS=16
CONFIG_USBIP_HOST=y
CONFIG_USBIP_VUDC=y
# CONFIG_USBIP_DEBUG is not set

#
# USB dual-mode controller drivers
#
CONFIG_USB_CDNS_SUPPORT=y
CONFIG_USB_CDNS_HOST=y
CONFIG_USB_CDNS3=y
CONFIG_USB_CDNS3_GADGET=y
CONFIG_USB_CDNS3_HOST=y
CONFIG_USB_CDNS3_PCI_WRAP=y
CONFIG_USB_CDNSP_PCI=y
CONFIG_USB_CDNSP_GADGET=y
CONFIG_USB_CDNSP_HOST=y
CONFIG_USB_MUSB_HDRC=y
# CONFIG_USB_MUSB_HOST is not set
# CONFIG_USB_MUSB_GADGET is not set
CONFIG_USB_MUSB_DUAL_ROLE=y

#
# Platform Glue Layer
#

#
# MUSB DMA mode
#
CONFIG_MUSB_PIO_ONLY=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_ULPI=y
# CONFIG_USB_DWC3_HOST is not set
CONFIG_USB_DWC3_GADGET=y
# CONFIG_USB_DWC3_DUAL_ROLE is not set

#
# Platform Glue Driver Support
#
CONFIG_USB_DWC3_PCI=y
CONFIG_USB_DWC3_HAPS=y
CONFIG_USB_DWC3_OF_SIMPLE=y
CONFIG_USB_DWC2=y
CONFIG_USB_DWC2_HOST=y

#
# Gadget/Dual-role mode requires USB Gadget support to be enabled
#
# CONFIG_USB_DWC2_PERIPHERAL is not set
# CONFIG_USB_DWC2_DUAL_ROLE is not set
CONFIG_USB_DWC2_PCI=y
# CONFIG_USB_DWC2_DEBUG is not set
# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_CHIPIDEA_PCI=y
CONFIG_USB_CHIPIDEA_MSM=y
CONFIG_USB_CHIPIDEA_NPCM=y
# CONFIG_USB_CHIPIDEA_IMX is not set
CONFIG_USB_CHIPIDEA_GENERIC=y
# CONFIG_USB_CHIPIDEA_TEGRA is not set
CONFIG_USB_ISP1760=y
CONFIG_USB_ISP1760_HCD=y
CONFIG_USB_ISP1761_UDC=y
# CONFIG_USB_ISP1760_HOST_ROLE is not set
# CONFIG_USB_ISP1760_GADGET_ROLE is not set
CONFIG_USB_ISP1760_DUAL_ROLE=y

#
# USB port drivers
#
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_CONSOLE=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_SIMPLE=y
CONFIG_USB_SERIAL_AIRCABLE=y
CONFIG_USB_SERIAL_ARK3116=y
CONFIG_USB_SERIAL_BELKIN=y
CONFIG_USB_SERIAL_CH341=y
CONFIG_USB_SERIAL_WHITEHEAT=y
CONFIG_USB_SERIAL_DIGI_ACCELEPORT=y
CONFIG_USB_SERIAL_CP210X=y
CONFIG_USB_SERIAL_CYPRESS_M8=y
CONFIG_USB_SERIAL_EMPEG=y
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_VISOR=y
CONFIG_USB_SERIAL_IPAQ=y
CONFIG_USB_SERIAL_IR=y
CONFIG_USB_SERIAL_EDGEPORT=y
CONFIG_USB_SERIAL_EDGEPORT_TI=y
CONFIG_USB_SERIAL_F81232=y
CONFIG_USB_SERIAL_F8153X=y
CONFIG_USB_SERIAL_GARMIN=y
CONFIG_USB_SERIAL_IPW=y
CONFIG_USB_SERIAL_IUU=y
CONFIG_USB_SERIAL_KEYSPAN_PDA=y
CONFIG_USB_SERIAL_KEYSPAN=y
CONFIG_USB_SERIAL_KLSI=y
CONFIG_USB_SERIAL_KOBIL_SCT=y
CONFIG_USB_SERIAL_MCT_U232=y
CONFIG_USB_SERIAL_METRO=y
CONFIG_USB_SERIAL_MOS7720=y
CONFIG_USB_SERIAL_MOS7715_PARPORT=y
CONFIG_USB_SERIAL_MOS7840=y
CONFIG_USB_SERIAL_MXUPORT=y
CONFIG_USB_SERIAL_NAVMAN=y
CONFIG_USB_SERIAL_PL2303=y
CONFIG_USB_SERIAL_OTI6858=y
CONFIG_USB_SERIAL_QCAUX=y
CONFIG_USB_SERIAL_QUALCOMM=y
CONFIG_USB_SERIAL_SPCP8X5=y
CONFIG_USB_SERIAL_SAFE=y
# CONFIG_USB_SERIAL_SAFE_PADDED is not set
CONFIG_USB_SERIAL_SIERRAWIRELESS=y
CONFIG_USB_SERIAL_SYMBOL=y
CONFIG_USB_SERIAL_TI=y
CONFIG_USB_SERIAL_CYBERJACK=y
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USB_SERIAL_OPTION=y
CONFIG_USB_SERIAL_OMNINET=y
CONFIG_USB_SERIAL_OPTICON=y
CONFIG_USB_SERIAL_XSENS_MT=y
CONFIG_USB_SERIAL_WISHBONE=y
CONFIG_USB_SERIAL_SSU100=y
CONFIG_USB_SERIAL_QT2=y
CONFIG_USB_SERIAL_UPD78F0730=y
CONFIG_USB_SERIAL_XR=y
CONFIG_USB_SERIAL_DEBUG=y

#
# USB Miscellaneous drivers
#
CONFIG_USB_USS720=y
CONFIG_USB_EMI62=y
CONFIG_USB_EMI26=y
CONFIG_USB_ADUTUX=y
CONFIG_USB_SEVSEG=y
CONFIG_USB_LEGOTOWER=y
CONFIG_USB_LCD=y
CONFIG_USB_CYPRESS_CY7C63=y
CONFIG_USB_CYTHERM=y
CONFIG_USB_IDMOUSE=y
CONFIG_USB_APPLEDISPLAY=y
CONFIG_APPLE_MFI_FASTCHARGE=y
CONFIG_USB_LJCA=y
CONFIG_USB_SISUSBVGA=y
CONFIG_USB_LD=y
CONFIG_USB_TRANCEVIBRATOR=y
CONFIG_USB_IOWARRIOR=y
CONFIG_USB_TEST=y
CONFIG_USB_EHSET_TEST_FIXTURE=y
CONFIG_USB_ISIGHTFW=y
CONFIG_USB_YUREX=y
CONFIG_USB_EZUSB_FX2=y
CONFIG_USB_HUB_USB251XB=y
CONFIG_USB_HSIC_USB3503=y
CONFIG_USB_HSIC_USB4604=y
CONFIG_USB_LINK_LAYER_TEST=y
CONFIG_USB_CHAOSKEY=y
# CONFIG_USB_ONBOARD_DEV is not set
CONFIG_USB_ATM=y
CONFIG_USB_SPEEDTOUCH=y
CONFIG_USB_CXACRU=y
CONFIG_USB_UEAGLEATM=y
CONFIG_USB_XUSBATM=y

#
# USB Physical Layer drivers
#
CONFIG_USB_PHY=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_TAHVO_USB=y
CONFIG_TAHVO_USB_HOST_BY_DEFAULT=y
CONFIG_USB_ISP1301=y
# end of USB Physical Layer drivers

CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_DEBUG is not set
CONFIG_USB_GADGET_DEBUG_FILES=y
CONFIG_USB_GADGET_DEBUG_FS=y
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
CONFIG_U_SERIAL_CONSOLE=y

#
# USB Peripheral Controller
#
CONFIG_USB_GR_UDC=y
CONFIG_USB_R8A66597=y
CONFIG_USB_PXA27X=y
CONFIG_USB_SNP_CORE=y
# CONFIG_USB_SNP_UDC_PLAT is not set
# CONFIG_USB_M66592 is not set
CONFIG_USB_BDC_UDC=y
CONFIG_USB_AMD5536UDC=y
CONFIG_USB_NET2280=y
CONFIG_USB_GOKU=y
CONFIG_USB_EG20T=y
# CONFIG_USB_GADGET_XILINX is not set
CONFIG_USB_MAX3420_UDC=y
CONFIG_USB_CDNS2_UDC=y
CONFIG_USB_DUMMY_HCD=y
# end of USB Peripheral Controller

CONFIG_USB_LIBCOMPOSITE=y
CONFIG_USB_F_ACM=y
CONFIG_USB_F_SS_LB=y
CONFIG_USB_U_SERIAL=y
CONFIG_USB_U_ETHER=y
CONFIG_USB_U_AUDIO=y
CONFIG_USB_F_SERIAL=y
CONFIG_USB_F_OBEX=y
CONFIG_USB_F_NCM=y
CONFIG_USB_F_ECM=y
CONFIG_USB_F_PHONET=y
CONFIG_USB_F_EEM=y
CONFIG_USB_F_SUBSET=y
CONFIG_USB_F_RNDIS=y
CONFIG_USB_F_MASS_STORAGE=y
CONFIG_USB_F_FS=y
CONFIG_USB_F_UAC1=y
CONFIG_USB_F_UAC1_LEGACY=y
CONFIG_USB_F_UAC2=y
CONFIG_USB_F_UVC=y
CONFIG_USB_F_MIDI=y
CONFIG_USB_F_MIDI2=y
CONFIG_USB_F_HID=y
CONFIG_USB_F_PRINTER=y
CONFIG_USB_F_TCM=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_PHONET=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_UAC1=y
CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=y
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_MIDI2=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_UVC=y
CONFIG_USB_CONFIGFS_F_PRINTER=y
CONFIG_USB_CONFIGFS_F_TCM=y

#
# USB Gadget precomposed configurations
#
# CONFIG_USB_ZERO is not set
# CONFIG_USB_AUDIO is not set
# CONFIG_USB_ETH is not set
# CONFIG_USB_G_NCM is not set
CONFIG_USB_GADGETFS=y
# CONFIG_USB_FUNCTIONFS is not set
# CONFIG_USB_MASS_STORAGE is not set
# CONFIG_USB_GADGET_TARGET is not set
# CONFIG_USB_G_SERIAL is not set
# CONFIG_USB_MIDI_GADGET is not set
# CONFIG_USB_G_PRINTER is not set
# CONFIG_USB_CDC_COMPOSITE is not set
# CONFIG_USB_G_NOKIA is not set
# CONFIG_USB_G_ACM_MS is not set
# CONFIG_USB_G_MULTI is not set
# CONFIG_USB_G_HID is not set
# CONFIG_USB_G_DBGP is not set
# CONFIG_USB_G_WEBCAM is not set
CONFIG_USB_RAW_GADGET=y
# end of USB Gadget precomposed configurations

CONFIG_TYPEC=y
CONFIG_TYPEC_TCPM=y
CONFIG_TYPEC_TCPCI=y
CONFIG_TYPEC_RT1711H=y
CONFIG_TYPEC_MT6360=y
CONFIG_TYPEC_TCPCI_MT6370=y
CONFIG_TYPEC_TCPCI_MAXIM=y
CONFIG_TYPEC_FUSB302=y
CONFIG_TYPEC_WCOVE=y
CONFIG_TYPEC_UCSI=y
CONFIG_UCSI_CCG=y
CONFIG_UCSI_ACPI=y
CONFIG_UCSI_STM32G0=y
CONFIG_TYPEC_TPS6598X=y
CONFIG_TYPEC_ANX7411=y
CONFIG_TYPEC_RT1719=y
CONFIG_TYPEC_HD3SS3220=y
CONFIG_TYPEC_STUSB160X=y
CONFIG_TYPEC_WUSB3801=y

#
# USB Type-C Multiplexer/DeMultiplexer Switch support
#
CONFIG_TYPEC_MUX_FSA4480=y
CONFIG_TYPEC_MUX_GPIO_SBU=y
CONFIG_TYPEC_MUX_PI3USB30532=y
CONFIG_TYPEC_MUX_INTEL_PMC=y
# CONFIG_TYPEC_MUX_IT5205 is not set
CONFIG_TYPEC_MUX_NB7VPQ904M=y
# CONFIG_TYPEC_MUX_PS883X is not set
CONFIG_TYPEC_MUX_PTN36502=y
# CONFIG_TYPEC_MUX_TUSB1046 is not set
CONFIG_TYPEC_MUX_WCD939X_USBSS=y
# end of USB Type-C Multiplexer/DeMultiplexer Switch support

#
# USB Type-C Alternate Mode drivers
#
CONFIG_TYPEC_DP_ALTMODE=y
CONFIG_TYPEC_NVIDIA_ALTMODE=y
# CONFIG_TYPEC_TBT_ALTMODE is not set
# end of USB Type-C Alternate Mode drivers

CONFIG_USB_ROLE_SWITCH=y
CONFIG_USB_ROLES_INTEL_XHCI=y
CONFIG_MMC=y
# CONFIG_PWRSEQ_EMMC is not set
# CONFIG_PWRSEQ_SD8787 is not set
# CONFIG_PWRSEQ_SIMPLE is not set
# CONFIG_MMC_BLOCK is not set
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set
# CONFIG_MMC_CRYPTO is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_WBSD is not set
# CONFIG_MMC_TIFM_SD is not set
# CONFIG_MMC_SPI is not set
# CONFIG_MMC_SDRICOH_CS is not set
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
CONFIG_MMC_VUB300=y
CONFIG_MMC_USHC=y
# CONFIG_MMC_USDHI6ROL0 is not set
CONFIG_MMC_REALTEK_USB=y
# CONFIG_MMC_CQHCI is not set
# CONFIG_MMC_HSQ is not set
# CONFIG_MMC_TOSHIBA_PCI is not set
# CONFIG_MMC_MTK is not set
# CONFIG_SCSI_UFSHCD is not set
CONFIG_MEMSTICK=y
# CONFIG_MEMSTICK_DEBUG is not set

#
# MemoryStick drivers
#
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
# CONFIG_MSPRO_BLOCK is not set
# CONFIG_MS_BLOCK is not set

#
# MemoryStick Host Controller Drivers
#
# CONFIG_MEMSTICK_TIFM_MS is not set
# CONFIG_MEMSTICK_JMICRON_38X is not set
# CONFIG_MEMSTICK_R592 is not set
CONFIG_MEMSTICK_REALTEK_USB=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
# CONFIG_LEDS_CLASS_FLASH is not set
CONFIG_LEDS_CLASS_MULTICOLOR=y
# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set

#
# LED drivers
#
# CONFIG_LEDS_AN30259A is not set
# CONFIG_LEDS_APU is not set
# CONFIG_LEDS_AW200XX is not set
# CONFIG_LEDS_AW2013 is not set
# CONFIG_LEDS_BCM6328 is not set
# CONFIG_LEDS_BCM6358 is not set
# CONFIG_LEDS_CHT_WCOVE is not set
# CONFIG_LEDS_CR0014114 is not set
# CONFIG_LEDS_EL15203000 is not set
# CONFIG_LEDS_LM3530 is not set
# CONFIG_LEDS_LM3532 is not set
# CONFIG_LEDS_LM3642 is not set
# CONFIG_LEDS_LM3692X is not set
# CONFIG_LEDS_PCA9532 is not set
# CONFIG_LEDS_GPIO is not set
# CONFIG_LEDS_LP3944 is not set
# CONFIG_LEDS_LP3952 is not set
# CONFIG_LEDS_LP50XX is not set
# CONFIG_LEDS_LP55XX_COMMON is not set
# CONFIG_LEDS_LP8860 is not set
# CONFIG_LEDS_LP8864 is not set
# CONFIG_LEDS_PCA955X is not set
# CONFIG_LEDS_PCA963X is not set
# CONFIG_LEDS_PCA995X is not set
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_REGULATOR is not set
# CONFIG_LEDS_BD2606MVV is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_INTEL_SS4200 is not set
# CONFIG_LEDS_LT3593 is not set
# CONFIG_LEDS_TCA6507 is not set
# CONFIG_LEDS_TLC591XX is not set
# CONFIG_LEDS_LM355x is not set
# CONFIG_LEDS_IS31FL319X is not set
# CONFIG_LEDS_IS31FL32XX is not set

#
# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)
#
# CONFIG_LEDS_BLINKM is not set
# CONFIG_LEDS_SYSCON is not set
# CONFIG_LEDS_MLXCPLD is not set
# CONFIG_LEDS_MLXREG is not set
# CONFIG_LEDS_USER is not set
# CONFIG_LEDS_NIC78BX is not set
# CONFIG_LEDS_SPI_BYTE is not set
# CONFIG_LEDS_LM3697 is not set
# CONFIG_LEDS_ST1202 is not set
# CONFIG_LEDS_LGM is not set

#
# Flash and Torch LED drivers
#

#
# RGB LED drivers
#
# CONFIG_LEDS_GROUP_MULTICOLOR is not set
# CONFIG_LEDS_KTD202X is not set
# CONFIG_LEDS_NCP5623 is not set
# CONFIG_LEDS_MT6370_RGB is not set

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
# CONFIG_LEDS_TRIGGER_TIMER is not set
# CONFIG_LEDS_TRIGGER_ONESHOT is not set
# CONFIG_LEDS_TRIGGER_DISK is not set
# CONFIG_LEDS_TRIGGER_MTD is not set
# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
# CONFIG_LEDS_TRIGGER_CPU is not set
# CONFIG_LEDS_TRIGGER_ACTIVITY is not set
# CONFIG_LEDS_TRIGGER_GPIO is not set
# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
# CONFIG_LEDS_TRIGGER_CAMERA is not set
# CONFIG_LEDS_TRIGGER_PANIC is not set
# CONFIG_LEDS_TRIGGER_NETDEV is not set
# CONFIG_LEDS_TRIGGER_PATTERN is not set
# CONFIG_LEDS_TRIGGER_TTY is not set
# CONFIG_LEDS_TRIGGER_INPUT_EVENTS is not set

#
# Simatic LED drivers
#
# CONFIG_ACCESSIBILITY is not set
CONFIG_INFINIBAND=y
CONFIG_INFINIBAND_USER_MAD=y
CONFIG_INFINIBAND_USER_ACCESS=y
CONFIG_INFINIBAND_USER_MEM=y
CONFIG_INFINIBAND_ON_DEMAND_PAGING=y
CONFIG_INFINIBAND_ADDR_TRANS=y
CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS=y
CONFIG_INFINIBAND_VIRT_DMA=y
# CONFIG_INFINIBAND_EFA is not set
# CONFIG_INFINIBAND_ERDMA is not set
CONFIG_MLX4_INFINIBAND=y
# CONFIG_INFINIBAND_MTHCA is not set
# CONFIG_INFINIBAND_OCRDMA is not set
# CONFIG_INFINIBAND_USNIC is not set
# CONFIG_INFINIBAND_VMWARE_PVRDMA is not set
# CONFIG_INFINIBAND_RDMAVT is not set
CONFIG_RDMA_RXE=y
CONFIG_RDMA_SIW=y
CONFIG_INFINIBAND_IPOIB=y
CONFIG_INFINIBAND_IPOIB_CM=y
CONFIG_INFINIBAND_IPOIB_DEBUG=y
# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
CONFIG_INFINIBAND_SRP=y
# CONFIG_INFINIBAND_SRPT is not set
CONFIG_INFINIBAND_ISER=y
CONFIG_INFINIBAND_RTRS=y
CONFIG_INFINIBAND_RTRS_CLIENT=y
# CONFIG_INFINIBAND_RTRS_SERVER is not set
# CONFIG_INFINIBAND_OPA_VNIC is not set
CONFIG_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_SUPPORT=y
CONFIG_EDAC=y
# CONFIG_EDAC_LEGACY_SYSFS is not set
# CONFIG_EDAC_DEBUG is not set
# CONFIG_EDAC_DECODE_MCE is not set
# CONFIG_EDAC_SCRUB is not set
# CONFIG_EDAC_ECS is not set
# CONFIG_EDAC_MEM_REPAIR is not set
# CONFIG_EDAC_E752X is not set
# CONFIG_EDAC_I82975X is not set
# CONFIG_EDAC_I3000 is not set
# CONFIG_EDAC_I3200 is not set
# CONFIG_EDAC_IE31200 is not set
# CONFIG_EDAC_X38 is not set
# CONFIG_EDAC_I5400 is not set
# CONFIG_EDAC_I7CORE is not set
# CONFIG_EDAC_I5100 is not set
# CONFIG_EDAC_I7300 is not set
# CONFIG_EDAC_SBRIDGE is not set
# CONFIG_EDAC_SKX is not set
# CONFIG_EDAC_I10NM is not set
# CONFIG_EDAC_PND2 is not set
# CONFIG_EDAC_IGEN6 is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_MC146818_LIB=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
CONFIG_RTC_SYSTOHC=y
CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set
# CONFIG_RTC_NVMEM is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_ABB5ZES3 is not set
# CONFIG_RTC_DRV_ABEOZ9 is not set
# CONFIG_RTC_DRV_ABX80X is not set
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_HYM8563 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_MAX31335 is not set
# CONFIG_RTC_DRV_NCT3018Y is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_ISL12026 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8523 is not set
# CONFIG_RTC_DRV_PCF85063 is not set
# CONFIG_RTC_DRV_PCF85363 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_TWL4030 is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8010 is not set
# CONFIG_RTC_DRV_RX8111 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3028 is not set
# CONFIG_RTC_DRV_RV3032 is not set
# CONFIG_RTC_DRV_RV8803 is not set
# CONFIG_RTC_DRV_SD2405AL is not set
# CONFIG_RTC_DRV_SD3078 is not set

#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_M41T93 is not set
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1302 is not set
# CONFIG_RTC_DRV_DS1305 is not set
# CONFIG_RTC_DRV_DS1343 is not set
# CONFIG_RTC_DRV_DS1347 is not set
# CONFIG_RTC_DRV_DS1390 is not set
# CONFIG_RTC_DRV_MAX6916 is not set
# CONFIG_RTC_DRV_R9701 is not set
# CONFIG_RTC_DRV_RX4581 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_PCF2123 is not set
# CONFIG_RTC_DRV_MCP795 is not set
CONFIG_RTC_I2C_AND_SPI=y

#
# SPI and I2C RTC drivers
#
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_PCF2127 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set
# CONFIG_RTC_DRV_RX6110 is not set

#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1685_FAMILY is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_DS2404 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_ZYNQMP is not set

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_CADENCE is not set
# CONFIG_RTC_DRV_FTRTC010 is not set
# CONFIG_RTC_DRV_R7301 is not set

#
# HID Sensor RTC drivers
#
CONFIG_RTC_DRV_HID_SENSOR_TIME=y
# CONFIG_RTC_DRV_GOLDFISH is not set
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set

#
# DMA Devices
#
CONFIG_DMA_ENGINE=y
CONFIG_DMA_VIRTUAL_CHANNELS=y
CONFIG_DMA_ACPI=y
CONFIG_DMA_OF=y
# CONFIG_ALTERA_MSGDMA is not set
# CONFIG_DW_AXI_DMAC is not set
# CONFIG_FSL_EDMA is not set
CONFIG_INTEL_IDMA64=y
# CONFIG_INTEL_IDXD is not set
# CONFIG_INTEL_IDXD_COMPAT is not set
CONFIG_INTEL_IOATDMA=y
# CONFIG_PLX_DMA is not set
# CONFIG_XILINX_DMA is not set
# CONFIG_XILINX_XDMA is not set
# CONFIG_XILINX_ZYNQMP_DPDMA is not set
# CONFIG_AMD_PTDMA is not set
# CONFIG_AMD_QDMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_HIDMA is not set
CONFIG_DW_DMAC_CORE=y
# CONFIG_DW_DMAC is not set
# CONFIG_DW_DMAC_PCI is not set
# CONFIG_DW_EDMA is not set
CONFIG_HSU_DMA=y
# CONFIG_SF_PDMA is not set
# CONFIG_INTEL_LDMA is not set

#
# DMA Clients
#
CONFIG_ASYNC_TX_DMA=y
# CONFIG_DMATEST is not set
CONFIG_DMA_ENGINE_RAID=y

#
# DMABUF options
#
CONFIG_SYNC_FILE=y
CONFIG_SW_SYNC=y
CONFIG_UDMABUF=y
CONFIG_DMABUF_MOVE_NOTIFY=y
# CONFIG_DMABUF_DEBUG is not set
# CONFIG_DMABUF_SELFTESTS is not set
CONFIG_DMABUF_HEAPS=y
# CONFIG_DMABUF_SYSFS_STATS is not set
CONFIG_DMABUF_HEAPS_SYSTEM=y
CONFIG_DMABUF_HEAPS_CMA=y
# end of DMABUF options

CONFIG_DCA=y
# CONFIG_UIO is not set
CONFIG_VFIO=y
CONFIG_VFIO_DEVICE_CDEV=y
# CONFIG_VFIO_GROUP is not set
CONFIG_VFIO_VIRQFD=y
# CONFIG_VFIO_DEBUGFS is not set

#
# VFIO support for PCI devices
#
CONFIG_VFIO_PCI_CORE=y
CONFIG_VFIO_PCI_INTX=y
CONFIG_VFIO_PCI=y
# CONFIG_VFIO_PCI_VGA is not set
# CONFIG_VFIO_PCI_IGD is not set
# CONFIG_VIRTIO_VFIO_PCI is not set
# end of VFIO support for PCI devices

CONFIG_IRQ_BYPASS_MANAGER=y
# CONFIG_VIRT_DRIVERS is not set
CONFIG_VIRTIO_ANCHOR=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI_LIB=y
CONFIG_VIRTIO_PCI_LIB_LEGACY=y
CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_ADMIN_LEGACY=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_VDPA=y
CONFIG_VIRTIO_PMEM=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_MEM=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_VIRTIO_DMA_SHARED_BUFFER=y
# CONFIG_VIRTIO_DEBUG is not set
# CONFIG_VIRTIO_RTC is not set
CONFIG_VDPA=y
CONFIG_VDPA_SIM=y
CONFIG_VDPA_SIM_NET=y
CONFIG_VDPA_SIM_BLOCK=y
# CONFIG_IFCVF is not set
# CONFIG_MLX5_VDPA_STEERING_DEBUG is not set
CONFIG_VP_VDPA=y
# CONFIG_ALIBABA_ENI_VDPA is not set
# CONFIG_SNET_VDPA is not set
# CONFIG_OCTEONEP_VDPA is not set
CONFIG_VHOST_IOTLB=y
CONFIG_VHOST_RING=y
CONFIG_VHOST_TASK=y
CONFIG_VHOST=y
CONFIG_VHOST_MENU=y
CONFIG_VHOST_NET=y
# CONFIG_VHOST_SCSI is not set
CONFIG_VHOST_VSOCK=y
CONFIG_VHOST_VDPA=y
CONFIG_VHOST_CROSS_ENDIAN_LEGACY=y

#
# Microsoft Hyper-V guest support
#
# CONFIG_HYPERV is not set
# end of Microsoft Hyper-V guest support

CONFIG_GREYBUS=y
# CONFIG_GREYBUS_BEAGLEPLAY is not set
CONFIG_GREYBUS_ES2=y
CONFIG_COMEDI=y
# CONFIG_COMEDI_DEBUG is not set
CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048
CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480
CONFIG_COMEDI_MISC_DRIVERS=y
CONFIG_COMEDI_BOND=y
CONFIG_COMEDI_TEST=y
CONFIG_COMEDI_PARPORT=y
CONFIG_COMEDI_ISA_DRIVERS=y
CONFIG_COMEDI_PCL711=y
CONFIG_COMEDI_PCL724=y
CONFIG_COMEDI_PCL726=y
CONFIG_COMEDI_PCL730=y
CONFIG_COMEDI_PCL812=y
CONFIG_COMEDI_PCL816=y
CONFIG_COMEDI_PCL818=y
CONFIG_COMEDI_PCM3724=y
CONFIG_COMEDI_AMPLC_DIO200_ISA=y
CONFIG_COMEDI_AMPLC_PC236_ISA=y
CONFIG_COMEDI_AMPLC_PC263_ISA=y
CONFIG_COMEDI_RTI800=y
CONFIG_COMEDI_RTI802=y
CONFIG_COMEDI_DAC02=y
CONFIG_COMEDI_DAS16M1=y
CONFIG_COMEDI_DAS08_ISA=y
# CONFIG_COMEDI_DAS16 is not set
CONFIG_COMEDI_DAS800=y
CONFIG_COMEDI_DAS1800=y
CONFIG_COMEDI_DAS6402=y
CONFIG_COMEDI_DT2801=y
CONFIG_COMEDI_DT2811=y
CONFIG_COMEDI_DT2814=y
CONFIG_COMEDI_DT2815=y
CONFIG_COMEDI_DT2817=y
CONFIG_COMEDI_DT282X=y
CONFIG_COMEDI_DMM32AT=y
CONFIG_COMEDI_FL512=y
CONFIG_COMEDI_AIO_AIO12_8=y
CONFIG_COMEDI_AIO_IIRO_16=y
# CONFIG_COMEDI_II_PCI20KC is not set
CONFIG_COMEDI_C6XDIGIO=y
CONFIG_COMEDI_MPC624=y
CONFIG_COMEDI_ADQ12B=y
CONFIG_COMEDI_NI_AT_A2150=y
CONFIG_COMEDI_NI_AT_AO=y
# CONFIG_COMEDI_NI_ATMIO is not set
CONFIG_COMEDI_NI_ATMIO16D=y
CONFIG_COMEDI_NI_LABPC_ISA=y
CONFIG_COMEDI_PCMAD=y
CONFIG_COMEDI_PCMDA12=y
CONFIG_COMEDI_PCMMIO=y
CONFIG_COMEDI_PCMUIO=y
CONFIG_COMEDI_MULTIQ3=y
CONFIG_COMEDI_S526=y
CONFIG_COMEDI_PCI_DRIVERS=y
CONFIG_COMEDI_8255_PCI=y
# CONFIG_COMEDI_ADDI_APCI_1032 is not set
# CONFIG_COMEDI_ADDI_APCI_1500 is not set
# CONFIG_COMEDI_ADDI_APCI_1516 is not set
# CONFIG_COMEDI_ADDI_APCI_1564 is not set
# CONFIG_COMEDI_ADDI_APCI_16XX is not set
# CONFIG_COMEDI_ADDI_APCI_2032 is not set
# CONFIG_COMEDI_ADDI_APCI_2200 is not set
# CONFIG_COMEDI_ADDI_APCI_3120 is not set
# CONFIG_COMEDI_ADDI_APCI_3501 is not set
# CONFIG_COMEDI_ADDI_APCI_3XXX is not set
# CONFIG_COMEDI_ADL_PCI6208 is not set
# CONFIG_COMEDI_ADL_PCI7X3X is not set
# CONFIG_COMEDI_ADL_PCI8164 is not set
# CONFIG_COMEDI_ADL_PCI9111 is not set
CONFIG_COMEDI_ADL_PCI9118=y
# CONFIG_COMEDI_ADV_PCI1710 is not set
# CONFIG_COMEDI_ADV_PCI1720 is not set
# CONFIG_COMEDI_ADV_PCI1723 is not set
# CONFIG_COMEDI_ADV_PCI1724 is not set
# CONFIG_COMEDI_ADV_PCI1760 is not set
# CONFIG_COMEDI_ADV_PCI_DIO is not set
# CONFIG_COMEDI_AMPLC_DIO200_PCI is not set
# CONFIG_COMEDI_AMPLC_PC236_PCI is not set
# CONFIG_COMEDI_AMPLC_PC263_PCI is not set
# CONFIG_COMEDI_AMPLC_PCI224 is not set
# CONFIG_COMEDI_AMPLC_PCI230 is not set
# CONFIG_COMEDI_CONTEC_PCI_DIO is not set
# CONFIG_COMEDI_DAS08_PCI is not set
# CONFIG_COMEDI_DT3000 is not set
# CONFIG_COMEDI_DYNA_PCI10XX is not set
# CONFIG_COMEDI_GSC_HPDI is not set
# CONFIG_COMEDI_MF6X4 is not set
# CONFIG_COMEDI_ICP_MULTI is not set
# CONFIG_COMEDI_DAQBOARD2000 is not set
# CONFIG_COMEDI_JR3_PCI is not set
# CONFIG_COMEDI_KE_COUNTER is not set
# CONFIG_COMEDI_CB_PCIDAS64 is not set
# CONFIG_COMEDI_CB_PCIDAS is not set
# CONFIG_COMEDI_CB_PCIDDA is not set
# CONFIG_COMEDI_CB_PCIMDAS is not set
# CONFIG_COMEDI_CB_PCIMDDA is not set
# CONFIG_COMEDI_ME4000 is not set
# CONFIG_COMEDI_ME_DAQ is not set
# CONFIG_COMEDI_NI_6527 is not set
# CONFIG_COMEDI_NI_65XX is not set
# CONFIG_COMEDI_NI_660X is not set
# CONFIG_COMEDI_NI_670X is not set
CONFIG_COMEDI_NI_LABPC_PCI=y
# CONFIG_COMEDI_NI_PCIDIO is not set
# CONFIG_COMEDI_NI_PCIMIO is not set
# CONFIG_COMEDI_RTD520 is not set
# CONFIG_COMEDI_S626 is not set
CONFIG_COMEDI_PCMCIA_DRIVERS=y
# CONFIG_COMEDI_CB_DAS16_CS is not set
# CONFIG_COMEDI_DAS08_CS is not set
CONFIG_COMEDI_NI_DAQ_700_CS=y
# CONFIG_COMEDI_NI_DAQ_DIO24_CS is not set
CONFIG_COMEDI_NI_LABPC_CS=y
# CONFIG_COMEDI_NI_MIO_CS is not set
# CONFIG_COMEDI_QUATECH_DAQP_CS is not set
CONFIG_COMEDI_USB_DRIVERS=y
CONFIG_COMEDI_DT9812=y
CONFIG_COMEDI_NI_USB6501=y
CONFIG_COMEDI_USBDUX=y
CONFIG_COMEDI_USBDUXFAST=y
CONFIG_COMEDI_USBDUXSIGMA=y
CONFIG_COMEDI_VMK80XX=y
CONFIG_COMEDI_8254=y
CONFIG_COMEDI_8255=y
CONFIG_COMEDI_8255_SA=y
CONFIG_COMEDI_KCOMEDILIB=y
CONFIG_COMEDI_AMPLC_DIO200=y
CONFIG_COMEDI_AMPLC_PC236=y
CONFIG_COMEDI_DAS08=y
CONFIG_COMEDI_ISADMA=y
CONFIG_COMEDI_NI_LABPC=y
CONFIG_COMEDI_NI_LABPC_ISADMA=y
# CONFIG_COMEDI_TESTS is not set
CONFIG_STAGING=y
# CONFIG_RTL8723BS is not set

#
# IIO staging drivers
#

#
# Accelerometers
#
# CONFIG_ADIS16203 is not set
# end of Accelerometers

#
# Analog to digital converters
#
# CONFIG_AD7816 is not set
# end of Analog to digital converters

#
# Analog digital bi-direction converters
#
# CONFIG_ADT7316 is not set
# end of Analog digital bi-direction converters

#
# Direct Digital Synthesis
#
# CONFIG_AD9832 is not set
# CONFIG_AD9834 is not set
# end of Direct Digital Synthesis

#
# Network Analyzer, Impedance Converters
#
# CONFIG_AD5933 is not set
# end of Network Analyzer, Impedance Converters
# end of IIO staging drivers

# CONFIG_FB_SM750 is not set
# CONFIG_STAGING_MEDIA is not set
# CONFIG_FB_TFT is not set
# CONFIG_MOST_COMPONENTS is not set
# CONFIG_GREYBUS_AUDIO is not set
# CONFIG_GREYBUS_BOOTROM is not set
# CONFIG_GREYBUS_FIRMWARE is not set
CONFIG_GREYBUS_HID=y
# CONFIG_GREYBUS_LOG is not set
# CONFIG_GREYBUS_LOOPBACK is not set
# CONFIG_GREYBUS_POWER is not set
# CONFIG_GREYBUS_RAW is not set
# CONFIG_GREYBUS_VIBRATOR is not set
CONFIG_GREYBUS_BRIDGED_PHY=y
# CONFIG_GREYBUS_GPIO is not set
# CONFIG_GREYBUS_I2C is not set
# CONFIG_GREYBUS_SDIO is not set
# CONFIG_GREYBUS_SPI is not set
# CONFIG_GREYBUS_UART is not set
CONFIG_GREYBUS_USB=y
# CONFIG_XIL_AXIS_FIFO is not set
# CONFIG_VME_BUS is not set
# CONFIG_GPIB is not set
# CONFIG_GOLDFISH is not set
# CONFIG_CHROME_PLATFORMS is not set
# CONFIG_MELLANOX_PLATFORM is not set
CONFIG_SURFACE_PLATFORMS=y
# CONFIG_SURFACE3_WMI is not set
# CONFIG_SURFACE_3_POWER_OPREGION is not set
# CONFIG_SURFACE_ACPI_NOTIFY is not set
# CONFIG_SURFACE_AGGREGATOR_CDEV is not set
# CONFIG_SURFACE_AGGREGATOR_HUB is not set
CONFIG_SURFACE_AGGREGATOR_REGISTRY=y
# CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH is not set
# CONFIG_SURFACE_DTX is not set
# CONFIG_SURFACE_GPE is not set
# CONFIG_SURFACE_HOTPLUG is not set
# CONFIG_SURFACE_PLATFORM_PROFILE is not set
# CONFIG_SURFACE_PRO3_BUTTON is not set
CONFIG_SURFACE_AGGREGATOR=y
CONFIG_SURFACE_AGGREGATOR_BUS=y
CONFIG_X86_PLATFORM_DEVICES=y
CONFIG_ACPI_WMI=y
CONFIG_WMI_BMOF=y
# CONFIG_HUAWEI_WMI is not set
# CONFIG_MXM_WMI is not set
# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set
# CONFIG_XIAOMI_WMI is not set
# CONFIG_GIGABYTE_WMI is not set
# CONFIG_YOGABOOK is not set
# CONFIG_YT2_1380 is not set
# CONFIG_ACERHDF is not set
# CONFIG_ACER_WIRELESS is not set
# CONFIG_ACER_WMI is not set

#
# AMD HSMP Driver
#
# CONFIG_AMD_HSMP_ACPI is not set
# CONFIG_AMD_HSMP_PLAT is not set
# end of AMD HSMP Driver

# CONFIG_AMD_PMC is not set
# CONFIG_AMD_3D_VCACHE is not set
# CONFIG_AMD_WBRF is not set
# CONFIG_AMD_ISP_PLATFORM is not set
# CONFIG_ADV_SWBUTTON is not set
# CONFIG_APPLE_GMUX is not set
# CONFIG_ASUS_LAPTOP is not set
# CONFIG_ASUS_WIRELESS is not set
CONFIG_ASUS_WMI=y
# CONFIG_ASUS_NB_WMI is not set
CONFIG_ASUS_TF103C_DOCK=y
CONFIG_EEEPC_LAPTOP=y
# CONFIG_EEEPC_WMI is not set
# CONFIG_X86_PLATFORM_DRIVERS_DELL is not set
# CONFIG_AMILO_RFKILL is not set
# CONFIG_FUJITSU_LAPTOP is not set
# CONFIG_FUJITSU_TABLET is not set
# CONFIG_GPD_POCKET_FAN is not set
# CONFIG_X86_PLATFORM_DRIVERS_HP is not set
# CONFIG_WIRELESS_HOTKEY is not set
# CONFIG_IBM_RTL is not set
# CONFIG_IDEAPAD_LAPTOP is not set
# CONFIG_LENOVO_WMI_HOTKEY_UTILITIES is not set
# CONFIG_SENSORS_HDAPS is not set
# CONFIG_THINKPAD_ACPI is not set
# CONFIG_THINKPAD_LMI is not set
# CONFIG_INTEL_ATOMISP2_PM is not set
# CONFIG_INTEL_IFS is not set
# CONFIG_INTEL_SAR_INT1092 is not set
# CONFIG_INTEL_SKL_INT3472 is not set

#
# Intel Speed Select Technology interface support
#
# CONFIG_INTEL_SPEED_SELECT_INTERFACE is not set
# end of Intel Speed Select Technology interface support

# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set
# CONFIG_INTEL_WMI_THUNDERBOLT is not set

#
# Intel Uncore Frequency Control
#
# CONFIG_INTEL_UNCORE_FREQ_CONTROL is not set
# end of Intel Uncore Frequency Control

# CONFIG_INTEL_HID_EVENT is not set
# CONFIG_INTEL_VBTN is not set
# CONFIG_INTEL_INT0002_VGPIO is not set
# CONFIG_INTEL_OAKTRAIL is not set
# CONFIG_INTEL_BXTWC_PMIC_TMU is not set
CONFIG_INTEL_CHTWC_INT33FE=y
CONFIG_INTEL_ISHTP_ECLITE=y
# CONFIG_INTEL_PUNIT_IPC is not set
# CONFIG_INTEL_RST is not set
# CONFIG_INTEL_SMARTCONNECT is not set
# CONFIG_INTEL_TURBO_MAX_3 is not set
# CONFIG_INTEL_VSEC is not set
# CONFIG_ACPI_QUICKSTART is not set
# CONFIG_MEEGOPAD_ANX7428 is not set
# CONFIG_MSI_EC is not set
# CONFIG_MSI_LAPTOP is not set
# CONFIG_MSI_WMI is not set
# CONFIG_MSI_WMI_PLATFORM is not set
# CONFIG_PCENGINES_APU2 is not set
# CONFIG_PORTWELL_EC is not set
# CONFIG_BARCO_P50_GPIO is not set
# CONFIG_SAMSUNG_GALAXYBOOK is not set
# CONFIG_SAMSUNG_LAPTOP is not set
# CONFIG_SAMSUNG_Q10 is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_TOSHIBA_HAPS is not set
# CONFIG_TOSHIBA_WMI is not set
# CONFIG_ACPI_CMPC is not set
# CONFIG_COMPAL_LAPTOP is not set
# CONFIG_LG_LAPTOP is not set
# CONFIG_PANASONIC_LAPTOP is not set
# CONFIG_SONY_LAPTOP is not set
# CONFIG_SYSTEM76_ACPI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_SERIAL_MULTI_INSTANTIATE is not set
# CONFIG_INSPUR_PLATFORM_PROFILE is not set
# CONFIG_LENOVO_WMI_CAMERA is not set
# CONFIG_DASHARO_ACPI is not set
# CONFIG_INTEL_IPS is not set
CONFIG_INTEL_SCU_IPC=y
# CONFIG_INTEL_SCU_PCI is not set
# CONFIG_INTEL_SCU_PLATFORM is not set
# CONFIG_SIEMENS_SIMATIC_IPC is not set
# CONFIG_SILICOM_PLATFORM is not set
# CONFIG_WINMATE_FM07_KEYS is not set
# CONFIG_OXP_EC is not set
# CONFIG_TUXEDO_NB04_WMI_AB is not set
CONFIG_P2SB=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_COMMON_CLK=y
# CONFIG_LMK04832 is not set
# CONFIG_COMMON_CLK_MAX9485 is not set
# CONFIG_COMMON_CLK_SI5341 is not set
# CONFIG_COMMON_CLK_SI5351 is not set
# CONFIG_COMMON_CLK_SI514 is not set
# CONFIG_COMMON_CLK_SI544 is not set
# CONFIG_COMMON_CLK_SI570 is not set
# CONFIG_COMMON_CLK_CDCE706 is not set
# CONFIG_COMMON_CLK_CDCE925 is not set
# CONFIG_COMMON_CLK_CS2000_CP is not set
# CONFIG_CLK_TWL is not set
# CONFIG_COMMON_CLK_AXI_CLKGEN is not set
# CONFIG_COMMON_CLK_RS9_PCIE is not set
# CONFIG_COMMON_CLK_SI521XX is not set
# CONFIG_COMMON_CLK_VC3 is not set
# CONFIG_COMMON_CLK_VC5 is not set
# CONFIG_COMMON_CLK_VC7 is not set
# CONFIG_COMMON_CLK_FIXED_MMIO is not set
# CONFIG_CLK_LGM_CGU is not set
# CONFIG_XILINX_VCU is not set
# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set
# CONFIG_HWSPINLOCK is not set

#
# Clock Source drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_I8253_LOCK=y
CONFIG_CLKBLD_I8253=y
# end of Clock Source drivers

CONFIG_MAILBOX=y
# CONFIG_PLATFORM_MHU is not set
CONFIG_PCC=y
# CONFIG_ALTERA_MBOX is not set
# CONFIG_MAILBOX_TEST is not set
CONFIG_IOMMU_IOVA=y
CONFIG_IOMMU_API=y
CONFIG_IOMMUFD_DRIVER=y
CONFIG_IOMMU_SUPPORT=y

#
# Generic IOMMU Pagetable Support
#
# end of Generic IOMMU Pagetable Support

# CONFIG_IOMMU_DEBUGFS is not set
# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set
CONFIG_IOMMU_DEFAULT_DMA_LAZY=y
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_OF_IOMMU=y
CONFIG_IOMMU_DMA=y
CONFIG_IOMMU_SVA=y
CONFIG_IOMMU_IOPF=y
# CONFIG_AMD_IOMMU is not set
CONFIG_DMAR_TABLE=y
CONFIG_INTEL_IOMMU=y
CONFIG_INTEL_IOMMU_SVM=y
CONFIG_INTEL_IOMMU_DEFAULT_ON=y
CONFIG_INTEL_IOMMU_FLOPPY_WA=y
CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON=y
CONFIG_INTEL_IOMMU_PERF_EVENTS=y
CONFIG_IOMMUFD_DRIVER_CORE=y
CONFIG_IOMMUFD=y
CONFIG_IOMMUFD_TEST=y
CONFIG_IRQ_REMAP=y
# CONFIG_VIRTIO_IOMMU is not set

#
# Remoteproc drivers
#
# CONFIG_REMOTEPROC is not set
# end of Remoteproc drivers

#
# Rpmsg drivers
#
# CONFIG_RPMSG_QCOM_GLINK_RPM is not set
# CONFIG_RPMSG_VIRTIO is not set
# end of Rpmsg drivers

CONFIG_SOUNDWIRE=y

#
# SoundWire Devices
#
# CONFIG_SOUNDWIRE_AMD is not set
# CONFIG_SOUNDWIRE_INTEL is not set
# CONFIG_SOUNDWIRE_QCOM is not set

#
# SOC (System On Chip) specific Drivers
#

#
# Amlogic SoC drivers
#
# end of Amlogic SoC drivers

#
# Broadcom SoC drivers
#
# end of Broadcom SoC drivers

#
# NXP/Freescale QorIQ SoC drivers
#
# end of NXP/Freescale QorIQ SoC drivers

#
# fujitsu SoC drivers
#
# end of fujitsu SoC drivers

#
# i.MX SoC drivers
#
# end of i.MX SoC drivers

#
# Enable LiteX SoC Builder specific drivers
#
# CONFIG_LITEX_SOC_CONTROLLER is not set
# end of Enable LiteX SoC Builder specific drivers

# CONFIG_WPCM450_SOC is not set

#
# Qualcomm SoC drivers
#
CONFIG_QCOM_QMI_HELPERS=y
# end of Qualcomm SoC drivers

# CONFIG_SOC_TI is not set

#
# Xilinx SoC drivers
#
# end of Xilinx SoC drivers
# end of SOC (System On Chip) specific Drivers

#
# PM Domains
#

#
# Amlogic PM Domains
#
# end of Amlogic PM Domains

#
# Broadcom PM Domains
#
# end of Broadcom PM Domains

#
# i.MX PM Domains
#
# end of i.MX PM Domains

#
# Qualcomm PM Domains
#
# end of Qualcomm PM Domains
# end of PM Domains

# CONFIG_PM_DEVFREQ is not set
CONFIG_EXTCON=y

#
# Extcon Device Drivers
#
# CONFIG_EXTCON_ADC_JACK is not set
# CONFIG_EXTCON_FSA9480 is not set
# CONFIG_EXTCON_GPIO is not set
# CONFIG_EXTCON_INTEL_INT3496 is not set
CONFIG_EXTCON_INTEL_CHT_WC=y
# CONFIG_EXTCON_LC824206XA is not set
# CONFIG_EXTCON_MAX3355 is not set
CONFIG_EXTCON_PTN5150=y
# CONFIG_EXTCON_RT8973A is not set
# CONFIG_EXTCON_SM5502 is not set
# CONFIG_EXTCON_USB_GPIO is not set
CONFIG_EXTCON_USBC_TUSB320=y
# CONFIG_MEMORY is not set
CONFIG_IIO=y
CONFIG_IIO_BUFFER=y
# CONFIG_IIO_BUFFER_CB is not set
# CONFIG_IIO_BUFFER_DMA is not set
# CONFIG_IIO_BUFFER_DMAENGINE is not set
# CONFIG_IIO_BUFFER_HW_CONSUMER is not set
CONFIG_IIO_KFIFO_BUF=y
CONFIG_IIO_TRIGGERED_BUFFER=y
# CONFIG_IIO_CONFIGFS is not set
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
# CONFIG_IIO_SW_DEVICE is not set
# CONFIG_IIO_SW_TRIGGER is not set
# CONFIG_IIO_TRIGGERED_EVENT is not set

#
# Accelerometers
#
# CONFIG_ADIS16201 is not set
# CONFIG_ADIS16209 is not set
# CONFIG_ADXL313_I2C is not set
# CONFIG_ADXL313_SPI is not set
# CONFIG_ADXL345_I2C is not set
# CONFIG_ADXL345_SPI is not set
# CONFIG_ADXL355_I2C is not set
# CONFIG_ADXL355_SPI is not set
# CONFIG_ADXL367_SPI is not set
# CONFIG_ADXL367_I2C is not set
# CONFIG_ADXL372_SPI is not set
# CONFIG_ADXL372_I2C is not set
# CONFIG_ADXL380_SPI is not set
# CONFIG_ADXL380_I2C is not set
# CONFIG_BMA180 is not set
# CONFIG_BMA220 is not set
# CONFIG_BMA400 is not set
# CONFIG_BMC150_ACCEL is not set
# CONFIG_BMI088_ACCEL is not set
# CONFIG_DA280 is not set
# CONFIG_DA311 is not set
# CONFIG_DMARD06 is not set
# CONFIG_DMARD09 is not set
# CONFIG_DMARD10 is not set
# CONFIG_FXLS8962AF_I2C is not set
# CONFIG_FXLS8962AF_SPI is not set
CONFIG_HID_SENSOR_ACCEL_3D=y
# CONFIG_IIO_ST_ACCEL_3AXIS is not set
# CONFIG_IIO_KX022A_SPI is not set
# CONFIG_IIO_KX022A_I2C is not set
# CONFIG_KXSD9 is not set
# CONFIG_KXCJK1013 is not set
# CONFIG_MC3230 is not set
# CONFIG_MMA7455_I2C is not set
# CONFIG_MMA7455_SPI is not set
# CONFIG_MMA7660 is not set
# CONFIG_MMA8452 is not set
# CONFIG_MMA9551 is not set
# CONFIG_MMA9553 is not set
# CONFIG_MSA311 is not set
# CONFIG_MXC4005 is not set
# CONFIG_MXC6255 is not set
# CONFIG_SCA3000 is not set
# CONFIG_SCA3300 is not set
# CONFIG_STK8312 is not set
# CONFIG_STK8BA50 is not set
# end of Accelerometers

#
# Analog to digital converters
#
# CONFIG_AD4000 is not set
# CONFIG_AD4030 is not set
# CONFIG_AD4130 is not set
# CONFIG_AD4695 is not set
# CONFIG_AD7091R5 is not set
# CONFIG_AD7091R8 is not set
# CONFIG_AD7124 is not set
# CONFIG_AD7173 is not set
# CONFIG_AD7191 is not set
# CONFIG_AD7192 is not set
# CONFIG_AD7266 is not set
# CONFIG_AD7280 is not set
# CONFIG_AD7291 is not set
# CONFIG_AD7292 is not set
# CONFIG_AD7298 is not set
# CONFIG_AD7380 is not set
# CONFIG_AD7476 is not set
# CONFIG_AD7606_IFACE_PARALLEL is not set
# CONFIG_AD7606_IFACE_SPI is not set
# CONFIG_AD7766 is not set
# CONFIG_AD7768_1 is not set
# CONFIG_AD7779 is not set
# CONFIG_AD7780 is not set
# CONFIG_AD7791 is not set
# CONFIG_AD7793 is not set
# CONFIG_AD7887 is not set
# CONFIG_AD7923 is not set
# CONFIG_AD7944 is not set
# CONFIG_AD7949 is not set
# CONFIG_AD799X is not set
# CONFIG_AD9467 is not set
# CONFIG_CC10001_ADC is not set
CONFIG_DLN2_ADC=y
# CONFIG_ENVELOPE_DETECTOR is not set
# CONFIG_GEHC_PMC_ADC is not set
# CONFIG_HI8435 is not set
# CONFIG_HX711 is not set
# CONFIG_INA2XX_ADC is not set
# CONFIG_LTC2309 is not set
# CONFIG_LTC2471 is not set
# CONFIG_LTC2485 is not set
# CONFIG_LTC2496 is not set
# CONFIG_LTC2497 is not set
# CONFIG_MAX1027 is not set
# CONFIG_MAX11100 is not set
# CONFIG_MAX1118 is not set
# CONFIG_MAX11205 is not set
# CONFIG_MAX11410 is not set
# CONFIG_MAX1241 is not set
# CONFIG_MAX1363 is not set
# CONFIG_MAX34408 is not set
# CONFIG_MAX9611 is not set
# CONFIG_MCP320X is not set
# CONFIG_MCP3422 is not set
# CONFIG_MCP3564 is not set
# CONFIG_MCP3911 is not set
# CONFIG_MEDIATEK_MT6360_ADC is not set
# CONFIG_MEDIATEK_MT6370_ADC is not set
# CONFIG_NAU7802 is not set
# CONFIG_NCT7201 is not set
# CONFIG_PAC1921 is not set
# CONFIG_PAC1934 is not set
# CONFIG_ROHM_BD79124 is not set
# CONFIG_RICHTEK_RTQ6056 is not set
# CONFIG_SD_ADC_MODULATOR is not set
# CONFIG_TI_ADC081C is not set
# CONFIG_TI_ADC0832 is not set
# CONFIG_TI_ADC084S021 is not set
# CONFIG_TI_ADC108S102 is not set
# CONFIG_TI_ADC12138 is not set
# CONFIG_TI_ADC128S052 is not set
# CONFIG_TI_ADC161S626 is not set
# CONFIG_TI_ADS1015 is not set
# CONFIG_TI_ADS1100 is not set
# CONFIG_TI_ADS1119 is not set
# CONFIG_TI_ADS124S08 is not set
# CONFIG_TI_ADS1298 is not set
# CONFIG_TI_ADS131E08 is not set
# CONFIG_TI_ADS7138 is not set
# CONFIG_TI_ADS7924 is not set
# CONFIG_TI_ADS7950 is not set
# CONFIG_TI_ADS8344 is not set
# CONFIG_TI_ADS8688 is not set
# CONFIG_TI_LMP92064 is not set
# CONFIG_TI_TLC4541 is not set
# CONFIG_TI_TSC2046 is not set
# CONFIG_TWL4030_MADC is not set
# CONFIG_TWL6030_GPADC is not set
# CONFIG_VF610_ADC is not set
CONFIG_VIPERBOARD_ADC=y
# CONFIG_XILINX_XADC is not set
# end of Analog to digital converters

#
# Analog to digital and digital to analog converters
#
# CONFIG_AD74115 is not set
# CONFIG_AD74413R is not set
# end of Analog to digital and digital to analog converters

#
# Analog Front Ends
#
# CONFIG_IIO_RESCALE is not set
# end of Analog Front Ends

#
# Amplifiers
#
# CONFIG_AD8366 is not set
# CONFIG_ADA4250 is not set
# CONFIG_HMC425 is not set
# end of Amplifiers

#
# Capacitance to digital converters
#
# CONFIG_AD7150 is not set
# CONFIG_AD7746 is not set
# end of Capacitance to digital converters

#
# Chemical Sensors
#
# CONFIG_AOSONG_AGS02MA is not set
# CONFIG_ATLAS_PH_SENSOR is not set
# CONFIG_ATLAS_EZO_SENSOR is not set
# CONFIG_BME680 is not set
# CONFIG_CCS811 is not set
# CONFIG_ENS160 is not set
# CONFIG_IAQCORE is not set
# CONFIG_MHZ19B is not set
# CONFIG_PMS7003 is not set
# CONFIG_SCD30_CORE is not set
# CONFIG_SCD4X is not set
# CONFIG_SEN0322 is not set
# CONFIG_SENSIRION_SGP30 is not set
# CONFIG_SENSIRION_SGP40 is not set
# CONFIG_SPS30_I2C is not set
# CONFIG_SPS30_SERIAL is not set
# CONFIG_SENSEAIR_SUNRISE_CO2 is not set
# CONFIG_VZ89X is not set
# end of Chemical Sensors

#
# Hid Sensor IIO Common
#
CONFIG_HID_SENSOR_IIO_COMMON=y
CONFIG_HID_SENSOR_IIO_TRIGGER=y
# end of Hid Sensor IIO Common

#
# IIO SCMI Sensors
#
# end of IIO SCMI Sensors

#
# SSP Sensor Common
#
# CONFIG_IIO_SSP_SENSORHUB is not set
# end of SSP Sensor Common

#
# Digital to analog converters
#
# CONFIG_AD3530R is not set
# CONFIG_AD3552R_HS is not set
# CONFIG_AD3552R is not set
# CONFIG_AD5064 is not set
# CONFIG_AD5360 is not set
# CONFIG_AD5380 is not set
# CONFIG_AD5421 is not set
# CONFIG_AD5446 is not set
# CONFIG_AD5449 is not set
# CONFIG_AD5592R is not set
# CONFIG_AD5593R is not set
# CONFIG_AD5504 is not set
# CONFIG_AD5624R_SPI is not set
# CONFIG_AD9739A is not set
# CONFIG_LTC2688 is not set
# CONFIG_AD5686_SPI is not set
# CONFIG_AD5696_I2C is not set
# CONFIG_AD5755 is not set
# CONFIG_AD5758 is not set
# CONFIG_AD5761 is not set
# CONFIG_AD5764 is not set
# CONFIG_AD5766 is not set
# CONFIG_AD5770R is not set
# CONFIG_AD5791 is not set
# CONFIG_AD7293 is not set
# CONFIG_AD7303 is not set
# CONFIG_AD8460 is not set
# CONFIG_AD8801 is not set
# CONFIG_BD79703 is not set
# CONFIG_CIO_DAC is not set
# CONFIG_DPOT_DAC is not set
# CONFIG_DS4424 is not set
# CONFIG_LTC1660 is not set
# CONFIG_LTC2632 is not set
# CONFIG_LTC2664 is not set
# CONFIG_M62332 is not set
# CONFIG_MAX517 is not set
# CONFIG_MAX5522 is not set
# CONFIG_MAX5821 is not set
# CONFIG_MCP4725 is not set
# CONFIG_MCP4728 is not set
# CONFIG_MCP4821 is not set
# CONFIG_MCP4922 is not set
# CONFIG_TI_DAC082S085 is not set
# CONFIG_TI_DAC5571 is not set
# CONFIG_TI_DAC7311 is not set
# CONFIG_TI_DAC7612 is not set
# CONFIG_VF610_DAC is not set
# end of Digital to analog converters

#
# IIO dummy driver
#
# end of IIO dummy driver

#
# Filters
#
# CONFIG_ADMV8818 is not set
# end of Filters

#
# Frequency Synthesizers DDS/PLL
#

#
# Clock Generator/Distribution
#
# CONFIG_AD9523 is not set
# end of Clock Generator/Distribution

#
# Phase-Locked Loop (PLL) frequency synthesizers
#
# CONFIG_ADF4350 is not set
# CONFIG_ADF4371 is not set
# CONFIG_ADF4377 is not set
# CONFIG_ADMFM2000 is not set
# CONFIG_ADMV1013 is not set
# CONFIG_ADMV1014 is not set
# CONFIG_ADMV4420 is not set
# CONFIG_ADRF6780 is not set
# end of Phase-Locked Loop (PLL) frequency synthesizers
# end of Frequency Synthesizers DDS/PLL

#
# Digital gyroscope sensors
#
# CONFIG_ADIS16080 is not set
# CONFIG_ADIS16130 is not set
# CONFIG_ADIS16136 is not set
# CONFIG_ADIS16260 is not set
# CONFIG_ADXRS290 is not set
# CONFIG_ADXRS450 is not set
# CONFIG_BMG160 is not set
# CONFIG_FXAS21002C is not set
CONFIG_HID_SENSOR_GYRO_3D=y
# CONFIG_MPU3050_I2C is not set
# CONFIG_IIO_ST_GYRO_3AXIS is not set
# CONFIG_ITG3200 is not set
# end of Digital gyroscope sensors

#
# Health Sensors
#

#
# Heart Rate Monitors
#
# CONFIG_AFE4403 is not set
# CONFIG_AFE4404 is not set
# CONFIG_MAX30100 is not set
# CONFIG_MAX30102 is not set
# end of Heart Rate Monitors
# end of Health Sensors

#
# Humidity sensors
#
# CONFIG_AM2315 is not set
# CONFIG_DHT11 is not set
# CONFIG_ENS210 is not set
# CONFIG_HDC100X is not set
# CONFIG_HDC2010 is not set
# CONFIG_HDC3020 is not set
CONFIG_HID_SENSOR_HUMIDITY=y
# CONFIG_HTS221 is not set
# CONFIG_HTU21 is not set
# CONFIG_SI7005 is not set
# CONFIG_SI7020 is not set
# end of Humidity sensors

#
# Inertial measurement units
#
# CONFIG_ADIS16400 is not set
# CONFIG_ADIS16460 is not set
# CONFIG_ADIS16475 is not set
# CONFIG_ADIS16480 is not set
# CONFIG_ADIS16550 is not set
# CONFIG_BMI160_I2C is not set
# CONFIG_BMI160_SPI is not set
# CONFIG_BMI270_I2C is not set
# CONFIG_BMI270_SPI is not set
# CONFIG_BMI323_I2C is not set
# CONFIG_BMI323_SPI is not set
# CONFIG_BOSCH_BNO055_SERIAL is not set
# CONFIG_BOSCH_BNO055_I2C is not set
# CONFIG_FXOS8700_I2C is not set
# CONFIG_FXOS8700_SPI is not set
# CONFIG_KMX61 is not set
# CONFIG_INV_ICM42600_I2C is not set
# CONFIG_INV_ICM42600_SPI is not set
# CONFIG_INV_MPU6050_I2C is not set
# CONFIG_INV_MPU6050_SPI is not set
# CONFIG_SMI240 is not set
# CONFIG_IIO_ST_LSM6DSX is not set
# CONFIG_IIO_ST_LSM9DS0 is not set
# end of Inertial measurement units

#
# Light sensors
#
# CONFIG_ACPI_ALS is not set
# CONFIG_ADJD_S311 is not set
# CONFIG_ADUX1020 is not set
# CONFIG_AL3000A is not set
# CONFIG_AL3010 is not set
# CONFIG_AL3320A is not set
# CONFIG_APDS9160 is not set
# CONFIG_APDS9300 is not set
# CONFIG_APDS9306 is not set
# CONFIG_APDS9960 is not set
# CONFIG_AS73211 is not set
# CONFIG_BH1745 is not set
# CONFIG_BH1750 is not set
# CONFIG_BH1780 is not set
# CONFIG_CM32181 is not set
# CONFIG_CM3232 is not set
# CONFIG_CM3323 is not set
# CONFIG_CM3605 is not set
# CONFIG_CM36651 is not set
# CONFIG_GP2AP002 is not set
# CONFIG_GP2AP020A00F is not set
# CONFIG_SENSORS_ISL29018 is not set
# CONFIG_SENSORS_ISL29028 is not set
# CONFIG_ISL29125 is not set
# CONFIG_ISL76682 is not set
CONFIG_HID_SENSOR_ALS=y
CONFIG_HID_SENSOR_PROX=y
# CONFIG_JSA1212 is not set
# CONFIG_ROHM_BU27034 is not set
# CONFIG_RPR0521 is not set
# CONFIG_LTR390 is not set
# CONFIG_LTR501 is not set
# CONFIG_LTRF216A is not set
# CONFIG_LV0104CS is not set
# CONFIG_MAX44000 is not set
# CONFIG_MAX44009 is not set
# CONFIG_NOA1305 is not set
# CONFIG_OPT3001 is not set
# CONFIG_OPT4001 is not set
# CONFIG_OPT4060 is not set
# CONFIG_PA12203001 is not set
# CONFIG_SI1133 is not set
# CONFIG_SI1145 is not set
# CONFIG_STK3310 is not set
# CONFIG_ST_UVIS25 is not set
# CONFIG_TCS3414 is not set
# CONFIG_TCS3472 is not set
# CONFIG_SENSORS_TSL2563 is not set
# CONFIG_TSL2583 is not set
# CONFIG_TSL2591 is not set
# CONFIG_TSL2772 is not set
# CONFIG_TSL4531 is not set
# CONFIG_US5182D is not set
# CONFIG_VCNL4000 is not set
# CONFIG_VCNL4035 is not set
# CONFIG_VEML3235 is not set
# CONFIG_VEML6030 is not set
# CONFIG_VEML6040 is not set
# CONFIG_VEML6070 is not set
# CONFIG_VEML6075 is not set
# CONFIG_VL6180 is not set
# CONFIG_ZOPT2201 is not set
# end of Light sensors

#
# Magnetometer sensors
#
# CONFIG_AF8133J is not set
# CONFIG_AK8974 is not set
# CONFIG_AK8975 is not set
# CONFIG_AK09911 is not set
# CONFIG_ALS31300 is not set
# CONFIG_BMC150_MAGN_I2C is not set
# CONFIG_BMC150_MAGN_SPI is not set
# CONFIG_MAG3110 is not set
CONFIG_HID_SENSOR_MAGNETOMETER_3D=y
# CONFIG_MMC35240 is not set
# CONFIG_IIO_ST_MAGN_3AXIS is not set
# CONFIG_SENSORS_HMC5843_I2C is not set
# CONFIG_SENSORS_HMC5843_SPI is not set
# CONFIG_SENSORS_RM3100_I2C is not set
# CONFIG_SENSORS_RM3100_SPI is not set
# CONFIG_SI7210 is not set
# CONFIG_TI_TMAG5273 is not set
# CONFIG_YAMAHA_YAS530 is not set
# end of Magnetometer sensors

#
# Multiplexers
#
# CONFIG_IIO_MUX is not set
# end of Multiplexers

#
# Inclinometer sensors
#
CONFIG_HID_SENSOR_INCLINOMETER_3D=y
CONFIG_HID_SENSOR_DEVICE_ROTATION=y
# end of Inclinometer sensors

#
# Triggers - standalone
#
# CONFIG_IIO_INTERRUPT_TRIGGER is not set
# CONFIG_IIO_SYSFS_TRIGGER is not set
# end of Triggers - standalone

#
# Linear and angular position sensors
#
CONFIG_HID_SENSOR_CUSTOM_INTEL_HINGE=y
# end of Linear and angular position sensors

#
# Digital potentiometers
#
# CONFIG_AD5110 is not set
# CONFIG_AD5272 is not set
# CONFIG_DS1803 is not set
# CONFIG_MAX5432 is not set
# CONFIG_MAX5481 is not set
# CONFIG_MAX5487 is not set
# CONFIG_MCP4018 is not set
# CONFIG_MCP4131 is not set
# CONFIG_MCP4531 is not set
# CONFIG_MCP41010 is not set
# CONFIG_TPL0102 is not set
# CONFIG_X9250 is not set
# end of Digital potentiometers

#
# Digital potentiostats
#
# CONFIG_LMP91000 is not set
# end of Digital potentiostats

#
# Pressure sensors
#
# CONFIG_ABP060MG is not set
# CONFIG_ROHM_BM1390 is not set
# CONFIG_BMP280 is not set
# CONFIG_DLHL60D is not set
# CONFIG_DPS310 is not set
CONFIG_HID_SENSOR_PRESS=y
# CONFIG_HP03 is not set
# CONFIG_HSC030PA is not set
# CONFIG_ICP10100 is not set
# CONFIG_MPL115_I2C is not set
# CONFIG_MPL115_SPI is not set
# CONFIG_MPL3115 is not set
# CONFIG_MPRLS0025PA is not set
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_SDP500 is not set
# CONFIG_IIO_ST_PRESS is not set
# CONFIG_T5403 is not set
# CONFIG_HP206C is not set
# CONFIG_ZPA2326 is not set
# end of Pressure sensors

#
# Lightning sensors
#
# CONFIG_AS3935 is not set
# end of Lightning sensors

#
# Proximity and distance sensors
#
# CONFIG_HX9023S is not set
# CONFIG_IRSD200 is not set
# CONFIG_ISL29501 is not set
# CONFIG_LIDAR_LITE_V2 is not set
# CONFIG_MB1232 is not set
# CONFIG_PING is not set
# CONFIG_RFD77402 is not set
# CONFIG_SRF04 is not set
# CONFIG_SX9310 is not set
# CONFIG_SX9324 is not set
# CONFIG_SX9360 is not set
# CONFIG_SX9500 is not set
# CONFIG_SRF08 is not set
# CONFIG_VCNL3020 is not set
# CONFIG_VL53L0X_I2C is not set
# CONFIG_AW96103 is not set
# end of Proximity and distance sensors

#
# Resolver to digital converters
#
# CONFIG_AD2S90 is not set
# CONFIG_AD2S1200 is not set
# CONFIG_AD2S1210 is not set
# end of Resolver to digital converters

#
# Temperature sensors
#
# CONFIG_LTC2983 is not set
# CONFIG_MAXIM_THERMOCOUPLE is not set
CONFIG_HID_SENSOR_TEMP=y
# CONFIG_MLX90614 is not set
# CONFIG_MLX90632 is not set
# CONFIG_MLX90635 is not set
# CONFIG_TMP006 is not set
# CONFIG_TMP007 is not set
# CONFIG_TMP117 is not set
# CONFIG_TSYS01 is not set
# CONFIG_TSYS02D is not set
# CONFIG_MAX30208 is not set
# CONFIG_MAX31856 is not set
# CONFIG_MAX31865 is not set
# CONFIG_MCP9600 is not set
# end of Temperature sensors

# CONFIG_NTB is not set
# CONFIG_PWM is not set

#
# IRQ chip support
#
CONFIG_IRQCHIP=y
# CONFIG_AL_FIC is not set
# CONFIG_XILINX_INTC is not set
# end of IRQ chip support

# CONFIG_IPACK_BUS is not set
CONFIG_RESET_CONTROLLER=y
# CONFIG_RESET_GPIO is not set
# CONFIG_RESET_INTEL_GW is not set
# CONFIG_RESET_SIMPLE is not set
# CONFIG_RESET_TI_SYSCON is not set
# CONFIG_RESET_TI_TPS380X is not set

#
# PHY Subsystem
#
CONFIG_GENERIC_PHY=y
CONFIG_USB_LGM_PHY=y
# CONFIG_PHY_CAN_TRANSCEIVER is not set
# CONFIG_PHY_NXP_PTN3222 is not set

#
# PHY drivers for Broadcom platforms
#
# CONFIG_BCM_KONA_USB2_PHY is not set
# end of PHY drivers for Broadcom platforms

# CONFIG_PHY_CADENCE_TORRENT is not set
# CONFIG_PHY_CADENCE_DPHY is not set
# CONFIG_PHY_CADENCE_DPHY_RX is not set
# CONFIG_PHY_CADENCE_SIERRA is not set
# CONFIG_PHY_CADENCE_SALVO is not set
# CONFIG_PHY_PXA_28NM_HSIC is not set
# CONFIG_PHY_PXA_28NM_USB2 is not set
CONFIG_PHY_CPCAP_USB=y
# CONFIG_PHY_MAPPHONE_MDM6600 is not set
# CONFIG_PHY_OCELOT_SERDES is not set
CONFIG_PHY_QCOM_USB_HS=y
CONFIG_PHY_QCOM_USB_HSIC=y
CONFIG_PHY_SAMSUNG_USB2=y
CONFIG_PHY_TUSB1210=y
# CONFIG_PHY_INTEL_LGM_COMBO is not set
# CONFIG_PHY_INTEL_LGM_EMMC is not set
# end of PHY Subsystem

# CONFIG_POWERCAP is not set
# CONFIG_MCB is not set

#
# Performance monitor support
#
# CONFIG_DWC_PCIE_PMU is not set
# end of Performance monitor support

CONFIG_RAS=y
CONFIG_USB4=y
# CONFIG_USB4_DEBUGFS_WRITE is not set
# CONFIG_USB4_DMA_TEST is not set

#
# Android
#
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
CONFIG_ANDROID_BINDER_DEVICES="binder0,binder1"
# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
# end of Android

CONFIG_LIBNVDIMM=y
CONFIG_BLK_DEV_PMEM=y
CONFIG_ND_CLAIM=y
CONFIG_ND_BTT=y
CONFIG_BTT=y
CONFIG_ND_PFN=y
CONFIG_NVDIMM_PFN=y
CONFIG_NVDIMM_DAX=y
CONFIG_OF_PMEM=y
CONFIG_NVDIMM_KEYS=y
# CONFIG_NVDIMM_SECURITY_TEST is not set
CONFIG_DAX=y
CONFIG_DEV_DAX=y
# CONFIG_DEV_DAX_PMEM is not set
# CONFIG_DEV_DAX_KMEM is not set
CONFIG_NVMEM=y
CONFIG_NVMEM_SYSFS=y
CONFIG_NVMEM_LAYOUTS=y

#
# Layout Types
#
# CONFIG_NVMEM_LAYOUT_SL28_VPD is not set
# CONFIG_NVMEM_LAYOUT_ONIE_TLV is not set
# CONFIG_NVMEM_LAYOUT_U_BOOT_ENV is not set
# end of Layout Types

# CONFIG_NVMEM_RMEM is not set
# CONFIG_NVMEM_U_BOOT_ENV is not set

#
# HW tracing support
#
# CONFIG_STM is not set
# CONFIG_INTEL_TH is not set
# end of HW tracing support

# CONFIG_FPGA is not set
# CONFIG_FSI is not set
CONFIG_TEE=y
# CONFIG_SIOX is not set
# CONFIG_SLIMBUS is not set
# CONFIG_INTERCONNECT is not set
CONFIG_COUNTER=y
# CONFIG_INTEL_QEP is not set
# CONFIG_INTERRUPT_CNT is not set
CONFIG_MOST=y
CONFIG_MOST_USB_HDM=y
# CONFIG_MOST_CDEV is not set
# CONFIG_MOST_SND is not set
# CONFIG_PECI is not set
# CONFIG_HTE is not set
# end of Device Drivers

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
CONFIG_VALIDATE_FS_PARSER=y
CONFIG_FS_IOMAP=y
CONFIG_FS_STACK=y
CONFIG_BUFFER_HEAD=y
CONFIG_LEGACY_DIRECT_IO=y
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
CONFIG_JFS_FS=y
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
CONFIG_JFS_DEBUG=y
# CONFIG_JFS_STATISTICS is not set
CONFIG_XFS_FS=y
# CONFIG_XFS_SUPPORT_V4 is not set
# CONFIG_XFS_SUPPORT_ASCII_CI is not set
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
# CONFIG_XFS_ONLINE_SCRUB is not set
# CONFIG_XFS_WARN is not set
# CONFIG_XFS_DEBUG is not set
CONFIG_GFS2_FS=y
CONFIG_GFS2_FS_LOCKING_DLM=y
CONFIG_OCFS2_FS=y
CONFIG_OCFS2_FS_O2CB=y
CONFIG_OCFS2_FS_USERSPACE_CLUSTER=y
CONFIG_OCFS2_FS_STATS=y
# CONFIG_OCFS2_DEBUG_MASKLOG is not set
CONFIG_OCFS2_DEBUG_FS=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
# CONFIG_BTRFS_DEBUG is not set
CONFIG_BTRFS_ASSERT=y
# CONFIG_BTRFS_EXPERIMENTAL is not set
CONFIG_BTRFS_FS_REF_VERIFY=y
CONFIG_NILFS2_FS=y
CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
CONFIG_F2FS_CHECK_FS=y
CONFIG_F2FS_FAULT_INJECTION=y
CONFIG_F2FS_FS_COMPRESSION=y
CONFIG_F2FS_FS_LZO=y
CONFIG_F2FS_FS_LZORLE=y
CONFIG_F2FS_FS_LZ4=y
CONFIG_F2FS_FS_LZ4HC=y
CONFIG_F2FS_FS_ZSTD=y
# CONFIG_F2FS_IOSTAT is not set
# CONFIG_F2FS_UNFAIR_RWSEM is not set
CONFIG_BCACHEFS_FS=y
CONFIG_BCACHEFS_QUOTA=y
CONFIG_BCACHEFS_ERASURE_CODING=y
CONFIG_BCACHEFS_POSIX_ACL=y
CONFIG_BCACHEFS_DEBUG=y
# CONFIG_BCACHEFS_INJECT_TRANSACTION_RESTARTS is not set
# CONFIG_BCACHEFS_TESTS is not set
# CONFIG_BCACHEFS_LOCK_TIME_STATS is not set
# CONFIG_BCACHEFS_NO_LATENCY_ACCT is not set
CONFIG_BCACHEFS_SIX_OPTIMISTIC_SPIN=y
# CONFIG_BCACHEFS_PATH_TRACEPOINTS is not set
# CONFIG_BCACHEFS_TRANS_KMALLOC_TRACE is not set
# CONFIG_BCACHEFS_ASYNC_OBJECT_LISTS is not set
CONFIG_ZONEFS_FS=y
CONFIG_FS_DAX=y
CONFIG_FS_DAX_PMD=y
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
CONFIG_EXPORTFS_BLOCK_OPS=y
CONFIG_FILE_LOCKING=y
CONFIG_FS_ENCRYPTION=y
CONFIG_FS_ENCRYPTION_ALGS=y
# CONFIG_FS_ENCRYPTION_INLINE_CRYPT is not set
CONFIG_FS_VERITY=y
CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
CONFIG_AUTOFS_FS=y
CONFIG_FUSE_FS=y
CONFIG_CUSE=y
CONFIG_VIRTIO_FS=y
CONFIG_FUSE_DAX=y
# CONFIG_FUSE_PASSTHROUGH is not set
# CONFIG_FUSE_IO_URING is not set
CONFIG_OVERLAY_FS=y
CONFIG_OVERLAY_FS_REDIRECT_DIR=y
CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y
CONFIG_OVERLAY_FS_INDEX=y
# CONFIG_OVERLAY_FS_NFS_EXPORT is not set
# CONFIG_OVERLAY_FS_XINO_AUTO is not set
# CONFIG_OVERLAY_FS_METACOPY is not set
CONFIG_OVERLAY_FS_DEBUG=y

#
# Caches
#
CONFIG_NETFS_SUPPORT=y
# CONFIG_NETFS_STATS is not set
# CONFIG_NETFS_DEBUG is not set
CONFIG_FSCACHE=y
# CONFIG_FSCACHE_STATS is not set
CONFIG_CACHEFILES=y
# CONFIG_CACHEFILES_DEBUG is not set
# CONFIG_CACHEFILES_ERROR_INJECTION is not set
# CONFIG_CACHEFILES_ONDEMAND is not set
# end of Caches

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=y
# end of CD-ROM/DVD Filesystems

#
# DOS/FAT/EXFAT/NT Filesystems
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_FAT_DEFAULT_UTF8 is not set
CONFIG_EXFAT_FS=y
CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
CONFIG_NTFS3_FS=y
# CONFIG_NTFS3_64BIT_CLUSTER is not set
CONFIG_NTFS3_LZX_XPRESS=y
CONFIG_NTFS3_FS_POSIX_ACL=y
# CONFIG_NTFS_FS is not set
# end of DOS/FAT/EXFAT/NT Filesystems

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_VMCORE=y
# CONFIG_PROC_VMCORE_DEVICE_DUMP is not set
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_PROC_CHILDREN=y
CONFIG_PROC_PID_ARCH_STATUS=y
CONFIG_KERNFS=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
# CONFIG_TMPFS_INODE64 is not set
CONFIG_TMPFS_QUOTA=y
CONFIG_HUGETLBFS=y
# CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON is not set
CONFIG_HUGETLB_PAGE=y
CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y
CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
CONFIG_CONFIGFS_FS=y
# end of Pseudo filesystems

CONFIG_MISC_FILESYSTEMS=y
CONFIG_ORANGEFS_FS=y
CONFIG_ADFS_FS=y
# CONFIG_ADFS_FS_RW is not set
CONFIG_AFFS_FS=y
CONFIG_ECRYPT_FS=y
CONFIG_ECRYPT_FS_MESSAGING=y
CONFIG_HFS_FS=y
CONFIG_HFSPLUS_FS=y
CONFIG_BEFS_FS=y
# CONFIG_BEFS_DEBUG is not set
CONFIG_BFS_FS=y
CONFIG_EFS_FS=y
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_JFFS2_FS_POSIX_ACL=y
CONFIG_JFFS2_FS_SECURITY=y
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_LZO=y
CONFIG_JFFS2_RTIME=y
CONFIG_JFFS2_RUBIN=y
# CONFIG_JFFS2_CMODE_NONE is not set
CONFIG_JFFS2_CMODE_PRIORITY=y
# CONFIG_JFFS2_CMODE_SIZE is not set
# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_ZSTD=y
CONFIG_UBIFS_ATIME_SUPPORT=y
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_SECURITY=y
# CONFIG_UBIFS_FS_AUTHENTICATION is not set
CONFIG_CRAMFS=y
CONFIG_CRAMFS_BLOCKDEV=y
CONFIG_CRAMFS_MTD=y
CONFIG_SQUASHFS=y
# CONFIG_SQUASHFS_FILE_CACHE is not set
CONFIG_SQUASHFS_FILE_DIRECT=y
CONFIG_SQUASHFS_DECOMP_MULTI=y
# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set
# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set
CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI=y
# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set
# CONFIG_SQUASHFS_MOUNT_DECOMP_THREADS is not set
CONFIG_SQUASHFS_XATTR=y
# CONFIG_SQUASHFS_COMP_CACHE_FULL is not set
CONFIG_SQUASHFS_ZLIB=y
CONFIG_SQUASHFS_LZ4=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
CONFIG_VXFS_FS=y
CONFIG_MINIX_FS=y
CONFIG_OMFS_FS=y
CONFIG_HPFS_FS=y
CONFIG_QNX4FS_FS=y
CONFIG_QNX6FS_FS=y
# CONFIG_QNX6FS_DEBUG is not set
CONFIG_ROMFS_FS=y
# CONFIG_ROMFS_BACKED_BY_BLOCK is not set
# CONFIG_ROMFS_BACKED_BY_MTD is not set
CONFIG_ROMFS_BACKED_BY_BOTH=y
CONFIG_ROMFS_ON_BLOCK=y
CONFIG_ROMFS_ON_MTD=y
CONFIG_PSTORE=y
CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240
CONFIG_PSTORE_COMPRESS=y
# CONFIG_PSTORE_CONSOLE is not set
# CONFIG_PSTORE_PMSG is not set
# CONFIG_PSTORE_RAM is not set
# CONFIG_PSTORE_BLK is not set
CONFIG_UFS_FS=y
CONFIG_UFS_FS_WRITE=y
# CONFIG_UFS_DEBUG is not set
CONFIG_EROFS_FS=y
# CONFIG_EROFS_FS_DEBUG is not set
CONFIG_EROFS_FS_XATTR=y
CONFIG_EROFS_FS_POSIX_ACL=y
CONFIG_EROFS_FS_SECURITY=y
# CONFIG_EROFS_FS_BACKED_BY_FILE is not set
CONFIG_EROFS_FS_ZIP=y
# CONFIG_EROFS_FS_ZIP_LZMA is not set
# CONFIG_EROFS_FS_ZIP_DEFLATE is not set
# CONFIG_EROFS_FS_ZIP_ZSTD is not set
# CONFIG_EROFS_FS_ZIP_ACCEL is not set
# CONFIG_EROFS_FS_ONDEMAND is not set
# CONFIG_EROFS_FS_PCPU_KTHREAD is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
# CONFIG_NFS_V2 is not set
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_2=y
CONFIG_PNFS_FILE_LAYOUT=y
CONFIG_PNFS_BLOCK=y
CONFIG_PNFS_FLEXFILE_LAYOUT=y
CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
# CONFIG_NFS_V4_1_MIGRATION is not set
CONFIG_NFS_V4_SECURITY_LABEL=y
CONFIG_ROOT_NFS=y
CONFIG_NFS_FSCACHE=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_DISABLE_UDP_SUPPORT is not set
CONFIG_NFS_V4_2_READ_PLUS=y
CONFIG_NFSD=y
# CONFIG_NFSD_V2 is not set
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFSD_PNFS=y
CONFIG_NFSD_BLOCKLAYOUT=y
CONFIG_NFSD_SCSILAYOUT=y
CONFIG_NFSD_FLEXFILELAYOUT=y
CONFIG_NFSD_V4_2_INTER_SSC=y
CONFIG_NFSD_V4_SECURITY_LABEL=y
# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set
# CONFIG_NFSD_V4_DELEG_TIMESTAMPS is not set
CONFIG_GRACE_PERIOD=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
# CONFIG_NFS_LOCALIO is not set
CONFIG_NFS_V4_2_SSC_HELPER=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_SUNRPC_BACKCHANNEL=y
CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA1 is not set
# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_CAMELLIA is not set
# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA2 is not set
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_SUNRPC_XPRT_RDMA is not set
CONFIG_CEPH_FS=y
CONFIG_CEPH_FSCACHE=y
CONFIG_CEPH_FS_POSIX_ACL=y
# CONFIG_CEPH_FS_SECURITY_LABEL is not set
CONFIG_CIFS=y
# CONFIG_CIFS_STATS2 is not set
CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y
CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
CONFIG_CIFS_DEBUG=y
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set
CONFIG_CIFS_DFS_UPCALL=y
CONFIG_CIFS_SWN_UPCALL=y
CONFIG_CIFS_SMB_DIRECT=y
CONFIG_CIFS_FSCACHE=y
# CONFIG_CIFS_ROOT is not set
# CONFIG_CIFS_COMPRESSION is not set
CONFIG_SMB_SERVER=y
# CONFIG_SMB_SERVER_SMBDIRECT is not set
# CONFIG_SMB_SERVER_CHECK_CAP_NET_ADMIN is not set
# CONFIG_SMB_SERVER_KERBEROS5 is not set
CONFIG_SMBFS=y
# CONFIG_CODA_FS is not set
CONFIG_AFS_FS=y
# CONFIG_AFS_DEBUG is not set
CONFIG_AFS_FSCACHE=y
# CONFIG_AFS_DEBUG_CURSOR is not set
CONFIG_9P_FS=y
CONFIG_9P_FSCACHE=y
CONFIG_9P_FS_POSIX_ACL=y
CONFIG_9P_FS_SECURITY=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=y
CONFIG_NLS_CODEPAGE_775=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_CODEPAGE_852=y
CONFIG_NLS_CODEPAGE_855=y
CONFIG_NLS_CODEPAGE_857=y
CONFIG_NLS_CODEPAGE_860=y
CONFIG_NLS_CODEPAGE_861=y
CONFIG_NLS_CODEPAGE_862=y
CONFIG_NLS_CODEPAGE_863=y
CONFIG_NLS_CODEPAGE_864=y
CONFIG_NLS_CODEPAGE_865=y
CONFIG_NLS_CODEPAGE_866=y
CONFIG_NLS_CODEPAGE_869=y
CONFIG_NLS_CODEPAGE_936=y
CONFIG_NLS_CODEPAGE_950=y
CONFIG_NLS_CODEPAGE_932=y
CONFIG_NLS_CODEPAGE_949=y
CONFIG_NLS_CODEPAGE_874=y
CONFIG_NLS_ISO8859_8=y
CONFIG_NLS_CODEPAGE_1250=y
CONFIG_NLS_CODEPAGE_1251=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_2=y
CONFIG_NLS_ISO8859_3=y
CONFIG_NLS_ISO8859_4=y
CONFIG_NLS_ISO8859_5=y
CONFIG_NLS_ISO8859_6=y
CONFIG_NLS_ISO8859_7=y
CONFIG_NLS_ISO8859_9=y
CONFIG_NLS_ISO8859_13=y
CONFIG_NLS_ISO8859_14=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_KOI8_R=y
CONFIG_NLS_KOI8_U=y
CONFIG_NLS_MAC_ROMAN=y
CONFIG_NLS_MAC_CELTIC=y
CONFIG_NLS_MAC_CENTEURO=y
CONFIG_NLS_MAC_CROATIAN=y
CONFIG_NLS_MAC_CYRILLIC=y
CONFIG_NLS_MAC_GAELIC=y
CONFIG_NLS_MAC_GREEK=y
CONFIG_NLS_MAC_ICELAND=y
CONFIG_NLS_MAC_INUIT=y
CONFIG_NLS_MAC_ROMANIAN=y
CONFIG_NLS_MAC_TURKISH=y
CONFIG_NLS_UTF8=y
CONFIG_NLS_UCS2_UTILS=y
CONFIG_DLM=y
# CONFIG_DLM_DEBUG is not set
CONFIG_UNICODE=y
CONFIG_IO_WQ=y
# end of File systems

#
# Security options
#
CONFIG_KEYS=y
CONFIG_KEYS_REQUEST_CACHE=y
CONFIG_PERSISTENT_KEYRINGS=y
CONFIG_BIG_KEYS=y
CONFIG_TRUSTED_KEYS=y
# CONFIG_TRUSTED_KEYS_TPM is not set
# CONFIG_TRUSTED_KEYS_TEE is not set

#
# No trust source selected!
#
CONFIG_ENCRYPTED_KEYS=y
# CONFIG_USER_DECRYPTED_DATA is not set
CONFIG_KEY_DH_OPERATIONS=y
CONFIG_KEY_NOTIFICATIONS=y
# CONFIG_SECURITY_DMESG_RESTRICT is not set
CONFIG_PROC_MEM_ALWAYS_FORCE=y
# CONFIG_PROC_MEM_FORCE_PTRACE is not set
# CONFIG_PROC_MEM_NO_FORCE is not set
CONFIG_SECURITY=y
CONFIG_HAS_SECURITY_AUDIT=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_INFINIBAND=y
CONFIG_SECURITY_NETWORK_XFRM=y
CONFIG_SECURITY_PATH=y
# CONFIG_INTEL_TXT is not set
# CONFIG_STATIC_USERMODEHELPER is not set
# CONFIG_SECURITY_SELINUX is not set
# CONFIG_SECURITY_SMACK is not set
CONFIG_SECURITY_TOMOYO=y
CONFIG_SECURITY_TOMOYO_MAX_ACCEPT_ENTRY=64
CONFIG_SECURITY_TOMOYO_MAX_AUDIT_LOG=32
CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER=y
CONFIG_SECURITY_TOMOYO_INSECURE_BUILTIN_SETTING=y
CONFIG_SECURITY_APPARMOR=y
CONFIG_SECURITY_APPARMOR_DEBUG=y
CONFIG_SECURITY_APPARMOR_DEBUG_ASSERTS=y
# CONFIG_SECURITY_APPARMOR_DEBUG_MESSAGES is not set
CONFIG_SECURITY_APPARMOR_INTROSPECT_POLICY=y
CONFIG_SECURITY_APPARMOR_HASH=y
CONFIG_SECURITY_APPARMOR_HASH_DEFAULT=y
# CONFIG_SECURITY_APPARMOR_EXPORT_BINARY is not set
# CONFIG_SECURITY_APPARMOR_PARANOID_LOAD is not set
# CONFIG_SECURITY_LOADPIN is not set
CONFIG_SECURITY_YAMA=y
CONFIG_SECURITY_SAFESETID=y
CONFIG_SECURITY_LOCKDOWN_LSM=y
CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y
CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y
# CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set
# CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set
CONFIG_SECURITY_LANDLOCK=y
# CONFIG_SECURITY_IPE is not set
CONFIG_INTEGRITY=y
CONFIG_INTEGRITY_SIGNATURE=y
CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
CONFIG_INTEGRITY_TRUSTED_KEYRING=y
CONFIG_INTEGRITY_AUDIT=y
CONFIG_IMA=y
CONFIG_IMA_MEASURE_PCR_IDX=10
CONFIG_IMA_LSM_RULES=y
CONFIG_IMA_NG_TEMPLATE=y
# CONFIG_IMA_SIG_TEMPLATE is not set
CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng"
# CONFIG_IMA_DEFAULT_HASH_SHA1 is not set
CONFIG_IMA_DEFAULT_HASH_SHA256=y
# CONFIG_IMA_DEFAULT_HASH_SHA512 is not set
# CONFIG_IMA_DEFAULT_HASH_WP512 is not set
CONFIG_IMA_DEFAULT_HASH="sha256"
CONFIG_IMA_WRITE_POLICY=y
CONFIG_IMA_READ_POLICY=y
CONFIG_IMA_APPRAISE=y
# CONFIG_IMA_ARCH_POLICY is not set
# CONFIG_IMA_APPRAISE_BUILD_POLICY is not set
# CONFIG_IMA_APPRAISE_BOOTPARAM is not set
CONFIG_IMA_APPRAISE_MODSIG=y
# CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY is not set
# CONFIG_IMA_BLACKLIST_KEYRING is not set
# CONFIG_IMA_LOAD_X509 is not set
CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS=y
CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS=y
# CONFIG_IMA_DISABLE_HTABLE is not set
CONFIG_EVM=y
CONFIG_EVM_ATTR_FSUUID=y
CONFIG_EVM_ADD_XATTRS=y
# CONFIG_EVM_LOAD_X509 is not set
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
CONFIG_DEFAULT_SECURITY_APPARMOR=y
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_LSM="landlock,lockdown,yama,safesetid,integrity,tomoyo,apparmor,bpf"

#
# Kernel hardening options
#

#
# Memory initialization
#
CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y
CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y
# CONFIG_INIT_STACK_NONE is not set
# CONFIG_INIT_STACK_ALL_PATTERN is not set
CONFIG_INIT_STACK_ALL_ZERO=y
CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y
# CONFIG_ZERO_CALL_USED_REGS is not set
# end of Memory initialization

#
# Bounds checking
#
CONFIG_FORTIFY_SOURCE=y
CONFIG_HARDENED_USERCOPY=y
# CONFIG_HARDENED_USERCOPY_DEFAULT_ON is not set
# end of Bounds checking

#
# Hardening of kernel data structures
#
CONFIG_LIST_HARDENED=y
CONFIG_BUG_ON_DATA_CORRUPTION=y
# end of Hardening of kernel data structures

CONFIG_CC_HAS_RANDSTRUCT=y
CONFIG_RANDSTRUCT_NONE=y
# CONFIG_RANDSTRUCT_FULL is not set
# end of Kernel hardening options
# end of Security options

CONFIG_XOR_BLOCKS=y
CONFIG_ASYNC_CORE=y
CONFIG_ASYNC_MEMCPY=y
CONFIG_ASYNC_XOR=y
CONFIG_ASYNC_PQ=y
CONFIG_ASYNC_RAID6_RECOV=y
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_SIG=y
CONFIG_CRYPTO_SIG2=y
CONFIG_CRYPTO_SKCIPHER=y
CONFIG_CRYPTO_SKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_RNG_DEFAULT=y
CONFIG_CRYPTO_AKCIPHER2=y
CONFIG_CRYPTO_AKCIPHER=y
CONFIG_CRYPTO_KPP2=y
CONFIG_CRYPTO_KPP=y
CONFIG_CRYPTO_ACOMP2=y
CONFIG_CRYPTO_HKDF=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_USER=y
# CONFIG_CRYPTO_SELFTESTS is not set
# CONFIG_CRYPTO_NULL is not set
CONFIG_CRYPTO_PCRYPT=y
CONFIG_CRYPTO_CRYPTD=y
CONFIG_CRYPTO_AUTHENC=y
CONFIG_CRYPTO_KRB5ENC=y
# CONFIG_CRYPTO_BENCHMARK is not set
CONFIG_CRYPTO_ENGINE=y
# end of Crypto core or helper

#
# Public-key cryptography
#
CONFIG_CRYPTO_RSA=y
CONFIG_CRYPTO_DH=y
# CONFIG_CRYPTO_DH_RFC7919_GROUPS is not set
CONFIG_CRYPTO_ECC=y
CONFIG_CRYPTO_ECDH=y
CONFIG_CRYPTO_ECDSA=y
CONFIG_CRYPTO_ECRDSA=y
CONFIG_CRYPTO_CURVE25519=y
# end of Public-key cryptography

#
# Block ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_TI=y
CONFIG_CRYPTO_ANUBIS=y
CONFIG_CRYPTO_ARIA=y
CONFIG_CRYPTO_BLOWFISH=y
CONFIG_CRYPTO_BLOWFISH_COMMON=y
CONFIG_CRYPTO_CAMELLIA=y
CONFIG_CRYPTO_CAST_COMMON=y
CONFIG_CRYPTO_CAST5=y
CONFIG_CRYPTO_CAST6=y
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_FCRYPT=y
CONFIG_CRYPTO_KHAZAD=y
CONFIG_CRYPTO_SEED=y
CONFIG_CRYPTO_SERPENT=y
CONFIG_CRYPTO_SM4=y
CONFIG_CRYPTO_SM4_GENERIC=y
CONFIG_CRYPTO_TEA=y
CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_TWOFISH_COMMON=y
# end of Block ciphers

#
# Length-preserving ciphers and modes
#
CONFIG_CRYPTO_ADIANTUM=y
CONFIG_CRYPTO_ARC4=y
CONFIG_CRYPTO_CHACHA20=y
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_CTS=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_HCTR2=y
CONFIG_CRYPTO_LRW=y
CONFIG_CRYPTO_PCBC=y
CONFIG_CRYPTO_XCTR=y
CONFIG_CRYPTO_XTS=y
CONFIG_CRYPTO_NHPOLY1305=y
# end of Length-preserving ciphers and modes

#
# AEAD (authenticated encryption with associated data) ciphers
#
CONFIG_CRYPTO_AEGIS128=y
CONFIG_CRYPTO_CHACHA20POLY1305=y
CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_GENIV=y
CONFIG_CRYPTO_SEQIV=y
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_ESSIV=y
# end of AEAD (authenticated encryption with associated data) ciphers

#
# Hashes, digests, and MACs
#
CONFIG_CRYPTO_BLAKE2B=y
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_GHASH=y
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=y
CONFIG_CRYPTO_POLYVAL=y
CONFIG_CRYPTO_RMD160=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_SHA3=y
# CONFIG_CRYPTO_SM3_GENERIC is not set
CONFIG_CRYPTO_STREEBOG=y
CONFIG_CRYPTO_WP512=y
CONFIG_CRYPTO_XCBC=y
CONFIG_CRYPTO_XXHASH=y
# end of Hashes, digests, and MACs

#
# CRCs (cyclic redundancy checks)
#
CONFIG_CRYPTO_CRC32C=y
# CONFIG_CRYPTO_CRC32 is not set
# end of CRCs (cyclic redundancy checks)

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_842=y
CONFIG_CRYPTO_LZ4=y
CONFIG_CRYPTO_LZ4HC=y
CONFIG_CRYPTO_ZSTD=y
# end of Compression

#
# Random number generation
#
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_DRBG_MENU=y
CONFIG_CRYPTO_DRBG_HMAC=y
CONFIG_CRYPTO_DRBG_HASH=y
CONFIG_CRYPTO_DRBG_CTR=y
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_JITTERENTROPY=y
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=64
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=32
CONFIG_CRYPTO_JITTERENTROPY_OSR=1
CONFIG_CRYPTO_KDF800108_CTR=y
# end of Random number generation

#
# Userspace interface
#
CONFIG_CRYPTO_USER_API=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
CONFIG_CRYPTO_USER_API_RNG=y
# CONFIG_CRYPTO_USER_API_RNG_CAVP is not set
CONFIG_CRYPTO_USER_API_AEAD=y
CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y
# end of Userspace interface

CONFIG_CRYPTO_HASH_INFO=y

#
# Accelerated Cryptographic Algorithms for CPU (x86)
#
CONFIG_CRYPTO_CURVE25519_X86=y
CONFIG_CRYPTO_AES_NI_INTEL=y
CONFIG_CRYPTO_BLOWFISH_X86_64=y
CONFIG_CRYPTO_CAMELLIA_X86_64=y
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64=y
CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64=y
CONFIG_CRYPTO_CAST5_AVX_X86_64=y
CONFIG_CRYPTO_CAST6_AVX_X86_64=y
CONFIG_CRYPTO_DES3_EDE_X86_64=y
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=y
CONFIG_CRYPTO_SERPENT_AVX_X86_64=y
CONFIG_CRYPTO_SERPENT_AVX2_X86_64=y
CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64=y
CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64=y
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=y
CONFIG_CRYPTO_TWOFISH_AVX_X86_64=y
CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64=y
# CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64 is not set
# CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64 is not set
CONFIG_CRYPTO_AEGIS128_AESNI_SSE2=y
CONFIG_CRYPTO_NHPOLY1305_SSE2=y
CONFIG_CRYPTO_NHPOLY1305_AVX2=y
CONFIG_CRYPTO_POLYVAL_CLMUL_NI=y
CONFIG_CRYPTO_SHA1_SSSE3=y
CONFIG_CRYPTO_SHA512_SSSE3=y
CONFIG_CRYPTO_SM3_AVX_X86_64=y
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=y
# end of Accelerated Cryptographic Algorithms for CPU (x86)

CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_DEV_PADLOCK=y
CONFIG_CRYPTO_DEV_PADLOCK_AES=y
CONFIG_CRYPTO_DEV_PADLOCK_SHA=y
# CONFIG_CRYPTO_DEV_ATMEL_ECC is not set
# CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set
CONFIG_CRYPTO_DEV_CCP=y
CONFIG_CRYPTO_DEV_CCP_DD=y
# CONFIG_CRYPTO_DEV_SP_CCP is not set
# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set
CONFIG_CRYPTO_DEV_QAT=y
CONFIG_CRYPTO_DEV_QAT_DH895xCC=y
CONFIG_CRYPTO_DEV_QAT_C3XXX=y
CONFIG_CRYPTO_DEV_QAT_C62X=y
# CONFIG_CRYPTO_DEV_QAT_4XXX is not set
# CONFIG_CRYPTO_DEV_QAT_420XX is not set
# CONFIG_CRYPTO_DEV_QAT_6XXX is not set
CONFIG_CRYPTO_DEV_QAT_DH895xCCVF=y
CONFIG_CRYPTO_DEV_QAT_C3XXXVF=y
CONFIG_CRYPTO_DEV_QAT_C62XVF=y
# CONFIG_CRYPTO_DEV_QAT_ERROR_INJECTION is not set
CONFIG_CRYPTO_DEV_VIRTIO=y
# CONFIG_CRYPTO_DEV_SAFEXCEL is not set
# CONFIG_CRYPTO_DEV_CCREE is not set
# CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_PKCS8_PRIVATE_KEY_PARSER=y
CONFIG_PKCS7_MESSAGE_PARSER=y
CONFIG_PKCS7_TEST_KEY=y
CONFIG_SIGNED_PE_FILE_VERIFICATION=y
# CONFIG_FIPS_SIGNATURE_SELFTEST is not set

#
# Certificates for signature checking
#
CONFIG_MODULE_SIG_KEY="certs/signing_key.pem"
# CONFIG_MODULE_SIG_KEY_TYPE_RSA is not set
CONFIG_MODULE_SIG_KEY_TYPE_ECDSA=y
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_SYSTEM_TRUSTED_KEYS=""
# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set
CONFIG_SECONDARY_TRUSTED_KEYRING=y
# CONFIG_SECONDARY_TRUSTED_KEYRING_SIGNED_BY_BUILTIN is not set
# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set
# end of Certificates for signature checking

CONFIG_CRYPTO_KRB5=y
# CONFIG_CRYPTO_KRB5_SELFTESTS is not set
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_RAID6_PQ=y
# CONFIG_RAID6_PQ_BENCHMARK is not set
CONFIG_LINEAR_RANGES=y
# CONFIG_PACKING is not set
CONFIG_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_NET_UTILS=y
# CONFIG_CORDIC is not set
# CONFIG_PRIME_NUMBERS is not set
CONFIG_RATIONAL=y
CONFIG_GENERIC_IOMAP=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_ARCH_HAS_FAST_MULTIPLIER=y
CONFIG_ARCH_USE_SYM_ANNOTATIONS=y

#
# Crypto library routines
#
CONFIG_CRYPTO_LIB_UTILS=y
CONFIG_CRYPTO_LIB_AES=y
CONFIG_CRYPTO_LIB_ARC4=y
CONFIG_CRYPTO_LIB_GF128MUL=y
CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S=y
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y
CONFIG_CRYPTO_LIB_CHACHA_GENERIC=y
CONFIG_CRYPTO_LIB_CHACHA=y
CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=y
CONFIG_CRYPTO_LIB_CURVE25519_INTERNAL=y
CONFIG_CRYPTO_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_DES=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11
CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=y
CONFIG_CRYPTO_LIB_POLY1305_GENERIC=y
CONFIG_CRYPTO_LIB_POLY1305=y
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
CONFIG_CRYPTO_LIB_SHA1=y
CONFIG_CRYPTO_LIB_SHA256=y
CONFIG_CRYPTO_ARCH_HAVE_LIB_SHA256=y
CONFIG_CRYPTO_ARCH_HAVE_LIB_SHA256_SIMD=y
CONFIG_CRYPTO_LIB_SHA256_GENERIC=y
CONFIG_CRYPTO_LIB_SM3=y
CONFIG_CRYPTO_BLAKE2S_X86=y
CONFIG_CRYPTO_CHACHA20_X86_64=y
CONFIG_CRYPTO_POLY1305_X86_64=y
CONFIG_CRYPTO_SHA256_X86_64=y
# end of Crypto library routines

CONFIG_CRC_CCITT=y
CONFIG_CRC16=y
CONFIG_CRC_T10DIF=y
CONFIG_ARCH_HAS_CRC_T10DIF=y
CONFIG_CRC_T10DIF_ARCH=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC32=y
CONFIG_ARCH_HAS_CRC32=y
CONFIG_CRC32_ARCH=y
CONFIG_CRC64=y
CONFIG_ARCH_HAS_CRC64=y
CONFIG_CRC64_ARCH=y
CONFIG_CRC8=y
CONFIG_CRC_OPTIMIZATIONS=y
CONFIG_XXHASH=y
# CONFIG_RANDOM32_SELFTEST is not set
CONFIG_842_COMPRESS=y
CONFIG_842_DECOMPRESS=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_LZ4_COMPRESS=y
CONFIG_LZ4HC_COMPRESS=y
CONFIG_LZ4_DECOMPRESS=y
CONFIG_ZSTD_COMMON=y
CONFIG_ZSTD_COMPRESS=y
CONFIG_ZSTD_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_ARM64=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_RISCV=y
# CONFIG_XZ_DEC_MICROLZMA is not set
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_DECOMPRESS_LZ4=y
CONFIG_DECOMPRESS_ZSTD=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_REED_SOLOMON=y
CONFIG_REED_SOLOMON_DEC8=y
CONFIG_TEXTSEARCH=y
CONFIG_TEXTSEARCH_KMP=y
CONFIG_TEXTSEARCH_BM=y
CONFIG_TEXTSEARCH_FSM=y
CONFIG_INTERVAL_TREE=y
CONFIG_INTERVAL_TREE_SPAN_ITER=y
CONFIG_XARRAY_MULTI=y
CONFIG_ASSOCIATIVE_ARRAY=y
CONFIG_CLOSURES=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HAS_DMA=y
CONFIG_DMA_OPS_HELPERS=y
CONFIG_NEED_SG_DMA_FLAGS=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DMA_DECLARE_COHERENT=y
CONFIG_SWIOTLB=y
# CONFIG_SWIOTLB_DYNAMIC is not set
CONFIG_DMA_NEED_SYNC=y
# CONFIG_DMA_RESTRICTED_POOL is not set
CONFIG_DMA_CMA=y
# CONFIG_DMA_NUMA_CMA is not set

#
# Default contiguous memory area size:
#
CONFIG_CMA_SIZE_MBYTES=0
CONFIG_CMA_SIZE_PERCENTAGE=0
# CONFIG_CMA_SIZE_SEL_MBYTES is not set
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
# CONFIG_CMA_SIZE_SEL_MIN is not set
CONFIG_CMA_SIZE_SEL_MAX=y
CONFIG_CMA_ALIGNMENT=8
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_DMA_MAP_BENCHMARK is not set
CONFIG_SGL_ALLOC=y
CONFIG_CHECK_SIGNATURE=y
# CONFIG_CPUMASK_OFFSTACK is not set
CONFIG_CPU_RMAP=y
CONFIG_DQL=y
CONFIG_GLOB=y
# CONFIG_GLOB_SELFTEST is not set
CONFIG_NLATTR=y
CONFIG_CLZ_TAB=y
CONFIG_IRQ_POLL=y
CONFIG_MPILIB=y
CONFIG_SIGNATURE=y
CONFIG_DIMLIB=y
CONFIG_LIBFDT=y
CONFIG_OID_REGISTRY=y
CONFIG_HAVE_GENERIC_VDSO=y
CONFIG_GENERIC_GETTIMEOFDAY=y
CONFIG_GENERIC_VDSO_TIME_NS=y
CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT=y
CONFIG_VDSO_GETRANDOM=y
CONFIG_GENERIC_VDSO_DATA_STORE=y
CONFIG_FONT_SUPPORT=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
CONFIG_SG_POOL=y
CONFIG_ARCH_HAS_PMEM_API=y
CONFIG_MEMREGION=y
CONFIG_ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION=y
CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y
CONFIG_ARCH_HAS_COPY_MC=y
CONFIG_ARCH_STACKWALK=y
CONFIG_STACKDEPOT=y
CONFIG_STACKDEPOT_ALWAYS_INIT=y
CONFIG_STACKDEPOT_MAX_FRAMES=64
CONFIG_REF_TRACKER=y
CONFIG_SBITMAP=y
# CONFIG_LWQ_TEST is not set
# end of Library routines

CONFIG_FIRMWARE_TABLE=y
CONFIG_UNION_FIND=y
CONFIG_MIN_HEAP=y

#
# Kernel hacking
#

#
# printk and dmesg options
#
CONFIG_PRINTK_TIME=y
CONFIG_PRINTK_CALLER=y
# CONFIG_STACKTRACE_BUILD_ID is not set
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7
CONFIG_CONSOLE_LOGLEVEL_QUIET=4
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
# CONFIG_BOOT_PRINTK_DELAY is not set
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DYNAMIC_DEBUG_CORE=y
CONFIG_SYMBOLIC_ERRNAME=y
CONFIG_DEBUG_BUGVERBOSE=y
# end of printk and dmesg options

CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MISC=y

#
# Compile-time checks and compiler options
#
CONFIG_DEBUG_INFO=y
CONFIG_AS_HAS_NON_CONST_ULEB128=y
# CONFIG_DEBUG_INFO_NONE is not set
# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
CONFIG_DEBUG_INFO_DWARF4=y
# CONFIG_DEBUG_INFO_DWARF5 is not set
# CONFIG_DEBUG_INFO_REDUCED is not set
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set
# CONFIG_DEBUG_INFO_COMPRESSED_ZSTD is not set
# CONFIG_DEBUG_INFO_SPLIT is not set
# CONFIG_DEBUG_INFO_BTF is not set
CONFIG_PAHOLE_HAS_SPLIT_BTF=y
CONFIG_PAHOLE_HAS_BTF_TAG=y
CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y
# CONFIG_GDB_SCRIPTS is not set
CONFIG_FRAME_WARN=2048
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_HEADERS_INSTALL is not set
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set
CONFIG_OBJTOOL=y
# CONFIG_OBJTOOL_WERROR is not set
CONFIG_NOINSTR_VALIDATION=y
# CONFIG_VMLINUX_MAP is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# end of Compile-time checks and compiler options

#
# Generic Kernel Debugging Instruments
#
# CONFIG_MAGIC_SYSRQ is not set
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ALLOW_ALL=y
# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set
# CONFIG_DEBUG_FS_ALLOW_NONE is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_ARCH_HAS_UBSAN=y
CONFIG_UBSAN=y
# CONFIG_UBSAN_TRAP is not set
CONFIG_CC_HAS_UBSAN_ARRAY_BOUNDS=y
CONFIG_UBSAN_BOUNDS=y
CONFIG_UBSAN_ARRAY_BOUNDS=y
CONFIG_UBSAN_SHIFT=y
# CONFIG_UBSAN_BOOL is not set
# CONFIG_UBSAN_ENUM is not set
# CONFIG_UBSAN_ALIGNMENT is not set
# CONFIG_TEST_UBSAN is not set
CONFIG_HAVE_ARCH_KCSAN=y
CONFIG_HAVE_KCSAN_COMPILER=y
# end of Generic Kernel Debugging Instruments

#
# Networking Debugging
#
CONFIG_NET_DEV_REFCNT_TRACKER=y
CONFIG_NET_NS_REFCNT_TRACKER=y
CONFIG_DEBUG_NET=y
# CONFIG_DEBUG_NET_SMALL_RTNL is not set
# end of Networking Debugging

#
# Memory Debugging
#
CONFIG_PAGE_EXTENSION=y
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_SLUB_DEBUG=y
# CONFIG_SLUB_DEBUG_ON is not set
CONFIG_SLUB_RCU_DEBUG=y
CONFIG_PAGE_OWNER=y
CONFIG_PAGE_TABLE_CHECK=y
CONFIG_PAGE_TABLE_CHECK_ENFORCED=y
CONFIG_PAGE_POISONING=y
# CONFIG_DEBUG_PAGE_REF is not set
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_ARCH_HAS_DEBUG_WX=y
CONFIG_DEBUG_WX=y
CONFIG_ARCH_HAS_PTDUMP=y
CONFIG_PTDUMP=y
CONFIG_PTDUMP_DEBUGFS=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_PER_VMA_LOCK_STATS is not set
CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
CONFIG_DEBUG_OBJECTS_FREE=y
CONFIG_DEBUG_OBJECTS_TIMERS=y
CONFIG_DEBUG_OBJECTS_WORK=y
CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
# CONFIG_SHRINKER_DEBUG is not set
CONFIG_DEBUG_STACK_USAGE=y
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y
CONFIG_DEBUG_VFS=y
CONFIG_DEBUG_VM_IRQSOFF=y
CONFIG_DEBUG_VM=y
CONFIG_DEBUG_VM_MAPLE_TREE=y
CONFIG_DEBUG_VM_RB=y
CONFIG_DEBUG_VM_PGFLAGS=y
CONFIG_DEBUG_VM_PGTABLE=y
CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
CONFIG_DEBUG_VIRTUAL=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_PER_CPU_MAPS=y
CONFIG_DEBUG_KMAP_LOCAL=y
CONFIG_ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP=y
CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP=y
# CONFIG_MEM_ALLOC_PROFILING is not set
CONFIG_HAVE_ARCH_KASAN=y
CONFIG_HAVE_ARCH_KASAN_VMALLOC=y
CONFIG_CC_HAS_KASAN_GENERIC=y
CONFIG_CC_HAS_KASAN_SW_TAGS=y
CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y
CONFIG_KASAN=y
CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX=y
CONFIG_KASAN_GENERIC=y
# CONFIG_KASAN_OUTLINE is not set
CONFIG_KASAN_INLINE=y
CONFIG_KASAN_STACK=y
CONFIG_KASAN_VMALLOC=y
# CONFIG_KASAN_EXTRA_INFO is not set
CONFIG_HAVE_ARCH_KFENCE=y
CONFIG_KFENCE=y
CONFIG_KFENCE_SAMPLE_INTERVAL=100
CONFIG_KFENCE_NUM_OBJECTS=255
# CONFIG_KFENCE_DEFERRABLE is not set
CONFIG_KFENCE_STATIC_KEYS=y
CONFIG_KFENCE_STRESS_TEST_FAULTS=0
CONFIG_HAVE_ARCH_KMSAN=y
CONFIG_HAVE_KMSAN_COMPILER=y
# end of Memory Debugging

# CONFIG_DEBUG_SHIRQ is not set

#
# Debug Oops, Lockups and Hangs
#
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_ON_OOPS_VALUE=1
CONFIG_PANIC_TIMEOUT=86400
CONFIG_LOCKUP_DETECTOR=y
CONFIG_SOFTLOCKUP_DETECTOR=y
# CONFIG_SOFTLOCKUP_DETECTOR_INTR_STORM is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y
CONFIG_HARDLOCKUP_DETECTOR=y
# CONFIG_HARDLOCKUP_DETECTOR_PREFER_BUDDY is not set
CONFIG_HARDLOCKUP_DETECTOR_PERF=y
# CONFIG_HARDLOCKUP_DETECTOR_BUDDY is not set
# CONFIG_HARDLOCKUP_DETECTOR_ARCH is not set
CONFIG_HARDLOCKUP_DETECTOR_COUNTS_HRTIMER=y
CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=140
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
# CONFIG_DETECT_HUNG_TASK_BLOCKER is not set
CONFIG_WQ_WATCHDOG=y
# CONFIG_WQ_CPU_INTENSIVE_REPORT is not set
# CONFIG_TEST_LOCKUP is not set
# end of Debug Oops, Lockups and Hangs

#
# Scheduler Debugging
#
CONFIG_SCHED_INFO=y
CONFIG_SCHEDSTATS=y
# end of Scheduler Debugging

CONFIG_DEBUG_PREEMPT=y

#
# Lock Debugging (spinlocks, mutexes, etc...)
#
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_PROVE_LOCKING=y
CONFIG_PROVE_RAW_LOCK_NESTING=y
# CONFIG_LOCK_STAT is not set
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
CONFIG_DEBUG_RWSEMS=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_LOCKDEP=y
CONFIG_LOCKDEP_BITS=20
CONFIG_LOCKDEP_CHAINS_BITS=20
CONFIG_LOCKDEP_STACK_TRACE_BITS=20
CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=14
CONFIG_LOCKDEP_CIRCULAR_QUEUE_BITS=12
# CONFIG_DEBUG_LOCKDEP is not set
CONFIG_DEBUG_ATOMIC_SLEEP=y
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_LOCK_TORTURE_TEST is not set
# CONFIG_WW_MUTEX_SELFTEST is not set
# CONFIG_SCF_TORTURE_TEST is not set
CONFIG_CSD_LOCK_WAIT_DEBUG=y
# CONFIG_CSD_LOCK_WAIT_DEBUG_DEFAULT is not set
# end of Lock Debugging (spinlocks, mutexes, etc...)

CONFIG_TRACE_IRQFLAGS=y
CONFIG_TRACE_IRQFLAGS_NMI=y
CONFIG_NMI_CHECK_CPU=y
CONFIG_DEBUG_IRQFLAGS=y
CONFIG_STACKTRACE=y
# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_KOBJECT_RELEASE is not set

#
# Debug kernel data structures
#
CONFIG_DEBUG_LIST=y
CONFIG_DEBUG_PLIST=y
CONFIG_DEBUG_SG=y
CONFIG_DEBUG_NOTIFIERS=y
# CONFIG_DEBUG_CLOSURES is not set
CONFIG_DEBUG_MAPLE_TREE=y
# end of Debug kernel data structures

#
# RCU Debugging
#
CONFIG_PROVE_RCU=y
# CONFIG_RCU_SCALE_TEST is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_REF_SCALE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=100
CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0
# CONFIG_RCU_CPU_STALL_CPUTIME is not set
# CONFIG_RCU_TRACE is not set
CONFIG_RCU_EQS_DEBUG=y
# end of RCU Debugging

# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set
# CONFIG_LATENCYTOP is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_RETHOOK=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_HAVE_FTRACE_REGS_HAVING_PT_REGS=y
CONFIG_HAVE_DYNAMIC_FTRACE_NO_PATCHABLE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_OBJTOOL_MCOUNT=y
CONFIG_HAVE_OBJTOOL_NOP_MCOUNT=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y
CONFIG_TRACE_CLOCK=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_PREEMPTIRQ_TRACEPOINTS=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
# CONFIG_BOOTTIME_TRACING is not set
# CONFIG_FUNCTION_TRACER is not set
# CONFIG_STACK_TRACER is not set
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_PREEMPT_TRACER is not set
# CONFIG_SCHED_TRACER is not set
# CONFIG_HWLAT_TRACER is not set
# CONFIG_OSNOISE_TRACER is not set
# CONFIG_TIMERLAT_TRACER is not set
# CONFIG_MMIOTRACE is not set
# CONFIG_FTRACE_SYSCALLS is not set
# CONFIG_TRACER_SNAPSHOT is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_UPROBE_EVENTS=y
CONFIG_BPF_EVENTS=y
CONFIG_DYNAMIC_EVENTS=y
CONFIG_PROBE_EVENTS=y
# CONFIG_SYNTH_EVENTS is not set
# CONFIG_USER_EVENTS is not set
# CONFIG_HIST_TRIGGERS is not set
CONFIG_TRACE_EVENT_INJECT=y
# CONFIG_TRACEPOINT_BENCHMARK is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_TRACE_EVAL_MAP_FILE is not set
# CONFIG_FTRACE_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_STARTUP_TEST is not set
CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS=y
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set
# CONFIG_RV is not set
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
# CONFIG_SAMPLES is not set
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
# CONFIG_STRICT_DEVMEM is not set

#
# x86 Debugging
#
CONFIG_EARLY_PRINTK_USB=y
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_PRINTK_DBGP=y
# CONFIG_EARLY_PRINTK_USB_XDBC is not set
# CONFIG_DEBUG_TLBFLUSH is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEBUG_BOOT_PARAMS=y
# CONFIG_CPA_DEBUG is not set
CONFIG_DEBUG_ENTRY=y
# CONFIG_DEBUG_NMI_SELFTEST is not set
CONFIG_X86_DEBUG_FPU=y
# CONFIG_PUNIT_ATOM_DEBUG is not set
CONFIG_UNWINDER_ORC=y
# CONFIG_UNWINDER_FRAME_POINTER is not set
# end of x86 Debugging

#
# Kernel Testing and Coverage
#
# CONFIG_KUNIT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
CONFIG_FAULT_INJECTION=y
CONFIG_FAILSLAB=y
CONFIG_FAIL_PAGE_ALLOC=y
CONFIG_FAULT_INJECTION_USERCOPY=y
CONFIG_FAIL_MAKE_REQUEST=y
CONFIG_FAIL_IO_TIMEOUT=y
CONFIG_FAIL_FUTEX=y
CONFIG_FAULT_INJECTION_DEBUG_FS=y
# CONFIG_FAIL_MMC_REQUEST is not set
# CONFIG_FAIL_SKB_REALLOC is not set
CONFIG_FAULT_INJECTION_CONFIGFS=y
# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set
CONFIG_ARCH_HAS_KCOV=y
CONFIG_KCOV=y
CONFIG_KCOV_ENABLE_COMPARISONS=y
CONFIG_KCOV_INSTRUMENT_ALL=y
CONFIG_KCOV_IRQ_AREA_SIZE=0x40000
# CONFIG_KCOV_SELFTEST is not set
CONFIG_RUNTIME_TESTING_MENU=y
# CONFIG_TEST_DHRY is not set
# CONFIG_LKDTM is not set
# CONFIG_TEST_MIN_HEAP is not set
# CONFIG_TEST_DIV64 is not set
# CONFIG_TEST_MULDIV64 is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_TEST_REF_TRACKER is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_REED_SOLOMON_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_PERCPU_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_ASYNC_RAID6_TEST is not set
# CONFIG_TEST_HEXDUMP is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_TEST_BITMAP is not set
# CONFIG_TEST_UUID is not set
# CONFIG_TEST_XARRAY is not set
# CONFIG_TEST_MAPLE_TREE is not set
# CONFIG_TEST_RHASHTABLE is not set
# CONFIG_TEST_IDA is not set
# CONFIG_TEST_LKM is not set
# CONFIG_TEST_BITOPS is not set
# CONFIG_TEST_VMALLOC is not set
# CONFIG_TEST_BPF is not set
# CONFIG_FIND_BIT_BENCHMARK is not set
# CONFIG_TEST_FIRMWARE is not set
# CONFIG_TEST_SYSCTL is not set
# CONFIG_TEST_UDELAY is not set
# CONFIG_TEST_STATIC_KEYS is not set
# CONFIG_TEST_DYNAMIC_DEBUG is not set
# CONFIG_TEST_KMOD is not set
# CONFIG_TEST_KALLSYMS is not set
# CONFIG_TEST_DEBUG_VIRTUAL is not set
# CONFIG_TEST_MEMCAT_P is not set
# CONFIG_TEST_MEMINIT is not set
# CONFIG_TEST_HMM is not set
# CONFIG_TEST_FREE_PAGES is not set
# CONFIG_TEST_CLOCKSOURCE_WATCHDOG is not set
# CONFIG_TEST_OBJPOOL is not set
CONFIG_ARCH_USE_MEMTEST=y
# CONFIG_MEMTEST is not set
# end of Kernel Testing and Coverage

#
# Rust hacking
#
# end of Rust hacking
# end of Kernel hacking

CONFIG_IO_URING_ZCRX=y
KernelRepo git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
ReproCID 5582085818941440
ReproOpts {"repeat":true,"procs":1,"slowdown":1,"sandbox":"","sandbox_arg":0,"close_fds":false,"tmpdir":true}
ReproSyzID 4652929773993984
SyzkallerCommit 0c1d6ded3570097468e0af306043c121b2ded6a8
TargetArch amd64
TargetOS linux

Current Stage: moderation
Next Stage: upstream

Reporting Stages and Comments:
Stage Source Reported At Ext ID Comments
moderation lore 2026/06/26 22:14 <65efb3d8-bbf9-4f4b-800e-b9bc5577b381@mail.kernel.org>
2 Comments
  • syzbot@kernel.org (2026/06/26 22:19):
    A corrupted JFS image can trick the kernel into calling release_metapage()
    on a pseudo-metapage embedded within the inode, leading to an out-of-bounds
    memory access and a spinlock crash.
    
    When operating on the root page of an xtree or dtree (which is stored
    inline within the inode), JFS doesn't use a real struct metapage. Instead,
    BT_GETPAGE() sets the metapage pointer to the address of
    JFS_IP(ip)->bxflag. Because this is a pseudo-metapage, it does not have a
    valid wait_queue_head_t wait field. Accessing mp->wait reads out-of-bounds
    memory in struct jfs_inode_info.
    
    In xt_getpage(), the code validates nextindex and maxentry, but it fails to
    verify that the BT_ROOT flag is set in p->header.flag for the root page (bn
    == 0). If the inline xtree root page has a corrupted header.flag where
    BT_ROOT is missing, xtTruncate() will mistakenly treat the root page as a
    regular leaf page and call discard_metapage(mp).
    
    Unlike XT_PUTPAGE() which safely checks !BT_IS_ROOT(mp) before releasing,
    discard_metapage() calls release_metapage(mp) directly. This assumes mp is
    a real metapage and calls unlock_metapage(mp), which executes
    wake_up(&mp->wait), accessing garbage memory and resulting in a spinlock
    bad magic BUG or UBSAN out-of-bounds array access.
    
    Fix this by enforcing the invariant that the BT_ROOT flag is set if and
    only if bn == 0 in both xt_getpage() and DT_GETPAGE().
    
    BUG: spinlock bad magic on CPU#0, syz-executor/6066
     lock: 0xffff888120999b48, .magic: ffffffff, .owner: <...>/-1902340672,
     .owner_cpu: 768
    CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1
    PREEMPT(full)
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
    1.16.3-debian-1.16.3-2 04/01/2014
    Call Trace:
     <TASK>
     dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
     spin_bug kernel/locking/spinlock_debug.c:78 [inline]
     debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
     do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
     __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
     _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
     __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
     unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
     release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
     xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
     jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
     jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
     evict+0x624/0xb50 fs/inode.c:841
     __dentry_kill+0x206/0x700 fs/dcache.c:718
     shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
     shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
     shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
     do_one_tree+0x28/0xe0 fs/dcache.c:1721
     shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
     generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
     kill_block_super+0x44/0x90 fs/super.c:1725
     deactivate_locked_super+0xbc/0x130 fs/super.c:476
     cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
     task_work_run+0x1d9/0x270 kernel/task_work.c:233
     resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
     __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
     exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
     __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
     syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230
     [inline]
     syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
     do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
     </TASK>
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Assisted-by: Gemini:gemini-3.1-pro-preview syzbot
    Reported-by: syzbot+e380443eaa59bfb75a84@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=e380443eaa59bfb75a84
    Link: https://syzkaller.appspot.com/ai_job?id=b075f2b7-e5d3-4157-9efa-ee28c166187b
    To: <jfs-discussion@lists.sourceforge.net>
    To: "Dave Kleikamp" <shaggy@kernel.org>
    Cc: "Arnd Bergmann" <arnd@arndb.de>
    Cc: <linux-kernel@vger.kernel.org>
    Cc: "Suchit Karunakaran" <suchitkarunakaran@gmail.com>
    Cc: "Yun Zhou" <yun.zhou@windriver.com>
    Cc: "Zheng Yu" <zheng.yu@northwestern.edu>
    
    ---
    diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
    index ac0f79faf..bbb157daf 100644
    --- a/fs/jfs/jfs_dtree.c
    +++ b/fs/jfs/jfs_dtree.c
    @@ -111,19 +111,26 @@ struct dtsplit {
     #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
     
     /* get page buffer for specified block address */
    -#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
    -do {									\
    -	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
    -	if (!(RC)) {							\
    -		if ((BN) && !check_dtpage(P)) {				\
    -			BT_PUTPAGE(MP);					\
    -			jfs_error((IP)->i_sb,				\
    -				  "DT_GETPAGE: dtree page corrupt\n");	\
    -			MP = NULL;					\
    -			RC = -EIO;					\
    -		}							\
    -	}								\
    -} while (0)
    +#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)                                       \
    +	do {                                                                      \
    +		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);          \
    +		if (!(RC)) {                                                      \
    +			if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {      \
    +				BT_PUTPAGE(MP);                                   \
    +				jfs_error(                                        \
    +					(IP)->i_sb,                               \
    +					"DT_GETPAGE: dtree root page corrupt\n"); \
    +				MP = NULL;                                        \
    +				RC = -EIO;                                        \
    +			} else if ((BN) && !check_dtpage(P)) {                    \
    +				BT_PUTPAGE(MP);                                   \
    +				jfs_error((IP)->i_sb,                             \
    +					  "DT_GETPAGE: dtree page corrupt\n");    \
    +				MP = NULL;                                        \
    +				RC = -EIO;                                        \
    +			}                                                         \
    +		}                                                                 \
    +	} while (0)
     
     /* for consistency */
     #define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
    diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
    index 28c3cf960..6d960dd96 100644
    --- a/fs/jfs/jfs_xtree.c
    +++ b/fs/jfs/jfs_xtree.c
    @@ -118,10 +118,11 @@ static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **m
     	if (rc)
     		return ERR_PTR(rc);
     	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
    -		(le16_to_cpu(p->header.nextindex) >
    -			le16_to_cpu(p->header.maxentry)) ||
    -		(le16_to_cpu(p->header.maxentry) >
    -			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
    +	    (le16_to_cpu(p->header.nextindex) >
    +	     le16_to_cpu(p->header.maxentry)) ||
    +	    (le16_to_cpu(p->header.maxentry) >
    +	     ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
    +	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {
     		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
     		BT_PUTPAGE(*mp);
     		*mp = NULL;
    
    
    base-commit: 8cd9520d35a6c38db6567e97dd93b1f11f185dc6
    -- 
    This is an AI-generated patch subject to moderation.
    Reply with '#syz upstream' to Sign-off the patch as a human author
    and send it to the upstream kernel mailing lists.
    Reply with '#syz reject' to reject it ('#syz unreject' to undo).
    
    See https://goo.gle/syzbot-ai-patches for information about AI-generated patches.
    You can comment on the patch as usual, syzbot will try to address
    the comments and send a new version of the patch if necessary.
    syzbot engineers can be reached at syzkaller@googlegroups.com.
    
  • kusaram@devineni.in (2026/07/09 07:13):
    On 27-06-2026 03:44 am, syzbot wrote:
    > A corrupted JFS image can trick the kernel into calling release_metapage()
    > on a pseudo-metapage embedded within the inode, leading to an out-of-bounds
    > memory access and a spinlock crash.
    > 
    > When operating on the root page of an xtree or dtree (which is stored
    > inline within the inode), JFS doesn't use a real struct metapage. Instead,
    > BT_GETPAGE() sets the metapage pointer to the address of
    > JFS_IP(ip)->bxflag. Because this is a pseudo-metapage, it does not have a
    > valid wait_queue_head_t wait field. Accessing mp->wait reads out-of-bounds
    > memory in struct jfs_inode_info.
    > 
    > In xt_getpage(), the code validates nextindex and maxentry, but it fails to
    > verify that the BT_ROOT flag is set in p->header.flag for the root page (bn
    > == 0). If the inline xtree root page has a corrupted header.flag where
    > BT_ROOT is missing, xtTruncate() will mistakenly treat the root page as a
    > regular leaf page and call discard_metapage(mp).
    > 
    > Unlike XT_PUTPAGE() which safely checks !BT_IS_ROOT(mp) before releasing,
    > discard_metapage() calls release_metapage(mp) directly. This assumes mp is
    > a real metapage and calls unlock_metapage(mp), which executes
    > wake_up(&mp->wait), accessing garbage memory and resulting in a spinlock
    > bad magic BUG or UBSAN out-of-bounds array access.
    > 
    > Fix this by enforcing the invariant that the BT_ROOT flag is set if and
    > only if bn == 0 in both xt_getpage() and DT_GETPAGE().
    > 
    
    keep the current fix direction. The BT_ROOT invariant checks in both 
    xt_getpage() and DT_GETPAGE() are correct.
    
    > BUG: spinlock bad magic on CPU#0, syz-executor/6066
    >   lock: 0xffff888120999b48, .magic: ffffffff, .owner: <...>/-1902340672,
    >   .owner_cpu: 768
    > CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1
    > PREEMPT(full)
    > Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
    > 1.16.3-debian-1.16.3-2 04/01/2014
    > Call Trace:
    >   <TASK>
    >   dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
    >   spin_bug kernel/locking/spinlock_debug.c:78 [inline]
    >   debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
    >   do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
    >   __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
    >   _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
    >   __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
    >   unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
    >   release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
    >   xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
    >   jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
    >   jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
    >   evict+0x624/0xb50 fs/inode.c:841
    >   __dentry_kill+0x206/0x700 fs/dcache.c:718
    >   shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
    >   shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
    >   shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
    >   do_one_tree+0x28/0xe0 fs/dcache.c:1721
    >   shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
    >   generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
    >   kill_block_super+0x44/0x90 fs/super.c:1725
    >   deactivate_locked_super+0xbc/0x130 fs/super.c:476
    >   cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
    >   task_work_run+0x1d9/0x270 kernel/task_work.c:233
    >   resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
    >   __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
    >   exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
    >   __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
    >   syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230
    >   [inline]
    >   syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
    >   do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
    >   entry_SYSCALL_64_after_hwframe+0x77/0x7f
    >   </TASK>
    > 
    > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    > Assisted-by: Gemini:gemini-3.1-pro-preview syzbot
    > Reported-by: syzbot+e380443eaa59bfb75a84@syzkaller.appspotmail.com
    > Closes: https://syzkaller.appspot.com/bug?extid=e380443eaa59bfb75a84
    > Link: https://syzkaller.appspot.com/ai_job?id=b075f2b7-e5d3-4157-9efa-ee28c166187b
    > To: <jfs-discussion@lists.sourceforge.net>
    > To: "Dave Kleikamp" <shaggy@kernel.org>
    > Cc: "Arnd Bergmann" <arnd@arndb.de>
    > Cc: <linux-kernel@vger.kernel.org>
    > Cc: "Suchit Karunakaran" <suchitkarunakaran@gmail.com>
    > Cc: "Yun Zhou" <yun.zhou@windriver.com>
    > Cc: "Zheng Yu" <zheng.yu@northwestern.edu>
    > 
    > ---
    > diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
    > index ac0f79faf..bbb157daf 100644
    > --- a/fs/jfs/jfs_dtree.c
    > +++ b/fs/jfs/jfs_dtree.c
    > @@ -111,19 +111,26 @@ struct dtsplit {
    >   #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
    >   
    >   /* get page buffer for specified block address */
    > -#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
    > -do {									\
    > -	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
    > -	if (!(RC)) {							\
    > -		if ((BN) && !check_dtpage(P)) {				\
    > -			BT_PUTPAGE(MP);					\
    > -			jfs_error((IP)->i_sb,				\
    > -				  "DT_GETPAGE: dtree page corrupt\n");	\
    > -			MP = NULL;					\
    > -			RC = -EIO;					\
    > -		}							\
    > -	}								\
    > -} while (0)
    > +#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)                                       \
    > +	do {                                                                      \
    > +		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);          \
    > +		if (!(RC)) {                                                      \
    > +			if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {      \
    > +				BT_PUTPAGE(MP);                                   \
    > +				jfs_error(                                        \
    > +					(IP)->i_sb,                               \
    > +					"DT_GETPAGE: dtree root page corrupt\n"); \
    > +				MP = NULL;                                        \
    > +				RC = -EIO;                                        \
    > +			} else if ((BN) && !check_dtpage(P)) {                    \
    > +				BT_PUTPAGE(MP);                                   \
    > +				jfs_error((IP)->i_sb,                             \
    > +					  "DT_GETPAGE: dtree page corrupt\n");    \
    > +				MP = NULL;                                        \
    > +				RC = -EIO;                                        \
    > +			}                                                         \
    > +		}                                                                 \
    > +	} while (0)
    >   
    
    in DT_GETPAGE(), prefer the existing error message: "DT_GETPAGE: dtree 
    page corrupt\n" instead of: "DT_GETPAGE: dtree root page corrupt\n" or 
    explain why the new string is desirable despite the check being 
    bidirectional. i.e. the invariant is bidirectional and also catches 
    non-root pages incorrectly carrying BT_ROOT.
    
    >   /* for consistency */
    >   #define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
    > diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
    > index 28c3cf960..6d960dd96 100644
    > --- a/fs/jfs/jfs_xtree.c
    > +++ b/fs/jfs/jfs_xtree.c
    > @@ -118,10 +118,11 @@ static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **m
    >   	if (rc)
    >   		return ERR_PTR(rc);
    >   	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
    > -		(le16_to_cpu(p->header.nextindex) >
    > -			le16_to_cpu(p->header.maxentry)) ||
    > -		(le16_to_cpu(p->header.maxentry) >
    > -			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
    > +	    (le16_to_cpu(p->header.nextindex) >
    > +	     le16_to_cpu(p->header.maxentry)) ||
    > +	    (le16_to_cpu(p->header.maxentry) >
    > +	     ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
    > +	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {
    >   		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
    >   		BT_PUTPAGE(*mp);
    >   		*mp = NULL;
    > 
    > 
    > base-commit: 8cd9520d35a6c38db6567e97dd93b1f11f185dc6
    
    preserve local indentation/style in `DT_GETPAGE()` and `xt_getpage()`. 
    do not reindent the whole DT_GETPAGE() macro or existing xt_getpage() 
    condition block. add only the minimal new condition/branch.
    
    -kusaram
    
    

Outputs:
AckedBy
[]
Fixes
map[Hash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Title:Linux-2.6.12-rc2]
KernelBranch
master
KernelCommit
8cd9520d35a6c38db6567e97dd93b1f11f185dc6
KernelRepo
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
PatchDescription
jfs: validate BT_ROOT flag in xt_getpage and DT_GETPAGE

A corrupted JFS image can trick the kernel into calling release_metapage()
on a pseudo-metapage embedded within the inode, leading to an out-of-bounds
memory access and a spinlock crash.

When operating on the root page of an xtree or dtree (which is stored
inline within the inode), JFS doesn't use a real struct metapage. Instead,
BT_GETPAGE() sets the metapage pointer to the address of
JFS_IP(ip)->bxflag. Because this is a pseudo-metapage, it does not have a
valid wait_queue_head_t wait field. Accessing mp->wait reads out-of-bounds
memory in struct jfs_inode_info.

In xt_getpage(), the code validates nextindex and maxentry, but it fails to
verify that the BT_ROOT flag is set in p->header.flag for the root page (bn
== 0). If the inline xtree root page has a corrupted header.flag where
BT_ROOT is missing, xtTruncate() will mistakenly treat the root page as a
regular leaf page and call discard_metapage(mp).

Unlike XT_PUTPAGE() which safely checks !BT_IS_ROOT(mp) before releasing,
discard_metapage() calls release_metapage(mp) directly. This assumes mp is
a real metapage and calls unlock_metapage(mp), which executes
wake_up(&mp->wait), accessing garbage memory and resulting in a spinlock
bad magic BUG or UBSAN out-of-bounds array access.

Fix this by enforcing the invariant that the BT_ROOT flag is set if and
only if bn == 0 in both xt_getpage() and DT_GETPAGE().

BUG: spinlock bad magic on CPU#0, syz-executor/6066
 lock: 0xffff888120999b48, .magic: ffffffff, .owner: <...>/-1902340672,
 .owner_cpu: 768
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1
PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230
 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 </TASK>
PatchDiff
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index ac0f79faf..bbb157daf 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -111,19 +111,26 @@ struct dtsplit {
 #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 
 /* get page buffer for specified block address */
-#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
-do {									\
-	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
-	if (!(RC)) {							\
-		if ((BN) && !check_dtpage(P)) {				\
-			BT_PUTPAGE(MP);					\
-			jfs_error((IP)->i_sb,				\
-				  "DT_GETPAGE: dtree page corrupt\n");	\
-			MP = NULL;					\
-			RC = -EIO;					\
-		}							\
-	}								\
-} while (0)
+#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)                                       \
+	do {                                                                      \
+		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);          \
+		if (!(RC)) {                                                      \
+			if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {      \
+				BT_PUTPAGE(MP);                                   \
+				jfs_error(                                        \
+					(IP)->i_sb,                               \
+					"DT_GETPAGE: dtree root page corrupt\n"); \
+				MP = NULL;                                        \
+				RC = -EIO;                                        \
+			} else if ((BN) && !check_dtpage(P)) {                    \
+				BT_PUTPAGE(MP);                                   \
+				jfs_error((IP)->i_sb,                             \
+					  "DT_GETPAGE: dtree page corrupt\n");    \
+				MP = NULL;                                        \
+				RC = -EIO;                                        \
+			}                                                         \
+		}                                                                 \
+	} while (0)
 
 /* for consistency */
 #define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 28c3cf960..6d960dd96 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -118,10 +118,11 @@ static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **m
 	if (rc)
 		return ERR_PTR(rc);
 	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
-		(le16_to_cpu(p->header.nextindex) >
-			le16_to_cpu(p->header.maxentry)) ||
-		(le16_to_cpu(p->header.maxentry) >
-			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
+	    (le16_to_cpu(p->header.nextindex) >
+	     le16_to_cpu(p->header.maxentry)) ||
+	    (le16_to_cpu(p->header.maxentry) >
+	     ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
+	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {
 		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
 		BT_PUTPAGE(*mp);
 		*mp = NULL;
Recipients
[map[Email:arnd@arndb.de Name:Arnd Bergmann To:false] map[Email:jfs-discussion@lists.sourceforge.net Name: To:true] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:shaggy@kernel.org Name:Dave Kleikamp To:true] map[Email:suchitkarunakaran@gmail.com Name:Suchit Karunakaran To:false] map[Email:yun.zhou@windriver.com Name:Yun Zhou To:false] map[Email:zheng.yu@northwestern.edu Name:Zheng Yu To:false]]
ReportedBy
[]
ReviewedBy
[]
TestedBy
[]

Crash report:
BUG: spinlock bad magic on CPU#1, syz-executor356/5851
==================================================================
BUG: KASAN: slab-out-of-bounds in string_nocheck lib/vsprintf.c:639 [inline]
BUG: KASAN: slab-out-of-bounds in string+0x231/0x2b0 lib/vsprintf.c:721
Read of size 1 at addr ffff888011715338 by task syz-executor356/5851

CPU: 1 UID: 0 PID: 5851 Comm: syz-executor356 Not tainted 6.16.0-rc7-syzkaller-00018-g01a412d06bc5 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xca/0x230 mm/kasan/report.c:480
 kasan_report+0x118/0x150 mm/kasan/report.c:593
 string_nocheck lib/vsprintf.c:639 [inline]
 string+0x231/0x2b0 lib/vsprintf.c:721
 vsnprintf+0x739/0xf00 lib/vsprintf.c:2874
 vprintk_store+0x3c7/0xd00 kernel/printk/printk.c:2279
 vprintk_emit+0x21e/0x7a0 kernel/printk/printk.c:2426
 _printk+0xcf/0x120 kernel/printk/printk.c:2475
 spin_dump+0x102/0x1a0 kernel/locking/spinlock_debug.c:64
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1ca/0x290 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0xb3/0xf0 kernel/locking/spinlock.c:162
 __wake_up_common_lock+0x2f/0x1f0 kernel/sched/wait.c:105
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x13c/0xac0 fs/jfs/jfs_metapage.c:869
 xtTruncate+0xe71/0x2dd0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x33a/0x4a0 fs/jfs/namei.c:759
 jfs_evict_inode+0x363/0x440 fs/jfs/inode.c:153
 evict+0x504/0x9c0 fs/inode.c:810
 __dentry_kill+0x209/0x660 fs/dcache.c:669
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1114
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1141
 shrink_dcache_parent+0xa1/0x2c0 fs/dcache.c:-1
 do_one_tree+0x23/0xe0 fs/dcache.c:1604
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1621
 generic_shutdown_super+0x67/0x2c0 fs/super.c:621
 kill_block_super+0x44/0x90 fs/super.c:1755
 deactivate_locked_super+0xbc/0x130 fs/super.c:474
 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1417
 task_work_run+0x1d4/0x260 kernel/task_work.c:227
 ptrace_notify+0x281/0x2c0 kernel/signal.c:2520
 ptrace_report_syscall include/linux/ptrace.h:415 [inline]
 ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
 syscall_exit_work+0xc6/0x1d0 kernel/entry/common.c:173
 syscall_exit_to_user_mode_work include/linux/entry-common.h:412 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline]
 do_syscall_64+0x2ad/0x3b0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f03dee40447
Code: 07 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffe686a4bf8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000018b76 RCX: 00007f03dee40447
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffe686a4cb0
RBP: 00007ffe686a4cb0 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000202 R12: 00007ffe686a5d20
R13: 00005555784cf6c0 R14: 0000000000000001 R15: 431bde82d7b634db
 </TASK>

The buggy address belongs to the object at ffff8880117152f8
 which belongs to the cache jfs_ip of size 2232
The buggy address is located 64 bytes inside of
 allocated 2232-byte region [ffff8880117152f8, ffff888011715bb0)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11710
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801df9a8c0 dead000000000122 0000000000000000
raw: 0000000000000000 00000000800d000d 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801df9a8c0 dead000000000122 0000000000000000
head: 0000000000000000 00000000800d000d 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea000045c401 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Reclaimable, gfp_mask 0xd2050(__GFP_RECLAIMABLE|__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5852, tgid 5852 (syz-executor356), ts 101599529134, free_ts 36990956990
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704
 prep_new_page mm/page_alloc.c:1712 [inline]
 get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3669
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4959
 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2419
 alloc_slab_page mm/slub.c:2451 [inline]
 allocate_slab+0x8a/0x3b0 mm/slub.c:2619
 new_slab mm/slub.c:2673 [inline]
 ___slab_alloc+0xbfc/0x1480 mm/slub.c:3859
 __slab_alloc mm/slub.c:3949 [inline]
 __slab_alloc_node mm/slub.c:4024 [inline]
 slab_alloc_node mm/slub.c:4185 [inline]
 kmem_cache_alloc_lru_noprof+0x288/0x3d0 mm/slub.c:4216
 jfs_alloc_inode+0x28/0x70 fs/jfs/super.c:105
 alloc_inode+0x6a/0x1b0 fs/inode.c:346
 new_inode+0x22/0x170 fs/inode.c:1145
 jfs_fill_super+0x569/0xd90 fs/jfs/super.c:511
 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1681
 vfs_get_tree+0x92/0x2b0 fs/super.c:1804
 do_new_mount+0x24a/0xa40 fs/namespace.c:3902
 do_mount fs/namespace.c:4239 [inline]
 __do_sys_mount fs/namespace.c:4450 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4427
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
page last free pid 1 tgid 1 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1248 [inline]
 __free_frozen_pages+0xc71/0xe70 mm/page_alloc.c:2706
 __free_pages mm/page_alloc.c:5071 [inline]
 free_reserved_page+0xce/0x120 mm/page_alloc.c:5974
 free_reserved_area+0x90/0x190 mm/page_alloc.c:5960
 free_init_pages arch/x86/mm/init.c:936 [inline]
 free_kernel_image_pages+0xa2/0x100 arch/x86/mm/init.c:952
 kernel_init+0x31/0x1d0 init/main.c:1483
 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Memory state around the buggy address:
 ffff888011715200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
 ffff888011715280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888011715300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                        ^
 ffff888011715380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888011715400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/06/26 20:26 flow patching
1h47m Results:
map[AckedBy:[] Fixes:map[Hash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Title:Linux-2.6.12-rc2] KernelBranch:master KernelCommit:8cd9520d35a6c38db6567e97dd93b1f11f185dc6 KernelRepo:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git PatchDescription:jfs: validate BT_ROOT flag in xt_getpage and DT_GETPAGE

A corrupted JFS image can trick the kernel into calling release_metapage()
on a pseudo-metapage embedded within the inode, leading to an out-of-bounds
memory access and a spinlock crash.

When operating on the root page of an xtree or dtree (which is stored
inline within the inode), JFS doesn't use a real struct metapage. Instead,
BT_GETPAGE() sets the metapage pointer to the address of
JFS_IP(ip)->bxflag. Because this is a pseudo-metapage, it does not have a
valid wait_queue_head_t wait field. Accessing mp->wait reads out-of-bounds
memory in struct jfs_inode_info.

In xt_getpage(), the code validates nextindex and maxentry, but it fails to
verify that the BT_ROOT flag is set in p->header.flag for the root page (bn
== 0). If the inline xtree root page has a corrupted header.flag where
BT_ROOT is missing, xtTruncate() will mistakenly treat the root page as a
regular leaf page and call discard_metapage(mp).

Unlike XT_PUTPAGE() which safely checks !BT_IS_ROOT(mp) before releasing,
discard_metapage() calls release_metapage(mp) directly. This assumes mp is
a real metapage and calls unlock_metapage(mp), which executes
wake_up(&mp->wait), accessing garbage memory and resulting in a spinlock
bad magic BUG or UBSAN out-of-bounds array access.

Fix this by enforcing the invariant that the BT_ROOT flag is set if and
only if bn == 0 in both xt_getpage() and DT_GETPAGE().

BUG: spinlock bad magic on CPU#0, syz-executor/6066
 lock: 0xffff888120999b48, .magic: ffffffff, .owner: <...>/-1902340672,
 .owner_cpu: 768
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1
PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230
 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 </TASK> PatchDiff:diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index ac0f79faf..bbb157daf 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -111,19 +111,26 @@ struct dtsplit {
 #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 
 /* get page buffer for specified block address */
-#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
-do {									\
-	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
-	if (!(RC)) {							\
-		if ((BN) && !check_dtpage(P)) {				\
-			BT_PUTPAGE(MP);					\
-			jfs_error((IP)->i_sb,				\
-				  "DT_GETPAGE: dtree page corrupt\n");	\
-			MP = NULL;					\
-			RC = -EIO;					\
-		}							\
-	}								\
-} while (0)
+#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)                                       \
+	do {                                                                      \
+		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);          \
+		if (!(RC)) {                                                      \
+			if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {      \
+				BT_PUTPAGE(MP);                                   \
+				jfs_error(                                        \
+					(IP)->i_sb,                               \
+					"DT_GETPAGE: dtree root page corrupt\n"); \
+				MP = NULL;                                        \
+				RC = -EIO;                                        \
+			} else if ((BN) && !check_dtpage(P)) {                    \
+				BT_PUTPAGE(MP);                                   \
+				jfs_error((IP)->i_sb,                             \
+					  "DT_GETPAGE: dtree page corrupt\n");    \
+				MP = NULL;                                        \
+				RC = -EIO;                                        \
+			}                                                         \
+		}                                                                 \
+	} while (0)
 
 /* for consistency */
 #define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 28c3cf960..6d960dd96 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -118,10 +118,11 @@ static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **m
 	if (rc)
 		return ERR_PTR(rc);
 	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
-		(le16_to_cpu(p->header.nextindex) >
-			le16_to_cpu(p->header.maxentry)) ||
-		(le16_to_cpu(p->header.maxentry) >
-			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
+	    (le16_to_cpu(p->header.nextindex) >
+	     le16_to_cpu(p->header.maxentry)) ||
+	    (le16_to_cpu(p->header.maxentry) >
+	     ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
+	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {
 		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
 		BT_PUTPAGE(*mp);
 		*mp = NULL;
 Recipients:[map[Email:arnd@arndb.de Name:Arnd Bergmann To:false] map[Email:jfs-discussion@lists.sourceforge.net Name: To:true] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:shaggy@kernel.org Name:Dave Kleikamp To:true] map[Email:suchitkarunakaran@gmail.com Name:Suchit Karunakaran To:false] map[Email:yun.zhou@windriver.com Name:Yun Zhou To:false] map[Email:zheng.yu@northwestern.edu Name:Zheng Yu To:false]] ReportedBy:[] ReviewedBy:[] TestedBy:[]]

1/1 2026/06/26 20:26 action base-commit-picker
0m Results:
map[KernelBranch:master KernelCommit:8cd9520d35a6c38db6567e97dd93b1f11f185dc6 KernelRepo:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git]

2/1 2026/06/26 20:26 action syz-repro-to-c-repro
0m Results:
map[SimplifiedCRepro:// autogenerated by syzkaller (https://github.com/google/syzkaller)

#define _GNU_SOURCE 

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <setjmp.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

#include <linux/loop.h>

#ifndef __NR_memfd_create
#define __NR_memfd_create 319
#endif
#ifndef __NR_open_tree
#define __NR_open_tree 428
#endif
#ifndef __NR_renameat2
#define __NR_renameat2 316
#endif

static unsigned long long procid;

//% This code is derived from puff.{c,h}, found in the zlib development. The
//% original files come with the following copyright notice:

//% Copyright (C) 2002-2013 Mark Adler, all rights reserved
//% version 2.3, 21 Jan 2013
//% This software is provided 'as-is', without any express or implied
//% warranty.  In no event will the author be held liable for any damages
//% arising from the use of this software.
//% Permission is granted to anyone to use this software for any purpose,
//% including commercial applications, and to alter it and redistribute it
//% freely, subject to the following restrictions:
//% 1. The origin of this software must not be misrepresented; you must not
//%    claim that you wrote the original software. If you use this software
//%    in a product, an acknowledgment in the product documentation would be
//%    appreciated but is not required.
//% 2. Altered source versions must be plainly marked as such, and must not be
//%    misrepresented as being the original software.
//% 3. This notice may not be removed or altered from any source distribution.
//% Mark Adler    madler@alumni.caltech.edu

//% BEGIN CODE DERIVED FROM puff.{c,h}

#define MAXBITS 15
#define MAXLCODES 286
#define MAXDCODES 30
#define MAXCODES (MAXLCODES + MAXDCODES)
#define FIXLCODES 288

struct puff_state {
	unsigned char* out;
	unsigned long outlen;
	unsigned long outcnt;
	const unsigned char* in;
	unsigned long inlen;
	unsigned long incnt;
	int bitbuf;
	int bitcnt;
	jmp_buf env;
};
static int puff_bits(struct puff_state* s, int need)
{
	long val = s->bitbuf;
	while (s->bitcnt < need) {
		if (s->incnt == s->inlen)
			longjmp(s->env, 1);
		val |= (long)(s->in[s->incnt++]) << s->bitcnt;
		s->bitcnt += 8;
	}
	s->bitbuf = (int)(val >> need);
	s->bitcnt -= need;
	return (int)(val & ((1L << need) - 1));
}
static int puff_stored(struct puff_state* s)
{
	s->bitbuf = 0;
	s->bitcnt = 0;
	if (s->incnt + 4 > s->inlen)
		return 2;
	unsigned len = s->in[s->incnt++];
	len |= s->in[s->incnt++] << 8;
	if (s->in[s->incnt++] != (~len & 0xff) ||
	    s->in[s->incnt++] != ((~len >> 8) & 0xff))
		return -2;
	if (s->incnt + len > s->inlen)
		return 2;
	if (s->outcnt + len > s->outlen)
		return 1;
	for (; len--; s->outcnt++, s->incnt++) {
		if (s->in[s->incnt])
			s->out[s->outcnt] = s->in[s->incnt];
	}
	return 0;
}
struct puff_huffman {
	short* count;
	short* symbol;
};
static int puff_decode(struct puff_state* s, const struct puff_huffman* h)
{
	int first = 0;
	int index = 0;
	int bitbuf = s->bitbuf;
	int left = s->bitcnt;
	int code = first = index = 0;
	int len = 1;
	short* next = h->count + 1;
	while (1) {
		while (left--) {
			code |= bitbuf & 1;
			bitbuf >>= 1;
			int count = *next++;
			if (code - count < first) {
				s->bitbuf = bitbuf;
				s->bitcnt = (s->bitcnt - len) & 7;
				return h->symbol[index + (code - first)];
			}
			index += count;
			first += count;
			first <<= 1;
			code <<= 1;
			len++;
		}
		left = (MAXBITS + 1) - len;
		if (left == 0)
			break;
		if (s->incnt == s->inlen)
			longjmp(s->env, 1);
		bitbuf = s->in[s->incnt++];
		if (left > 8)
			left = 8;
	}
	return -10;
}
static int puff_construct(struct puff_huffman* h, const short* length, int n)
{
	int len;
	for (len = 0; len <= MAXBITS; len++)
		h->count[len] = 0;
	int symbol;
	for (symbol = 0; symbol < n; symbol++)
		(h->count[length[symbol]])++;
	if (h->count[0] == n)
		return 0;
	int left = 1;
	for (len = 1; len <= MAXBITS; len++) {
		left <<= 1;
		left -= h->count[len];
		if (left < 0)
			return left;
	}
	short offs[MAXBITS + 1];
	offs[1] = 0;
	for (len = 1; len < MAXBITS; len++)
		offs[len + 1] = offs[len] + h->count[len];
	for (symbol = 0; symbol < n; symbol++)
		if (length[symbol] != 0)
			h->symbol[offs[length[symbol]]++] = symbol;
	return left;
}
static int puff_codes(struct puff_state* s,
		      const struct puff_huffman* lencode,
		      const struct puff_huffman* distcode)
{
	static const short lens[29] = {
				       3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
				       35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258};
	static const short lext[29] = {
				       0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
				       3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
	static const short dists[30] = {
					1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
					257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
					8193, 12289, 16385, 24577};
	static const short dext[30] = {
				       0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
				       7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
				       12, 12, 13, 13};
	int symbol;
	do {
		symbol = puff_decode(s, lencode);
		if (symbol < 0)
			return symbol;
		if (symbol < 256) {
			if (s->outcnt == s->outlen)
				return 1;
			if (symbol)
				s->out[s->outcnt] = symbol;
			s->outcnt++;
		} else if (symbol > 256) {
			symbol -= 257;
			if (symbol >= 29)
				return -10;
			int len = lens[symbol] + puff_bits(s, lext[symbol]);
			symbol = puff_decode(s, distcode);
			if (symbol < 0)
				return symbol;
			unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]);
			if (dist > s->outcnt)
				return -11;
			if (s->outcnt + len > s->outlen)
				return 1;
			while (len--) {
				if (dist <= s->outcnt && s->out[s->outcnt - dist])
					s->out[s->outcnt] = s->out[s->outcnt - dist];
				s->outcnt++;
			}
		}
	} while (symbol != 256);
	return 0;
}
static int puff_fixed(struct puff_state* s)
{
	static int virgin = 1;
	static short lencnt[MAXBITS + 1], lensym[FIXLCODES];
	static short distcnt[MAXBITS + 1], distsym[MAXDCODES];
	static struct puff_huffman lencode, distcode;
	if (virgin) {
		lencode.count = lencnt;
		lencode.symbol = lensym;
		distcode.count = distcnt;
		distcode.symbol = distsym;
		short lengths[FIXLCODES];
		int symbol;
		for (symbol = 0; symbol < 144; symbol++)
			lengths[symbol] = 8;
		for (; symbol < 256; symbol++)
			lengths[symbol] = 9;
		for (; symbol < 280; symbol++)
			lengths[symbol] = 7;
		for (; symbol < FIXLCODES; symbol++)
			lengths[symbol] = 8;
		puff_construct(&lencode, lengths, FIXLCODES);
		for (symbol = 0; symbol < MAXDCODES; symbol++)
			lengths[symbol] = 5;
		puff_construct(&distcode, lengths, MAXDCODES);
		virgin = 0;
	}
	return puff_codes(s, &lencode, &distcode);
}
static int puff_dynamic(struct puff_state* s)
{
	static const short order[19] =
	    {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
	int nlen = puff_bits(s, 5) + 257;
	int ndist = puff_bits(s, 5) + 1;
	int ncode = puff_bits(s, 4) + 4;
	if (nlen > MAXLCODES || ndist > MAXDCODES)
		return -3;
	short lengths[MAXCODES];
	int index;
	for (index = 0; index < ncode; index++)
		lengths[order[index]] = puff_bits(s, 3);
	for (; index < 19; index++)
		lengths[order[index]] = 0;
	short lencnt[MAXBITS + 1], lensym[MAXLCODES];
	struct puff_huffman lencode = {lencnt, lensym};
	int err = puff_construct(&lencode, lengths, 19);
	if (err != 0)
		return -4;
	index = 0;
	while (index < nlen + ndist) {
		int symbol;
		int len;
		symbol = puff_decode(s, &lencode);
		if (symbol < 0)
			return symbol;
		if (symbol < 16)
			lengths[index++] = symbol;
		else {
			len = 0;
			if (symbol == 16) {
				if (index == 0)
					return -5;
				len = lengths[index - 1];
				symbol = 3 + puff_bits(s, 2);
			} else if (symbol == 17)
				symbol = 3 + puff_bits(s, 3);
			else
				symbol = 11 + puff_bits(s, 7);
			if (index + symbol > nlen + ndist)
				return -6;
			while (symbol--)
				lengths[index++] = len;
		}
	}
	if (lengths[256] == 0)
		return -9;
	err = puff_construct(&lencode, lengths, nlen);
	if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1]))
		return -7;
	short distcnt[MAXBITS + 1], distsym[MAXDCODES];
	struct puff_huffman distcode = {distcnt, distsym};
	err = puff_construct(&distcode, lengths + nlen, ndist);
	if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1]))
		return -8;
	return puff_codes(s, &lencode, &distcode);
}
static int puff(
    unsigned char* dest,
    unsigned long* destlen,
    const unsigned char* source,
    unsigned long sourcelen)
{
	struct puff_state s = {
	    .out = dest,
	    .outlen = *destlen,
	    .outcnt = 0,
	    .in = source,
	    .inlen = sourcelen,
	    .incnt = 0,
	    .bitbuf = 0,
	    .bitcnt = 0,
	};
	int err;
	if (setjmp(s.env) != 0)
		err = 2;
	else {
		int last;
		do {
			last = puff_bits(&s, 1);
			int type = puff_bits(&s, 2);
			err = type == 0 ? puff_stored(&s) : (type == 1 ? puff_fixed(&s) : (type == 2 ? puff_dynamic(&s) : -1));
			if (err != 0)
				break;
		} while (!last);
	}
	*destlen = s.outcnt;
	return err;
}

//% END CODE DERIVED FROM puff.{c,h}

#define ZLIB_HEADER_WIDTH 2

static int puff_zlib_to_file(const unsigned char* source, unsigned long sourcelen, int dest_fd)
{
	if (sourcelen < ZLIB_HEADER_WIDTH)
		return 0;
	source += ZLIB_HEADER_WIDTH;
	sourcelen -= ZLIB_HEADER_WIDTH;
	const unsigned long max_destlen = 132 << 20;
	void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0);
	if (ret == MAP_FAILED)
		return -1;
	unsigned char* dest = (unsigned char*)ret;
	unsigned long destlen = max_destlen;
	int err = puff(dest, &destlen, source, sourcelen);
	if (err) {
		munmap(dest, max_destlen);
		errno = -err;
		return -1;
	}
	if (write(dest_fd, dest, destlen) != (ssize_t)destlen) {
		munmap(dest, max_destlen);
		return -1;
	}
	return munmap(dest, max_destlen);
}

static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p)
{
	int err = 0, loopfd = -1;
	int memfd = syscall(__NR_memfd_create, "syzkaller", 0);
	if (memfd == -1) {
		err = errno;
		goto error;
	}
	if (puff_zlib_to_file(data, size, memfd)) {
		err = errno;
		goto error_close_memfd;
	}
	loopfd = open(loopname, O_RDWR);
	if (loopfd == -1) {
		err = errno;
		goto error_close_memfd;
	}
	if (ioctl(loopfd, LOOP_SET_FD, memfd)) {
		if (errno != EBUSY) {
			err = errno;
			goto error_close_loop;
		}
		ioctl(loopfd, LOOP_CLR_FD, 0);
		usleep(1000);
		if (ioctl(loopfd, LOOP_SET_FD, memfd)) {
			err = errno;
			goto error_close_loop;
		}
	}
	close(memfd);
	*loopfd_p = loopfd;
	return 0;

error_close_loop:
	close(loopfd);
error_close_memfd:
	close(memfd);
error:
	errno = err;
	return -1;
}

static void reset_loop_device(const char* loopname)
{
	int loopfd = open(loopname, O_RDWR);
	if (loopfd == -1) {
		return;
	}
	if (ioctl(loopfd, LOOP_CLR_FD, 0)) {
	}
	close(loopfd);
}

static long syz_mount_image(
    volatile long fsarg,
    volatile long dir,
    volatile long flags,
    volatile long optsarg,
    volatile long change_dir,
    volatile unsigned long size,
    volatile long image)
{
	unsigned char* data = (unsigned char*)image;
	int res = -1, err = 0, need_loop_device = !!size;
	char* mount_opts = (char*)optsarg;
	char* target = (char*)dir;
	char* fs = (char*)fsarg;
	char* source = NULL;
	char loopname[64];
	if (need_loop_device) {
		int loopfd;
		memset(loopname, 0, sizeof(loopname));
		snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid);
		if (setup_loop_device(data, size, loopname, &loopfd) == -1)
			return -1;
		close(loopfd);
		source = loopname;
	}
	mkdir(target, 0777);
	char opts[256];
	memset(opts, 0, sizeof(opts));
	if (strlen(mount_opts) > (sizeof(opts) - 32)) {
	}
	strncpy(opts, mount_opts, sizeof(opts) - 32);
	if (strcmp(fs, "iso9660") == 0) {
		flags |= MS_RDONLY;
	} else if (strncmp(fs, "ext", 3) == 0) {
		bool has_remount_ro = false;
		char* remount_ro_start = strstr(opts, "errors=remount-ro");
		if (remount_ro_start != NULL) {
			char after = *(remount_ro_start + strlen("errors=remount-ro"));
			char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1);
			has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ','));
		}
		if (strstr(opts, "errors=panic") || !has_remount_ro)
			strcat(opts, ",errors=continue");
	} else if (strcmp(fs, "xfs") == 0) {
		strcat(opts, ",nouuid");
	} else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) {
		strcat(opts, ",errors=withdraw");
	}
	res = mount(source, target, fs, flags, opts);
	if (res == -1) {
		err = errno;
		goto error_clear_loop;
	}
	res = open(target, O_RDONLY | O_DIRECTORY);
	if (res == -1) {
		err = errno;
		goto error_clear_loop;
	}
	if (change_dir) {
		res = chdir(target);
		if (res == -1) {
			err = errno;
		}
	}

error_clear_loop:
	if (need_loop_device)
		reset_loop_device(loopname);
	errno = err;
	return res;
}

uint64_t r[1] = {0xffffffffffffffff};

int main(void)
{
		syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	const char* reason;
	(void)reason;
				intptr_t res = 0;
	if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {}
//  syz_mount_image$jfs arguments: [
//    fs: ptr[in, buffer] {
//      buffer: {6a 66 73 00} (length 0x4)
//    }
//    dir: ptr[in, buffer] {
//      buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8)
//    }
//    flags: mount_flags = 0x2 (8 bytes)
//    opts: ptr[in, fs_options[jfs_options]] {
//      fs_options[jfs_options] {
//        elems: array[fs_opt_elem[jfs_options]] {
//        }
//        common: array[fs_opt_elem[fs_options_common]] {
//        }
//        null: const = 0x0 (1 bytes)
//      }
//    }
//    chdir: int8 = 0x1 (1 bytes)
//    size: len = 0x608f (8 bytes)
//    img: ptr[in, buffer] {
//      buffer: (compressed buffer with length 0x608f)
//    }
//  ]
//  returns fd_dir
memcpy((void*)0x200000000000, "jfs\000", 4);
memcpy((void*)0x200000000180, "./file0\000", 8);
*(uint8_t*)0x200000000040 = 0;
memcpy((void*)0x200000006600, "... [truncated large byte array] ...", 24719);
syz_mount_image(/*fs=*/0x200000000000, /*dir=*/0x200000000180, /*flags=MS_NOSUID*/2, /*opts=*/0x200000000040, /*chdir=*/1, /*size=*/0x608f, /*img=*/0x200000006600);
//  open_tree arguments: [
//    dfd: fd_dir (resource)
//    filename: ptr[in, buffer] {
//      buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8)
//    }
//    flags: open_tree_flags = 0x0 (8 bytes)
//  ]
//  returns fd
memcpy((void*)0x200000000040, "./file0\000", 8);
	res = syscall(__NR_open_tree, /*dfd=*/0xffffff9c, /*filename=*/0x200000000040ul, /*flags=*/0ul);
	if (res != -1)
		r[0] = res;
//  renameat2 arguments: [
//    oldfd: fd_dir (resource)
//    old: ptr[in, buffer] {
//      buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8)
//    }
//    newfd: fd_dir (resource)
//    new: ptr[in, buffer] {
//      buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8)
//    }
//    flags: renameat2_flags = 0x0 (8 bytes)
//  ]
memcpy((void*)0x200000000140, "./file1\000", 8);
memcpy((void*)0x200000000980, "./file0\000", 8);
	syscall(__NR_renameat2, /*oldfd=*/0xffffff9c, /*old=*/0x200000000140ul, /*newfd=*/r[0], /*new=*/0x200000000980ul, /*flags=*/0ul);
	return 0;
}
]

3/1 2026/06/26 20:26 action kernel-checkouter
0m Results:
map[KernelSrc:/app/workdir/cache/src/1583fc50e73bc268b47064ec35fa43904fad8ca1]

4/1 2026/06/26 20:26 action kernel-builder
28m Results:
map[KernelObj:/app/workdir/cache/build/050c65f58b2b3880a0442bc55400001da6a3ea7d]

5/1 2026/06/26 20:55 action crash-reproducer
1m Results:
map[OtherCrashReports:<nil> ReproducedBugTitle:BUG: spinlock bad magic in release_metapage ReproducedCrashReport:BUG: spinlock bad magic on CPU#0, syz-executor/6066
 lock: 0xffff888120999b48, .magic: ffffffff, .owner: �������� �������/-1902340672, .owner_cpu: 768
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in /app/workdir/cache/src/1583fc50e73bc268b47064ec35fa43904fad8ca1/kernel/locking/qspinlock.h:68:9
index 8945 is out of range for type 'unsigned long[8]'
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 ubsan_epilogue+0xa/0x30 lib/ubsan.c:233
 __ubsan_handle_out_of_bounds+0xe8/0xf0 lib/ubsan.c:455
 decode_tail kernel/locking/qspinlock.h:68 [inline]
 __pv_queued_spin_lock_slowpath+0xaf3/0xbc0 kernel/locking/qspinlock.c:285
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:35 [inline]
 queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:66 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x26c/0x2f0 kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
---[ end trace ]---
 ReproducedFaultInjection:]

6/1 2026/06/26 20:57 action codesearch-prepare
12m Results:
map[Index:codesearch-index]

7/1 2026/06/26 21:09 agent debugger
7m Model:
gemini-3.1-pro-preview

Instruction:
You are an experienced Linux kernel developer tasked with debugging a kernel crash root cause.
You need to provide a detailed explanation of the root cause for another developer to be
able to write a fix for the bug based on your explanation. Include all relevant details
into the response: function/struct/field/etc names, code snippets, line numbers,
macro/enum values, etc.



Don't make assumptions about the kernel source code (it may be different from what you assume it is).
Extensively use the provided code access tools (codesearch-*, git-*, grepper, etc)
to examine the actual source code, and confirm any assumptions.

Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash is:

BUG: spinlock bad magic on CPU#0, syz-executor/6066
 lock: 0xffff888120999b48, .magic: ffffffff, .owner: �������� �������/-1902340672, .owner_cpu: 768
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in /app/workdir/cache/src/1583fc50e73bc268b47064ec35fa43904fad8ca1/kernel/locking/qspinlock.h:68:9
index 8945 is out of range for type 'unsigned long[8]'
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 ubsan_epilogue+0xa/0x30 lib/ubsan.c:233
 __ubsan_handle_out_of_bounds+0xe8/0xf0 lib/ubsan.c:455
 decode_tail kernel/locking/qspinlock.h:68 [inline]
 __pv_queued_spin_lock_slowpath+0xaf3/0xbc0 kernel/locking/qspinlock.c:285
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:35 [inline]
 queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:66 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x26c/0x2f0 kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
---[ end trace ]---


The following C code is a draft of the vulnerable syscall sequence. Keep in mind that
it may lack the precise threading, sandboxing, and some arguments of a working reproducer:

// autogenerated by syzkaller (https://github.com/google/syzkaller)

#define _GNU_SOURCE 

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <setjmp.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

#include <linux/loop.h>

#ifndef __NR_memfd_create
#define __NR_memfd_create 319
#endif
#ifndef __NR_open_tree
#define __NR_open_tree 428
#endif
#ifndef __NR_renameat2
#define __NR_renameat2 316
#endif

static unsigned long long procid;

//% This code is derived from puff.{c,h}, found in the zlib development. The
//% original files come with the following copyright notice:

//% Copyright (C) 2002-2013 Mark Adler, all rights reserved
//% version 2.3, 21 Jan 2013
//% This software is provided 'as-is', without any express or implied
//% warranty.  In no event will the author be held liable for any damages
//% arising from the use of this software.
//% Permission is granted to anyone to use this software for any purpose,
//% including commercial applications, and to alter it and redistribute it
//% freely, subject to the following restrictions:
//% 1. The origin of this software must not be misrepresented; you must not
//%    claim that you wrote the original software. If you use this software
//%    in a product, an acknowledgment in the product documentation would be
//%    appreciated but is not required.
//% 2. Altered source versions must be plainly marked as such, and must not be
//%    misrepresented as being the original software.
//% 3. This notice may not be removed or altered from any source distribution.
//% Mark Adler    madler@alumni.caltech.edu

//% BEGIN CODE DERIVED FROM puff.{c,h}

#define MAXBITS 15
#define MAXLCODES 286
#define MAXDCODES 30
#define MAXCODES (MAXLCODES + MAXDCODES)
#define FIXLCODES 288

struct puff_state {
	unsigned char* out;
	unsigned long outlen;
	unsigned long outcnt;
	const unsigned char* in;
	unsigned long inlen;
	unsigned long incnt;
	int bitbuf;
	int bitcnt;
	jmp_buf env;
};
static int puff_bits(struct puff_state* s, int need)
{
	long val = s->bitbuf;
	while (s->bitcnt < need) {
		if (s->incnt == s->inlen)
			longjmp(s->env, 1);
		val |= (long)(s->in[s->incnt++]) << s->bitcnt;
		s->bitcnt += 8;
	}
	s->bitbuf = (int)(val >> need);
	s->bitcnt -= need;
	return (int)(val & ((1L << need) - 1));
}
static int puff_stored(struct puff_state* s)
{
	s->bitbuf = 0;
	s->bitcnt = 0;
	if (s->incnt + 4 > s->inlen)
		return 2;
	unsigned len = s->in[s->incnt++];
	len |= s->in[s->incnt++] << 8;
	if (s->in[s->incnt++] != (~len & 0xff) ||
	    s->in[s->incnt++] != ((~len >> 8) & 0xff))
		return -2;
	if (s->incnt + len > s->inlen)
		return 2;
	if (s->outcnt + len > s->outlen)
		return 1;
	for (; len--; s->outcnt++, s->incnt++) {
		if (s->in[s->incnt])
			s->out[s->outcnt] = s->in[s->incnt];
	}
	return 0;
}
struct puff_huffman {
	short* count;
	short* symbol;
};
static int puff_decode(struct puff_state* s, const struct puff_huffman* h)
{
	int first = 0;
	int index = 0;
	int bitbuf = s->bitbuf;
	int left = s->bitcnt;
	int code = first = index = 0;
	int len = 1;
	short* next = h->count + 1;
	while (1) {
		while (left--) {
			code |= bitbuf & 1;
			bitbuf >>= 1;
			int count = *next++;
			if (code - count < first) {
				s->bitbuf = bitbuf;
				s->bitcnt = (s->bitcnt - len) & 7;
				return h->symbol[index + (code - first)];
			}
			index += count;
			first += count;
			first <<= 1;
			code <<= 1;
			len++;
		}
		left = (MAXBITS + 1) - len;
		if (left == 0)
			break;
		if (s->incnt == s->inlen)
			longjmp(s->env, 1);
		bitbuf = s->in[s->incnt++];
		if (left > 8)
			left = 8;
	}
	return -10;
}
static int puff_construct(struct puff_huffman* h, const short* length, int n)
{
	int len;
	for (len = 0; len <= MAXBITS; len++)
		h->count[len] = 0;
	int symbol;
	for (symbol = 0; symbol < n; symbol++)
		(h->count[length[symbol]])++;
	if (h->count[0] == n)
		return 0;
	int left = 1;
	for (len = 1; len <= MAXBITS; len++) {
		left <<= 1;
		left -= h->count[len];
		if (left < 0)
			return left;
	}
	short offs[MAXBITS + 1];
	offs[1] = 0;
	for (len = 1; len < MAXBITS; len++)
		offs[len + 1] = offs[len] + h->count[len];
	for (symbol = 0; symbol < n; symbol++)
		if (length[symbol] != 0)
			h->symbol[offs[length[symbol]]++] = symbol;
	return left;
}
static int puff_codes(struct puff_state* s,
		      const struct puff_huffman* lencode,
		      const struct puff_huffman* distcode)
{
	static const short lens[29] = {
				       3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
				       35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258};
	static const short lext[29] = {
				       0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
				       3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
	static const short dists[30] = {
					1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
					257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
					8193, 12289, 16385, 24577};
	static const short dext[30] = {
				       0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
				       7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
				       12, 12, 13, 13};
	int symbol;
	do {
		symbol = puff_decode(s, lencode);
		if (symbol < 0)
			return symbol;
		if (symbol < 256) {
			if (s->outcnt == s->outlen)
				return 1;
			if (symbol)
				s->out[s->outcnt] = symbol;
			s->outcnt++;
		} else if (symbol > 256) {
			symbol -= 257;
			if (symbol >= 29)
				return -10;
			int len = lens[symbol] + puff_bits(s, lext[symbol]);
			symbol = puff_decode(s, distcode);
			if (symbol < 0)
				return symbol;
			unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]);
			if (dist > s->outcnt)
				return -11;
			if (s->outcnt + len > s->outlen)
				return 1;
			while (len--) {
				if (dist <= s->outcnt && s->out[s->outcnt - dist])
					s->out[s->outcnt] = s->out[s->outcnt - dist];
				s->outcnt++;
			}
		}
	} while (symbol != 256);
	return 0;
}
static int puff_fixed(struct puff_state* s)
{
	static int virgin = 1;
	static short lencnt[MAXBITS + 1], lensym[FIXLCODES];
	static short distcnt[MAXBITS + 1], distsym[MAXDCODES];
	static struct puff_huffman lencode, distcode;
	if (virgin) {
		lencode.count = lencnt;
		lencode.symbol = lensym;
		distcode.count = distcnt;
		distcode.symbol = distsym;
		short lengths[FIXLCODES];
		int symbol;
		for (symbol = 0; symbol < 144; symbol++)
			lengths[symbol] = 8;
		for (; symbol < 256; symbol++)
			lengths[symbol] = 9;
		for (; symbol < 280; symbol++)
			lengths[symbol] = 7;
		for (; symbol < FIXLCODES; symbol++)
			lengths[symbol] = 8;
		puff_construct(&lencode, lengths, FIXLCODES);
		for (symbol = 0; symbol < MAXDCODES; symbol++)
			lengths[symbol] = 5;
		puff_construct(&distcode, lengths, MAXDCODES);
		virgin = 0;
	}
	return puff_codes(s, &lencode, &distcode);
}
static int puff_dynamic(struct puff_state* s)
{
	static const short order[19] =
	    {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
	int nlen = puff_bits(s, 5) + 257;
	int ndist = puff_bits(s, 5) + 1;
	int ncode = puff_bits(s, 4) + 4;
	if (nlen > MAXLCODES || ndist > MAXDCODES)
		return -3;
	short lengths[MAXCODES];
	int index;
	for (index = 0; index < ncode; index++)
		lengths[order[index]] = puff_bits(s, 3);
	for (; index < 19; index++)
		lengths[order[index]] = 0;
	short lencnt[MAXBITS + 1], lensym[MAXLCODES];
	struct puff_huffman lencode = {lencnt, lensym};
	int err = puff_construct(&lencode, lengths, 19);
	if (err != 0)
		return -4;
	index = 0;
	while (index < nlen + ndist) {
		int symbol;
		int len;
		symbol = puff_decode(s, &lencode);
		if (symbol < 0)
			return symbol;
		if (symbol < 16)
			lengths[index++] = symbol;
		else {
			len = 0;
			if (symbol == 16) {
				if (index == 0)
					return -5;
				len = lengths[index - 1];
				symbol = 3 + puff_bits(s, 2);
			} else if (symbol == 17)
				symbol = 3 + puff_bits(s, 3);
			else
				symbol = 11 + puff_bits(s, 7);
			if (index + symbol > nlen + ndist)
				return -6;
			while (symbol--)
				lengths[index++] = len;
		}
	}
	if (lengths[256] == 0)
		return -9;
	err = puff_construct(&lencode, lengths, nlen);
	if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1]))
		return -7;
	short distcnt[MAXBITS + 1], distsym[MAXDCODES];
	struct puff_huffman distcode = {distcnt, distsym};
	err = puff_construct(&distcode, lengths + nlen, ndist);
	if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1]))
		return -8;
	return puff_codes(s, &lencode, &distcode);
}
static int puff(
    unsigned char* dest,
    unsigned long* destlen,
    const unsigned char* source,
    unsigned long sourcelen)
{
	struct puff_state s = {
	    .out = dest,
	    .outlen = *destlen,
	    .outcnt = 0,
	    .in = source,
	    .inlen = sourcelen,
	    .incnt = 0,
	    .bitbuf = 0,
	    .bitcnt = 0,
	};
	int err;
	if (setjmp(s.env) != 0)
		err = 2;
	else {
		int last;
		do {
			last = puff_bits(&s, 1);
			int type = puff_bits(&s, 2);
			err = type == 0 ? puff_stored(&s) : (type == 1 ? puff_fixed(&s) : (type == 2 ? puff_dynamic(&s) : -1));
			if (err != 0)
				break;
		} while (!last);
	}
	*destlen = s.outcnt;
	return err;
}

//% END CODE DERIVED FROM puff.{c,h}

#define ZLIB_HEADER_WIDTH 2

static int puff_zlib_to_file(const unsigned char* source, unsigned long sourcelen, int dest_fd)
{
	if (sourcelen < ZLIB_HEADER_WIDTH)
		return 0;
	source += ZLIB_HEADER_WIDTH;
	sourcelen -= ZLIB_HEADER_WIDTH;
	const unsigned long max_destlen = 132 << 20;
	void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0);
	if (ret == MAP_FAILED)
		return -1;
	unsigned char* dest = (unsigned char*)ret;
	unsigned long destlen = max_destlen;
	int err = puff(dest, &destlen, source, sourcelen);
	if (err) {
		munmap(dest, max_destlen);
		errno = -err;
		return -1;
	}
	if (write(dest_fd, dest, destlen) != (ssize_t)destlen) {
		munmap(dest, max_destlen);
		return -1;
	}
	return munmap(dest, max_destlen);
}

static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p)
{
	int err = 0, loopfd = -1;
	int memfd = syscall(__NR_memfd_create, "syzkaller", 0);
	if (memfd == -1) {
		err = errno;
		goto error;
	}
	if (puff_zlib_to_file(data, size, memfd)) {
		err = errno;
		goto error_close_memfd;
	}
	loopfd = open(loopname, O_RDWR);
	if (loopfd == -1) {
		err = errno;
		goto error_close_memfd;
	}
	if (ioctl(loopfd, LOOP_SET_FD, memfd)) {
		if (errno != EBUSY) {
			err = errno;
			goto error_close_loop;
		}
		ioctl(loopfd, LOOP_CLR_FD, 0);
		usleep(1000);
		if (ioctl(loopfd, LOOP_SET_FD, memfd)) {
			err = errno;
			goto error_close_loop;
		}
	}
	close(memfd);
	*loopfd_p = loopfd;
	return 0;

error_close_loop:
	close(loopfd);
error_close_memfd:
	close(memfd);
error:
	errno = err;
	return -1;
}

static void reset_loop_device(const char* loopname)
{
	int loopfd = open(loopname, O_RDWR);
	if (loopfd == -1) {
		return;
	}
	if (ioctl(loopfd, LOOP_CLR_FD, 0)) {
	}
	close(loopfd);
}

static long syz_mount_image(
    volatile long fsarg,
    volatile long dir,
    volatile long flags,
    volatile long optsarg,
    volatile long change_dir,
    volatile unsigned long size,
    volatile long image)
{
	unsigned char* data = (unsigned char*)image;
	int res = -1, err = 0, need_loop_device = !!size;
	char* mount_opts = (char*)optsarg;
	char* target = (char*)dir;
	char* fs = (char*)fsarg;
	char* source = NULL;
	char loopname[64];
	if (need_loop_device) {
		int loopfd;
		memset(loopname, 0, sizeof(loopname));
		snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid);
		if (setup_loop_device(data, size, loopname, &loopfd) == -1)
			return -1;
		close(loopfd);
		source = loopname;
	}
	mkdir(target, 0777);
	char opts[256];
	memset(opts, 0, sizeof(opts));
	if (strlen(mount_opts) > (sizeof(opts) - 32)) {
	}
	strncpy(opts, mount_opts, sizeof(opts) - 32);
	if (strcmp(fs, "iso9660") == 0) {
		flags |= MS_RDONLY;
	} else if (strncmp(fs, "ext", 3) == 0) {
		bool has_remount_ro = false;
		char* remount_ro_start = strstr(opts, "errors=remount-ro");
		if (remount_ro_start != NULL) {
			char after = *(remount_ro_start + strlen("errors=remount-ro"));
			char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1);
			has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ','));
		}
		if (strstr(opts, "errors=panic") || !has_remount_ro)
			strcat(opts, ",errors=continue");
	} else if (strcmp(fs, "xfs") == 0) {
		strcat(opts, ",nouuid");
	} else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) {
		strcat(opts, ",errors=withdraw");
	}
	res = mount(source, target, fs, flags, opts);
	if (res == -1) {
		err = errno;
		goto error_clear_loop;
	}
	res = open(target, O_RDONLY | O_DIRECTORY);
	if (res == -1) {
		err = errno;
		goto error_clear_loop;
	}
	if (change_dir) {
		res = chdir(target);
		if (res == -1) {
			err = errno;
		}
	}

error_clear_loop:
	if (need_loop_device)
		reset_loop_device(loopname);
	errno = err;
	return res;
}

uint64_t r[1] = {0xffffffffffffffff};

int main(void)
{
		syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
	const char* reason;
	(void)reason;
				intptr_t res = 0;
	if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {}
//  syz_mount_image$jfs arguments: [
//    fs: ptr[in, buffer] {
//      buffer: {6a 66 73 00} (length 0x4)
//    }
//    dir: ptr[in, buffer] {
//      buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8)
//    }
//    flags: mount_flags = 0x2 (8 bytes)
//    opts: ptr[in, fs_options[jfs_options]] {
//      fs_options[jfs_options] {
//        elems: array[fs_opt_elem[jfs_options]] {
//        }
//        common: array[fs_opt_elem[fs_options_common]] {
//        }
//        null: const = 0x0 (1 bytes)
//      }
//    }
//    chdir: int8 = 0x1 (1 bytes)
//    size: len = 0x608f (8 bytes)
//    img: ptr[in, buffer] {
//      buffer: (compressed buffer with length 0x608f)
//    }
//  ]
//  returns fd_dir
memcpy((void*)0x200000000000, "jfs\000", 4);
memcpy((void*)0x200000000180, "./file0\000", 8);
*(uint8_t*)0x200000000040 = 0;
memcpy((void*)0x200000006600, "... [truncated large byte array] ...", 24719);
syz_mount_image(/*fs=*/0x200000000000, /*dir=*/0x200000000180, /*flags=MS_NOSUID*/2, /*opts=*/0x200000000040, /*chdir=*/1, /*size=*/0x608f, /*img=*/0x200000006600);
//  open_tree arguments: [
//    dfd: fd_dir (resource)
//    filename: ptr[in, buffer] {
//      buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8)
//    }
//    flags: open_tree_flags = 0x0 (8 bytes)
//  ]
//  returns fd
memcpy((void*)0x200000000040, "./file0\000", 8);
	res = syscall(__NR_open_tree, /*dfd=*/0xffffff9c, /*filename=*/0x200000000040ul, /*flags=*/0ul);
	if (res != -1)
		r[0] = res;
//  renameat2 arguments: [
//    oldfd: fd_dir (resource)
//    old: ptr[in, buffer] {
//      buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8)
//    }
//    newfd: fd_dir (resource)
//    new: ptr[in, buffer] {
//      buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8)
//    }
//    flags: renameat2_flags = 0x0 (8 bytes)
//  ]
memcpy((void*)0x200000000140, "./file1\000", 8);
memcpy((void*)0x200000000980, "./file0\000", 8);
	syscall(__NR_renameat2, /*oldfd=*/0xffffff9c, /*old=*/0x200000000140ul, /*newfd=*/r[0], /*new=*/0x200000000980ul, /*flags=*/0ul);
	return 0;
}





Reply:
An excellent catch! The crash is caused by a corrupted JFS image that tricks the kernel into calling `release_metapage()` on a pseudo-metapage embedded within the inode, leading to an out-of-bounds memory access and a spinlock crash.

Here is the detailed root cause analysis and the proposed fix.

### Root Cause Analysis

1. **The Pseudo-Metapage:**
   When operating on the root page of an xtree or dtree (which is stored inline within the inode), JFS doesn't use a real `struct metapage`. Instead, `BT_GETPAGE` (called via `xt_getpage` for `bn == 0`) sets the metapage pointer `mp` to the address of `JFS_IP(ip)->bxflag`:
   ```c
   // fs/jfs/jfs_btree.h
   #define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\
   {\
       if ((BN) == 0)\
       {\
           MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
           P = (TYPE *)&JFS_IP(IP)->ROOT;\
           RC = 0;\
       }\
       // ...
   ```
   Because this is a pseudo-metapage, it does not have a valid `wait_queue_head_t wait` field. Accessing `mp->wait` (which is at offset 64 in `struct metapage`) actually reads out-of-bounds memory in `struct jfs_inode_info` (overlapping with `rdwrlock` or `anon_inode_list`).

2. **The Missing Validation:**
   In `xt_getpage()`, the code validates `nextindex` and `maxentry`, but it **fails to verify that the `BT_ROOT` flag is set** in `p->header.flag` for the root page (`bn == 0`). In the corrupted syzkaller image, the inline xtree root page (`i_xtroot`) has a corrupted `header.flag` where `BT_ROOT` is missing.

3. **The Vulnerable Path in `xtTruncate`:**
   When `xtTruncate()` processes this corrupted root page and it becomes empty, it checks if it is the root page by looking at the `BT_ROOT` flag:
   ```c
   // fs/jfs/jfs_xtree.c : xtTruncate()
           if (p->header.flag & BT_ROOT) {
               // ...
               XT_PUTPAGE(mp);
               goto out;
           } else {
               if (log) {
                   XT_PUTPAGE(mp);
               } else {
                   if (mp->lid)
                       lid_to_tlock(mp->lid)->flag |= tlckFREELOCK;

                   /* invalidate empty leaf page */
                   discard_metapage(mp);
               }
           }
   ```
   Because `BT_ROOT` is missing due to corruption, `xtTruncate` takes the `else` branch, mistakenly treating the root page as a regular leaf page, and calls `discard_metapage(mp)`.

4. **The Crash:**
   Unlike `XT_PUTPAGE` (which wraps `BT_PUTPAGE` and safely checks `!BT_IS_ROOT(mp)` before releasing), `discard_metapage()` calls `release_metapage(mp)` directly:
   ```c
   // fs/jfs/jfs_metapage.h
   static inline void discard_metapage(struct metapage *mp)
   {
       clear_bit(META_dirty, &mp->flag);
       set_bit(META_discard, &mp->flag);
       release_metapage(mp);
   }
   ```
   `release_metapage()` assumes `mp` is a real metapage and calls `unlock_metapage(mp)`, which executes `wake_up(&mp->wait)`. Since `mp` points to `&JFS_IP(ip)->bxflag`, this accesses garbage memory, resulting in the `spinlock bad magic` BUG or the UBSAN out-of-bounds array access.

### Proposed Fix

To fix this, we must enforce the invariant that the `BT_ROOT` flag is set **if and only if** `bn == 0`. 

**1. Fix in `xt_getpage` (`fs/jfs/jfs_xtree.c`):**
Add a check to ensure `BT_ROOT` consistency:
```c
static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
{
	xtpage_t *p;
	int rc;

	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);

	if (rc)
		return ERR_PTR(rc);
	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
	    (le16_to_cpu(p->header.nextindex) > le16_to_cpu(p->header.maxentry)) ||
	    (le16_to_cpu(p->header.maxentry) > ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {      // <--- ADD THIS CHECK
		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	}
	return p;
}
```

**2. Fix in `DT_GETPAGE` (`fs/jfs/jfs_dtree.c`):**
The exact same vulnerability exists for dtree pages (e.g., `dtDeleteUp` can crash the same way if `i_dtroot` is corrupted). The `DT_GETPAGE` macro should be updated to enforce the same `BT_ROOT` invariant:
```c
#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
do {									\
	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
	if (!(RC)) {							\
		if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {	\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree root page corrupt\n"); \
			MP = NULL;					\
			RC = -EIO;					\
		} else if ((BN) && !check_dtpage(P)) {			\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree page corrupt\n");	\
			MP = NULL;					\
			RC = -EIO;					\
		}							\
	}								\
} while (0)
```

8/2 2026/06/26 21:09 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 14077
							output: 40
							thoughts: 638
						

Thoughts:
**JFS Crash Investigation**

Okay, here's what's running through my mind. We've got a pretty nasty crash in the JFS filesystem. The kernel's complaining about a "spinlock bad magic" on CPU 0.  That's always a red flag – clearly a spinlock corruption. The trace points to `kernel/locking/spinlock_debug.c`, specifically `do_raw_spin_lock`. I can see the lock itself (0xffff888120999b48), the bogus magic value (ffffffff), and some garbage in the owner and owner_cpu fields.  That strongly suggests that spinlock debugging is enabled, making this issue a bit easier to diagnose.

The call trace is key. It's leading me from the lock acquisition down to `__wake_up_common_lock` and then, crucially, through the JFS code:  `unlock_metapage`, `release_metapage`, `xtTruncate`, `jfs_free_zero_link`, and `jfs_evict_inode`, ultimately going to the generic `evict` function. This suggests a problem in the inode lifecycle during a file system operation, possibly during truncation or freeing of data blocks linked to an inode.  The `unlock_metapage` call seems to be the common link in the problem, since it also shows up in the UBSAN issue.

And speaking of that, there's a related UBSAN (Undefiend Behavior Sanitizer) complaint about an array-index-out-of-bounds in `qspinlock.h` at line 68. The index is 8945, which is out of range for the array. Again, this issue's call trace also leads us down to `unlock_metapage` and `release_metapage` from `xtTruncate`. That's not good, and it points to some memory corruption or an off-by-one error at the very least. This could be related to the spinlock corruption, or it could be a separate but related issue. The Qspinlock slowpath is triggered so this may point to an issue with contention.

So, my next steps are clear. I'm going to dig into `fs/jfs/jfs_metapage.c`, focusing on the lines around 40 (the `unlock_metapage` call) and 872 (the `release_metapage` call), because these functions appear at the center of both the spinlock and the UBSAN errors. I need to understand what's happening within those functions, where the spinlock is being used, and where the potential out-of-bounds access is occurring. Is there a race condition? Is memory being corrupted?  I need to trace the variables being passed into these calls and how they are used. I'll probably also want to review the code around `xtTruncate` and `jfs_free_zero_link` to see how those operations interact with metadata. Given the location of the UBSAN error, I will also inspect the `decode_tail` function for possible array bounds violations.



9/2 2026/06/26 21:09 tool read-file
0m Args:
map[File:fs/jfs/jfs_metapage.c FirstLine:20 LineCount:50]

Results:
map[Contents:  20:	#include "jfs_superblock.h"
  21:	#include "jfs_filsys.h"
  22:	#include "jfs_metapage.h"
  23:	#include "jfs_txnmgr.h"
  24:	#include "jfs_debug.h"
  25:	
  26:	#ifdef CONFIG_JFS_STATISTICS
  27:	static struct {
  28:		uint	pagealloc;	/* # of page allocations */
  29:		uint	pagefree;	/* # of page frees */
  30:		uint	lockwait;	/* # of sleeping lock_metapage() calls */
  31:	} mpStat;
  32:	#endif
  33:	
  34:	#define metapage_locked(mp) test_bit(META_locked, &(mp)->flag)
  35:	#define trylock_metapage(mp) test_and_set_bit_lock(META_locked, &(mp)->flag)
  36:	
  37:	static inline void unlock_metapage(struct metapage *mp)
  38:	{
  39:		clear_bit_unlock(META_locked, &mp->flag);
  40:		wake_up(&mp->wait);
  41:	}
  42:	
  43:	static inline void __lock_metapage(struct metapage *mp)
  44:	{
  45:		DECLARE_WAITQUEUE(wait, current);
  46:		INCREMENT(mpStat.lockwait);
  47:		add_wait_queue_exclusive(&mp->wait, &wait);
  48:		do {
  49:			set_current_state(TASK_UNINTERRUPTIBLE);
  50:			if (metapage_locked(mp)) {
  51:				folio_unlock(mp->folio);
  52:				io_schedule();
  53:				folio_lock(mp->folio);
  54:			}
  55:		} while (trylock_metapage(mp));
  56:		__set_current_state(TASK_RUNNING);
  57:		remove_wait_queue(&mp->wait, &wait);
  58:	}
  59:	
  60:	/*
  61:	 * Must have mp->folio locked
  62:	 */
  63:	static inline void lock_metapage(struct metapage *mp)
  64:	{
  65:		if (trylock_metapage(mp))
  66:			__lock_metapage(mp);
  67:	}
  68:	
  69:	#define METAPOOL_MIN_PAGES 32
]

10/2 2026/06/26 21:09 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16137
							output: 41
							thoughts: 77
						

Thoughts:
Okay, let's break this down.

**Potential Race Condition in Metapage Handling**

Right, so `unlock_metapage` is calling `wake_up(&mp->wait)`. That `mp->wait` is a `wait_queue_head_t`, as expected. My immediate concern is that if the `mp` structure itself gets freed or, worse, corrupted *before* that `wake_up` happens, we're going to be trying to access a completely invalid spinlock. Not good. That sounds like a textbook race condition to me. I need to see what's happening in `release_metapage` at line 872. That's where the critical section that may free the `mp` struct probably lives. I'll need to check the code there to see if the timing is correct.



11/2 2026/06/26 21:10 tool read-file
0m Args:
map[File:fs/jfs/jfs_metapage.c FirstLine:850 LineCount:50]

Results:
map[Contents: 850:	}
 851:	
 852:	void put_metapage(struct metapage *mp)
 853:	{
 854:		if (mp->count || mp->nohomeok) {
 855:			/* Someone else will release this */
 856:			folio_unlock(mp->folio);
 857:			return;
 858:		}
 859:		folio_get(mp->folio);
 860:		mp->count++;
 861:		lock_metapage(mp);
 862:		folio_unlock(mp->folio);
 863:		release_metapage(mp);
 864:	}
 865:	
 866:	void release_metapage(struct metapage * mp)
 867:	{
 868:		struct folio *folio = mp->folio;
 869:		jfs_info("release_metapage: mp = 0x%p, flag = 0x%lx", mp, mp->flag);
 870:	
 871:		folio_lock(folio);
 872:		unlock_metapage(mp);
 873:	
 874:		assert(mp->count);
 875:		if (--mp->count || mp->nohomeok) {
 876:			folio_unlock(folio);
 877:			folio_put(folio);
 878:			return;
 879:		}
 880:	
 881:		if (test_bit(META_dirty, &mp->flag)) {
 882:			folio_mark_dirty(folio);
 883:			if (test_bit(META_sync, &mp->flag)) {
 884:				clear_bit(META_sync, &mp->flag);
 885:				if (metapage_write_one(folio))
 886:					jfs_error(mp->sb, "metapage_write_one() failed\n");
 887:				folio_lock(folio);
 888:			}
 889:		} else if (mp->lsn)	/* discard_metapage doesn't remove it */
 890:			remove_from_logsync(mp);
 891:	
 892:		/* Try to keep metapages from using up too much memory */
 893:		drop_metapage(folio, mp);
 894:	
 895:		folio_unlock(folio);
 896:		folio_put(folio);
 897:	}
 898:	
 899:	void __invalidate_metapages(struct inode *ip, s64 addr, int len)
]

12/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17167
							output: 35
							thoughts: 43
						

Thoughts:
Here's my summary, as the thought process unfolds:

**Tracing Down `release_metapage` in JFS**

Okay, so I see `release_metapage` being called from `xtTruncate`. My immediate concern is the context of that call. Let's dig into `xtTruncate` and see what's going on there. Time to pull up `fs/jfs/jfs_xtree.c` and get a handle on the file truncation logic within the JFS X-tree implementation. I'm especially interested in the conditions under which that metapage release is happening within the larger truncate sequence. Gotta understand the data dependencies.



13/2 2026/06/26 21:10 tool grepper
0m Args:
map[Expression:xtTruncate PathPrefix:fs/jfs/jfs_xtree.c]

Results:
map[Output:fs/jfs/jfs_xtree.c=2114=void xtInitRoot(tid_t tid, struct inode *ip)
--
fs/jfs/jfs_xtree.c-2148- * in a single transaction.  Currently we will truncate the file so that
fs/jfs/jfs_xtree.c:2149: * no more than 50 leaf pages will be locked.  The caller of xtTruncate
fs/jfs/jfs_xtree.c-2150- * will be responsible for ensuring that the current transaction gets
--
fs/jfs/jfs_xtree.c-2156-/*
fs/jfs/jfs_xtree.c:2157: *	xtTruncate()
fs/jfs/jfs_xtree.c-2158- *
--
fs/jfs/jfs_xtree.c-2180- *	PMAP:
fs/jfs/jfs_xtree.c:2181: *	 Call xtTruncate_pmap instead
fs/jfs/jfs_xtree.c-2182- *	WMAP:
--
fs/jfs/jfs_xtree.c-2202- */
fs/jfs/jfs_xtree.c:2203:s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
fs/jfs/jfs_xtree.c-2204-{
--
fs/jfs/jfs_xtree.c-2735-/*
fs/jfs/jfs_xtree.c:2736: *	xtTruncate_pmap()
fs/jfs/jfs_xtree.c-2737- *
--
fs/jfs/jfs_xtree.c-2757- */
fs/jfs/jfs_xtree.c:2758:s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
fs/jfs/jfs_xtree.c-2759-{
]

14/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17924
							output: 42
							thoughts: 32
						

Thoughts:
Here's a summary of my thought process, as requested:

**Diving into `xtTruncate` in `jfs_xtree.c`**

Okay, time to dig into the `xtTruncate` function. Let's start by pinpointing exactly where it is in the code. I'm going to jump into `fs/jfs/jfs_xtree.c` around line 2203. That's usually a good starting point to get a feel for how the function is structured and what it's trying to achieve. I'll be looking for the core logic surrounding how JFS handles truncation operations at the extent tree level. I expect to see the code interacting with the extent tree structures, manipulating extent maps, and potentially handling allocation or deallocation of blocks depending on the new size requested. My immediate focus will be on the interactions with the data structures and how it ensures data consistency after the truncation operation. From experience with other filesystems, I'm anticipating some considerations around metadata updates, journal writes (if JFS uses journaling, which it does), and ensuring that any partially written blocks are handled correctly to prevent data corruption. I want to see how it deals with the common cases. I'm especially interested in how it handles operations across extent boundaries and what locks are employed to ensure data integrity during concurrent accesses.



15/2 2026/06/26 21:10 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:2200 LineCount:100]

Results:
map[Contents:2200:	 * info but delay free of pages;
2201:	 *
2202:	 */
2203:	s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
2204:	{
2205:		s64 teof;
2206:		struct metapage *mp;
2207:		xtpage_t *p;
2208:		s64 bn;
2209:		int index, nextindex;
2210:		xad_t *xad;
2211:		s64 xoff, xaddr;
2212:		int xlen, len, freexlen;
2213:		struct btstack btstack;
2214:		struct btframe *parent;
2215:		struct tblock *tblk = NULL;
2216:		struct tlock *tlck = NULL;
2217:		struct xtlock *xtlck = NULL;
2218:		struct xdlistlock xadlock;	/* maplock for COMMIT_WMAP */
2219:		struct pxd_lock *pxdlock;		/* maplock for COMMIT_WMAP */
2220:		s64 nfreed;
2221:		int freed, log;
2222:		int locked_leaves = 0;
2223:	
2224:		/* save object truncation type */
2225:		if (tid) {
2226:			tblk = tid_to_tblock(tid);
2227:			tblk->xflag |= flag;
2228:		}
2229:	
2230:		nfreed = 0;
2231:	
2232:		flag &= COMMIT_MAP;
2233:		assert(flag != COMMIT_PMAP);
2234:	
2235:		if (flag == COMMIT_PWMAP)
2236:			log = 1;
2237:		else {
2238:			log = 0;
2239:			xadlock.flag = mlckFREEXADLIST;
2240:			xadlock.index = 1;
2241:		}
2242:	
2243:		/*
2244:		 * if the newsize is not an integral number of pages,
2245:		 * the file between newsize and next page boundary will
2246:		 * be cleared.
2247:		 * if truncating into a file hole, it will cause
2248:		 * a full block to be allocated for the logical block.
2249:		 */
2250:	
2251:		/*
2252:		 * release page blocks of truncated region <teof, eof>
2253:		 *
2254:		 * free the data blocks from the leaf index blocks.
2255:		 * delete the parent index entries corresponding to
2256:		 * the freed child data/index blocks.
2257:		 * free the index blocks themselves which aren't needed
2258:		 * in new sized file.
2259:		 *
2260:		 * index blocks are updated only if the blocks are to be
2261:		 * retained in the new sized file.
2262:		 * if type is PMAP, the data and index pages are NOT
2263:		 * freed, and the data and index blocks are NOT freed
2264:		 * from working map.
2265:		 * (this will allow continued access of data/index of
2266:		 * temporary file (zerolink count file truncated to zero-length)).
2267:		 */
2268:		teof = (newsize + (JFS_SBI(ip->i_sb)->bsize - 1)) >>
2269:		    JFS_SBI(ip->i_sb)->l2bsize;
2270:	
2271:		/* clear stack */
2272:		BT_CLR(&btstack);
2273:	
2274:		/*
2275:		 * start with root
2276:		 *
2277:		 * root resides in the inode
2278:		 */
2279:		bn = 0;
2280:	
2281:		/*
2282:		 * first access of each page:
2283:		 */
2284:	      getPage:
2285:		p = xt_getpage(ip, bn, &mp);
2286:		if (IS_ERR(p))
2287:			return PTR_ERR(p);
2288:	
2289:		/* process entries backward from last index */
2290:		index = le16_to_cpu(p->header.nextindex) - 1;
2291:	
2292:	
2293:		/* Since this is the rightmost page at this level, and we may have
2294:		 * already freed a page that was formerly to the right, let's make
2295:		 * sure that the next pointer is zero.
2296:		 */
2297:		if (p->header.next) {
2298:			if (log)
2299:				/*
]

16/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 19677
							output: 42
							thoughts: 11
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and presented as if it's my own internal dialogue:

**Delving Deeper into `xtTruncate`**

Right, let's get down to brass tacks. "Let's read more of `xtTruncate`." My initial thought is to push past any surface-level understanding or cursory glance I might have given it previously. I'm not satisfied with a general overview; I need to drill down into the specifics of `xtTruncate`. That command, function, or whatever implementation it is, clearly warrants further investigation. I'm thinking about edge cases, its performance characteristics under different data loads, the potential for unexpected side effects, and of course, how it interacts with other modules or libraries within the system. I'm keen to dissect its internal workings. I need to understand its behavior thoroughly, and, I'm hoping to discover any undocumented nuances and implications. It's time to put on my investigator's hat and really *understand* this `xtTruncate` implementation.



17/2 2026/06/26 21:10 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:2300 LineCount:100]

Results:
map[Contents:2300:				 * Make sure this change to the header is logged.
2301:				 * If we really truncate this leaf, the flag
2302:				 * will be changed to tlckTRUNCATE
2303:				 */
2304:				tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
2305:			BT_MARK_DIRTY(mp, ip);
2306:			p->header.next = 0;
2307:		}
2308:	
2309:		if (p->header.flag & BT_INTERNAL)
2310:			goto getChild;
2311:	
2312:		/*
2313:		 *	leaf page
2314:		 */
2315:		freed = 0;
2316:	
2317:		/* does region covered by leaf page precede Teof ? */
2318:		xad = &p->xad[index];
2319:		xoff = offsetXAD(xad);
2320:		xlen = lengthXAD(xad);
2321:		if (teof >= xoff + xlen) {
2322:			XT_PUTPAGE(mp);
2323:			goto getParent;
2324:		}
2325:	
2326:		/* (re)acquire tlock of the leaf page */
2327:		if (log) {
2328:			if (++locked_leaves > MAX_TRUNCATE_LEAVES) {
2329:				/*
2330:				 * We need to limit the size of the transaction
2331:				 * to avoid exhausting pagecache & tlocks
2332:				 */
2333:				XT_PUTPAGE(mp);
2334:				newsize = (xoff + xlen) << JFS_SBI(ip->i_sb)->l2bsize;
2335:				goto getParent;
2336:			}
2337:			tlck = txLock(tid, ip, mp, tlckXTREE);
2338:			tlck->type = tlckXTREE | tlckTRUNCATE;
2339:			xtlck = (struct xtlock *) & tlck->lock;
2340:			xtlck->hwm.offset = le16_to_cpu(p->header.nextindex) - 1;
2341:		}
2342:		BT_MARK_DIRTY(mp, ip);
2343:	
2344:		/*
2345:		 * scan backward leaf page entries
2346:		 */
2347:		for (; index >= XTENTRYSTART; index--) {
2348:			xad = &p->xad[index];
2349:			xoff = offsetXAD(xad);
2350:			xlen = lengthXAD(xad);
2351:			xaddr = addressXAD(xad);
2352:	
2353:			/*
2354:			 * The "data" for a directory is indexed by the block
2355:			 * device's address space.  This metadata must be invalidated
2356:			 * here
2357:			 */
2358:			if (S_ISDIR(ip->i_mode) && (teof == 0))
2359:				invalidate_xad_metapages(ip, *xad);
2360:			/*
2361:			 * entry beyond eof: continue scan of current page
2362:			 *          xad
2363:			 * ---|---=======------->
2364:			 *   eof
2365:			 */
2366:			if (teof < xoff) {
2367:				nfreed += xlen;
2368:				continue;
2369:			}
2370:	
2371:			/*
2372:			 * (xoff <= teof): last entry to be deleted from page;
2373:			 * If other entries remain in page: keep and update the page.
2374:			 */
2375:	
2376:			/*
2377:			 * eof == entry_start: delete the entry
2378:			 *           xad
2379:			 * -------|=======------->
2380:			 *       eof
2381:			 *
2382:			 */
2383:			if (teof == xoff) {
2384:				nfreed += xlen;
2385:	
2386:				if (index == XTENTRYSTART)
2387:					break;
2388:	
2389:				nextindex = index;
2390:			}
2391:			/*
2392:			 * eof within the entry: truncate the entry.
2393:			 *          xad
2394:			 * -------===|===------->
2395:			 *          eof
2396:			 */
2397:			else if (teof < xoff + xlen) {
2398:				/* update truncated entry */
2399:				len = teof - xoff;
]

18/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 21335
							output: 42
							thoughts: 11
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and presented as if it's my own internal dialogue:

**Delving Deeper into `xtTruncate`**

Right, let's get down to brass tacks. "Let's read more of `xtTruncate`." My initial thought is to push past any surface-level understanding or cursory glance I might have given it previously. I'm not satisfied with a general overview; I need to drill down into the specifics of `xtTruncate`. That command, function, or whatever implementation it is, clearly warrants further investigation. I'm thinking about edge cases, its performance characteristics under different data loads, the potential for unexpected side effects, and of course, how it interacts with other modules or libraries within the system. I'm keen to dissect its internal workings. I need to understand its behavior thoroughly, and, I'm hoping to discover any undocumented nuances and implications. It's time to put on my investigator's hat and really *understand* this `xtTruncate` implementation.



19/2 2026/06/26 21:10 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:2400 LineCount:100]

Results:
map[Contents:2400:				freexlen = xlen - len;
2401:				XADlength(xad, len);
2402:	
2403:				/* save pxd of truncated extent in tlck */
2404:				xaddr += len;
2405:				if (log) {	/* COMMIT_PWMAP */
2406:					xtlck->lwm.offset = (xtlck->lwm.offset) ?
2407:					    min(index, (int)xtlck->lwm.offset) : index;
2408:					xtlck->lwm.length = index + 1 -
2409:					    xtlck->lwm.offset;
2410:					xtlck->twm.offset = index;
2411:					pxdlock = (struct pxd_lock *) & xtlck->pxdlock;
2412:					pxdlock->flag = mlckFREEPXD;
2413:					PXDaddress(&pxdlock->pxd, xaddr);
2414:					PXDlength(&pxdlock->pxd, freexlen);
2415:				}
2416:				/* free truncated extent */
2417:				else {	/* COMMIT_WMAP */
2418:	
2419:					pxdlock = (struct pxd_lock *) & xadlock;
2420:					pxdlock->flag = mlckFREEPXD;
2421:					PXDaddress(&pxdlock->pxd, xaddr);
2422:					PXDlength(&pxdlock->pxd, freexlen);
2423:					txFreeMap(ip, pxdlock, NULL, COMMIT_WMAP);
2424:	
2425:					/* reset map lock */
2426:					xadlock.flag = mlckFREEXADLIST;
2427:				}
2428:	
2429:				/* current entry is new last entry; */
2430:				nextindex = index + 1;
2431:	
2432:				nfreed += freexlen;
2433:			}
2434:			/*
2435:			 * eof beyond the entry:
2436:			 *          xad
2437:			 * -------=======---|--->
2438:			 *                 eof
2439:			 */
2440:			else {		/* (xoff + xlen < teof) */
2441:	
2442:				nextindex = index + 1;
2443:			}
2444:	
2445:			if (nextindex < le16_to_cpu(p->header.nextindex)) {
2446:				if (!log) {	/* COMMIT_WAMP */
2447:					xadlock.xdlist = &p->xad[nextindex];
2448:					xadlock.count =
2449:					    le16_to_cpu(p->header.nextindex) -
2450:					    nextindex;
2451:					txFreeMap(ip, (struct maplock *) & xadlock,
2452:						  NULL, COMMIT_WMAP);
2453:				}
2454:				p->header.nextindex = cpu_to_le16(nextindex);
2455:			}
2456:	
2457:			XT_PUTPAGE(mp);
2458:	
2459:			/* assert(freed == 0); */
2460:			goto getParent;
2461:		}			/* end scan of leaf page entries */
2462:	
2463:		freed = 1;
2464:	
2465:		/*
2466:		 * leaf page become empty: free the page if type != PMAP
2467:		 */
2468:		if (log) {		/* COMMIT_PWMAP */
2469:			/* txCommit() with tlckFREE:
2470:			 * free data extents covered by leaf [XTENTRYSTART:hwm);
2471:			 * invalidate leaf if COMMIT_PWMAP;
2472:			 * if (TRUNCATE), will write LOG_NOREDOPAGE;
2473:			 */
2474:			tlck->type = tlckXTREE | tlckFREE;
2475:		} else {		/* COMMIT_WAMP */
2476:	
2477:			/* free data extents covered by leaf */
2478:			xadlock.xdlist = &p->xad[XTENTRYSTART];
2479:			xadlock.count =
2480:			    le16_to_cpu(p->header.nextindex) - XTENTRYSTART;
2481:			txFreeMap(ip, (struct maplock *) & xadlock, NULL, COMMIT_WMAP);
2482:		}
2483:	
2484:		if (p->header.flag & BT_ROOT) {
2485:			p->header.flag &= ~BT_INTERNAL;
2486:			p->header.flag |= BT_LEAF;
2487:			p->header.nextindex = cpu_to_le16(XTENTRYSTART);
2488:	
2489:			XT_PUTPAGE(mp);	/* debug */
2490:			goto out;
2491:		} else {
2492:			if (log) {	/* COMMIT_PWMAP */
2493:				/* page will be invalidated at tx completion
2494:				 */
2495:				XT_PUTPAGE(mp);
2496:			} else {	/* COMMIT_WMAP */
2497:	
2498:				if (mp->lid)
2499:					lid_to_tlock(mp->lid)->flag |= tlckFREELOCK;
]

20/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 23161
							output: 42
							thoughts: 11
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and presented as if it's my own internal dialogue:

**Delving Deeper into `xtTruncate`**

Right, let's get down to brass tacks. "Let's read more of `xtTruncate`." My initial thought is to push past any surface-level understanding or cursory glance I might have given it previously. I'm not satisfied with a general overview; I need to drill down into the specifics of `xtTruncate`. That command, function, or whatever implementation it is, clearly warrants further investigation. I'm thinking about edge cases, its performance characteristics under different data loads, the potential for unexpected side effects, and of course, how it interacts with other modules or libraries within the system. I'm keen to dissect its internal workings. I need to understand its behavior thoroughly, and, I'm hoping to discover any undocumented nuances and implications. It's time to put on my investigator's hat and really *understand* this `xtTruncate` implementation.



21/2 2026/06/26 21:10 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:2500 LineCount:100]

Results:
map[Contents:2500:	
2501:				/* invalidate empty leaf page */
2502:				discard_metapage(mp);
2503:			}
2504:		}
2505:	
2506:		/*
2507:		 * the leaf page become empty: delete the parent entry
2508:		 * for the leaf page if the parent page is to be kept
2509:		 * in the new sized file.
2510:		 */
2511:	
2512:		/*
2513:		 * go back up to the parent page
2514:		 */
2515:	      getParent:
2516:		/* pop/restore parent entry for the current child page */
2517:		if ((parent = BT_POP(&btstack)) == NULL)
2518:			/* current page must have been root */
2519:			goto out;
2520:	
2521:		/* get back the parent page */
2522:		bn = parent->bn;
2523:		p = xt_getpage(ip, bn, &mp);
2524:		if (IS_ERR(p))
2525:			return PTR_ERR(p);
2526:	
2527:		index = parent->index;
2528:	
2529:		/*
2530:		 * child page was not empty:
2531:		 */
2532:		if (freed == 0) {
2533:			/* has any entry deleted from parent ? */
2534:			if (index < le16_to_cpu(p->header.nextindex) - 1) {
2535:				/* (re)acquire tlock on the parent page */
2536:				if (log) {	/* COMMIT_PWMAP */
2537:					/* txCommit() with tlckTRUNCATE:
2538:					 * free child extents covered by parent [);
2539:					 */
2540:					tlck = txLock(tid, ip, mp, tlckXTREE);
2541:					xtlck = (struct xtlock *) & tlck->lock;
2542:					if (!(tlck->type & tlckTRUNCATE)) {
2543:						xtlck->hwm.offset =
2544:						    le16_to_cpu(p->header.
2545:								nextindex) - 1;
2546:						tlck->type =
2547:						    tlckXTREE | tlckTRUNCATE;
2548:					}
2549:				} else {	/* COMMIT_WMAP */
2550:	
2551:					/* free child extents covered by parent */
2552:					xadlock.xdlist = &p->xad[index + 1];
2553:					xadlock.count =
2554:					    le16_to_cpu(p->header.nextindex) -
2555:					    index - 1;
2556:					txFreeMap(ip, (struct maplock *) & xadlock,
2557:						  NULL, COMMIT_WMAP);
2558:				}
2559:				BT_MARK_DIRTY(mp, ip);
2560:	
2561:				p->header.nextindex = cpu_to_le16(index + 1);
2562:			}
2563:			XT_PUTPAGE(mp);
2564:			goto getParent;
2565:		}
2566:	
2567:		/*
2568:		 * child page was empty:
2569:		 */
2570:		nfreed += lengthXAD(&p->xad[index]);
2571:	
2572:		/*
2573:		 * During working map update, child page's tlock must be handled
2574:		 * before parent's.  This is because the parent's tlock will cause
2575:		 * the child's disk space to be marked available in the wmap, so
2576:		 * it's important that the child page be released by that time.
2577:		 *
2578:		 * ToDo:  tlocks should be on doubly-linked list, so we can
2579:		 * quickly remove it and add it to the end.
2580:		 */
2581:	
2582:		/*
2583:		 * Move parent page's tlock to the end of the tid's tlock list
2584:		 */
2585:		if (log && mp->lid && (tblk->last != mp->lid) &&
2586:		    lid_to_tlock(mp->lid)->tid) {
2587:			lid_t lid = mp->lid;
2588:			struct tlock *prev;
2589:	
2590:			tlck = lid_to_tlock(lid);
2591:	
2592:			if (tblk->next == lid)
2593:				tblk->next = tlck->next;
2594:			else {
2595:				for (prev = lid_to_tlock(tblk->next);
2596:				     prev->next != lid;
2597:				     prev = lid_to_tlock(prev->next)) {
2598:					assert(prev->next);
2599:				}
]

22/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24895
							output: 42
							thoughts: 11
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and presented as if it's my own internal dialogue:

**Delving Deeper into `xtTruncate`**

Right, let's get down to brass tacks. "Let's read more of `xtTruncate`." My initial thought is to push past any surface-level understanding or cursory glance I might have given it previously. I'm not satisfied with a general overview; I need to drill down into the specifics of `xtTruncate`. That command, function, or whatever implementation it is, clearly warrants further investigation. I'm thinking about edge cases, its performance characteristics under different data loads, the potential for unexpected side effects, and of course, how it interacts with other modules or libraries within the system. I'm keen to dissect its internal workings. I need to understand its behavior thoroughly, and, I'm hoping to discover any undocumented nuances and implications. It's time to put on my investigator's hat and really *understand* this `xtTruncate` implementation.



23/2 2026/06/26 21:10 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:2600 LineCount:100]

Results:
map[Contents:2600:				prev->next = tlck->next;
2601:			}
2602:			lid_to_tlock(tblk->last)->next = lid;
2603:			tlck->next = 0;
2604:			tblk->last = lid;
2605:		}
2606:	
2607:		/*
2608:		 * parent page become empty: free the page
2609:		 */
2610:		if (index == XTENTRYSTART) {
2611:			if (log) {	/* COMMIT_PWMAP */
2612:				/* txCommit() with tlckFREE:
2613:				 * free child extents covered by parent;
2614:				 * invalidate parent if COMMIT_PWMAP;
2615:				 */
2616:				tlck = txLock(tid, ip, mp, tlckXTREE);
2617:				xtlck = (struct xtlock *) & tlck->lock;
2618:				xtlck->hwm.offset =
2619:				    le16_to_cpu(p->header.nextindex) - 1;
2620:				tlck->type = tlckXTREE | tlckFREE;
2621:			} else {	/* COMMIT_WMAP */
2622:	
2623:				/* free child extents covered by parent */
2624:				xadlock.xdlist = &p->xad[XTENTRYSTART];
2625:				xadlock.count =
2626:				    le16_to_cpu(p->header.nextindex) -
2627:				    XTENTRYSTART;
2628:				txFreeMap(ip, (struct maplock *) & xadlock, NULL,
2629:					  COMMIT_WMAP);
2630:			}
2631:			BT_MARK_DIRTY(mp, ip);
2632:	
2633:			if (p->header.flag & BT_ROOT) {
2634:				p->header.flag &= ~BT_INTERNAL;
2635:				p->header.flag |= BT_LEAF;
2636:				p->header.nextindex = cpu_to_le16(XTENTRYSTART);
2637:				if (le16_to_cpu(p->header.maxentry) == XTROOTMAXSLOT) {
2638:					/*
2639:					 * Shrink root down to allow inline
2640:					 * EA (otherwise fsck complains)
2641:					 */
2642:					p->header.maxentry =
2643:					    cpu_to_le16(XTROOTINITSLOT);
2644:					JFS_IP(ip)->mode2 |= INLINEEA;
2645:				}
2646:	
2647:				XT_PUTPAGE(mp);	/* debug */
2648:				goto out;
2649:			} else {
2650:				if (log) {	/* COMMIT_PWMAP */
2651:					/* page will be invalidated at tx completion
2652:					 */
2653:					XT_PUTPAGE(mp);
2654:				} else {	/* COMMIT_WMAP */
2655:	
2656:					if (mp->lid)
2657:						lid_to_tlock(mp->lid)->flag |=
2658:							tlckFREELOCK;
2659:	
2660:					/* invalidate parent page */
2661:					discard_metapage(mp);
2662:				}
2663:	
2664:				/* parent has become empty and freed:
2665:				 * go back up to its parent page
2666:				 */
2667:				/* freed = 1; */
2668:				goto getParent;
2669:			}
2670:		}
2671:		/*
2672:		 * parent page still has entries for front region;
2673:		 */
2674:		else {
2675:			/* try truncate region covered by preceding entry
2676:			 * (process backward)
2677:			 */
2678:			index--;
2679:	
2680:			/* go back down to the child page corresponding
2681:			 * to the entry
2682:			 */
2683:			goto getChild;
2684:		}
2685:	
2686:		/*
2687:		 *	internal page: go down to child page of current entry
2688:		 */
2689:	      getChild:
2690:		/* save current parent entry for the child page */
2691:		if (BT_STACK_FULL(&btstack)) {
2692:			jfs_error(ip->i_sb, "stack overrun!\n");
2693:			XT_PUTPAGE(mp);
2694:			return -EIO;
2695:		}
2696:		BT_PUSH(&btstack, bn, index);
2697:	
2698:		/* get child page */
2699:		xad = &p->xad[index];
]

24/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 26570
							output: 42
							thoughts: 11
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Diving Deeper into `xtTruncate`**

Right, let's get down to brass tacks. The phrase "Let's read more of `xtTruncate`" immediately flags a desire for deeper understanding. It suggests that a preliminary assessment of `xtTruncate` has been made, and now the need for further, more detailed examination is apparent. We're beyond a cursory glance. We're looking to peel back the layers and understand the nuances.

My immediate assumptions are: `xtTruncate` is likely some kind of functionality or routine related to data truncation. Perhaps it is a database function, a string manipulation utility, or something similar. Depending on the context, truncation could imply precision loss, data reduction, or potentially even data security measures. The fact that the thought *explicitly* mentions reading more signals that the initial information wasn't quite sufficient for the task at hand. It's time to dig into the documentation, the source code, the associated specifications – whatever's available. I want to understand its implementation, its performance characteristics, and its potential impact within the system. Is it a well-established standard or a custom piece of code? I need to assess its robustness, potential edge cases, and its overall suitability for its intended purpose. The goal is a comprehensive grasp of its functionality, not just a surface-level understanding. Let's see what we can unearth.



25/2 2026/06/26 21:10 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:2700 LineCount:100]

Results:
map[Contents:2700:		bn = addressXAD(xad);
2701:	
2702:		/*
2703:		 * first access of each internal entry:
2704:		 */
2705:		/* release parent page */
2706:		XT_PUTPAGE(mp);
2707:	
2708:		/* process the child page */
2709:		goto getPage;
2710:	
2711:	      out:
2712:		/*
2713:		 * update file resource stat
2714:		 */
2715:		/* set size
2716:		 */
2717:		if (S_ISDIR(ip->i_mode) && !newsize)
2718:			ip->i_size = 1;	/* fsck hates zero-length directories */
2719:		else
2720:			ip->i_size = newsize;
2721:	
2722:		/* update quota allocation to reflect freed blocks */
2723:		dquot_free_block(ip, nfreed);
2724:	
2725:		/*
2726:		 * free tlock of invalidated pages
2727:		 */
2728:		if (flag == COMMIT_WMAP)
2729:			txFreelock(ip);
2730:	
2731:		return newsize;
2732:	}
2733:	
2734:	
2735:	/*
2736:	 *	xtTruncate_pmap()
2737:	 *
2738:	 * function:
2739:	 *	Perform truncate to zero length for deleted file, leaving the
2740:	 *	xtree and working map untouched.  This allows the file to
2741:	 *	be accessed via open file handles, while the delete of the file
2742:	 *	is committed to disk.
2743:	 *
2744:	 * parameter:
2745:	 *	tid_t		tid,
2746:	 *	struct inode	*ip,
2747:	 *	s64		committed_size)
2748:	 *
2749:	 * return: new committed size
2750:	 *
2751:	 * note:
2752:	 *
2753:	 *	To avoid deadlock by holding too many transaction locks, the
2754:	 *	truncation may be broken up into multiple transactions.
2755:	 *	The committed_size keeps track of part of the file has been
2756:	 *	freed from the pmaps.
2757:	 */
2758:	s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
2759:	{
2760:		s64 bn;
2761:		struct btstack btstack;
2762:		int cmp;
2763:		int index;
2764:		int locked_leaves = 0;
2765:		struct metapage *mp;
2766:		xtpage_t *p;
2767:		struct btframe *parent;
2768:		int rc;
2769:		struct tblock *tblk;
2770:		struct tlock *tlck = NULL;
2771:		xad_t *xad;
2772:		int xlen;
2773:		s64 xoff;
2774:		struct xtlock *xtlck = NULL;
2775:	
2776:		/* save object truncation type */
2777:		tblk = tid_to_tblock(tid);
2778:		tblk->xflag |= COMMIT_PMAP;
2779:	
2780:		/* clear stack */
2781:		BT_CLR(&btstack);
2782:	
2783:		if (committed_size) {
2784:			xoff = (committed_size >> JFS_SBI(ip->i_sb)->l2bsize) - 1;
2785:			rc = xtSearch(ip, xoff, NULL, &cmp, &btstack, 0);
2786:			if (rc)
2787:				return rc;
2788:	
2789:			XT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
2790:	
2791:			if (cmp != 0) {
2792:				XT_PUTPAGE(mp);
2793:				jfs_error(ip->i_sb, "did not find extent\n");
2794:				return -EIO;
2795:			}
2796:		} else {
2797:			/*
2798:			 * start with root
2799:			 *
]

26/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28254
							output: 31
							thoughts: 91
						

Thoughts:
Okay, here's my take on those crash notes, focusing on the thought process:

**Deconstructing the Metadata Page Corruption**

Alright, so the system crashed. The trace points directly to a sequence: `release_metapage` leading to `unlock_metapage`, which then results in a `wake_up(&mp->wait)` call, and ultimately, a nasty `spin_bug` or an `array-index-out-of-bounds` error buried in `qspinlock.h`. The critical thing here is *why* we're seeing this. It screams corruption.

Specifically, it looks like the `mp` metadata page itself is messed up, or *at least* the `mp->wait` field within it is either uninitialized, corrupted, or pointing somewhere entirely wrong. This whole thing smells like a race condition or some memory management problem where metadata is being stomped on.

Now, where did this corrupt `mp` come from? I need to backtrack and really focus on where `mp` gets set, and the likely culprit is `XT_PUTPAGE(mp)`. I need to start dissecting how this specific piece of code is interacting with this metadata, and start poking around where that metadata page is sourced, how it's being used, and what its lifecycle is. I know from experience that `PUTPAGE` calls have potential for subtle errors. Let's dig in.



27/2 2026/06/26 21:10 tool grepper
0m Args:
map[Expression:#define XT_PUTPAGE PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_xtree.c-52-/* for consistency */
fs/jfs/jfs_xtree.c:53:#define XT_PUTPAGE(MP) BT_PUTPAGE(MP)
fs/jfs/jfs_xtree.c-54-
]

28/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28755
							output: 31
							thoughts: 10
						

Thoughts:
Here's my thought process, summarized as if I were thinking it:

**Locating `BT_PUTPAGE`**

Okay, so I need to find `BT_PUTPAGE`. That's the core of my current task, no question about it. Given my expertise, I already know this likely resides within the B-Tree implementation. It's a key function, very likely responsible for writing or updating a page in the B-Tree structure. I need to understand its exact function, how it interacts with other components, and ultimately, its role in the overall system. To dive in, I need to know where it's defined and how to start debugging this process. I'll need to know the specific file, but I need to find it first.



29/2 2026/06/26 21:10 tool grepper
0m Args:
map[Expression:#define BT_PUTPAGE PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_btree.h=17=struct btpage {
--
fs/jfs/jfs_btree.h-84-/* put the page buffer */
fs/jfs/jfs_btree.h:85:#define BT_PUTPAGE(MP)\
fs/jfs/jfs_btree.h-86-{\
]

30/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29052
							output: 38
							thoughts: 23
						

Thoughts:
Okay, let's dive into this. I'm going to pull up `fs/jfs/jfs_btree.h` and focus around line 85. I want to understand what's happening at this point in the code. I'm anticipating this will be part of the JFS B-tree implementation, so likely some crucial data structure definitions or possibly some fundamental algorithms. My expertise in file systems and B-trees will allow me to quickly parse this; I'll be looking for key structures, macros, or function prototypes related to B-tree node management, key comparisons, or data storage. I’ll keep in mind the potential performance implications as I read, considering disk I/O, cache efficiency, and concurrency issues. I'll mentally map these concepts to the broader JFS architecture and my understanding of its design goals. Let's get to work and see what this section reveals!



31/2 2026/06/26 21:10 tool read-file
0m Args:
map[File:fs/jfs/jfs_btree.h FirstLine:75 LineCount:20]

Results:
map[Contents:  75:	
  76:	#define BT_MARK_DIRTY(MP, IP)\
  77:	{\
  78:		if (BT_IS_ROOT(MP))\
  79:			mark_inode_dirty(IP);\
  80:		else\
  81:			mark_metapage_dirty(MP);\
  82:	}
  83:	
  84:	/* put the page buffer */
  85:	#define BT_PUTPAGE(MP)\
  86:	{\
  87:		if (! BT_IS_ROOT(MP)) \
  88:			release_metapage(MP); \
  89:	}
  90:	
  91:	
  92:	/*
  93:	 *	btree traversal stack
  94:	 *
]

32/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29525
							output: 29
							thoughts: 59
						

Thoughts:
Okay, let's break this down.

**XT_PUTPAGE and Truncation: A Deep Dive**

Right, so `XT_PUTPAGE(mp)` – that's essentially the same as calling `release_metapage(mp)`. No surprises there. It seems pretty straightforward, releasing the metapage. But where is `mp` coming from? Let's trace it through `xtTruncate`. Ah, there it is! In `xtTruncate`, that `mp` is obtained via `xt_getpage(ip, bn, &mp)`. Okay, so `xt_getpage` must be the critical function here. It's the one responsible for fetching that `mp` that gets subsequently released by `XT_PUTPAGE`. Time to dig into `xt_getpage`. I need to understand exactly how it’s pulling the page in and what context it’s using to do so - the inode `ip`, block number `bn` and then that ampersand to assign the metapage. I can see why the code structure made me look at this. Let's see how this ties into the rest of the file system.



33/2 2026/06/26 21:10 tool grepper
0m Args:
map[Expression:xt_getpage PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_xtree.c=94=static int xtSplitRoot(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_xtree.c-97-/*
fs/jfs/jfs_xtree.c:98: *	xt_getpage()
fs/jfs/jfs_xtree.c-99- *
--
fs/jfs/jfs_xtree.c-110-
fs/jfs/jfs_xtree.c:111:static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
fs/jfs/jfs_xtree.c-112-{
--
fs/jfs/jfs_xtree.c-124-			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
fs/jfs/jfs_xtree.c:125:		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
fs/jfs/jfs_xtree.c-126-		BT_PUTPAGE(*mp);
--
fs/jfs/jfs_xtree.c=231=static int xtSearch(struct inode *ip, s64 xoff,	s64 *nextp,
--
fs/jfs/jfs_xtree.c-269-		/* get/pin the page to search */
fs/jfs/jfs_xtree.c:270:		p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-271-		if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c=679=xtSplitUp(tid_t tid,
--
fs/jfs/jfs_xtree.c-824-		/* get/pin the parent page <sp> */
fs/jfs/jfs_xtree.c:825:		sp = xt_getpage(ip, parent->bn, &smp);
fs/jfs/jfs_xtree.c-826-		if (IS_ERR(sp)) {
--
fs/jfs/jfs_xtree.c=949=xtSplitPage(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_xtree.c-1079-	if (nextbn != 0) {
fs/jfs/jfs_xtree.c:1080:		p = xt_getpage(ip, nextbn, &mp);
fs/jfs/jfs_xtree.c-1081-		if (IS_ERR(p)) {
--
fs/jfs/jfs_xtree.c=1351=int xtExtend(tid_t tid,		/* transaction id */
--
fs/jfs/jfs_xtree.c-1434-		/* get back old page */
fs/jfs/jfs_xtree.c:1435:		p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-1436-		if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c-1450-			/* get new child page */
fs/jfs/jfs_xtree.c:1451:			p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-1452-			if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c=1513=int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
--
fs/jfs/jfs_xtree.c-1728-		/* get back old page */
fs/jfs/jfs_xtree.c:1729:		p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-1730-		if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c-1744-			/* get new child page */
fs/jfs/jfs_xtree.c:1745:			p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-1746-			if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c-1805-		/* get new right page */
fs/jfs/jfs_xtree.c:1806:		p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-1807-		if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c=1868=printf("xtUpdate.updateLeft.split p:0x%p\n", p);
--
fs/jfs/jfs_xtree.c-1881-		/* get back old page */
fs/jfs/jfs_xtree.c:1882:		p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-1883-		if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c-1898-			/* get new child page */
fs/jfs/jfs_xtree.c:1899:			p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-1900-			if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c=2203=s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
--
fs/jfs/jfs_xtree.c-2284-      getPage:
fs/jfs/jfs_xtree.c:2285:	p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-2286-	if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c-2522-	bn = parent->bn;
fs/jfs/jfs_xtree.c:2523:	p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-2524-	if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c=2758=s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
--
fs/jfs/jfs_xtree.c-2807-      getPage:
fs/jfs/jfs_xtree.c:2808:		p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-2809-		if (IS_ERR(p))
--
fs/jfs/jfs_xtree.c-2852-	bn = parent->bn;
fs/jfs/jfs_xtree.c:2853:	p = xt_getpage(ip, bn, &mp);
fs/jfs/jfs_xtree.c-2854-	if (IS_ERR(p))
]

34/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31747
							output: 40
							thoughts: 10
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm deep in my domain of expertise:

**Diving into `xt_getpage`**

Alright, time to crack into this `xt_getpage` function. Just seeing the name sparks a few immediate questions, naturally. Is this related to some external table mechanism, or is this about internal page retrieval within the kernel, or something else entirely? The name itself doesn't provide enough context, so the first thing I'm doing is mentally preparing to navigate a potentially complex codebase. I'm going to quickly assess its location in the overall architecture - where is it called from and where does it reside in the call stack? What associated structures and data types will it operate on? I need to get a handle on the data flow. A quick glance at the header files will likely be in order to figure out what context I'm going to be dealing with. Ultimately, my first goal is to build a high-level understanding of what this function *does* at a functional level before I get bogged down in the minutiae.



35/2 2026/06/26 21:10 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:100 LineCount:40]

Results:
map[Contents: 100:	 * function:	get the page buffer for a specified block address.
 101:	 *
 102:	 * parameters:
 103:	 *	ip      - pointer to the inode
 104:	 *	bn      - block number (s64) of the xtree page to be retrieved;
 105:	 *	mp      - pointer to a metapage pointer where the page buffer is returned;
 106:	 *
 107:	 * returns:
 108:	 *      A pointer to the xtree page (xtpage_t) on success, -EIO on error.
 109:	 */
 110:	
 111:	static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
 112:	{
 113:		xtpage_t *p;
 114:		int rc;
 115:	
 116:		BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);
 117:	
 118:		if (rc)
 119:			return ERR_PTR(rc);
 120:		if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
 121:			(le16_to_cpu(p->header.nextindex) >
 122:				le16_to_cpu(p->header.maxentry)) ||
 123:			(le16_to_cpu(p->header.maxentry) >
 124:				((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
 125:			jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
 126:			BT_PUTPAGE(*mp);
 127:			*mp = NULL;
 128:			return ERR_PTR(-EIO);
 129:		}
 130:		return p;
 131:	}
 132:	
 133:	/*
 134:	 *	xtLookup()
 135:	 *
 136:	 * function: map a single page into a physical extent;
 137:	 */
 138:	int xtLookup(struct inode *ip, s64 lstart,
 139:		     s64 llen, int *pflag, s64 * paddr, s32 * plen, int no_check)
]

36/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 32702
							output: 31
							thoughts: 10
						

Thoughts:
Okay, here's my interpretation of "Let's see `BT_GETPAGE`," presented as a first-person thought process, keeping in mind I'm dealing with a fellow expert:

**Diving into BT_GETPAGE**

Right, let's get into this. "Let's see `BT_GETPAGE`." That immediately signals we're dealing with a specific function or operation, likely within a database or storage system. The "BT" prefix strongly suggests it's related to B-trees or a similar indexed data structure – binary trees. My guess, without further context, is that `BT_GETPAGE` is a fundamental function for retrieving a specific page or node from the B-tree structure. It's the core workhorse for fetching data based on an index lookup, the building block upon which the entire access path is constructed.

Now, I'm already mentally running through the typical considerations: What's the expected input? Presumably, at a bare minimum, a key or identifier to locate the page, and the B-tree handle itself, maybe a database handle. What's the output? A pointer to the page in memory, perhaps? Or a return code indicating success or failure? Error handling is key here, especially for something so fundamental. Are we talking about in-memory data, or is this fetching from disk? That'll dramatically influence the performance characteristics and concurrency considerations. If it's on disk, what caching strategies are in play? LRU, LFU, or something more sophisticated? Are we dealing with page locks or other concurrency control to prevent corruption? I'm already thinking about potential bottlenecks and optimizations.
Let's figure out what the function actually is, and what its implementation entails.



37/2 2026/06/26 21:10 tool grepper
0m Args:
map[Expression:#define BT_GETPAGE PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_btree.h=17=struct btpage {
--
fs/jfs/jfs_btree.h-53-/* get the page buffer and the page for specified block address */
fs/jfs/jfs_btree.h:54:#define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\
fs/jfs/jfs_btree.h-55-{\
]

38/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33225
							output: 38
							thoughts: 23
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Diving into the JFS B-Tree Implementation**

Okay, time to get my hands dirty. I'm going to start by examining the JFS B-tree code, specifically around line 54 of `fs/jfs/jfs_btree.h`. I'm guessing this area likely deals with some core data structure definition or perhaps an initial macro definition central to how the B-tree is built in JFS. I need to refresh my memory on the specifics of this implementation. Let's see if this code is in line with the standards to minimize I/O to improve performance. This file is probably the best place to go, so let's dig in and review that section.



39/2 2026/06/26 21:10 tool read-file
0m Args:
map[File:fs/jfs/jfs_btree.h FirstLine:50 LineCount:25]

Results:
map[Contents:  50:	#define BT_PAGE(IP, MP, TYPE, ROOT)\
  51:		(BT_IS_ROOT(MP) ? (TYPE *)&JFS_IP(IP)->ROOT : (TYPE *)(MP)->data)
  52:	
  53:	/* get the page buffer and the page for specified block address */
  54:	#define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\
  55:	{\
  56:		if ((BN) == 0)\
  57:		{\
  58:			MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
  59:			P = (TYPE *)&JFS_IP(IP)->ROOT;\
  60:			RC = 0;\
  61:		}\
  62:		else\
  63:		{\
  64:			MP = read_metapage((IP), BN, SIZE, 1);\
  65:			if (MP) {\
  66:				RC = 0;\
  67:				P = (MP)->data;\
  68:			} else {\
  69:				P = NULL;\
  70:				jfs_err("bread failed!");\
  71:				RC = -EIO;\
  72:			}\
  73:		}\
  74:	}
]

40/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33803
							output: 32
							thoughts: 102
						

Thoughts:
**Analyzing the JFS Code Path**

Okay, so I'm looking at this `BT_GETPAGE` call where `BN` is zero. It looks like this sets the metapage pointer `MP` to point to `JFS_IP(IP)->bxflag`. Interesting. Now, `BT_PUTPAGE(MP)` is the counterpart, and it appears to do something.

Let me take a closer look at the actual code within `BT_PUTPAGE`:

```c
#define BT_PUTPAGE(MP)\
{\
	if (! BT_IS_ROOT(MP)) \
		release_metapage(MP); \
}
```

Right, so `BT_PUTPAGE` seems to be conditionally releasing the metapage. And that condition hinges on `BT_IS_ROOT(MP)`. I need to understand that macro to figure out the exact behavior. What does it mean for a metapage to *be* a root? It's key to the page management logic here, and likely critical to understanding how data is persisted within the JFS file system. I'll need to trace into `BT_IS_ROOT` to see what checks it's performing.



41/2 2026/06/26 21:10 tool grepper
0m Args:
map[Expression:#define BT_IS_ROOT PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_btree.h=17=struct btpage {
--
fs/jfs/jfs_btree.h-46- */
fs/jfs/jfs_btree.h:47:#define BT_IS_ROOT(MP) (((MP)->xflag & COMMIT_PAGE) == 0)
fs/jfs/jfs_btree.h-48-
]

42/2 2026/06/26 21:10 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 34298
							output: 24
							thoughts: 74
						

Thoughts:
Okay, let me break this down.

**Diving into the `BT_IS_ROOT` Macro**

Right, so I'm looking at this bit of code, and the first thing I notice is that `BT_IS_ROOT(MP)` is defined as `(((MP)->xflag & COMMIT_PAGE) == 0)`.  Essentially, we're checking if the `xflag` field of a `MP` (metapage) structure has the `COMMIT_PAGE` bit *cleared*. Makes sense – probably indicates something about whether it's the root of a b-tree or something similar, and the commit status.

Now, if `bn` (presumably a block number or something similar) equals zero, then `MP` gets set to `(struct metapage *)&JFS_IP(IP)->bxflag`. Hmm, that's interesting. It looks like we're deriving the `MP` pointer from `JFS_IP(IP)->bxflag`. I need to figure out what `JFS_IP(IP)->bxflag` is. I'm guessing that's some specific flag, maybe representing the flags for some specific inode within a JFS filesystem. I want to check `JFS_IP(IP)->bxflag`.



43/2 2026/06/26 21:11 tool codesearch-struct-layout
0m Args:
map[Name:jfs_inode_info]

Results:
map[Fields:[map[Name:fileset OffsetBits:0 SizeBits:32] map[Name:mode2 OffsetBits:32 SizeBits:32] map[Name:saved_uid OffsetBits:64 SizeBits:32] map[Name:saved_gid OffsetBits:96 SizeBits:32] map[Name:ixpxd OffsetBits:128 SizeBits:64] map[Name:acl OffsetBits:192 SizeBits:128] map[Name:ea OffsetBits:320 SizeBits:128] map[Name:otime OffsetBits:448 SizeBits:64] map[Name:next_index OffsetBits:512 SizeBits:32] map[Name:acltype OffsetBits:544 SizeBits:32] map[Name:btorder OffsetBits:576 SizeBits:16] map[Name:btindex OffsetBits:592 SizeBits:16] map[Name:ipimap OffsetBits:640 SizeBits:64] map[Name:cflag OffsetBits:704 SizeBits:64] map[Name:agstart OffsetBits:768 SizeBits:64] map[Name:bxflag OffsetBits:832 SizeBits:16] map[Name:pad OffsetBits:848 SizeBits:8] map[Name:active_ag OffsetBits:856 SizeBits:8] map[Name:blid OffsetBits:864 SizeBits:16] map[Name:atlhead OffsetBits:880 SizeBits:16] map[Name:atltail OffsetBits:896 SizeBits:16] map[Name:ag_lock OffsetBits:960 SizeBits:512] map[Name:anon_inode_list OffsetBits:1472 SizeBits:128] map[Name:rdwrlock OffsetBits:1600 SizeBits:1152] map[Name:commit_mutex OffsetBits:2752 SizeBits:1088] map[Name:xattr_sem OffsetBits:3840 SizeBits:1152] map[Name:xtlid OffsetBits:4992 SizeBits:16] map[Name:u OffsetBits:5056 SizeBits:3072] map[Name:i_dquot OffsetBits:8128 SizeBits:192] map[Name:dev OffsetBits:8320 SizeBits:32] map[Name:vfs_inode OffsetBits:8384 SizeBits:8768]]]

44/2 2026/06/26 21:11 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 35331
							output: 21
							thoughts: 9
						

Thoughts:
Okay, let's dive into this. Here's my take on those thoughts, as if they're my own:

**Diving into `struct metapage`**

Alright, time to get my hands dirty. My mind's immediately drawn to the `struct metapage`. I know I've encountered this before, and it's pivotal for understanding how our system handles... well, meta-information about pages. Let's start with a quick mental review of its key members. I need to refresh the relationships to other structs like `struct page` and how they're used in the virtual memory infrastructure. My experience tells me that this struct likely holds metadata critical for cache management, page replacement algorithms, and possibly even NUMA node placement. I need to think about how these fields tie into the overall memory management strategy, specifically how it affects performance and scalability under heavy loads. Understanding this struct in detail is often the key to debugging subtle memory leaks or performance bottlenecks. I also need to consider possible data races and concurrency issues within the `metapage`'s members and access methods in a multi-threaded system. Let's see how this ties into the current analysis.



45/2 2026/06/26 21:11 tool codesearch-struct-layout
0m Args:
map[Name:metapage]

Results:
map[Fields:[map[Name:xflag OffsetBits:0 SizeBits:16] map[Name:unused OffsetBits:16 SizeBits:16] map[Name:lid OffsetBits:32 SizeBits:16] map[Name:lsn OffsetBits:64 SizeBits:32] map[Name:synclist OffsetBits:128 SizeBits:128] map[Name:flag OffsetBits:256 SizeBits:64] map[Name:count OffsetBits:320 SizeBits:64] map[Name:data OffsetBits:384 SizeBits:64] map[Name:index OffsetBits:448 SizeBits:64] map[Name:wait OffsetBits:512 SizeBits:640] map[Name:folio OffsetBits:1152 SizeBits:64] map[Name:sb OffsetBits:1216 SizeBits:64] map[Name:logical_size OffsetBits:1280 SizeBits:32] map[Name:clsn OffsetBits:1312 SizeBits:32] map[Name:nohomeok OffsetBits:1344 SizeBits:32] map[Name:log OffsetBits:1408 SizeBits:64]]]

46/2 2026/06/26 21:11 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 35936
							output: 30
							thoughts: 535
						

Thoughts:
**Analyzing a Potential Race Condition in JFS's Metapage Handling**

Okay, so I'm digging into this JFS code, and I see this curious aliasing situation. `xflag` in `struct metapage` is at offset 0, that's straightforward. Then, there's `bxflag` within `jfs_inode_info`, specifically at offset 832. This means that casting `&JFS_IP(IP)->bxflag` to a `struct metapage *` is going to overlap `bxflag` with `xflag`, which is a classic potential gotcha.

The code uses `BT_IS_ROOT(MP)` which boils down to checking if `((MP)->xflag & COMMIT_PAGE) == 0`. I'm starting to see a race. If `MP` isn't a "real" metapage (`bn != 0`), the `xflag` check works as intended. But if `bn == 0`, and `bxflag` *does* have `COMMIT_PAGE` set, this is where it gets interesting and where my expert mind kicks in.

If `bxflag & COMMIT_PAGE` is true, the `BT_IS_ROOT(MP)` check will evaluate to false, meaning `BT_PUTPAGE(MP)` will be called and ultimately execute `release_metapage(MP)`. This function is where things go south.

Inside `release_metapage`, the code treats the potentially misaligned `&JFS_IP(IP)->bxflag` as a `struct metapage *` and calls `unlock_metapage(mp)`. This in turn calls `wake_up(&mp->wait)`. Now, I know `mp->wait` is at offset 64 in `struct metapage`. But because of the aliasing, this means it will try to access something at `&JFS_IP(IP)->bxflag + 64 bytes`, which is inside `jfs_inode_info`, in particular, at offset 168 bytes.

I need to confirm this: offset 832 (where `bxflag` begins) + 64 bytes = offset 1344 bits, which is 168 bytes. I need to know what's at offset 168 bytes of `jfs_inode_info`. Let's verify. Checking the struct, I see that 168 bytes is inside either `ag_lock` or `anon_inode_list`. `ag_lock` is at offset 120 and spans 64 bytes. This means `mp->wait` would overlap with `anon_inode_list` and `rdwrlock`. This is bad, really bad.

Calling `wake_up` on this garbage data, effectively a spinlock, is going to cause a kernel panic, which makes this race condition a real concern. I'm going to verify if `bxflag` can actually *have* `COMMIT_PAGE` set to proceed with further investigation of the root cause. I need to understand what `COMMIT_PAGE` represents to understand if we need to implement a patch to prevent this race condition.



47/2 2026/06/26 21:11 tool grepper
0m Args:
map[Expression:#define COMMIT_PAGE PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_txnmgr.h=59=extern struct tblock *TxBlock;	/* transaction block table */
--
fs/jfs/jfs_txnmgr.h-73-#define	COMMIT_LAZY	0x0800	/* lazy commit */
fs/jfs/jfs_txnmgr.h:74:#define COMMIT_PAGE	0x1000	/* Identifies element as metapage */
fs/jfs/jfs_txnmgr.h-75-#define COMMIT_INODE	0x2000	/* Identifies element as inode */
]

48/2 2026/06/26 21:11 llm debugger
1m Model:
gemini-3.1-pro-preview

Tokens:
							input: 37341
							output: 27
							thoughts: 45
						

Thoughts:
Okay, here's my interpretation of those thoughts, presented as my own mental process:

**Diving into this `bxflag` Mystery**

Alright, let's see... so `COMMIT_PAGE` is defined as `0x1000`. That's a key constant. Now, a question arises. Can the `bxflag` variable *ever* have `0x1000` set within it? It seems relevant to my current task. I need to understand this relationship.

The next logical step is clear: I need to trace where the `bxflag` variable is being set. I must follow its usage to determine if this specific bit is ever toggled. This is my next investigative point.



49/2 2026/06/26 21:12 tool grepper
0m Args:
map[Expression:bxflag PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_btree.h=17=struct btpage {
--
fs/jfs/jfs_btree.h-57-	{\
fs/jfs/jfs_btree.h:58:		MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
fs/jfs/jfs_btree.h-59-		P = (TYPE *)&JFS_IP(IP)->ROOT;\
--
fs/jfs/jfs_dtree.c=2521=void dtInitRoot(tid_t tid, struct inode *ip, u32 idotdot)
--
fs/jfs/jfs_dtree.c-2570-	 */
fs/jfs/jfs_dtree.c:2571:	tlck = txLock(tid, ip, (struct metapage *) & jfs_ip->bxflag,
fs/jfs/jfs_dtree.c-2572-		      tlckDTREE | tlckENTRY | tlckBTROOT);
--
fs/jfs/jfs_imap.c=3034=static int copy_from_dinode(struct dinode * dip, struct inode *ip)
--
fs/jfs/jfs_imap.c-3117-	jfs_ip->btorder = 0;
fs/jfs/jfs_imap.c:3118:	jfs_ip->bxflag = 0;
fs/jfs/jfs_imap.c-3119-	jfs_ip->blid = 0;
--
fs/jfs/jfs_incore.h=27=struct jfs_inode_info {
--
fs/jfs/jfs_incore.h-42-	u64	agstart;	/* agstart of the containing IAG */
fs/jfs/jfs_incore.h:43:	u16	bxflag;		/* xflag of pseudo buffer?	*/
fs/jfs/jfs_incore.h-44-	unchar	pad;
--
fs/jfs/jfs_inode.c=41=struct inode *ialloc(struct inode *parent, umode_t mode)
--
fs/jfs/jfs_inode.c-112-	jfs_inode->btindex = 0;
fs/jfs/jfs_inode.c:113:	jfs_inode->bxflag = 0;
fs/jfs/jfs_inode.c-114-	jfs_inode->blid = 0;
--
fs/jfs/jfs_txnmgr.c=1129=int txCommit(tid_t tid,		/* transaction identifier */
--
fs/jfs/jfs_txnmgr.c-1349-		 */
fs/jfs/jfs_txnmgr.c:1350:		jfs_ip->bxflag = 0;
fs/jfs/jfs_txnmgr.c-1351-		jfs_ip->blid = 0;
--
fs/jfs/jfs_xtree.c=2114=void xtInitRoot(tid_t tid, struct inode *ip)
--
fs/jfs/jfs_xtree.c-2122-	 */
fs/jfs/jfs_xtree.c:2123:	txLock(tid, ip, (struct metapage *) &JFS_IP(ip)->bxflag,
fs/jfs/jfs_xtree.c-2124-		      tlckXTREE | tlckNEW);
--
fs/jfs/namei.c=1069=static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
--
fs/jfs/namei.c-1260-			tlck = txLock(tid, old_ip,
fs/jfs/namei.c:1261:				    (struct metapage *) &JFS_IP(old_ip)->bxflag,
fs/jfs/namei.c-1262-				      tlckDTREE | tlckBTROOT | tlckRELINK);
]

50/2 2026/06/26 21:12 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 38604
							output: 41
							thoughts: 38
						

Thoughts:
Okay, let me think this through.

**Analyzing the `bxflag` Variable**

Right, so `bxflag` is initialized to 0. That much is clear. But then... hold on, it's aliased to a `struct metapage` within the `txLock` function. Interesting. I need to understand what's happening within `txLock` to see how this aliasing is utilized and what the implications are. This definitely needs further investigation to understand its purpose and how it influences the data flow. Let's dig into `txLock`.



51/2 2026/06/26 21:12 tool read-file
0m Args:
map[File:fs/jfs/jfs_txnmgr.c FirstLine:790 LineCount:50]

Results:
map[Contents: 790:				    le16_to_cpu(p->header.nextindex);
 791:			}
 792:			xtlck->lwm.length = 0;	/* ! */
 793:			xtlck->twm.offset = 0;
 794:			xtlck->hwm.offset = 0;
 795:	
 796:			xtlck->index = 2;
 797:			break;
 798:	
 799:		case tlckINODE:
 800:			linelock->l2linesize = L2INODESLOTSIZE;
 801:			break;
 802:	
 803:		case tlckDATA:
 804:			linelock->l2linesize = L2DATASLOTSIZE;
 805:			break;
 806:	
 807:		default:
 808:			jfs_err("UFO tlock:0x%p", tlck);
 809:		}
 810:	
 811:		/*
 812:		 * update tlock vector
 813:		 */
 814:	      grantLock:
 815:		tlck->type |= type;
 816:	
 817:		return tlck;
 818:	
 819:		/*
 820:		 * page is being locked by another transaction:
 821:		 */
 822:	      waitLock:
 823:		/* Only locks on ipimap or ipaimap should reach here */
 824:		/* assert(jfs_ip->fileset == AGGREGATE_I); */
 825:		if (jfs_ip->fileset != AGGREGATE_I) {
 826:			printk(KERN_ERR "txLock: trying to lock locked page!");
 827:			print_hex_dump(KERN_ERR, "ip: ", DUMP_PREFIX_ADDRESS, 16, 4,
 828:				       ip, sizeof(*ip), 0);
 829:			print_hex_dump(KERN_ERR, "mp: ", DUMP_PREFIX_ADDRESS, 16, 4,
 830:				       mp, sizeof(*mp), 0);
 831:			print_hex_dump(KERN_ERR, "Locker's tblock: ",
 832:				       DUMP_PREFIX_ADDRESS, 16, 4, tid_to_tblock(tid),
 833:				       sizeof(struct tblock), 0);
 834:			print_hex_dump(KERN_ERR, "Tlock: ", DUMP_PREFIX_ADDRESS, 16, 4,
 835:				       tlck, sizeof(*tlck), 0);
 836:			BUG();
 837:		}
 838:		INCREMENT(stattx.waitlock);	/* statistics */
 839:		TXN_UNLOCK();
]

52/2 2026/06/26 21:12 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 39593
							output: 42
							thoughts: 12
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, as if I were having them:

**Diving into `txLock`**

Alright, let's get down to brass tacks. I need to understand this `txLock` implementation inside and out. The best way, as always, is to start at the absolute beginning. Forget any preconceptions; let's methodically trace the execution path. I'll read it line by line, really internalizing the logic, and identifying the data structures and control flow. No shortcuts. What are the initial assumptions, the input conditions, the intended outputs? I need to build a solid mental model of how this thing works, from the ground up. Then, and only then, can I begin to analyze its behavior under different loads or possible scenarios. Let's see what we're dealing with here...



53/2 2026/06/26 21:12 tool read-file
0m Args:
map[File:fs/jfs/jfs_txnmgr.c FirstLine:600 LineCount:100]

Results:
map[Contents: 600:		    !(mp->xflag & COMMIT_PAGE)) {
 601:			/*
 602:			 * Directory inode is special.  It can have both an xtree tlock
 603:			 * and a dtree tlock associated with it.
 604:			 */
 605:			dir_xtree = 1;
 606:			lid = jfs_ip->xtlid;
 607:		} else
 608:			lid = mp->lid;
 609:	
 610:		/* is page not locked by a transaction ? */
 611:		if (lid == 0)
 612:			goto allocateLock;
 613:	
 614:		jfs_info("txLock: tid:%d ip:0x%p mp:0x%p lid:%d", tid, ip, mp, lid);
 615:	
 616:		/* is page locked by the requester transaction ? */
 617:		tlck = lid_to_tlock(lid);
 618:		if ((xtid = tlck->tid) == tid) {
 619:			TXN_UNLOCK();
 620:			goto grantLock;
 621:		}
 622:	
 623:		/*
 624:		 * is page locked by anonymous transaction/lock ?
 625:		 *
 626:		 * (page update without transaction (i.e., file write) is
 627:		 * locked under anonymous transaction tid = 0:
 628:		 * anonymous tlocks maintained on anonymous tlock list of
 629:		 * the inode of the page and available to all anonymous
 630:		 * transactions until txCommit() time at which point
 631:		 * they are transferred to the transaction tlock list of
 632:		 * the committing transaction of the inode)
 633:		 */
 634:		if (xtid == 0) {
 635:			tlck->tid = tid;
 636:			TXN_UNLOCK();
 637:			tblk = tid_to_tblock(tid);
 638:			/*
 639:			 * The order of the tlocks in the transaction is important
 640:			 * (during truncate, child xtree pages must be freed before
 641:			 * parent's tlocks change the working map).
 642:			 * Take tlock off anonymous list and add to tail of
 643:			 * transaction list
 644:			 *
 645:			 * Note:  We really need to get rid of the tid & lid and
 646:			 * use list_head's.  This code is getting UGLY!
 647:			 */
 648:			if (jfs_ip->atlhead == lid) {
 649:				if (jfs_ip->atltail == lid) {
 650:					/* only anonymous txn.
 651:					 * Remove from anon_list
 652:					 */
 653:					TXN_LOCK();
 654:					list_del_init(&jfs_ip->anon_inode_list);
 655:					TXN_UNLOCK();
 656:				}
 657:				jfs_ip->atlhead = tlck->next;
 658:			} else {
 659:				lid_t last;
 660:				for (last = jfs_ip->atlhead;
 661:				     lid_to_tlock(last)->next != lid;
 662:				     last = lid_to_tlock(last)->next) {
 663:					assert(last);
 664:				}
 665:				lid_to_tlock(last)->next = tlck->next;
 666:				if (jfs_ip->atltail == lid)
 667:					jfs_ip->atltail = last;
 668:			}
 669:	
 670:			/* insert the tlock at tail of transaction tlock list */
 671:	
 672:			if (tblk->next)
 673:				lid_to_tlock(tblk->last)->next = lid;
 674:			else
 675:				tblk->next = lid;
 676:			tlck->next = 0;
 677:			tblk->last = lid;
 678:	
 679:			goto grantLock;
 680:		}
 681:	
 682:		goto waitLock;
 683:	
 684:		/*
 685:		 * allocate a tlock
 686:		 */
 687:	      allocateLock:
 688:		lid = txLockAlloc();
 689:		tlck = lid_to_tlock(lid);
 690:	
 691:		/*
 692:		 * initialize tlock
 693:		 */
 694:		tlck->tid = tid;
 695:	
 696:		TXN_UNLOCK();
 697:	
 698:		/* mark tlock for meta-data page */
 699:		if (mp->xflag & COMMIT_PAGE) {
]

54/2 2026/06/26 21:12 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 41230
							output: 41
							thoughts: 15
						

Thoughts:
Okay, let's dive into this code.

**Analyzing `txLock` at Line 550**

Alright, I'm zeroing in on line 550 and specifically that `txLock` variable. Given my understanding of this system and the surrounding context, I need to figure out exactly what `txLock` represents and what's happening to it here. I'm already assuming it's probably a lock of some sort, perhaps related to transaction management given its naming. I should examine the surrounding lines of code for clues. Are we acquiring, releasing, or checking the state of this lock? What resources might it be protecting? Is this a read lock, a write lock, or something more sophisticated? Is it a global lock, or scoped to a particular transaction? All of these questions are swirling in my mind as I approach this line. I need to understand its role in ensuring data integrity or concurrency control within the transaction context. Let's see what the code reveals.



55/2 2026/06/26 21:12 tool read-file
0m Args:
map[File:fs/jfs/jfs_txnmgr.c FirstLine:550 LineCount:50]

Results:
map[Contents: 550:				/* write dirty metadata & forward log syncpt */
 551:				jfs_syncpt(log, 1);
 552:	
 553:				jfs_info("log barrier off: 0x%x", log->lsn);
 554:	
 555:				/* enable new transactions start */
 556:				clear_bit(log_SYNCBARRIER, &log->flag);
 557:	
 558:				/* wakeup all waitors for logsync barrier */
 559:				TXN_WAKEUP(&log->syncwait);
 560:	
 561:				goto wakeup;
 562:			}
 563:		}
 564:	
 565:		TXN_UNLOCK();
 566:	wakeup:
 567:		/*
 568:		 * wakeup all waitors for a free tblock
 569:		 */
 570:		TXN_WAKEUP(&TxAnchor.freewait);
 571:	}
 572:	
 573:	/*
 574:	 *	txLock()
 575:	 *
 576:	 * function: acquire a transaction lock on the specified <mp>
 577:	 *
 578:	 * parameter:
 579:	 *
 580:	 * return:	transaction lock id
 581:	 *
 582:	 * serialization:
 583:	 */
 584:	struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
 585:			     int type)
 586:	{
 587:		struct jfs_inode_info *jfs_ip = JFS_IP(ip);
 588:		int dir_xtree = 0;
 589:		lid_t lid;
 590:		tid_t xtid;
 591:		struct tlock *tlck;
 592:		struct xtlock *xtlck;
 593:		struct linelock *linelock;
 594:		xtpage_t *p;
 595:		struct tblock *tblk;
 596:	
 597:		TXN_LOCK();
 598:	
 599:		if (S_ISDIR(ip->i_mode) && (type & tlckXTREE) &&
]

56/2 2026/06/26 21:12 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 42150
							output: 29
							thoughts: 536
						

Thoughts:
**Analyzing the Page Locking Mechanism**

Okay, so I'm diving into this `txLock` function and trying to understand how it's managing meta-data page locks. The core logic hinges on `mp->xflag & COMMIT_PAGE`. Now, I recall that in `xtInitRoot`, they're passing `(struct metapage *) &JFS_IP(ip)->bxflag`. And `bxflag` is initialized to zero, which means initially `mp->xflag & COMMIT_PAGE` is definitely zero.

But here's the kicker: `txLock` has different branching based on whether `mp->xflag & COMMIT_PAGE` is set. If it IS set, that means it's a "meta-data page", and we get `tlck->flag = tlckPAGELOCK`, the transaction lock is associated with the page ( `mp->lid = lid`), and the lock gets added to the page's anonymous lock list.

If it's *not* a meta-data page (the `else` block), `tlck->flag = tlckINODELOCK`, and we've got some conditional logic involving `jfs_ip->xtlid`, `jfs_ip->blid` and `jfs_ip->bxflag |= type;`. That `type` variable is the key.

Let's break down where `type` gets set. In `xtInitRoot`, `type` is `tlckXTREE | tlckNEW`. Looking at the definitions, `tlckXTREE` is `0x0002` and `tlckNEW` is `0x0020`. So, `bxflag` ends up becoming `0x0022`. In `dtInitRoot`, we have a different set of flags: `tlckDTREE | tlckENTRY | tlckBTROOT`. Those resolve to `0x0004`, `0x0008`, and `0x0010`. Thus, `bxflag` becomes `0x001C`. And, in `jfs_rename`, it's `tlckDTREE | tlckBTROOT | tlckRELINK`, which means `bxflag` becomes `0x0054`.

The crucial question is, can `bxflag` *ever* actually become `0x1000`? Because, that's what `COMMIT_PAGE` is defined as. If so, then meta pages *can* get locked.

I need to see the `tlck*` flag definitions in order to decide.



57/2 2026/06/26 21:12 tool grepper
0m Args:
map[Expression:#define tlck PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_txnmgr.h=98=extern struct tlock *TxLock;	/* transaction lock table */
--
fs/jfs/jfs_txnmgr.h-103-/* txLock state */
fs/jfs/jfs_txnmgr.h:104:#define tlckPAGELOCK		0x8000
fs/jfs/jfs_txnmgr.h:105:#define tlckINODELOCK		0x4000
fs/jfs/jfs_txnmgr.h:106:#define tlckLINELOCK		0x2000
fs/jfs/jfs_txnmgr.h:107:#define tlckINLINELOCK		0x1000
fs/jfs/jfs_txnmgr.h-108-/* lmLog state */
fs/jfs/jfs_txnmgr.h:109:#define tlckLOG			0x0800
fs/jfs/jfs_txnmgr.h-110-/* updateMap state */
--
fs/jfs/jfs_txnmgr.h-113-/* freeLock state */
fs/jfs/jfs_txnmgr.h:114:#define tlckFREELOCK		0x0008
fs/jfs/jfs_txnmgr.h:115:#define tlckWRITEPAGE		0x0004
fs/jfs/jfs_txnmgr.h:116:#define tlckFREEPAGE		0x0002
fs/jfs/jfs_txnmgr.h-117-
--
fs/jfs/jfs_txnmgr.h-131-#define	tlckOPERATION		0x00ff
fs/jfs/jfs_txnmgr.h:132:#define tlckGROW		0x0001	/* file grow */
fs/jfs/jfs_txnmgr.h:133:#define tlckREMOVE		0x0002	/* file delete */
fs/jfs/jfs_txnmgr.h:134:#define tlckTRUNCATE		0x0004	/* file truncate */
fs/jfs/jfs_txnmgr.h:135:#define tlckRELOCATE		0x0008	/* file/directory relocate */
fs/jfs/jfs_txnmgr.h:136:#define tlckENTRY		0x0001	/* directory insert/delete */
fs/jfs/jfs_txnmgr.h:137:#define tlckEXTEND		0x0002	/* directory extend in-line */
fs/jfs/jfs_txnmgr.h:138:#define tlckSPLIT		0x0010	/* splited page */
fs/jfs/jfs_txnmgr.h:139:#define tlckNEW			0x0020	/* new page from split */
fs/jfs/jfs_txnmgr.h:140:#define tlckFREE		0x0040	/* free page */
fs/jfs/jfs_txnmgr.h:141:#define tlckRELINK		0x0080	/* update sibling pointer */
fs/jfs/jfs_txnmgr.h-142-
]

58/2 2026/06/26 21:12 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 44112
							output: 30
							thoughts: 55
						

Thoughts:
**Analyzing Memory Allocation Flags**

Okay, hold on a second. I'm seeing something here with these memory allocation flags. The `tlckINLINELOCK` flag, I'm pretty sure that's defined as `0x1000`. And, let's see, `COMMIT_PAGE` is also set to `0x1000`. Hmmm... that's interesting. Are these two flags actually sharing the same bit position? We need to be careful with bitwise operations, especially when these flags could indicate different allocation behaviors. Best to double-check the definition for `COMMIT_PAGE` again. Gotta make sure there's no overlap or conflicting behavior that could cause a bug down the line.



59/2 2026/06/26 21:12 tool grepper
0m Args:
map[Expression:#define COMMIT_PAGE PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_txnmgr.h=59=extern struct tblock *TxBlock;	/* transaction block table */
--
fs/jfs/jfs_txnmgr.h-73-#define	COMMIT_LAZY	0x0800	/* lazy commit */
fs/jfs/jfs_txnmgr.h:74:#define COMMIT_PAGE	0x1000	/* Identifies element as metapage */
fs/jfs/jfs_txnmgr.h-75-#define COMMIT_INODE	0x2000	/* Identifies element as inode */
]

60/2 2026/06/26 21:12 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 44509
							output: 31
							thoughts: 179
						

Thoughts:
**Analyzing the Transaction Lock Mechanism**

Okay, so I'm digging into this `txLock` function, specifically within the JFS filesystem code. First things first, confirming that `COMMIT_PAGE` is indeed `0x1000`. That's a fundamental constant, and it's good to verify these things. Now, I see this `bxflag` variable – it's a `u16`, so a 16-bit unsigned integer. That's relevant to how much information it can store.

Looking at the core logic within `txLock`, I see it sets a `tlck->flag` to `tlckINODELOCK` when dealing with an in-memory page. Okay, standard locking procedure. Now, the conditional part is what I'm focused on. If `dir_xtree` is true, then `jfs_ip->xtlid = lid`. Makes sense, sets up the XTree lock ID. But if not (and this is the key piece), it sets `jfs_ip->blid = lid` and the important part, `jfs_ip->bxflag |= type;`.

Ah, that `type` variable. I need to understand what values it can possibly take. It seems to be the critical bit of information used to indicate the nature of the lock. I should verify that `tlckXTREE` is 0x0002. This is essential for interpreting the value of `bxflag` later on. A mistake here, and it’s a bug. This needs a deeper dive to track the usage of `type` and what each of its bits actually means.



61/2 2026/06/26 21:12 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:#define tlckXTREE PathPrefix:fs/jfs/]

Results:
map[Output:]

62/2 2026/06/26 21:12 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 45083
							output: 29
							thoughts: 10
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Analyzing `tlck` Types**

Alright, time to dig into those `tlck` types. I need to get a handle on what we're working with here. First, I'm thinking about the common pitfalls – are we dealing with any ambiguous definitions or inconsistent implementations? We've seen this before, and it can throw a wrench into everything downstream.

I'm mentally running through the typical `tlck` subtypes – what are the expected characteristics of each? What are their key performance indicators, or KPIs? Are there any implicit assumptions I should be questioning? I need to be sure I understand the data structures and how they're managed. This means considering how these types interface with other parts of the system.

I'm also thinking about potential edge cases. Are there any unusual `tlck` configurations that could cause problems? What about specific scenarios where performance might degrade? This means considering the impact on resource consumption, and the possible for bottlenecks. Ultimately, I'm focusing on their efficiency and how robust they are in the face of varying loads and inputs.



63/2 2026/06/26 21:12 tool grepper
0m Args:
map[Expression:#define tlck PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_txnmgr.h=98=extern struct tlock *TxLock;	/* transaction lock table */
--
fs/jfs/jfs_txnmgr.h-103-/* txLock state */
fs/jfs/jfs_txnmgr.h:104:#define tlckPAGELOCK		0x8000
fs/jfs/jfs_txnmgr.h:105:#define tlckINODELOCK		0x4000
fs/jfs/jfs_txnmgr.h:106:#define tlckLINELOCK		0x2000
fs/jfs/jfs_txnmgr.h:107:#define tlckINLINELOCK		0x1000
fs/jfs/jfs_txnmgr.h-108-/* lmLog state */
fs/jfs/jfs_txnmgr.h:109:#define tlckLOG			0x0800
fs/jfs/jfs_txnmgr.h-110-/* updateMap state */
--
fs/jfs/jfs_txnmgr.h-113-/* freeLock state */
fs/jfs/jfs_txnmgr.h:114:#define tlckFREELOCK		0x0008
fs/jfs/jfs_txnmgr.h:115:#define tlckWRITEPAGE		0x0004
fs/jfs/jfs_txnmgr.h:116:#define tlckFREEPAGE		0x0002
fs/jfs/jfs_txnmgr.h-117-
--
fs/jfs/jfs_txnmgr.h-131-#define	tlckOPERATION		0x00ff
fs/jfs/jfs_txnmgr.h:132:#define tlckGROW		0x0001	/* file grow */
fs/jfs/jfs_txnmgr.h:133:#define tlckREMOVE		0x0002	/* file delete */
fs/jfs/jfs_txnmgr.h:134:#define tlckTRUNCATE		0x0004	/* file truncate */
fs/jfs/jfs_txnmgr.h:135:#define tlckRELOCATE		0x0008	/* file/directory relocate */
fs/jfs/jfs_txnmgr.h:136:#define tlckENTRY		0x0001	/* directory insert/delete */
fs/jfs/jfs_txnmgr.h:137:#define tlckEXTEND		0x0002	/* directory extend in-line */
fs/jfs/jfs_txnmgr.h:138:#define tlckSPLIT		0x0010	/* splited page */
fs/jfs/jfs_txnmgr.h:139:#define tlckNEW			0x0020	/* new page from split */
fs/jfs/jfs_txnmgr.h:140:#define tlckFREE		0x0040	/* free page */
fs/jfs/jfs_txnmgr.h:141:#define tlckRELINK		0x0080	/* update sibling pointer */
fs/jfs/jfs_txnmgr.h-142-
]

64/2 2026/06/26 21:12 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 46202
							output: 29
							thoughts: 11
						

Thoughts:
Okay, here's my summary, taking the perspective of someone thinking about that text, with the assumption that I, as the user, am an expert and understand the context:

**Where's `tlckXTREE`?**

Huh. Wait a minute, I was just looking at something, and now...where is that `tlckXTREE` thing? It's not in the place I expected it to be. This is a bit unsettling. It could be anywhere, and that's going to make this process much more difficult. I need to figure out where it's gone and fast. This is likely part of a much larger process, and without it, I'm at a standstill. I need to retrace my steps or check the dependencies. Okay, deep breath. Let's start with the basics...



65/2 2026/06/26 21:12 tool grepper
0m Args:
map[Expression:tlckXTREE PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_imap.c=581=int diWrite(tid_t tid, struct inode *ip)
--
fs/jfs/jfs_imap.c-680-		tlck = lid_to_tlock(lid);
fs/jfs/jfs_imap.c:681:		assert(tlck->type & tlckXTREE);
fs/jfs/jfs_imap.c-682-		tlck->type |= tlckBTROOT;
--
fs/jfs/jfs_imap.c-717-	 */
fs/jfs/jfs_imap.c:718:	if (type & tlckXTREE) {
fs/jfs/jfs_imap.c-719-		xtroot_t *p, *xp;
--
fs/jfs/jfs_txnmgr.c=584=struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
--
fs/jfs/jfs_txnmgr.c-598-
fs/jfs/jfs_txnmgr.c:599:	if (S_ISDIR(ip->i_mode) && (type & tlckXTREE) &&
fs/jfs/jfs_txnmgr.c-600-	    !(mp->xflag & COMMIT_PAGE)) {
--
fs/jfs/jfs_txnmgr.c-774-
fs/jfs/jfs_txnmgr.c:775:	case tlckXTREE:
fs/jfs/jfs_txnmgr.c-776-		linelock->l2linesize = L2XTSLOTSIZE;
--
fs/jfs/jfs_txnmgr.c=1374=static void txLog(struct jfs_log *log, struct tblock *tblk, struct commit *cd)
--
fs/jfs/jfs_txnmgr.c-1396-		switch (tlck->type & tlckTYPE) {
fs/jfs/jfs_txnmgr.c:1397:		case tlckXTREE:
fs/jfs/jfs_txnmgr.c-1398-			xtLog(log, tblk, lrd, tlck);
--
fs/jfs/jfs_txnmgr.h=98=extern struct tlock *TxLock;	/* transaction lock table */
--
fs/jfs/jfs_txnmgr.h-122-#define	tlckINODE		0x8000
fs/jfs/jfs_txnmgr.h:123:#define	tlckXTREE		0x4000
fs/jfs/jfs_txnmgr.h-124-#define	tlckDTREE		0x2000
--
fs/jfs/jfs_xtree.c=528=int xtInsert(tid_t tid,		/* transaction id */
--
fs/jfs/jfs_xtree.c-644-	if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:645:		tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-646-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=679=xtSplitUp(tid_t tid,
--
fs/jfs/jfs_xtree.c-735-		if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:736:			tlck = txLock(tid, ip, smp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-737-			xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-905-				tlck = txLock(tid, ip, smp,
fs/jfs/jfs_xtree.c:906:					      tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-907-				xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=949=xtSplitPage(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_xtree.c-1013-		 */
fs/jfs/jfs_xtree.c:1014:		tlck = txLock(tid, ip, rmp, tlckXTREE | tlckNEW);
fs/jfs/jfs_xtree.c-1015-		rxtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1019-		 */
fs/jfs/jfs_xtree.c:1020:		tlck = txLock(tid, ip, smp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-1021-		sxtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1092-		if (!test_cflag(COMMIT_Nolink, ip))
fs/jfs/jfs_xtree.c:1093:			tlck = txLock(tid, ip, mp, tlckXTREE | tlckRELINK);
fs/jfs/jfs_xtree.c-1094-
--
fs/jfs/jfs_xtree.c=1216=xtSplitRoot(tid_t tid,
--
fs/jfs/jfs_xtree.c-1296-	if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1297:		tlck = txLock(tid, ip, rmp, tlckXTREE | tlckNEW);
fs/jfs/jfs_xtree.c-1298-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1327-	if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1328:		tlck = txLock(tid, ip, split->mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-1329-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=1351=int xtExtend(tid_t tid,		/* transaction id */
--
fs/jfs/jfs_xtree.c-1398-	if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1399:		tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-1400-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1456-			if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1457:				tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
fs/jfs/jfs_xtree.c-1458-				xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=1513=int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
--
fs/jfs/jfs_xtree.c-1553-	if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1554:		tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-1555-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1750-			if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1751:				tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
fs/jfs/jfs_xtree.c-1752-				xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1811-		if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1812:			tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-1813-			xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=1868=printf("xtUpdate.updateLeft.split p:0x%p\n", p);
--
fs/jfs/jfs_xtree.c-1904-			if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1905:				tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
fs/jfs/jfs_xtree.c-1906-				xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=1956=int xtAppend(tid_t tid,		/* transaction id */
--
fs/jfs/jfs_xtree.c-2083-	 */
fs/jfs/jfs_xtree.c:2084:	tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-2085-	xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=2114=void xtInitRoot(tid_t tid, struct inode *ip)
--
fs/jfs/jfs_xtree.c-2123-	txLock(tid, ip, (struct metapage *) &JFS_IP(ip)->bxflag,
fs/jfs/jfs_xtree.c:2124:		      tlckXTREE | tlckNEW);
fs/jfs/jfs_xtree.c-2125-	p = &JFS_IP(ip)->i_xtroot;
--
fs/jfs/jfs_xtree.c=2203=s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
--
fs/jfs/jfs_xtree.c-2303-			 */
fs/jfs/jfs_xtree.c:2304:			tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
fs/jfs/jfs_xtree.c-2305-		BT_MARK_DIRTY(mp, ip);
--
fs/jfs/jfs_xtree.c-2336-		}
fs/jfs/jfs_xtree.c:2337:		tlck = txLock(tid, ip, mp, tlckXTREE);
fs/jfs/jfs_xtree.c:2338:		tlck->type = tlckXTREE | tlckTRUNCATE;
fs/jfs/jfs_xtree.c-2339-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-2473-		 */
fs/jfs/jfs_xtree.c:2474:		tlck->type = tlckXTREE | tlckFREE;
fs/jfs/jfs_xtree.c-2475-	} else {		/* COMMIT_WAMP */
--
fs/jfs/jfs_xtree.c-2539-				 */
fs/jfs/jfs_xtree.c:2540:				tlck = txLock(tid, ip, mp, tlckXTREE);
fs/jfs/jfs_xtree.c-2541-				xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-2546-					tlck->type =
fs/jfs/jfs_xtree.c:2547:					    tlckXTREE | tlckTRUNCATE;
fs/jfs/jfs_xtree.c-2548-				}
--
fs/jfs/jfs_xtree.c-2615-			 */
fs/jfs/jfs_xtree.c:2616:			tlck = txLock(tid, ip, mp, tlckXTREE);
fs/jfs/jfs_xtree.c-2617-			xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-2619-			    le16_to_cpu(p->header.nextindex) - 1;
fs/jfs/jfs_xtree.c:2620:			tlck->type = tlckXTREE | tlckFREE;
fs/jfs/jfs_xtree.c-2621-		} else {	/* COMMIT_WMAP */
--
fs/jfs/jfs_xtree.c=2758=s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
--
fs/jfs/jfs_xtree.c-2833-	}
fs/jfs/jfs_xtree.c:2834:	tlck = txLock(tid, ip, mp, tlckXTREE);
fs/jfs/jfs_xtree.c:2835:	tlck->type = tlckXTREE | tlckFREE;
fs/jfs/jfs_xtree.c-2836-	xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-2866-		 */
fs/jfs/jfs_xtree.c:2867:		tlck = txLock(tid, ip, mp, tlckXTREE);
fs/jfs/jfs_xtree.c-2868-		xtlck = (struct xtlock *) & tlck->lock;
fs/jfs/jfs_xtree.c-2869-		xtlck->hwm.offset = le16_to_cpu(p->header.nextindex) - 1;
fs/jfs/jfs_xtree.c:2870:		tlck->type = tlckXTREE | tlckFREE;
fs/jfs/jfs_xtree.c-2871-
]

66/2 2026/06/26 21:12 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 50294
							output: 41
							thoughts: 235
						

Thoughts:
**Decoding Transaction Lock Constants**

Okay, so I'm looking at this code, and it seems like `tlckXTREE` is defined as `0x4000`. Wait a minute, I think I've seen that value assigned to `tlckINODELOCK` somewhere too. Hang on, let's just make sure I'm not misremembering... Is `tlckXTREE` really `0x4000`? This feels like a potential conflict, or at least a point of confusion that needs clearing up.

Let's quickly confirm this. I need to consult `jfs_txnmgr.h` to see how these constants are actually defined.  *Checks `jfs_txnmgr.h`...* Yup. `tlckXTREE` is indeed defined as `0x4000`.

*Checks `jfs_txnmgr.h` around line 100...*

And... wait a second - is `tlckINODELOCK` also `0x4000`? I need to clarify this and resolve any potential definition conflicts. I should be able to get to the bottom of this.



67/2 2026/06/26 21:13 tool read-file
0m Args:
map[File:fs/jfs/jfs_txnmgr.h FirstLine:100 LineCount:30]

Results:
map[Contents: 100:	/*
 101:	 * tlock flag
 102:	 */
 103:	/* txLock state */
 104:	#define tlckPAGELOCK		0x8000
 105:	#define tlckINODELOCK		0x4000
 106:	#define tlckLINELOCK		0x2000
 107:	#define tlckINLINELOCK		0x1000
 108:	/* lmLog state */
 109:	#define tlckLOG			0x0800
 110:	/* updateMap state */
 111:	#define	tlckUPDATEMAP		0x0080
 112:	#define	tlckDIRECTORY		0x0040
 113:	/* freeLock state */
 114:	#define tlckFREELOCK		0x0008
 115:	#define tlckWRITEPAGE		0x0004
 116:	#define tlckFREEPAGE		0x0002
 117:	
 118:	/*
 119:	 * tlock type
 120:	 */
 121:	#define	tlckTYPE		0xfe00
 122:	#define	tlckINODE		0x8000
 123:	#define	tlckXTREE		0x4000
 124:	#define	tlckDTREE		0x2000
 125:	#define	tlckMAP			0x1000
 126:	#define	tlckEA			0x0800
 127:	#define	tlckACL			0x0400
 128:	#define	tlckDATA		0x0200
 129:	#define	tlckBTROOT		0x0100
]

68/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 51342
							output: 28
							thoughts: 104
						

Thoughts:
**Analyzing a Potential Bug in Memory Management**

Okay, so I'm looking at this code and immediately I see something that's grabbing my attention. `tlckMAP` is defined as `0x1000`, and `COMMIT_PAGE` is also `0x1000`. Now, that's not necessarily a problem in itself, but it does make me think, "Hmm, if a bitfield, `bxflag`, gets `tlckMAP` set, then the bitwise AND operation `bxflag & COMMIT_PAGE` is going to evaluate to true!" That's the key.

The question then becomes: can `bxflag` *actually* get `tlckMAP` set in the current design? That's what I need to dig into. I need to understand the control flow, where this `tlckMAP` value is used, and more importantly, how `bxflag` is manipulated in relation to it. Time to trace those usages and see where this can lead, to uncover the possible issue.



69/2 2026/06/26 21:13 tool grepper
0m Args:
map[Expression:tlckMAP PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_txnmgr.c=1374=static void txLog(struct jfs_log *log, struct tblock *tblk, struct commit *cd)
--
fs/jfs/jfs_txnmgr.c-1408-
fs/jfs/jfs_txnmgr.c:1409:		case tlckMAP:
fs/jfs/jfs_txnmgr.c-1410-			mapLog(log, tblk, lrd, tlck);
--
fs/jfs/jfs_txnmgr.c=2127=void txEA(tid_t tid, struct inode *ip, dxd_t * oldea, dxd_t * newea)
--
fs/jfs/jfs_txnmgr.c-2140-		if (newea->flag & DXD_EXTENT) {
fs/jfs/jfs_txnmgr.c:2141:			tlck = txMaplock(tid, ip, tlckMAP);
fs/jfs/jfs_txnmgr.c-2142-			maplock = (struct pxd_lock *) & tlck->lock;
--
fs/jfs/jfs_txnmgr.c-2160-		if (tlck == NULL) {
fs/jfs/jfs_txnmgr.c:2161:			tlck = txMaplock(tid, ip, tlckMAP);
fs/jfs/jfs_txnmgr.c-2162-			maplock = (struct pxd_lock *) & tlck->lock;
--
fs/jfs/jfs_txnmgr.h=98=extern struct tlock *TxLock;	/* transaction lock table */
--
fs/jfs/jfs_txnmgr.h-124-#define	tlckDTREE		0x2000
fs/jfs/jfs_txnmgr.h:125:#define	tlckMAP			0x1000
fs/jfs/jfs_txnmgr.h-126-#define	tlckEA			0x0800
]

70/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 52230
							output: 41
							thoughts: 36
						

Thoughts:
Here's my summary, as the expert:

**Delving into Transaction Locking and Flags**

Okay, so I'm looking at `txMaplock`. The key question right now is whether this function is correctly using the `tlckMAP` data. My immediate concern is whether `txMaplock` also manages the `bxflag`. This bit of information is crucial for understanding the overall locking strategy. I need to refresh my memory and verify this. I'm going to jump into the `txMaplock` code directly to clarify this point.



71/2 2026/06/26 21:13 tool read-file
0m Args:
map[File:fs/jfs/jfs_txnmgr.c FirstLine:840 LineCount:50]

Results:
map[Contents: 840:		release_metapage(mp);
 841:		TXN_LOCK();
 842:		xtid = tlck->tid;	/* reacquire after dropping TXN_LOCK */
 843:	
 844:		jfs_info("txLock: in waitLock, tid = %d, xtid = %d, lid = %d",
 845:			 tid, xtid, lid);
 846:	
 847:		/* Recheck everything since dropping TXN_LOCK */
 848:		if (xtid && (tlck->mp == mp) && (mp->lid == lid))
 849:			TXN_SLEEP_DROP_LOCK(&tid_to_tblock(xtid)->waitor);
 850:		else
 851:			TXN_UNLOCK();
 852:		jfs_info("txLock: awakened     tid = %d, lid = %d", tid, lid);
 853:	
 854:		return NULL;
 855:	}
 856:	
 857:	/*
 858:	 * NAME:	txRelease()
 859:	 *
 860:	 * FUNCTION:	Release buffers associated with transaction locks, but don't
 861:	 *		mark homeok yet.  The allows other transactions to modify
 862:	 *		buffers, but won't let them go to disk until commit record
 863:	 *		actually gets written.
 864:	 *
 865:	 * PARAMETER:
 866:	 *		tblk	-
 867:	 *
 868:	 * RETURN:	Errors from subroutines.
 869:	 */
 870:	static void txRelease(struct tblock * tblk)
 871:	{
 872:		struct metapage *mp;
 873:		lid_t lid;
 874:		struct tlock *tlck;
 875:	
 876:		TXN_LOCK();
 877:	
 878:		for (lid = tblk->next; lid; lid = tlck->next) {
 879:			tlck = lid_to_tlock(lid);
 880:			if ((mp = tlck->mp) != NULL &&
 881:			    (tlck->type & tlckBTROOT) == 0) {
 882:				assert(mp->xflag & COMMIT_PAGE);
 883:				mp->lid = 0;
 884:			}
 885:		}
 886:	
 887:		/*
 888:		 * wakeup transactions waiting on a page locked
 889:		 * by the current transaction
]

72/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 53154
							output: 28
							thoughts: 9
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Locating the Crucial Piece: txMaplock**

Right, let's get down to brass tacks. My initial thought process is laser-focused on finding a specific element: `txMaplock`. The brevity of the thought indicates a direct, perhaps even subconscious, search for this particular variable or structure. This implies that whatever the current investigation or task, `txMaplock` is central to it. It's not just *a* variable; it’s *the* variable that likely unlocks a critical understanding or enables a specific action. The fact that the thought immediately surfaces this suggests this is a common variable used in solving problems. It is something which I will already have in my knowledge to investigate.



73/2 2026/06/26 21:13 tool grepper
0m Args:
map[Expression:txMaplock PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_dtree.c=1635=static int dtExtendPage(tid_t tid,
--
fs/jfs/jfs_dtree.c-1688-		/* save moved extent descriptor for later free */
fs/jfs/jfs_dtree.c:1689:		tlck = txMaplock(tid, ip, tlckDTREE | tlckRELOCATE);
fs/jfs/jfs_dtree.c-1690-		pxdlock = (struct pxd_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c=2230=static int dtDeleteUp(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_dtree.c-2270-	 */
fs/jfs/jfs_dtree.c:2271:	tlck = txMaplock(tid, ip, tlckDTREE | tlckFREE);
fs/jfs/jfs_dtree.c-2272-	pxdlock = (struct pxd_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c-2345-				tlck =
fs/jfs/jfs_dtree.c:2346:				    txMaplock(tid, ip,
fs/jfs/jfs_dtree.c-2347-					      tlckDTREE | tlckFREE);
--
fs/jfs/jfs_txnmgr.c=902=static void txUnlock(struct tblock * tblk)
--
fs/jfs/jfs_txnmgr.c-983-/*
fs/jfs/jfs_txnmgr.c:984: *	txMaplock()
fs/jfs/jfs_txnmgr.c-985- *
--
fs/jfs/jfs_txnmgr.c-988- */
fs/jfs/jfs_txnmgr.c:989:struct tlock *txMaplock(tid_t tid, struct inode *ip, int type)
fs/jfs/jfs_txnmgr.c-990-{
--
fs/jfs/jfs_txnmgr.c=2127=void txEA(tid_t tid, struct inode *ip, dxd_t * oldea, dxd_t * newea)
--
fs/jfs/jfs_txnmgr.c-2140-		if (newea->flag & DXD_EXTENT) {
fs/jfs/jfs_txnmgr.c:2141:			tlck = txMaplock(tid, ip, tlckMAP);
fs/jfs/jfs_txnmgr.c-2142-			maplock = (struct pxd_lock *) & tlck->lock;
--
fs/jfs/jfs_txnmgr.c-2160-		if (tlck == NULL) {
fs/jfs/jfs_txnmgr.c:2161:			tlck = txMaplock(tid, ip, tlckMAP);
fs/jfs/jfs_txnmgr.c-2162-			maplock = (struct pxd_lock *) & tlck->lock;
--
fs/jfs/jfs_txnmgr.h=280=extern struct tlock *txLock(tid_t, struct inode *, struct metapage *, int);
fs/jfs/jfs_txnmgr.h:281:extern struct tlock *txMaplock(tid_t, struct inode *, int);
fs/jfs/jfs_txnmgr.h-282-extern int txCommit(tid_t, int, struct inode **, int);
]

74/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 54299
							output: 41
							thoughts: 9
						

Thoughts:
Okay, let's dive into this. Here's my take on those thoughts, as if they're my own:

**Initial Assessment: Reading `txMaplock`**

Right, `txMaplock`. That's the starting point. Time to get my head around this. Let's start with a mental map. What are the key architectural elements? Is this related to state management? Is this part of a concurrency model? I need to quickly establish the context within the larger system. My immediate goal is to understand the purpose and function of `txMaplock` within the scope of transactions. Is this a custom implementation, or does it leverage existing primitives? I need to identify any potential gotchas or optimizations that might be employed here. Okay, let's read the code.



75/2 2026/06/26 21:13 tool read-file
0m Args:
map[File:fs/jfs/jfs_txnmgr.c FirstLine:980 LineCount:50]

Results:
map[Contents: 980:		}
 981:	}
 982:	
 983:	/*
 984:	 *	txMaplock()
 985:	 *
 986:	 * function: allocate a transaction lock for freed page/entry;
 987:	 *	for freed page, maplock is used as xtlock/dtlock type;
 988:	 */
 989:	struct tlock *txMaplock(tid_t tid, struct inode *ip, int type)
 990:	{
 991:		struct jfs_inode_info *jfs_ip = JFS_IP(ip);
 992:		lid_t lid;
 993:		struct tblock *tblk;
 994:		struct tlock *tlck;
 995:		struct maplock *maplock;
 996:	
 997:		TXN_LOCK();
 998:	
 999:		/*
1000:		 * allocate a tlock
1001:		 */
1002:		lid = txLockAlloc();
1003:		tlck = lid_to_tlock(lid);
1004:	
1005:		/*
1006:		 * initialize tlock
1007:		 */
1008:		tlck->tid = tid;
1009:	
1010:		/* bind the tlock and the object */
1011:		tlck->flag = tlckINODELOCK;
1012:		if (S_ISDIR(ip->i_mode))
1013:			tlck->flag |= tlckDIRECTORY;
1014:		tlck->ip = ip;
1015:		tlck->mp = NULL;
1016:	
1017:		tlck->type = type;
1018:	
1019:		/*
1020:		 * enqueue transaction lock to transaction/inode
1021:		 */
1022:		/* insert the tlock at tail of transaction tlock list */
1023:		if (tid) {
1024:			tblk = tid_to_tblock(tid);
1025:			if (tblk->next)
1026:				lid_to_tlock(tblk->last)->next = lid;
1027:			else
1028:				tblk->next = lid;
1029:			tlck->next = 0;
]

76/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 55173
							output: 31
							thoughts: 66
						

Thoughts:
**Investigating the `txMaplock` and `bxflag` Interaction**

Okay, so it seems like `txMaplock` isn't explicitly setting the `bxflag`. That's a potential area for a bug, but hold on a moment... what happens if `bxflag` *is* already set to something specific, particularly `tlckINLINELOCK`? I know that `tlckINLINELOCK` has a value of `0x1000`. It’s a value I would expect to have some implications for how the lock is handled. Now I need to figure out everywhere that `tlckINLINELOCK` is actually *used*. I've got to trace its usage to understand the full implications here, maybe there’s some unexpected interaction between the two flags.



77/2 2026/06/26 21:13 tool grepper
0m Args:
map[Expression:tlckINLINELOCK PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_txnmgr.h=98=extern struct tlock *TxLock;	/* transaction lock table */
--
fs/jfs/jfs_txnmgr.h-106-#define tlckLINELOCK		0x2000
fs/jfs/jfs_txnmgr.h:107:#define tlckINLINELOCK		0x1000
fs/jfs/jfs_txnmgr.h-108-/* lmLog state */
]

78/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 55576
							output: 27
							thoughts: 95
						

Thoughts:
**Investigating the Unused `bxflag`**

Okay, so I'm looking at this code and, initially, I'm thinking, "Where the heck is `bxflag` actually being used?" It seems completely dead. But then, a thought pops into my head. What if `bxflag` has a conditional use case? Like, what happens if it's set to something specific, namely, if `bxflag` is set to `tlckMAP`? Now, I need to remind myself, what *is* `tlckMAP`? Oh, right, it's defined as `0x1000`.

Okay, so `tlckMAP` *is* passed to `txMaplock`, but wait a second... `txMaplock` itself *doesn't* appear to actually set `bxflag`. This is making me go in circles. Is there another spot in this code where `bxflag` is modified? I need to go back and methodically check all instances of `bxflag`. I need to figure out where the setting is happening, and if it's based on some sort of conditional logic that's currently opaque.



79/2 2026/06/26 21:13 tool grepper
0m Args:
map[Expression:bxflag PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_btree.h=17=struct btpage {
--
fs/jfs/jfs_btree.h-57-	{\
fs/jfs/jfs_btree.h:58:		MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
fs/jfs/jfs_btree.h-59-		P = (TYPE *)&JFS_IP(IP)->ROOT;\
--
fs/jfs/jfs_dtree.c=2521=void dtInitRoot(tid_t tid, struct inode *ip, u32 idotdot)
--
fs/jfs/jfs_dtree.c-2570-	 */
fs/jfs/jfs_dtree.c:2571:	tlck = txLock(tid, ip, (struct metapage *) & jfs_ip->bxflag,
fs/jfs/jfs_dtree.c-2572-		      tlckDTREE | tlckENTRY | tlckBTROOT);
--
fs/jfs/jfs_imap.c=3034=static int copy_from_dinode(struct dinode * dip, struct inode *ip)
--
fs/jfs/jfs_imap.c-3117-	jfs_ip->btorder = 0;
fs/jfs/jfs_imap.c:3118:	jfs_ip->bxflag = 0;
fs/jfs/jfs_imap.c-3119-	jfs_ip->blid = 0;
--
fs/jfs/jfs_incore.h=27=struct jfs_inode_info {
--
fs/jfs/jfs_incore.h-42-	u64	agstart;	/* agstart of the containing IAG */
fs/jfs/jfs_incore.h:43:	u16	bxflag;		/* xflag of pseudo buffer?	*/
fs/jfs/jfs_incore.h-44-	unchar	pad;
--
fs/jfs/jfs_inode.c=41=struct inode *ialloc(struct inode *parent, umode_t mode)
--
fs/jfs/jfs_inode.c-112-	jfs_inode->btindex = 0;
fs/jfs/jfs_inode.c:113:	jfs_inode->bxflag = 0;
fs/jfs/jfs_inode.c-114-	jfs_inode->blid = 0;
--
fs/jfs/jfs_txnmgr.c=1129=int txCommit(tid_t tid,		/* transaction identifier */
--
fs/jfs/jfs_txnmgr.c-1349-		 */
fs/jfs/jfs_txnmgr.c:1350:		jfs_ip->bxflag = 0;
fs/jfs/jfs_txnmgr.c-1351-		jfs_ip->blid = 0;
--
fs/jfs/jfs_xtree.c=2114=void xtInitRoot(tid_t tid, struct inode *ip)
--
fs/jfs/jfs_xtree.c-2122-	 */
fs/jfs/jfs_xtree.c:2123:	txLock(tid, ip, (struct metapage *) &JFS_IP(ip)->bxflag,
fs/jfs/jfs_xtree.c-2124-		      tlckXTREE | tlckNEW);
--
fs/jfs/namei.c=1069=static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
--
fs/jfs/namei.c-1260-			tlck = txLock(tid, old_ip,
fs/jfs/namei.c:1261:				    (struct metapage *) &JFS_IP(old_ip)->bxflag,
fs/jfs/namei.c-1262-				      tlckDTREE | tlckBTROOT | tlckRELINK);
]

80/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 56983
							output: 27
							thoughts: 476
						

Thoughts:
**Analyzing the `bxflag` in `txLock` and its Implications**

Okay, let me break this down. I'm focusing on the `bxflag` within the `txLock` function. The code shows that if `bxflag` is set in a certain branch, and if the `type` argument passed to `txLock` includes `tlckMAP` (0x1000), then `bxflag` will receive this `tlckMAP` value. However, a crucial point is that `txLock` is *never* actually called with `tlckMAP`.

Now, looking at specific uses, in `xtInitRoot`, `txLock` is called with `tlckXTREE | tlckNEW` (0x4020). Therefore `bxflag` becomes 0x4020 here. The code then checks `bxflag & COMMIT_PAGE` (where `COMMIT_PAGE` is 0x1000). Doing the bitwise and, 0x4020 & 0x1000 is 0. So, the presence of `tlckXTREE` in `type` does not set `COMMIT_PAGE` in `bxflag`.

I'm starting to consider the case where `type` might have other flags. If `type` includes `tlckINLINELOCK`, it isn't used, and it's irrelevant. However, it *might* have `tlckDTREE` (0x2000). Examining uses of `tlckDTREE`, in `dtInitRoot`, `txLock` is called with `tlckDTREE | tlckENTRY | tlckBTROOT` (0x2101). In `jfs_rename`, we're seeing `tlckDTREE | tlckBTROOT | tlckRELINK` (0x2180).

Now I'm thinking about other calls to modify `bxflag`. I need to go look at `txLinelock`.



81/2 2026/06/26 21:13 tool grepper
0m Args:
map[Expression:bxflag PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_btree.h=17=struct btpage {
--
fs/jfs/jfs_btree.h-57-	{\
fs/jfs/jfs_btree.h:58:		MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
fs/jfs/jfs_btree.h-59-		P = (TYPE *)&JFS_IP(IP)->ROOT;\
--
fs/jfs/jfs_dtree.c=2521=void dtInitRoot(tid_t tid, struct inode *ip, u32 idotdot)
--
fs/jfs/jfs_dtree.c-2570-	 */
fs/jfs/jfs_dtree.c:2571:	tlck = txLock(tid, ip, (struct metapage *) & jfs_ip->bxflag,
fs/jfs/jfs_dtree.c-2572-		      tlckDTREE | tlckENTRY | tlckBTROOT);
--
fs/jfs/jfs_imap.c=3034=static int copy_from_dinode(struct dinode * dip, struct inode *ip)
--
fs/jfs/jfs_imap.c-3117-	jfs_ip->btorder = 0;
fs/jfs/jfs_imap.c:3118:	jfs_ip->bxflag = 0;
fs/jfs/jfs_imap.c-3119-	jfs_ip->blid = 0;
--
fs/jfs/jfs_incore.h=27=struct jfs_inode_info {
--
fs/jfs/jfs_incore.h-42-	u64	agstart;	/* agstart of the containing IAG */
fs/jfs/jfs_incore.h:43:	u16	bxflag;		/* xflag of pseudo buffer?	*/
fs/jfs/jfs_incore.h-44-	unchar	pad;
--
fs/jfs/jfs_inode.c=41=struct inode *ialloc(struct inode *parent, umode_t mode)
--
fs/jfs/jfs_inode.c-112-	jfs_inode->btindex = 0;
fs/jfs/jfs_inode.c:113:	jfs_inode->bxflag = 0;
fs/jfs/jfs_inode.c-114-	jfs_inode->blid = 0;
--
fs/jfs/jfs_txnmgr.c=1129=int txCommit(tid_t tid,		/* transaction identifier */
--
fs/jfs/jfs_txnmgr.c-1349-		 */
fs/jfs/jfs_txnmgr.c:1350:		jfs_ip->bxflag = 0;
fs/jfs/jfs_txnmgr.c-1351-		jfs_ip->blid = 0;
--
fs/jfs/jfs_xtree.c=2114=void xtInitRoot(tid_t tid, struct inode *ip)
--
fs/jfs/jfs_xtree.c-2122-	 */
fs/jfs/jfs_xtree.c:2123:	txLock(tid, ip, (struct metapage *) &JFS_IP(ip)->bxflag,
fs/jfs/jfs_xtree.c-2124-		      tlckXTREE | tlckNEW);
--
fs/jfs/namei.c=1069=static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
--
fs/jfs/namei.c-1260-			tlck = txLock(tid, old_ip,
fs/jfs/namei.c:1261:				    (struct metapage *) &JFS_IP(old_ip)->bxflag,
fs/jfs/namei.c-1262-				      tlckDTREE | tlckBTROOT | tlckRELINK);
]

82/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 58955
							output: 24
							thoughts: 244
						

Thoughts:
**Analyzing the `bxflag` in JFS Inode Locking**

Okay, let's think this through. The variable `bxflag` is only touched within `txLock`, and the only way it's modified is with a bitwise OR operation: `jfs_ip->bxflag |= type;`. It's initialized to zero. So, that means the only possible values for `bxflag` are combinations of `tlckXTREE`, `tlckDTREE`, `tlckNEW`, `tlckENTRY`, `tlckBTROOT`, and `tlckRELINK`. None of those include the value `0x1000`, which we know is `COMMIT_PAGE`.

Wait a minute, `tlckINLINELOCK` *is* `0x1000`. So, if `bxflag` *did* contain `0x1000`, it could be because `tlckINLINELOCK` was passed as `type`. However, let me double-check that, and no, `type` is *never* passed with `tlckINLINELOCK`.

Now, that's interesting. I just realized that `COMMIT_PAGE` *is* `0x1000`. So if `bxflag` ends up with that value, it's definitely an error. But what happens if `bxflag` isn't initialized, or if it gets corrupted somehow? It could cause unintended behaviors.

Okay, let's back up. The type of `bxflag` is a `u16`. In other words, it's 16 bits. And in the `struct metapage`, `xflag` is a `u16` located at offset 0. Wait, `jfs_ip->bxflag` is located at offset 832 bits, which is 104 bytes. I think I need to re-examine the structure `jfs_inode_info` again to be sure.



83/2 2026/06/26 21:13 tool codesearch-struct-layout
0m Args:
map[Name:jfs_inode_info]

Results:
map[Fields:[map[Name:fileset OffsetBits:0 SizeBits:32] map[Name:mode2 OffsetBits:32 SizeBits:32] map[Name:saved_uid OffsetBits:64 SizeBits:32] map[Name:saved_gid OffsetBits:96 SizeBits:32] map[Name:ixpxd OffsetBits:128 SizeBits:64] map[Name:acl OffsetBits:192 SizeBits:128] map[Name:ea OffsetBits:320 SizeBits:128] map[Name:otime OffsetBits:448 SizeBits:64] map[Name:next_index OffsetBits:512 SizeBits:32] map[Name:acltype OffsetBits:544 SizeBits:32] map[Name:btorder OffsetBits:576 SizeBits:16] map[Name:btindex OffsetBits:592 SizeBits:16] map[Name:ipimap OffsetBits:640 SizeBits:64] map[Name:cflag OffsetBits:704 SizeBits:64] map[Name:agstart OffsetBits:768 SizeBits:64] map[Name:bxflag OffsetBits:832 SizeBits:16] map[Name:pad OffsetBits:848 SizeBits:8] map[Name:active_ag OffsetBits:856 SizeBits:8] map[Name:blid OffsetBits:864 SizeBits:16] map[Name:atlhead OffsetBits:880 SizeBits:16] map[Name:atltail OffsetBits:896 SizeBits:16] map[Name:ag_lock OffsetBits:960 SizeBits:512] map[Name:anon_inode_list OffsetBits:1472 SizeBits:128] map[Name:rdwrlock OffsetBits:1600 SizeBits:1152] map[Name:commit_mutex OffsetBits:2752 SizeBits:1088] map[Name:xattr_sem OffsetBits:3840 SizeBits:1152] map[Name:xtlid OffsetBits:4992 SizeBits:16] map[Name:u OffsetBits:5056 SizeBits:3072] map[Name:i_dquot OffsetBits:8128 SizeBits:192] map[Name:dev OffsetBits:8320 SizeBits:32] map[Name:vfs_inode OffsetBits:8384 SizeBits:8768]]]

84/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 60311
							output: 41
							thoughts: 621
						

Thoughts:
**Analyzing a Potential Memory Corruption Issue**

Okay, let me think this through. I've got this `bxflag` variable which is located at an offset of 104 bytes. Meanwhile, the `struct metapage` structure has its `xflag` at offset zero. Then there's `flag`, which is at offset 32 bytes within `struct metapage`, and `count` is at 40 bytes. The problem is when `release_metapage` is called with a pointer to `&JFS_IP(IP)->bxflag` which is meant to be a `metapage` instance, it appears it is actually acting on `mp->flag` at an offset of 136 bytes and `mp->count` at offset 144 bytes.

Now, `release_metapage` also uses `mp->folio`, located 144 bytes into the `metapage` structure. That means that relative to `bxflag`, `mp->folio` is at an offset of 248 bytes within the `jfs_inode_info` structure. Let's see what we find at 248 bytes, which is 1984 bits. Looking at the definition, `rdwrlock` starts at 1600 bits and spans 1152 bits, ending at 2752 bits. Oh dear, `mp->folio` overlaps with `rdwrlock`! `rdwrlock` is a `struct rw_semaphore`.

So, if `mp->folio` contains garbage, `folio_lock(folio)` should crash with a page fault, but I'm thinking the actual crash is in `unlock_metapage(mp)`, specifically when calling `wake_up(&mp->wait)`. But wait, `folio_lock` isn't crashing? I recall that `folio_lock` is an inline function, so it might just perform a bit operation if the folio isn't locked! Okay, so why isn't it crashing with a page fault if `folio` is garbage? Maybe it points to mapped memory.

But hang on. `mp->folio` is at offset 144, so it might not be `&JFS_IP(IP)->bxflag` at all. Could `mp` be a *freed* `metapage`? If that's the case, then the fact that `folio_lock` doesn't immediately crash is plausible if the freed memory is still mapped. Let me re-examine the `xtTruncate` code again.



85/2 2026/06/26 21:13 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:2280 LineCount:50]

Results:
map[Contents:2280:	
2281:		/*
2282:		 * first access of each page:
2283:		 */
2284:	      getPage:
2285:		p = xt_getpage(ip, bn, &mp);
2286:		if (IS_ERR(p))
2287:			return PTR_ERR(p);
2288:	
2289:		/* process entries backward from last index */
2290:		index = le16_to_cpu(p->header.nextindex) - 1;
2291:	
2292:	
2293:		/* Since this is the rightmost page at this level, and we may have
2294:		 * already freed a page that was formerly to the right, let's make
2295:		 * sure that the next pointer is zero.
2296:		 */
2297:		if (p->header.next) {
2298:			if (log)
2299:				/*
2300:				 * Make sure this change to the header is logged.
2301:				 * If we really truncate this leaf, the flag
2302:				 * will be changed to tlckTRUNCATE
2303:				 */
2304:				tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
2305:			BT_MARK_DIRTY(mp, ip);
2306:			p->header.next = 0;
2307:		}
2308:	
2309:		if (p->header.flag & BT_INTERNAL)
2310:			goto getChild;
2311:	
2312:		/*
2313:		 *	leaf page
2314:		 */
2315:		freed = 0;
2316:	
2317:		/* does region covered by leaf page precede Teof ? */
2318:		xad = &p->xad[index];
2319:		xoff = offsetXAD(xad);
2320:		xlen = lengthXAD(xad);
2321:		if (teof >= xoff + xlen) {
2322:			XT_PUTPAGE(mp);
2323:			goto getParent;
2324:		}
2325:	
2326:		/* (re)acquire tlock of the leaf page */
2327:		if (log) {
2328:			if (++locked_leaves > MAX_TRUNCATE_LEAVES) {
2329:				/*
]

86/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 62218
							output: 27
							thoughts: 604
						

Thoughts:
**The Root of the Problem**

Okay, so I've been staring at this crash and finally, I think I see the core issue. It hinges around `xtTruncate` and the manipulation of `bxflag`, and the crucial bit is how the `COMMIT_PAGE` flag (0x1000) is getting set on this `bxflag`.

Let's break it down. `xtTruncate` starts with `bn = 0`, which is the beginning. So, the initial call to `xt_getpage` will be with a block number of 0. This means `mp` will point directly to `&JFS_IP(IP)->bxflag`.  Then, there's `XT_PUTPAGE(mp)` – which is really `BT_PUTPAGE(mp)`. Looking at the macro definition:

```c
#define BT_PUTPAGE(MP)\
{\
	if (! BT_IS_ROOT(MP)) \
		release_metapage(MP); \
}
```

Now `BT_IS_ROOT(MP)` becomes the key, which is defined as `(((MP)->xflag & COMMIT_PAGE) == 0)`.  Since `MP` is `&JFS_IP(IP)->bxflag`, this means it's checking `JFS_IP(IP)->bxflag & COMMIT_PAGE`.  Here's the problem: if `bxflag` *does* have `COMMIT_PAGE` (0x1000) set, then `BT_IS_ROOT(MP)` becomes false! That leads to a call to `release_metapage(MP)`, but `MP` is pointing to `&JFS_IP(IP)->bxflag`. *That* explains the crash, which has been staring me in the face all along!  We are calling `release_metapage` on a control word.

The next question: how *does* `bxflag` end up with `COMMIT_PAGE` set? Let's revisit `txLock`.

```c
	/* mark tlock for in-memory page */
	else {
		tlck->flag = tlckINODELOCK;

		if (dir_xtree)
			jfs_ip->xtlid = lid;
		else {
			jfs_ip->blid = lid;
			jfs_ip->bxflag |= type;
		}
	}
```

Initially, I looked at this and thought the `type` parameter would never have `tlckMAP` (0x1000) set, and that was correct. Then I saw `tlckINLINELOCK` is actually 0x1000. But this is not used. Any other way?

Then it dawned on me. Could it be uninitialized? No, both `ialloc` and `copy_from_dinode` initialize it to zero, which is good.  So that leaves us with another place where `bxflag` is modified. I need to track down *every* occurrence of `bxflag` in the code, because that's where the corruption is coming from.



87/2 2026/06/26 21:13 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:bxflag PathPrefix:fs/jfs/]

88/2 2026/06/26 21:13 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 63592
							output: 41
							thoughts: 495
						

Thoughts:
**Analyzing bxflag Usage in JFS**

Okay, so I started by grepping for `bxflag` – seems like a good starting point. The results show its usage scattered across a few key areas: `BT_GETPAGE`, which reads it, several functions (`dtInitRoot`, `xtInitRoot`, `jfs_rename`) passing its address to `txLock`, `copy_from_dinode`, `ialloc`, and `txCommit` which all set it to zero, and the header file `jfs_incore.h` where it's declared.

The core of the issue seems to be how `txLock` modifies `jfs_ip->bxflag`. Now, I need to understand how the `type` parameter in `txLock` affects the bitwise OR operation. I'm going through different combinations of the `tlck` flags. If `type` is `tlckXTREE | tlckTRUNCATE`, then it becomes `0x4004`. If `type` is `tlckXTREE | tlckFREE`, `type` is `0x4040`. If `type` is `tlckDTREE | tlckFREE`, then it becomes `0x2040`. Finally, if `type` is `tlckXTREE | tlckGROW`, it becomes `0x4001`. If `type` is `tlckXTREE | tlckNEW`, it becomes `0x4020`.

Wait, but I'm looking for a particular bit, specifically `COMMIT_PAGE` which is `0x1000`. I don't see that in any of these bitwise combinations! Let me double-check the `jfs_txnmgr.h` file again.



89/2 2026/06/26 21:14 tool read-file
0m Args:
map[File:fs/jfs/jfs_txnmgr.h FirstLine:120 LineCount:30]

Results:
map[Contents: 120:	 */
 121:	#define	tlckTYPE		0xfe00
 122:	#define	tlckINODE		0x8000
 123:	#define	tlckXTREE		0x4000
 124:	#define	tlckDTREE		0x2000
 125:	#define	tlckMAP			0x1000
 126:	#define	tlckEA			0x0800
 127:	#define	tlckACL			0x0400
 128:	#define	tlckDATA		0x0200
 129:	#define	tlckBTROOT		0x0100
 130:	
 131:	#define	tlckOPERATION		0x00ff
 132:	#define tlckGROW		0x0001	/* file grow */
 133:	#define tlckREMOVE		0x0002	/* file delete */
 134:	#define tlckTRUNCATE		0x0004	/* file truncate */
 135:	#define tlckRELOCATE		0x0008	/* file/directory relocate */
 136:	#define tlckENTRY		0x0001	/* directory insert/delete */
 137:	#define tlckEXTEND		0x0002	/* directory extend in-line */
 138:	#define tlckSPLIT		0x0010	/* splited page */
 139:	#define tlckNEW			0x0020	/* new page from split */
 140:	#define tlckFREE		0x0040	/* free page */
 141:	#define tlckRELINK		0x0080	/* update sibling pointer */
 142:	
 143:	/*
 144:	 *	linelock for lmLog()
 145:	 *
 146:	 * note: linelock and its variations are overlaid
 147:	 * at tlock.lock: watch for alignment;
 148:	 */
 149:	struct lv {
]

90/2 2026/06/26 21:14 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 65090
							output: 28
							thoughts: 42
						

Thoughts:
Okay, here's my interpretation of those thoughts, presented as my own mental process:

**Diving Deep into Transaction Locking**

Alright, hang on a second... I just saw something in the code that's nagging at me. The `tlckMAP` variable, that's supposed to be our lock mapping structure, is initialized to `0x1000`. That's a specific address, so my immediate thought is whether that address is ever passed to `txLock`.

Okay, I need to confirm this. I need to know if the address itself, which is `tlckMAP` is being passed to a function called `txLock` anywhere in the code. I need to check the call sites for `txLock`. I want to confirm if `tlckMAP` is ever used as an argument to it.



91/2 2026/06/26 21:14 tool grepper
0m Args:
map[Expression:txLock\( PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_dtree.c=289=static inline void lock_index(tid_t tid, struct inode *ip, struct metapage * mp,
--
fs/jfs/jfs_dtree.c-295-
fs/jfs/jfs_dtree.c:296:	tlck = txLock(tid, ip, mp, tlckDATA);
fs/jfs/jfs_dtree.c-297-	llck = (struct linelock *) tlck->lock;
--
fs/jfs/jfs_dtree.c=319=static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
--
fs/jfs/jfs_dtree.c-409-		}
fs/jfs/jfs_dtree.c:410:		tlck = txLock(tid, ip, mp, tlckDATA);
fs/jfs/jfs_dtree.c-411-		llck = (struct linelock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c=812=int dtInsert(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_dtree.c-880-	 */
fs/jfs/jfs_dtree.c:881:	tlck = txLock(tid, ip, mp, tlckDTREE | tlckENTRY);
fs/jfs/jfs_dtree.c-882-	dtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c=923=static int dtSplitUp(tid_t tid,
--
fs/jfs/jfs_dtree.c-1257-			 */
fs/jfs/jfs_dtree.c:1258:			tlck = txLock(tid, ip, smp, tlckDTREE | tlckENTRY);
fs/jfs/jfs_dtree.c-1259-			dtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c=1323=static int dtSplitPage(tid_t tid, struct inode *ip, struct dtsplit * split,
--
fs/jfs/jfs_dtree.c-1376-	 */
fs/jfs/jfs_dtree.c:1377:	tlck = txLock(tid, ip, rmp, tlckDTREE | tlckNEW);
fs/jfs/jfs_dtree.c-1378-	rdtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c-1389-	 */
fs/jfs/jfs_dtree.c:1390:	tlck = txLock(tid, ip, smp, tlckDTREE | tlckENTRY);
fs/jfs/jfs_dtree.c-1391-	sdtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c-1477-		 */
fs/jfs/jfs_dtree.c:1478:		tlck = txLock(tid, ip, mp, tlckDTREE | tlckRELINK);
fs/jfs/jfs_dtree.c-1479-		jfs_info("dtSplitPage: tlck = 0x%p, ip = 0x%p, mp=0x%p",
--
fs/jfs/jfs_dtree.c=1635=static int dtExtendPage(tid_t tid,
--
fs/jfs/jfs_dtree.c-1725-	 */
fs/jfs/jfs_dtree.c:1726:	tlck = txLock(tid, ip, smp, tlckDTREE | type);
fs/jfs/jfs_dtree.c-1727-	dtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c-1831-	 */
fs/jfs/jfs_dtree.c:1832:	tlck = txLock(tid, ip, pmp, tlckDTREE | tlckENTRY);
fs/jfs/jfs_dtree.c-1833-	dtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c=1868=static int dtSplitRoot(tid_t tid,
--
fs/jfs/jfs_dtree.c-1923-	 */
fs/jfs/jfs_dtree.c:1924:	tlck = txLock(tid, ip, rmp, tlckDTREE | tlckNEW);
fs/jfs/jfs_dtree.c-1925-	dtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c-2020-	 */
fs/jfs/jfs_dtree.c:2021:	tlck = txLock(tid, ip, smp, tlckDTREE | tlckNEW | tlckBTROOT);
fs/jfs/jfs_dtree.c-2022-	dtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c=2075=int dtDelete(tid_t tid,
--
fs/jfs/jfs_dtree.c-2160-		 */
fs/jfs/jfs_dtree.c:2161:		tlck = txLock(tid, ip, mp, tlckDTREE | tlckENTRY);
fs/jfs/jfs_dtree.c-2162-		dtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c=2230=static int dtDeleteUp(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_dtree.c-2382-		 */
fs/jfs/jfs_dtree.c:2383:		tlck = txLock(tid, ip, mp, tlckDTREE | tlckENTRY);
fs/jfs/jfs_dtree.c-2384-		dtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_dtree.c=2442=static int dtRelink(tid_t tid, struct inode *ip, dtpage_t * p)
--
fs/jfs/jfs_dtree.c-2465-		 */
fs/jfs/jfs_dtree.c:2466:		tlck = txLock(tid, ip, mp, tlckDTREE | tlckRELINK);
fs/jfs/jfs_dtree.c-2467-		jfs_info("dtRelink nextbn: tlck = 0x%p, ip = 0x%p, mp=0x%p",
--
fs/jfs/jfs_dtree.c-2494-		 */
fs/jfs/jfs_dtree.c:2495:		tlck = txLock(tid, ip, mp, tlckDTREE | tlckRELINK);
fs/jfs/jfs_dtree.c-2496-		jfs_info("dtRelink prevbn: tlck = 0x%p, ip = 0x%p, mp=0x%p",
--
fs/jfs/jfs_dtree.c=2521=void dtInitRoot(tid_t tid, struct inode *ip, u32 idotdot)
--
fs/jfs/jfs_dtree.c-2570-	 */
fs/jfs/jfs_dtree.c:2571:	tlck = txLock(tid, ip, (struct metapage *) & jfs_ip->bxflag,
fs/jfs/jfs_dtree.c-2572-		      tlckDTREE | tlckENTRY | tlckBTROOT);
--
fs/jfs/jfs_dtree.c=2613=static int add_missing_indices(struct inode *inode, s64 bn)
--
fs/jfs/jfs_dtree.c-2638-
fs/jfs/jfs_dtree.c:2639:	tlck = txLock(tid, inode, mp, tlckDTREE | tlckENTRY);
fs/jfs/jfs_dtree.c-2640-	if (BT_IS_ROOT(mp))
--
fs/jfs/jfs_dtree.c=4241=int dtModify(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_dtree.c-4271-	 */
fs/jfs/jfs_dtree.c:4272:	tlck = txLock(tid, ip, mp, tlckDTREE | tlckENTRY);
fs/jfs/jfs_dtree.c-4273-	dtlck = (struct dt_lock *) & tlck->lock;
--
fs/jfs/jfs_imap.c=581=int diWrite(tid_t tid, struct inode *ip)
--
fs/jfs/jfs_imap.c-653-	if ((ditlck =
fs/jfs/jfs_imap.c:654:	     txLock(tid, ipimap, mp, tlckINODE | tlckENTRY)) == NULL)
fs/jfs/jfs_imap.c-655-		goto retry;
--
fs/jfs/jfs_imap.c=845=int diFree(struct inode *ip)
--
fs/jfs/jfs_imap.c-1240-	 */
fs/jfs/jfs_imap.c:1241:	tlck = txLock(tid, ipimap, mp, tlckINODE | tlckFREE);
fs/jfs/jfs_imap.c-1242-	pxdlock = (struct pxd_lock *) & tlck->lock;
--
fs/jfs/jfs_txnmgr.c=494=void txEnd(tid_t tid)
--
fs/jfs/jfs_txnmgr.c-573-/*
fs/jfs/jfs_txnmgr.c:574: *	txLock()
fs/jfs/jfs_txnmgr.c-575- *
--
fs/jfs/jfs_txnmgr.c-583- */
fs/jfs/jfs_txnmgr.c:584:struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
fs/jfs/jfs_txnmgr.c-585-		     int type)
--
fs/jfs/jfs_txnmgr.c=1430=static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
--
fs/jfs/jfs_txnmgr.c-1463-		 * a maplock for free of the extent has been formatted at
fs/jfs/jfs_txnmgr.c:1464:		 * txLock() time);
fs/jfs/jfs_txnmgr.c-1465-		 *
--
fs/jfs/jfs_txnmgr.c=1554=static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
--
fs/jfs/jfs_txnmgr.c-1631-	 *	a maplock for free of the page has been formatted
fs/jfs/jfs_txnmgr.c:1632:	 *	at txLock() time);
fs/jfs/jfs_txnmgr.c-1633-	 */
--
fs/jfs/jfs_txnmgr.c-1644-		/* a maplock for txUpdateMap() for free of the page
fs/jfs/jfs_txnmgr.c:1645:		 * has been formatted at txLock() time;
fs/jfs/jfs_txnmgr.c-1646-		 */
--
fs/jfs/jfs_txnmgr.c=2040=static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
--
fs/jfs/jfs_txnmgr.c-2050-	 * a maplock for txUpdateMap() for free of the page
fs/jfs/jfs_txnmgr.c:2051:	 * has been formatted at txLock() time saving the src
fs/jfs/jfs_txnmgr.c-2052-	 * relocated page address;
--
fs/jfs/jfs_txnmgr.c-2080-		/* a maplock for txUpdateMap() for free of the page
fs/jfs/jfs_txnmgr.c:2081:		 * has been formatted at txLock() time;
fs/jfs/jfs_txnmgr.c-2082-		 */
--
fs/jfs/jfs_txnmgr.h=279=extern void txExit(void);
fs/jfs/jfs_txnmgr.h:280:extern struct tlock *txLock(tid_t, struct inode *, struct metapage *, int);
fs/jfs/jfs_txnmgr.h-281-extern struct tlock *txMaplock(tid_t, struct inode *, int);
--
fs/jfs/jfs_xtree.c=528=int xtInsert(tid_t tid,		/* transaction id */
--
fs/jfs/jfs_xtree.c-644-	if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:645:		tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-646-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=679=xtSplitUp(tid_t tid,
--
fs/jfs/jfs_xtree.c-735-		if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:736:			tlck = txLock(tid, ip, smp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-737-			xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-904-			if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:905:				tlck = txLock(tid, ip, smp,
fs/jfs/jfs_xtree.c-906-					      tlckXTREE | tlckGROW);
--
fs/jfs/jfs_xtree.c=949=xtSplitPage(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_xtree.c-1013-		 */
fs/jfs/jfs_xtree.c:1014:		tlck = txLock(tid, ip, rmp, tlckXTREE | tlckNEW);
fs/jfs/jfs_xtree.c-1015-		rxtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1019-		 */
fs/jfs/jfs_xtree.c:1020:		tlck = txLock(tid, ip, smp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-1021-		sxtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1092-		if (!test_cflag(COMMIT_Nolink, ip))
fs/jfs/jfs_xtree.c:1093:			tlck = txLock(tid, ip, mp, tlckXTREE | tlckRELINK);
fs/jfs/jfs_xtree.c-1094-
--
fs/jfs/jfs_xtree.c=1216=xtSplitRoot(tid_t tid,
--
fs/jfs/jfs_xtree.c-1296-	if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1297:		tlck = txLock(tid, ip, rmp, tlckXTREE | tlckNEW);
fs/jfs/jfs_xtree.c-1298-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1327-	if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1328:		tlck = txLock(tid, ip, split->mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-1329-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=1351=int xtExtend(tid_t tid,		/* transaction id */
--
fs/jfs/jfs_xtree.c-1398-	if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1399:		tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-1400-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1456-			if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1457:				tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
fs/jfs/jfs_xtree.c-1458-				xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=1513=int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
--
fs/jfs/jfs_xtree.c-1553-	if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1554:		tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-1555-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1750-			if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1751:				tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
fs/jfs/jfs_xtree.c-1752-				xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-1811-		if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1812:			tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-1813-			xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=1868=printf("xtUpdate.updateLeft.split p:0x%p\n", p);
--
fs/jfs/jfs_xtree.c-1904-			if (!test_cflag(COMMIT_Nolink, ip)) {
fs/jfs/jfs_xtree.c:1905:				tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
fs/jfs/jfs_xtree.c-1906-				xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=1956=int xtAppend(tid_t tid,		/* transaction id */
--
fs/jfs/jfs_xtree.c-2083-	 */
fs/jfs/jfs_xtree.c:2084:	tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
fs/jfs/jfs_xtree.c-2085-	xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=2114=void xtInitRoot(tid_t tid, struct inode *ip)
--
fs/jfs/jfs_xtree.c-2122-	 */
fs/jfs/jfs_xtree.c:2123:	txLock(tid, ip, (struct metapage *) &JFS_IP(ip)->bxflag,
fs/jfs/jfs_xtree.c-2124-		      tlckXTREE | tlckNEW);
--
fs/jfs/jfs_xtree.c=2203=s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
--
fs/jfs/jfs_xtree.c-2303-			 */
fs/jfs/jfs_xtree.c:2304:			tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
fs/jfs/jfs_xtree.c-2305-		BT_MARK_DIRTY(mp, ip);
--
fs/jfs/jfs_xtree.c-2336-		}
fs/jfs/jfs_xtree.c:2337:		tlck = txLock(tid, ip, mp, tlckXTREE);
fs/jfs/jfs_xtree.c-2338-		tlck->type = tlckXTREE | tlckTRUNCATE;
--
fs/jfs/jfs_xtree.c-2539-				 */
fs/jfs/jfs_xtree.c:2540:				tlck = txLock(tid, ip, mp, tlckXTREE);
fs/jfs/jfs_xtree.c-2541-				xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c-2615-			 */
fs/jfs/jfs_xtree.c:2616:			tlck = txLock(tid, ip, mp, tlckXTREE);
fs/jfs/jfs_xtree.c-2617-			xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/jfs_xtree.c=2758=s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
--
fs/jfs/jfs_xtree.c-2833-	}
fs/jfs/jfs_xtree.c:2834:	tlck = txLock(tid, ip, mp, tlckXTREE);
fs/jfs/jfs_xtree.c-2835-	tlck->type = tlckXTREE | tlckFREE;
--
fs/jfs/jfs_xtree.c-2866-		 */
fs/jfs/jfs_xtree.c:2867:		tlck = txLock(tid, ip, mp, tlckXTREE);
fs/jfs/jfs_xtree.c-2868-		xtlck = (struct xtlock *) & tlck->lock;
--
fs/jfs/namei.c=1069=static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
--
fs/jfs/namei.c-1259-			/* Linelock header of dtree */
fs/jfs/namei.c:1260:			tlck = txLock(tid, old_ip,
fs/jfs/namei.c-1261-				    (struct metapage *) &JFS_IP(old_ip)->bxflag,
]

92/2 2026/06/26 21:14 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 71653
							output: 41
							thoughts: 330
						

Thoughts:
**Analyzing Transaction Lock Types**

Okay, let me break this down. First, I'm seeing a list of various `txLock` calls and the lock types passed to them. I'm focusing on the bit flags. I'm noting the various combinations of `tlckDATA` (0x0200), `tlckDTREE` (0x2000), `tlckENTRY` (0x0001), `tlckNEW` (0x0020), `tlckRELINK` (0x0080), `tlckBTROOT` (0x0100), `tlckINODE` (0x8000), `tlckFREE` (0x0040), `tlckXTREE` (0x4000), and `tlckGROW` (0x0001). I notice that none of these combinations include `0x1000`, or `tlckMAP` (which is likely related to `COMMIT_PAGE` operation).

Now I'm focusing. There's something specific I'm interested in: `dtExtendPage`, and I see a `txLock` call within that function. The important thing here is the parameters to `txLock`.

```c
	tlck = txLock(tid, ip, smp, tlckDTREE | type);
```

So it looks like `txLock` is called with `tlckDTREE` bitwise-OR'd with some `type` argument. The question is, what is this `type`? I need to figure out what that `type` is to understand what's actually being locked in `dtExtendPage`. I need to look closer at `dtExtendPage` to understand what that 'type' is.



93/2 2026/06/26 21:14 tool read-file
0m Args:
map[File:fs/jfs/jfs_dtree.c FirstLine:1630 LineCount:50]

Results:
map[Contents:1630:	 *
1631:	 * return: 0 - success;
1632:	 *	   errno - failure;
1633:	 *	return extended page pinned;
1634:	 */
1635:	static int dtExtendPage(tid_t tid,
1636:		     struct inode *ip, struct dtsplit * split, struct btstack * btstack)
1637:	{
1638:		struct super_block *sb = ip->i_sb;
1639:		int rc;
1640:		struct metapage *smp, *pmp, *mp;
1641:		dtpage_t *sp, *pp;
1642:		struct pxdlist *pxdlist;
1643:		pxd_t *pxd, *tpxd;
1644:		int xlen, xsize;
1645:		int newstblindex, newstblsize;
1646:		int oldstblindex, oldstblsize;
1647:		int fsi, last;
1648:		struct dtslot *f;
1649:		struct btframe *parent;
1650:		int n;
1651:		struct dt_lock *dtlck;
1652:		s64 xaddr, txaddr;
1653:		struct tlock *tlck;
1654:		struct pxd_lock *pxdlock;
1655:		struct lv *lv;
1656:		uint type;
1657:		struct ldtentry *ldtentry;
1658:		u8 *stbl;
1659:	
1660:		/* get page to extend */
1661:		smp = split->mp;
1662:		sp = DT_PAGE(ip, smp);
1663:	
1664:		/* get parent/root page */
1665:		parent = BT_POP(btstack);
1666:		DT_GETPAGE(ip, parent->bn, pmp, PSIZE, pp, rc);
1667:		if (rc)
1668:			return (rc);
1669:	
1670:		/*
1671:		 *	extend the extent
1672:		 */
1673:		pxdlist = split->pxdlist;
1674:		pxd = &pxdlist->pxd[pxdlist->npxd];
1675:		pxdlist->npxd++;
1676:	
1677:		xaddr = addressPXD(pxd);
1678:		tpxd = &sp->header.self;
1679:		txaddr = addressPXD(tpxd);
]

94/2 2026/06/26 21:14 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 73148
							output: 41
							thoughts: 11
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Diving Deeper into `dtExtendPage`**

Alright, time to dig into this `dtExtendPage` concept. I'm already familiar with its general purpose, but this prompt indicates a need for a deeper understanding. My intuition is that we're talking about extending or modifying the functionality of a particular pagination or data table component – likely one within a specific framework, given the abbreviated naming convention. I'll need to understand the nuances of this extension. What are the specific aspects we are trying to extend: the client-side data handling, the server-side interactions, the UI rendering, or perhaps the event management tied to the pagination controls? This will influence the approach I'll take.



95/2 2026/06/26 21:14 tool read-file
0m Args:
map[File:fs/jfs/jfs_dtree.c FirstLine:1680 LineCount:50]

Results:
map[Contents:1680:		/* in-place extension */
1681:		if (xaddr == txaddr) {
1682:			type = tlckEXTEND;
1683:		}
1684:		/* relocation */
1685:		else {
1686:			type = tlckNEW;
1687:	
1688:			/* save moved extent descriptor for later free */
1689:			tlck = txMaplock(tid, ip, tlckDTREE | tlckRELOCATE);
1690:			pxdlock = (struct pxd_lock *) & tlck->lock;
1691:			pxdlock->flag = mlckFREEPXD;
1692:			pxdlock->pxd = sp->header.self;
1693:			pxdlock->index = 1;
1694:	
1695:			/*
1696:			 * Update directory index table to reflect new page address
1697:			 */
1698:			if (DO_INDEX(ip)) {
1699:				s64 lblock;
1700:	
1701:				mp = NULL;
1702:				stbl = DT_GETSTBL(sp);
1703:				for (n = 0; n < sp->header.nextindex; n++) {
1704:					ldtentry =
1705:					    (struct ldtentry *) & sp->slot[stbl[n]];
1706:					modify_index(tid, ip,
1707:						     le32_to_cpu(ldtentry->index),
1708:						     xaddr, n, &mp, &lblock);
1709:				}
1710:				if (mp)
1711:					release_metapage(mp);
1712:			}
1713:		}
1714:	
1715:		/*
1716:		 *	extend the page
1717:		 */
1718:		sp->header.self = *pxd;
1719:	
1720:		jfs_info("dtExtendPage: ip:0x%p smp:0x%p sp:0x%p", ip, smp, sp);
1721:	
1722:		BT_MARK_DIRTY(smp, ip);
1723:		/*
1724:		 * acquire a transaction lock on the extended/leaf page
1725:		 */
1726:		tlck = txLock(tid, ip, smp, tlckDTREE | type);
1727:		dtlck = (struct dt_lock *) & tlck->lock;
1728:		lv = & dtlck->lv[0];
1729:	
]

96/2 2026/06/26 21:14 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 74109
							output: 28
							thoughts: 2180
						

Thoughts:
**Root Cause Analysis of JFS Crash in xtTruncate**

Okay, let's break this down. My initial thought was that the `type` parameter, when OR'd with `tlckDTREE`, might be causing an issue because of the potential values it could take. But, no, those values don't include `0x1000`. So, I started wondering if `bxflag` itself was being corrupted by a buffer overflow. It's at offset 104 bytes in `jfs_inode_info`. I check the layout, and no obvious overflows. But, I didn't see any writes out of bounds to any fields that would overflow into it, so that wasn't it.

I then started to consider if the `COMMIT_PAGE` flag was getting set somehow, even though I didn't think it was being set. I went back to `txLock` and saw that `bxflag` (specifically the `bxflag` member of the `jfs_inode_info` struct) is aliased to `xflag` in a `metapage` struct.  The code clearly uses `mp->xflag`, where `mp` points to `&JFS_IP(ip)->bxflag`.  If the `bxflag` value *already* had `COMMIT_PAGE` set, we'd hit a different code path in `txLock`, which would mark the in-memory page, so that path is ruled out. When `bxflag` is `0x4020` (`tlckXTREE | tlckNEW` as set in `xtInitRoot`), `BT_IS_ROOT(MP)` would return true and not call `release_metapage`.

But the crash *is* in `release_metapage`.  So something must have gone wrong. Going back to `xtTruncate`, I find `XT_PUTPAGE(mp)`.  This expands to `BT_PUTPAGE(mp)`. `BT_PUTPAGE` uses `BT_IS_ROOT(MP)`.  If that is false, then `release_metapage` will be called. I'm thinking, okay, how could `BT_IS_ROOT(MP)` be false? It's `((MP)->xflag & COMMIT_PAGE) == 0`.  So, that means `bxflag & 0x1000` must be non-zero!  But... how?

I then double-checked that `COMMIT_PAGE` *is* actually `0x1000`. It is.  I checked that `bxflag` *is* aliased to `xflag` correctly, and it is, and the relevant struct layouts confirm this. `bxflag` is at offset 104 in `jfs_inode_info`.  So `bxflag` and `xflag` match.  I started to wonder if something else was overwriting `bxflag` with a value that included `COMMIT_PAGE`. I re-examined `txLock` and confirmed it's only being set via `|= type;`. I noted that the `type` parameter does NOT contain the value `COMMIT_PAGE`, so that wasn't it.

Then I looked at the metapage's relationship to the root page. If the *metapage* came from `read_metapage` or `alloc_metapage`, that page would have a *real* `xflag`. I needed to understand how a "real" metapage gets that `xflag` value. It seems a separate code path, with real `metapage`s, is initialized, or so it appears. This might be where the answer lies. This suggests a different code path or scenario that needs deeper investigation.



97/2 2026/06/26 21:14 tool grepper
0m Args:
map[Expression:COMMIT_PAGE PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_btree.h=17=struct btpage {
--
fs/jfs/jfs_btree.h-46- */
fs/jfs/jfs_btree.h:47:#define BT_IS_ROOT(MP) (((MP)->xflag & COMMIT_PAGE) == 0)
fs/jfs/jfs_btree.h-48-
--
fs/jfs/jfs_logmgr.c=1506=void jfs_flush_journal(struct jfs_log *log, int wait)
--
fs/jfs/jfs_logmgr.c-1592-		list_for_each_entry(lp, &log->synclist, synclist) {
fs/jfs/jfs_logmgr.c:1593:			if (lp->xflag & COMMIT_PAGE) {
fs/jfs/jfs_logmgr.c-1594-				struct metapage *mp = (struct metapage *)lp;
--
fs/jfs/jfs_metapage.c=684=struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
--
fs/jfs/jfs_metapage.c-766-		mp->flag = 0;
fs/jfs/jfs_metapage.c:767:		mp->xflag = COMMIT_PAGE;
fs/jfs/jfs_metapage.c-768-		mp->count = 1;
--
fs/jfs/jfs_txnmgr.c=584=struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
--
fs/jfs/jfs_txnmgr.c-599-	if (S_ISDIR(ip->i_mode) && (type & tlckXTREE) &&
fs/jfs/jfs_txnmgr.c:600:	    !(mp->xflag & COMMIT_PAGE)) {
fs/jfs/jfs_txnmgr.c-601-		/*
--
fs/jfs/jfs_txnmgr.c-698-	/* mark tlock for meta-data page */
fs/jfs/jfs_txnmgr.c:699:	if (mp->xflag & COMMIT_PAGE) {
fs/jfs/jfs_txnmgr.c-700-
--
fs/jfs/jfs_txnmgr.c-784-		} else {
fs/jfs/jfs_txnmgr.c:785:			if (mp->xflag & COMMIT_PAGE)
fs/jfs/jfs_txnmgr.c-786-				p = (xtpage_t *) mp->data;
--
fs/jfs/jfs_txnmgr.c=870=static void txRelease(struct tblock * tblk)
--
fs/jfs/jfs_txnmgr.c-881-		    (tlck->type & tlckBTROOT) == 0) {
fs/jfs/jfs_txnmgr.c:882:			assert(mp->xflag & COMMIT_PAGE);
fs/jfs/jfs_txnmgr.c-883-			mp->lid = 0;
--
fs/jfs/jfs_txnmgr.c=902=static void txUnlock(struct tblock * tblk)
--
fs/jfs/jfs_txnmgr.c-926-		    (tlck->type & tlckBTROOT) == 0) {
fs/jfs/jfs_txnmgr.c:927:			assert(mp->xflag & COMMIT_PAGE);
fs/jfs/jfs_txnmgr.c-928-
--
fs/jfs/jfs_txnmgr.c=2179=static void txForce(struct tblock * tblk)
--
fs/jfs/jfs_txnmgr.c-2210-		    (tlck->type & tlckBTROOT) == 0) {
fs/jfs/jfs_txnmgr.c:2211:			assert(mp->xflag & COMMIT_PAGE);
fs/jfs/jfs_txnmgr.c-2212-
--
fs/jfs/jfs_txnmgr.c=2247=static void txUpdateMap(struct tblock * tblk)
--
fs/jfs/jfs_txnmgr.c-2290-			mp = tlck->mp;
fs/jfs/jfs_txnmgr.c:2291:			ASSERT(mp->xflag & COMMIT_PAGE);
fs/jfs/jfs_txnmgr.c-2292-			grab_metapage(mp);
--
fs/jfs/jfs_txnmgr.c=2595=void txAbort(tid_t tid, int dirty)
--
fs/jfs/jfs_txnmgr.c-2621-			 */
fs/jfs/jfs_txnmgr.c:2622:			if (mp->xflag & COMMIT_PAGE && mp->lsn)
fs/jfs/jfs_txnmgr.c-2623-				LogSyncRelease(mp);
--
fs/jfs/jfs_txnmgr.h=59=extern struct tblock *TxBlock;	/* transaction block table */
--
fs/jfs/jfs_txnmgr.h-73-#define	COMMIT_LAZY	0x0800	/* lazy commit */
fs/jfs/jfs_txnmgr.h:74:#define COMMIT_PAGE	0x1000	/* Identifies element as metapage */
fs/jfs/jfs_txnmgr.h-75-#define COMMIT_INODE	0x2000	/* Identifies element as inode */
]

98/2 2026/06/26 21:14 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 78591
							output: 37
							thoughts: 376
						

Thoughts:
**Analyzing the Metapage and its Role in the Crash**

Okay, so I'm following the logic here. The `__get_metapage` function sets `mp->xflag = COMMIT_PAGE`. So, for a *real* metapage, the `mp->xflag & COMMIT_PAGE` flag will definitely be true. This means, the macro `BT_IS_ROOT(MP)` which evaluates to `(((MP)->xflag & COMMIT_PAGE) == 0)` will be *false* for a true metapage. Consequently, `BT_PUTPAGE(MP)` will then call `release_metapage(MP)` when dealing with a genuine metapage.

Now, looking at `&JFS_IP(ip)->bxflag`, the `bxflag` is initialized to either `0` or `0x4020`. So, `bxflag & COMMIT_PAGE` is equal to `0`. Consequently, `BT_IS_ROOT(MP)` evaluates to *true*. That means `BT_PUTPAGE(MP)` will *not* call `release_metapage` in this case.

Hmm, this is a puzzle. If `BT_IS_ROOT(MP)` is TRUE for `&JFS_IP(ip)->bxflag`, then `release_metapage` *shouldn't* be called. So, why did the crash occur? I need to re-examine the crash trace:

```
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
```

Wait a second… `xtTruncate` *directly* calls `release_metapage`! That's the missing link. I need to search for all instances of `release_metapage` within `xtTruncate` now. It looks like the crash isn't happening *through* the expected `BT_PUTPAGE` path, but via a direct call that circumvents this check. This direct call is likely the source of the problem.



99/2 2026/06/26 21:14 tool grepper
0m Args:
map[Expression:release_metapage PathPrefix:fs/jfs/jfs_xtree.c]

Results:
map[Output:fs/jfs/jfs_xtree.c=1216=xtSplitRoot(tid_t tid,
--
fs/jfs/jfs_xtree.c-1248-	if (rc) {
fs/jfs/jfs_xtree.c:1249:		release_metapage(rmp);
fs/jfs/jfs_xtree.c-1250-		return rc;
]

100/2 2026/06/26 21:14 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 79621
							output: 41
							thoughts: 1017
						

Thoughts:
**Debugging `xtTruncate` and Metapage Release**

Okay, so I'm looking at this stack trace, and it's telling me `release_metapage` is being called from `xtTruncate`, but I don't see a direct call in the source! That's odd. Let's see... `xtTruncate` is using `XT_PUTPAGE(mp)`. Ah, right, that's a macro, and that expands to `BT_PUTPAGE(mp)`.  And *that* expands to:

```c
#define BT_PUTPAGE(MP)\
{\
	if (! BT_IS_ROOT(MP)) \
		release_metapage(MP); \
}
```

So, `release_metapage` *is* called, but only if the metapage isn't a root! So, if `BT_IS_ROOT(MP)` is true, it skips the call. Okay, that makes sense. So, if we're crashing *in* `release_metapage`, that means the metapage *isn't* the root. Fine.

This means `(MP)->xflag & COMMIT_PAGE` is NOT zero, so `bxflag & 0x1000` IS non-zero! But hang on... how can `bxflag` have `0x1000` set? Is `mp` actually `&JFS_IP(ip)->bxflag`, the thing I *think* it is? Or is `mp` a *real* `metapage` structure? Because if it's a real `metapage`, then `release_metapage` *should* be called, right? But if it's a real metapage, it shouldn't crash in `unlock_metapage`. Unless the `metapage` was already freed somehow? Or maybe uninitialized? Need to re-examine the xtTruncate code...

Alright, let's trace this back.  `xtTruncate` calls `xt_getpage`, which, if `bn` is not zero, calls `BT_GETPAGE`, which calls `read_metapage`. If `read_metapage` returns a valid `mp`, that's a *real* metapage, right? And then `xtTruncate` processes it, and *then* it calls `XT_PUTPAGE(mp)`. So why would `release_metapage(mp)` crash on a real `metapage`? That doesn't make sense!

Wait... I see something. Look at `xtTruncate` around line 2457! There's a section, then it calls `XT_PUTPAGE(mp)`. And then further down in a section, where `p->header.flag` has the `BT_ROOT` flag set, it *also* calls `XT_PUTPAGE(mp)`. But in this same section, if `log` is false and not `BT_ROOT`, there is a call to `discard_metapage(mp)`! What does *that* do? I think I found something! That `discard_metapage` must be the culprit here. We need to investigate what `discard_metapage` does and if we can figure out why the metapage is being corrupted.



101/2 2026/06/26 21:14 tool read-file
0m Args:
map[File:fs/jfs/jfs_metapage.c FirstLine:790 LineCount:50]

Results:
map[Contents: 790:		folio_unlock(folio);
 791:		return NULL;
 792:	}
 793:	
 794:	void grab_metapage(struct metapage * mp)
 795:	{
 796:		jfs_info("grab_metapage: mp = 0x%p", mp);
 797:		folio_get(mp->folio);
 798:		folio_lock(mp->folio);
 799:		mp->count++;
 800:		lock_metapage(mp);
 801:		folio_unlock(mp->folio);
 802:	}
 803:	
 804:	static int metapage_write_one(struct folio *folio)
 805:	{
 806:		struct address_space *mapping = folio->mapping;
 807:		struct writeback_control wbc = {
 808:			.sync_mode = WB_SYNC_ALL,
 809:			.nr_to_write = folio_nr_pages(folio),
 810:		};
 811:		int ret = 0;
 812:	
 813:		BUG_ON(!folio_test_locked(folio));
 814:	
 815:		folio_wait_writeback(folio);
 816:	
 817:		if (folio_clear_dirty_for_io(folio)) {
 818:			folio_get(folio);
 819:			ret = metapage_write_folio(folio, &wbc);
 820:			if (ret == 0)
 821:				folio_wait_writeback(folio);
 822:			folio_put(folio);
 823:		} else {
 824:			folio_unlock(folio);
 825:		}
 826:	
 827:		if (!ret)
 828:			ret = filemap_check_errors(mapping);
 829:		return ret;
 830:	}
 831:	
 832:	void force_metapage(struct metapage *mp)
 833:	{
 834:		struct folio *folio = mp->folio;
 835:		jfs_info("force_metapage: mp = 0x%p", mp);
 836:		set_bit(META_forcewrite, &mp->flag);
 837:		clear_bit(META_sync, &mp->flag);
 838:		folio_get(folio);
 839:		folio_lock(folio);
]

102/2 2026/06/26 21:14 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 82105
							output: 30
							thoughts: 11
						

Thoughts:
Okay, here's my attempt at summarizing that thought process, keeping in mind I'm speaking to a fellow expert:

**Finding `discard_metapage`**

Right, let's get down to brass tacks. I need to find the definition or usage of `discard_metapage`. No beating around the bush, let's get straight to the code. We're likely talking about a memory management or paging context here, so that's the area of focus. I'll need to pinpoint where this function, variable, or macro – whatever it is – is defined or used within the code base. Are we looking at low-level kernel routines, specific drivers, or maybe a higher-level abstraction? I need to quickly establish the relevant scope to narrow down the search. Time to dive in and get this investigation started.



103/2 2026/06/26 21:15 tool grepper
0m Args:
map[Expression:discard_metapage PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_dtree.c=1323=static int dtSplitPage(tid_t tid, struct inode *ip, struct dtsplit * split,
--
fs/jfs/jfs_dtree.c-1469-		if (rc) {
fs/jfs/jfs_dtree.c:1470:			discard_metapage(rmp);
fs/jfs/jfs_dtree.c-1471-			return rc;
--
fs/jfs/jfs_dtree.c=2230=static int dtDeleteUp(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_dtree.c-2288-	/* free/invalidate its buffer page */
fs/jfs/jfs_dtree.c:2289:	discard_metapage(fmp);
fs/jfs/jfs_dtree.c-2290-
--
fs/jfs/jfs_dtree.c-2364-				/* free/invalidate its buffer page */
fs/jfs/jfs_dtree.c:2365:				discard_metapage(mp);
fs/jfs/jfs_dtree.c-2366-
--
fs/jfs/jfs_metapage.c=684=struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
--
fs/jfs/jfs_metapage.c-753-					  "using a discarded metapage\n");
fs/jfs/jfs_metapage.c:754:				discard_metapage(mp);
fs/jfs/jfs_metapage.c-755-				goto unlock;
--
fs/jfs/jfs_metapage.c=866=void release_metapage(struct metapage * mp)
--
fs/jfs/jfs_metapage.c-888-		}
fs/jfs/jfs_metapage.c:889:	} else if (mp->lsn)	/* discard_metapage doesn't remove it */
fs/jfs/jfs_metapage.c-890-		remove_from_logsync(mp);
--
fs/jfs/jfs_metapage.h=78=static inline void flush_metapage(struct metapage *mp)
--
fs/jfs/jfs_metapage.h-83-
fs/jfs/jfs_metapage.h:84:static inline void discard_metapage(struct metapage *mp)
fs/jfs/jfs_metapage.h-85-{
--
fs/jfs/jfs_txnmgr.c=1508=static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
--
fs/jfs/jfs_txnmgr.c-1532-		metapage_homeok(mp);
fs/jfs/jfs_txnmgr.c:1533:		discard_metapage(mp);
fs/jfs/jfs_txnmgr.c-1534-		tlck->mp = NULL;
--
fs/jfs/jfs_txnmgr.c=2247=static void txUpdateMap(struct tblock * tblk)
--
fs/jfs/jfs_txnmgr.c-2343-			metapage_homeok(mp);
fs/jfs/jfs_txnmgr.c:2344:			discard_metapage(mp);
fs/jfs/jfs_txnmgr.c-2345-			tlck->mp = NULL;
--
fs/jfs/jfs_xtree.c=2203=s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
--
fs/jfs/jfs_xtree.c-2501-			/* invalidate empty leaf page */
fs/jfs/jfs_xtree.c:2502:			discard_metapage(mp);
fs/jfs/jfs_xtree.c-2503-		}
--
fs/jfs/jfs_xtree.c-2660-				/* invalidate parent page */
fs/jfs/jfs_xtree.c:2661:				discard_metapage(mp);
fs/jfs/jfs_xtree.c-2662-			}
--
fs/jfs/xattr.c=426=static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size)
--
fs/jfs/xattr.c-541-		if ((rc = ea_read(inode, ea_buf->xattr))) {
fs/jfs/xattr.c:542:			discard_metapage(ea_buf->mp);
fs/jfs/xattr.c-543-			dbFree(inode, blkno, (s64) blocks_needed);
--
fs/jfs/xattr.c=601=static int ea_put(tid_t tid, struct inode *inode, struct ea_buffer *ea_buf,
--
fs/jfs/xattr.c-626-		rc = ea_write(inode, ea_buf->xattr, new_size, &ea_buf->new_ea);
fs/jfs/xattr.c:627:		discard_metapage(ea_buf->mp);
fs/jfs/xattr.c-628-	}
]

104/2 2026/06/26 21:15 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 83742
							output: 40
							thoughts: 11
						

Thoughts:
Okay, let's dive into this. Here's my thought process on the matter, summarized as requested:

**Deconstructing `discard_metapage`**

Alright, time to get to it. First things first, let's crack open that `discard_metapage` function. My initial thought process is to understand its purpose within the broader context of whatever system this is a part of. What are we trying to accomplish with this function? Is it related to memory management, caching, garbage collection, something else entirely? The name itself suggests we are working with metadata of sorts and removing it - so I will make sure to pay attention to that.

Okay, let's think. We're an expert and can think about this critically, in detail, as if we are the one who wrote it.
I'm going to start by looking for any immediate clues: variable names, comments, related function calls, data structures it interacts with. Are there any error conditions it handles? What are the potential consequences of a failed `discard_metapage` operation? Could it lead to memory leaks, performance degradation, or even system instability? I'll probably look for the edge cases.

I'll be paying close attention to any memory deallocation calls, locking mechanisms, and concurrency considerations. If it involves shared memory or a multi-threaded environment, things get a lot more interesting. We'll need to look for race conditions and potential deadlocks.

I also want to consider performance implications. Is this a critical path function that gets called frequently? If so, we need to analyze its time complexity and identify any potential bottlenecks. Are there any optimizations we can apply?

I think I will have a more informed discussion after looking through the source code.



105/2 2026/06/26 21:15 tool read-file
0m Args:
map[File:fs/jfs/jfs_metapage.h FirstLine:80 LineCount:20]

Results:
map[Contents:  80:		set_bit(META_sync, &mp->flag);
  81:		write_metapage(mp);
  82:	}
  83:	
  84:	static inline void discard_metapage(struct metapage *mp)
  85:	{
  86:		clear_bit(META_dirty, &mp->flag);
  87:		set_bit(META_discard, &mp->flag);
  88:		release_metapage(mp);
  89:	}
  90:	
  91:	static inline void metapage_nohomeok(struct metapage *mp)
  92:	{
  93:		struct folio *folio = mp->folio;
  94:		folio_lock(folio);
  95:		if (!mp->nohomeok++) {
  96:			mark_metapage_dirty(mp);
  97:			folio_get(folio);
  98:			folio_wait_writeback(folio);
  99:		}
]

106/2 2026/06/26 21:15 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 84432
							output: 40
							thoughts: 2194
						

Thoughts:
**Analysis of JFS Xtree Truncation Vulnerability**

Okay, so here's what I've got. I'm looking at how `discard_metapage` is used in the `xtTruncate` function, specifically related to how JFS handles its xtree structure. The `discard_metapage` function directly calls `release_metapage(mp)`, and critically, it doesn't check if the page being released is actually the root page using `BT_IS_ROOT(mp)`.

The vulnerability stems from the interaction between `xtTruncate` and potentially corrupted filesystem images. Let me break it down:  `discard_metapage` can be called from within `xtTruncate`.  The key is that the code in `xtTruncate` checks if a page is the root page using a conditional `p->header.flag & BT_ROOT`. If this bit is *not* set, the code calls `discard_metapage`. Now, if the `mp` is `&JFS_IP(ip)->bxflag` (which is the pseudo-metapage), and `p` is `&JFS_IP(ip)->i_xtroot`, the root page in the inode, the absence of `BT_ROOT` in the filesystem image causes `discard_metapage` to be called on this pseudo-metapage.

In the case where the filesystem image is corrupted and `BT_ROOT` is not set, the code enters the `else` branch, and because `log` is zero in the `COMMIT_WMAP` case, it ends up calling `discard_metapage(mp)`. This `discard_metapage` call then results in `release_metapage` being called on the pseudo-metapage `&JFS_IP(ip)->bxflag`. This pseudo-metapage doesn't actually exist in the regular page pool and will result in out-of-bounds access.  The `release_metapage` function tries to access `mp->wait`, which overlaps with other structures and will likely lead to a spinlock crash.

I've confirmed this behavior by examining the `xtTruncate` code flow. Specifically, when `flag` is `COMMIT_WMAP`, the `log` variable is set to 0.  Then when `p->header.flag & BT_ROOT` evaluates to false, the code path leads to the problematic `discard_metapage` call.

The `xt_getpage` function, which is responsible for retrieving xtree pages, doesn't validate `BT_ROOT` when `bn` is 0. This lack of validation allows a corrupted root page (with `BT_ROOT` unset) to be successfully retrieved, and then processed by `xtTruncate`. There is a check for `nextindex` and `maxentry`, but not `BT_ROOT`. This means a corrupted image, where `i_xtroot.header.flag` doesn't have `BT_ROOT` set, will be misinterpreted as a non-root page.

Essentially, the filesystem image can become corrupt. Then, when `xtTruncate` processes it, it can mistake the inode's internal root page as a leaf page, and attempt to release the fake metapage, leading to the crash.

The critical flaw lies in that `xtTruncate` doesn't adequately check if it's operating on the root page before calling `discard_metapage`. The check should focus on the page being the inline root page or not.

I've identified two potential fixes:

1.  Modify `xtTruncate` to check if `bn == 0` instead of `p->header.flag & BT_ROOT` to determine if it is the root page and avoid calling `discard_metapage`.

2.  Enforce the check within `xt_getpage` to ensure that, if `bn == 0`, the `BT_ROOT` flag is set. Then, if the flag is missing, return an error.



107/2 2026/06/26 21:15 tool read-file
0m Args:
map[File:fs/jfs/jfs_dtree.c FirstLine:110 LineCount:40]

Results:
map[Contents: 110:	
 111:	#define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 112:	
 113:	/* get page buffer for specified block address */
 114:	#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
 115:	do {									\
 116:		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
 117:		if (!(RC)) {							\
 118:			if ((BN) && !check_dtpage(P)) {				\
 119:				BT_PUTPAGE(MP);					\
 120:				jfs_error((IP)->i_sb,				\
 121:					  "DT_GETPAGE: dtree page corrupt\n");	\
 122:				MP = NULL;					\
 123:				RC = -EIO;					\
 124:			}							\
 125:		}								\
 126:	} while (0)
 127:	
 128:	/* for consistency */
 129:	#define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
 130:	
 131:	#define DT_GETSEARCH(IP, LEAF, BN, MP, P, INDEX) \
 132:		BT_GETSEARCH(IP, LEAF, BN, MP, dtpage_t, P, INDEX, i_dtroot)
 133:	
 134:	/*
 135:	 * forward references
 136:	 */
 137:	static int dtSplitUp(tid_t tid, struct inode *ip,
 138:			     struct dtsplit * split, struct btstack * btstack);
 139:	
 140:	static int dtSplitPage(tid_t tid, struct inode *ip, struct dtsplit * split,
 141:			       struct metapage ** rmpp, dtpage_t ** rpp, pxd_t * rxdp);
 142:	
 143:	static int dtExtendPage(tid_t tid, struct inode *ip,
 144:				struct dtsplit * split, struct btstack * btstack);
 145:	
 146:	static int dtSplitRoot(tid_t tid, struct inode *ip,
 147:			       struct dtsplit * split, struct metapage ** rmpp);
 148:	
 149:	static int dtDeleteUp(tid_t tid, struct inode *ip, struct metapage * fmp,
]

108/2 2026/06/26 21:15 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 88239
							output: 41
							thoughts: 408
						

Thoughts:
**Analyzing the DT_GETPAGE and xt_getpage Functions**

Okay, so I'm looking at `DT_GETPAGE`. It looks like it skips a crucial check, `check_dtpage(P)`, when `BN` is zero. That's immediately a red flag. What happens when `BN` is zero? I see that `dtTruncate` doesn't exist. Now, let's circle back to `xt_getpage`. I need to figure out how this is all supposed to work and if there is an error.

Looking at `xt_getpage` again, specifically the integrity check there. It appears there is a check on the `nextindex`, `maxentry`, and the block number (`bn`). The check appears to make an exception for `bn == 0`. I have a suspicion that we need to add a check for the `BT_ROOT` flag when `bn == 0`. If we add this into `xt_getpage`, then it would looks something like this:

```c
	if (bn == 0 && !(p->header.flag & BT_ROOT)) {
		jfs_error(ip->i_sb, "xt_getpage: xtree root page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	}
```

Now, the question is, *is* `BT_ROOT` always set when `bn == 0`? That's the crux of it. If `bn == 0`, it signifies the root page, which is embedded within the inode. And the root page *must* have the `BT_ROOT` flag set. So, yes, that should be the case. Now, let me check the `xtInitRoot` function just to be sure...



109/2 2026/06/26 21:15 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:2110 LineCount:40]

Results:
map[Contents:2110:	 *	xtInitRoot()
2111:	 *
2112:	 * initialize file root (inline in inode)
2113:	 */
2114:	void xtInitRoot(tid_t tid, struct inode *ip)
2115:	{
2116:		xtroot_t *p;
2117:	
2118:		/*
2119:		 * acquire a transaction lock on the root
2120:		 *
2121:		 * action:
2122:		 */
2123:		txLock(tid, ip, (struct metapage *) &JFS_IP(ip)->bxflag,
2124:			      tlckXTREE | tlckNEW);
2125:		p = &JFS_IP(ip)->i_xtroot;
2126:	
2127:		p->header.flag = DXD_INDEX | BT_ROOT | BT_LEAF;
2128:		p->header.nextindex = cpu_to_le16(XTENTRYSTART);
2129:	
2130:		if (S_ISDIR(ip->i_mode))
2131:			p->header.maxentry = cpu_to_le16(XTROOTINITSLOT_DIR);
2132:		else {
2133:			p->header.maxentry = cpu_to_le16(XTROOTINITSLOT);
2134:			ip->i_size = 0;
2135:		}
2136:	
2137:	
2138:		return;
2139:	}
2140:	
2141:	
2142:	/*
2143:	 * We can run into a deadlock truncating a file with a large number of
2144:	 * xtree pages (large fragmented file).  A robust fix would entail a
2145:	 * reservation system where we would reserve a number of metadata pages
2146:	 * and tlocks which we would be guaranteed without a deadlock.  Without
2147:	 * this, a partial fix is to limit number of metadata pages we will lock
2148:	 * in a single transaction.  Currently we will truncate the file so that
2149:	 * no more than 50 leaf pages will be locked.  The caller of xtTruncate
]

110/2 2026/06/26 21:15 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 89700
							output: 35
							thoughts: 667
						

Thoughts:
**Analyzing the Truncation Logic and Potential Bug**

Okay, so `xtInitRoot` is responsible for setting `BT_ROOT`, got it. The core issue seems to be how `xtTruncate` handles a corrupted image with `bn == 0` when `BT_ROOT` isn't set.  That triggers a call to `discard_metapage` on the pseudo-metapage, leading to a crash – classic.

But, hold on... what happens when `bn` *isn't* zero, and `BT_ROOT` *is* set? Let's trace it. It seems that `xtTruncate` will then execute this block of code:

```c
		if (p->header.flag & BT_ROOT) {
			p->header.flag &= ~BT_INTERNAL;
			p->header.flag |= BT_LEAF;
			p->header.nextindex = cpu_to_le16(XTENTRYSTART);

			XT_PUTPAGE(mp);	/* debug */
			goto out;
		}
```

The `goto out` indicates it will return early.  So, this would *avoid* the crash, but potentially leave the truncation incomplete.  However, with `XT_PUTPAGE(mp)`, it's calling `release_metapage(mp)`, since `BT_IS_ROOT(mp)` is false (it's a real metapage). Good, the metapage is released.

But wait, we are modifying the flag and then returning. Is that safe? Yes, it just returns.

Now, here's a thought… what if instead of checking `p->header.flag & BT_ROOT`, we checked `BT_IS_ROOT(mp)` directly in `xtTruncate`?  Let's see:

```c
		if (BT_IS_ROOT(mp)) {
			p->header.flag &= ~BT_INTERNAL;
			p->header.flag |= BT_LEAF;
			p->header.nextindex = cpu_to_le16(XTENTRYSTART);

			XT_PUTPAGE(mp);	/* debug */
			goto out;
		} else {
			if (log) {	/* COMMIT_PWMAP */
				/* page will be invalidated at tx completion
				 */
				XT_PUTPAGE(mp);
			} else {	/* COMMIT_WMAP */

				if (mp->lid)
					lid_to_tlock(mp->lid)->flag |= tlckFREELOCK;

				/* invalidate empty leaf page */
				discard_metapage(mp);
			}
		}
```

I'm starting to see it. If we changed `if (p->header.flag & BT_ROOT)` to `if (BT_IS_ROOT(mp))`, that would perfectly fix the issue!  `BT_IS_ROOT(mp)` correctly identifies if `mp` is the pseudo-metapage.  It ensures the right code path is taken whether we are dealing with the root or a normal page.  Looks like a clean fix! Let me just quickly check all the places in `xtTruncate` that use `p->header.flag & BT_ROOT`.



111/2 2026/06/26 21:15 tool grepper
0m Args:
map[Expression:BT_ROOT PathPrefix:fs/jfs/jfs_xtree.c]

Results:
map[Output:fs/jfs/jfs_xtree.c=679=xtSplitUp(tid_t tid,
--
fs/jfs/jfs_xtree.c-705-	/* is inode xtree root extension/inline EA area free ? */
fs/jfs/jfs_xtree.c:706:	if ((sp->header.flag & BT_ROOT) && (!S_ISDIR(ip->i_mode)) &&
fs/jfs/jfs_xtree.c-707-	    (le16_to_cpu(sp->header.maxentry) < XTROOTMAXSLOT) &&
--
fs/jfs/jfs_xtree.c-783-	 */
fs/jfs/jfs_xtree.c:784:	rc = (sp->header.flag & BT_ROOT) ?
fs/jfs/jfs_xtree.c-785-	    xtSplitRoot(tid, ip, split, &rmp) :
--
fs/jfs/jfs_xtree.c-859-			 */
fs/jfs/jfs_xtree.c:860:			rc = (sp->header.flag & BT_ROOT) ?
fs/jfs/jfs_xtree.c-861-			    xtSplitRoot(tid, ip, split, &rmp) :
--
fs/jfs/jfs_xtree.c=2114=void xtInitRoot(tid_t tid, struct inode *ip)
--
fs/jfs/jfs_xtree.c-2126-
fs/jfs/jfs_xtree.c:2127:	p->header.flag = DXD_INDEX | BT_ROOT | BT_LEAF;
fs/jfs/jfs_xtree.c-2128-	p->header.nextindex = cpu_to_le16(XTENTRYSTART);
--
fs/jfs/jfs_xtree.c=2203=s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
--
fs/jfs/jfs_xtree.c-2483-
fs/jfs/jfs_xtree.c:2484:	if (p->header.flag & BT_ROOT) {
fs/jfs/jfs_xtree.c-2485-		p->header.flag &= ~BT_INTERNAL;
--
fs/jfs/jfs_xtree.c-2632-
fs/jfs/jfs_xtree.c:2633:		if (p->header.flag & BT_ROOT) {
fs/jfs/jfs_xtree.c-2634-			p->header.flag &= ~BT_INTERNAL;
--
fs/jfs/jfs_xtree.c=2758=s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
--
fs/jfs/jfs_xtree.c-2873-
fs/jfs/jfs_xtree.c:2874:		if (p->header.flag & BT_ROOT) {
fs/jfs/jfs_xtree.c-2875-
]

112/2 2026/06/26 21:15 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 91923
							output: 40
							thoughts: 945
						

Thoughts:
**Refining the Root Page Identification in the JFS Xtree Code**

Okay, so I've been looking at how the root page is identified in the JFS Xtree code. I noticed that `xtTruncate` and `xtTruncate_pmap` currently check `p->header.flag & BT_ROOT`, which is a common pattern. I initially thought we could improve this by using `BT_IS_ROOT(mp)` instead, but then I realized `xtSplitUp` also relies on that `BT_ROOT` flag.

The concern here is that if a *non-root* page inadvertently has the `BT_ROOT` flag set, there's a risk of triggering `xtSplitRoot` on it, which would be disastrous.

Then, I started thinking about how we can robustly enforce the `BT_ROOT` property within the code. `xt_getpage` looks like the right place. My idea is to make `xt_getpage` the single point of enforcement for `BT_ROOT`. Specifically, I can add a check that ensures `BT_ROOT` is set *only* when the block number (`bn`) is zero. I originally wrote this:

```c
	if (bn == 0 && !(p->header.flag & BT_ROOT)) {
		jfs_error(ip->i_sb, "xt_getpage: xtree root page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	}
```

...but then I realized I need to handle the opposite case, too. So, if `bn != 0` *and* `p->header.flag & BT_ROOT` is true, we should also throw an error. This led me to add the second conditional:

```c
	if (bn != 0 && (p->header.flag & BT_ROOT)) {
		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	}
```

This led me to the conclusion that if we could enforce this single invariant: `(bn == 0) == !!(p->header.flag & BT_ROOT)`, it should fix *all* places that rely on `p->header.flag & BT_ROOT`.

My next step was to verify that `BT_ROOT` is *never* incorrectly cleared on the root page. I confirmed that `xtTruncate` *doesn't* clear `BT_ROOT`. However, `xtSplitRoot` *does* clear it on the child page, which is correct. So, the root page maintains `BT_ROOT` and child pages get that bit cleared.

So now, I need to double-check `dt_getpage` to make sure nothing there clashes with the revised logic.



113/2 2026/06/26 21:15 tool read-file
0m Args:
map[File:fs/jfs/jfs_dtree.c FirstLine:110 LineCount:20]

Results:
map[Contents: 110:	
 111:	#define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 112:	
 113:	/* get page buffer for specified block address */
 114:	#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
 115:	do {									\
 116:		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
 117:		if (!(RC)) {							\
 118:			if ((BN) && !check_dtpage(P)) {				\
 119:				BT_PUTPAGE(MP);					\
 120:				jfs_error((IP)->i_sb,				\
 121:					  "DT_GETPAGE: dtree page corrupt\n");	\
 122:				MP = NULL;					\
 123:				RC = -EIO;					\
 124:			}							\
 125:		}								\
 126:	} while (0)
 127:	
 128:	/* for consistency */
 129:	#define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
]

114/2 2026/06/26 21:15 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 93898
							output: 29
							thoughts: 28
						

Thoughts:
Here's my thought process, as if I were analyzing that code:

**Analyzing the `check_dtpage` Call**

Okay, so I see `check_dtpage` is being called, and the condition is specifically tied to `BN != 0`. That's an immediate clue. My brain's already starting to build a mental picture of the control flow. I need to understand *why* this condition matters.

Let's dive into `check_dtpage`. I need to understand what this function does, what its inputs are, and how it relates to `BN`. Is it a flag, an index, a pointer? What's the context here? I'm picturing the data structures involved; it could be critical for understanding a specific area of memory. This conditional call, specifically tied to `BN`, gives me a direction to focus my attention. It's likely involved in memory management, page validation, or some kind of data integrity check. Time to get into the details of `check_dtpage`.



115/2 2026/06/26 21:16 tool grepper
0m Args:
map[Expression:check_dtpage PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_dtree.c=115=do {									\
--
fs/jfs/jfs_dtree.c-117-	if (!(RC)) {							\
fs/jfs/jfs_dtree.c:118:		if ((BN) && !check_dtpage(P)) {				\
fs/jfs/jfs_dtree.c-119-			BT_PUTPAGE(MP);					\
--
fs/jfs/jfs_dtree.c=4298=bool check_dtroot(dtroot_t *p)
--
fs/jfs/jfs_dtree.c-4383-
fs/jfs/jfs_dtree.c:4384:bool check_dtpage(dtpage_t *p)
fs/jfs/jfs_dtree.c-4385-{
--
fs/jfs/jfs_dtree.h=257=extern bool check_dtroot(dtroot_t *p);
fs/jfs/jfs_dtree.h-258-
fs/jfs/jfs_dtree.h:259:extern bool check_dtpage(dtpage_t *p);
fs/jfs/jfs_dtree.h-260-#endif				/* !_H_JFS_DTREE */
]

116/2 2026/06/26 21:16 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 94517
							output: 41
							thoughts: 10
						

Thoughts:
Okay, let's dive into this. Here's my take on those thoughts, as if they're my own:

**Analyzing the Code: check\_dtpage**

Alright, time to break down `check_dtpage`. Let's see what's going on here. I'm assuming it's related to some sort of date/time handling, given the naming convention. My immediate thought is to understand the purpose: is it validating input, parsing a specific format, performing calculations, or something else entirely? A quick scan will give me the gist of what's happening. I'll be looking for the core logic, any potential edge cases the developers considered, and any dependencies on external libraries or configurations. I'll want to see how robust it is against unexpected inputs; is it likely to raise exceptions or return invalid data silently? This is important because I'll be looking to identify any areas for improvement, possible vulnerabilities, or potential bugs, because I'll need to see how it can be adapted to some of the specific use cases in mind.



117/2 2026/06/26 21:16 tool read-file
0m Args:
map[File:fs/jfs/jfs_dtree.c FirstLine:4380 LineCount:20]

Results:
map[Contents:4380:	
4381:		return true;
4382:	}
4383:	
4384:	bool check_dtpage(dtpage_t *p)
4385:	{
4386:		DECLARE_BITMAP(bitmap, DTPAGEMAXSLOT) = {0};
4387:		const int stblsize = ((PSIZE >> L2DTSLOTSIZE) + 31) >> L2DTSLOTSIZE;
4388:		int i;
4389:	
4390:		/* Validate maxslot (maximum number of slots in the page)
4391:		 * dtpage_t slot array is defined to hold up to DTPAGEMAXSLOT (128) slots
4392:		 */
4393:		if (unlikely(p->header.maxslot != DTPAGEMAXSLOT)) {
4394:			jfs_err("Bad maxslot:%d in dtpage (expected %d)\n",
4395:					p->header.maxslot, DTPAGEMAXSLOT);
4396:			return false;
4397:		}
4398:	
4399:		/* freecnt cannot be negative or exceed DTPAGEMAXSLOT-1
]

118/2 2026/06/26 21:16 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 95130
							output: 41
							thoughts: 9
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm deep in my specialized field (let's say, embedded systems programming):

**Initial Code Inspection: Root Path Verification**

Alright, let me see... "Does it check `BT_ROOT`?" Hmm, so, my immediate mental check is about the foundational setup. It's almost reflexive at this point. I'm thinking about whether the code properly validates the root directory setting, likely for a Bluetooth-related system, given the `BT` prefix. This is *critical*. Failure here could lead to all sorts of havoc, from file access vulnerabilities to misconfigurations that break everything. I need to know if the software is robust in how it handles the fundamental path from which it starts. Is this robust? I need more context to evaluate the impact. I need to keep probing.



119/2 2026/06/26 21:16 tool read-file
0m Args:
map[File:fs/jfs/jfs_dtree.c FirstLine:4400 LineCount:20]

Results:
map[Contents:4400:		 * (since slot[0] is occupied by the header).
4401:		 */
4402:		if (unlikely(p->header.freecnt < 0 ||
4403:					p->header.freecnt > DTPAGEMAXSLOT - 1)) {
4404:			jfs_err("Bad freecnt:%d in dtpage\n", p->header.freecnt);
4405:			return false;
4406:		} else if (p->header.freecnt == 0) {
4407:			/* No free slots: freelist must be -1 */
4408:			if (unlikely(p->header.freelist != -1)) {
4409:				jfs_err("freecnt=0 but freelist=%d in dtpage\n",
4410:						p->header.freelist);
4411:				return false;
4412:			}
4413:		} else {
4414:			int fsi;
4415:	
4416:			if (unlikely(p->header.freelist < 1)) {
4417:				jfs_err("Bad freelist:%d in dtpage\n", p->header.freelist);
4418:				return false;
4419:			}
]

120/2 2026/06/26 21:16 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 95709
							output: 40
							thoughts: 416
						

Thoughts:
**Analyzing the `xt_getpage` Function and Potential Corruption**

Okay, so I'm looking at this code related to xtree pages, specifically the `xt_getpage` function. Initially, I noticed it doesn't explicitly check `BT_ROOT`, which immediately raises a flag. But then I remember `xt_getpage` doesn't use `check_xtpage` (that's a non-existent function, apparently). So, the corruption check is missing.

My first instinct is to add a check directly within `xt_getpage`. Something like this:

```c
	if ((bn == 0) != !!(p->header.flag & BT_ROOT)) {
		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	}
```

Wait, hold on a second... is the relationship between `bn == 0` and `BT_ROOT` always true? Does it hold as an invariant? Let's trace it back. Okay, `xtInitRoot` sets `BT_ROOT` when the block number is zero. That makes sense. And then `xtSplitRoot` clears it on the child pages. Yes, it looks like `(bn == 0) == !!(p->header.flag & BT_ROOT)` *should* always be the case. Good!

Now, does this fix the problem or does it cause issues elsewhere? I need to consider where else `xt_getpage` is called. Let's see... looking at `xtTruncate`:

```c
	      getPage:
		p = xt_getpage(ip, bn, &mp);
		if (IS_ERR(p))
			return PTR_ERR(p);
```

Ah, right. If `bn == 0` and `BT_ROOT` is *not* set, the `xt_getpage` check will return `-EIO`, and `xtTruncate` will propagate that, returning `-EIO`. This will prevent the crash. That looks solid.

Okay, let's make sure I'm not missing anything. Is `xt_getpage` the *only* place xtree pages are read? Yes, it's the wrapper around `BT_GETPAGE`, so it's the gatekeeper. We're safe. Back to reviewing the added check in `xt_getpage`... looks good.



121/2 2026/06/26 21:16 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:110 LineCount:25]

Results:
map[Contents: 110:	
 111:	static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
 112:	{
 113:		xtpage_t *p;
 114:		int rc;
 115:	
 116:		BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);
 117:	
 118:		if (rc)
 119:			return ERR_PTR(rc);
 120:		if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
 121:			(le16_to_cpu(p->header.nextindex) >
 122:				le16_to_cpu(p->header.maxentry)) ||
 123:			(le16_to_cpu(p->header.maxentry) >
 124:				((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
 125:			jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
 126:			BT_PUTPAGE(*mp);
 127:			*mp = NULL;
 128:			return ERR_PTR(-EIO);
 129:		}
 130:		return p;
 131:	}
 132:	
 133:	/*
 134:	 *	xtLookup()
]

122/2 2026/06/26 21:16 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 97132
							output: 22
							thoughts: 132
						

Thoughts:
**Analyzing Potential File System Corruption**

Okay, so I'm looking at this piece of C code, and it's flagged as a potential corruption check within the JFS file system. I see this `if` statement, and my first reaction is, "Right, a quick sanity check to make sure the expected invariants of the B-Tree structure are in order."

Specifically, it checks if `bn` is zero and whether the `BT_ROOT` flag matches a comparison of a flag extracted from the B-tree metadata or header. A mismatch would indicate corruption. So, this looks like a critical safeguard during page retrieval.

But then, I pause. I need to be more precise in my thoughts. Let's look closely at `p->header.flag`. It's defined somewhere in the JFS structures. I need to refresh my memory, this is an 8-bit integer, and I need to double-check that this is accurate. Is that correct? Let me make sure that `p->header.flag` type is actually what I'm thinking it is. Knowing it's 8 bits means I need to be careful with bit-wise operations.



123/2 2026/06/26 21:16 tool codesearch-struct-layout
0m Error:
log-in to see details

Args:
map[Name:xtpage_t]

Results:
map[Fields:<nil>]

124/2 2026/06/26 21:16 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 97565
							output: 31
							thoughts: 10
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Analyzing the `xtpage_t` Structure**

Alright, time to dive in. My immediate thought is, "Let's check `xtpage_t`." This isn't just a casual glance; I need to understand its design and purpose deeply. I’m thinking about what information it's meant to hold, and how it relates to the overall system architecture. Is it a central structure, a peripheral one, or something in between? What are the key fields within it? Memory management, virtual addressing, page table entries... those concepts are immediately what I'm thinking of, and how `xtpage_t` is involved in them. I need to be sure that I am understanding its role in the greater scheme of things.



125/2 2026/06/26 21:16 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:typedef.*xtpage_t PathPrefix:fs/jfs/]

Results:
map[Output:]

126/2 2026/06/26 21:16 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 97801
							output: 29
							thoughts: 11
						

Thoughts:
Okay, here's my attempt at summarizing that thought process, keeping in mind I'm dealing with someone who understands technical jargon:

**Hunting Down `xtpage_t`**

Alright, time to get to it. My initial thought process is to dive straight into a search for `xtpage_t`. No preamble, just directly target the term. This likely means I'm looking for its definition, its usage, or maybe even debugging a problem related to it. I'm assuming it's a known entity within the codebase or the specific context I'm working in, given the directness of the approach. The search itself could be through code search tools, grep, or whatever's appropriate for the project. I need to understand what this thing is.



127/2 2026/06/26 21:16 tool grepper
0m Args:
map[Expression:xtpage_t PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_txnmgr.c=584=struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
--
fs/jfs/jfs_txnmgr.c-593-	struct linelock *linelock;
fs/jfs/jfs_txnmgr.c:594:	xtpage_t *p;
fs/jfs/jfs_txnmgr.c-595-	struct tblock *tblk;
--
fs/jfs/jfs_txnmgr.c-785-			if (mp->xflag & COMMIT_PAGE)
fs/jfs/jfs_txnmgr.c:786:				p = (xtpage_t *) mp->data;
fs/jfs/jfs_txnmgr.c-787-			else
fs/jfs/jfs_txnmgr.c:788:				p = (xtpage_t *) &jfs_ip->i_xtroot;
fs/jfs/jfs_txnmgr.c-789-			xtlck->lwm.offset =
--
fs/jfs/jfs_txnmgr.c=1657=static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
--
fs/jfs/jfs_txnmgr.c-1661-	struct metapage *mp;
fs/jfs/jfs_txnmgr.c:1662:	xtpage_t *p;
fs/jfs/jfs_txnmgr.c-1663-	struct xtlock *xtlck;
--
fs/jfs/jfs_txnmgr.c-1680-		lrd->log.redopage.type |= cpu_to_le16(LOG_BTROOT);
fs/jfs/jfs_txnmgr.c:1681:		p = (xtpage_t *) &JFS_IP(ip)->i_xtroot;
fs/jfs/jfs_txnmgr.c-1682-		if (S_ISDIR(ip->i_mode))
--
fs/jfs/jfs_txnmgr.c-1685-	} else
fs/jfs/jfs_txnmgr.c:1686:		p = (xtpage_t *) mp->data;
fs/jfs/jfs_txnmgr.c-1687-	next = le16_to_cpu(p->header.nextindex);
--
fs/jfs/jfs_xtree.c-49-
fs/jfs/jfs_xtree.c:50:#define XT_PAGE(IP, MP) BT_PAGE(IP, MP, xtpage_t, i_xtroot)
fs/jfs/jfs_xtree.c-51-
--
fs/jfs/jfs_xtree.c-55-#define XT_GETSEARCH(IP, LEAF, BN, MP, P, INDEX) \
fs/jfs/jfs_xtree.c:56:	BT_GETSEARCH(IP, LEAF, BN, MP, xtpage_t, P, INDEX, i_xtroot)
fs/jfs/jfs_xtree.c-57-/* xtree entry parameter descriptor */
--
fs/jfs/jfs_xtree.c=94=static int xtSplitRoot(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_xtree.c-107- * returns:
fs/jfs/jfs_xtree.c:108: *      A pointer to the xtree page (xtpage_t) on success, -EIO on error.
fs/jfs/jfs_xtree.c-109- */
fs/jfs/jfs_xtree.c-110-
fs/jfs/jfs_xtree.c:111:static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
fs/jfs/jfs_xtree.c-112-{
fs/jfs/jfs_xtree.c:113:	xtpage_t *p;
fs/jfs/jfs_xtree.c-114-	int rc;
fs/jfs/jfs_xtree.c-115-
fs/jfs/jfs_xtree.c:116:	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);
fs/jfs/jfs_xtree.c-117-
--
fs/jfs/jfs_xtree.c=138=int xtLookup(struct inode *ip, s64 lstart,
--
fs/jfs/jfs_xtree.c-145-	struct metapage *mp;
fs/jfs/jfs_xtree.c:146:	xtpage_t *p;
fs/jfs/jfs_xtree.c-147-	int index;
--
fs/jfs/jfs_xtree.c=231=static int xtSearch(struct inode *ip, s64 xoff,	s64 *nextp,
--
fs/jfs/jfs_xtree.c-237-	struct metapage *mp;	/* page buffer */
fs/jfs/jfs_xtree.c:238:	xtpage_t *p;		/* page */
fs/jfs/jfs_xtree.c-239-	xad_t *xad;
--
fs/jfs/jfs_xtree.c=528=int xtInsert(tid_t tid,		/* transaction id */
--
fs/jfs/jfs_xtree.c-534-	struct metapage *mp;	/* meta-page buffer */
fs/jfs/jfs_xtree.c:535:	xtpage_t *p;		/* base B+-tree index page */
fs/jfs/jfs_xtree.c-536-	s64 bn;
--
fs/jfs/jfs_xtree.c=679=xtSplitUp(tid_t tid,
--
fs/jfs/jfs_xtree.c-683-	struct metapage *smp;
fs/jfs/jfs_xtree.c:684:	xtpage_t *sp;		/* split page */
fs/jfs/jfs_xtree.c-685-	struct metapage *rmp;
--
fs/jfs/jfs_xtree.c-687-	struct metapage *rcmp;
fs/jfs/jfs_xtree.c:688:	xtpage_t *rcp;		/* right child page */
fs/jfs/jfs_xtree.c-689-	s64 rcbn;		/* right child page block number */
--
fs/jfs/jfs_xtree.c=949=xtSplitPage(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_xtree.c-953-	struct metapage *smp;
fs/jfs/jfs_xtree.c:954:	xtpage_t *sp;
fs/jfs/jfs_xtree.c-955-	struct metapage *rmp;
fs/jfs/jfs_xtree.c:956:	xtpage_t *rp;		/* new right page allocated */
fs/jfs/jfs_xtree.c-957-	s64 rbn;		/* new right page block number */
fs/jfs/jfs_xtree.c-958-	struct metapage *mp;
fs/jfs/jfs_xtree.c:959:	xtpage_t *p;
fs/jfs/jfs_xtree.c-960-	s64 nextbn;
--
fs/jfs/jfs_xtree.c-1001-
fs/jfs/jfs_xtree.c:1002:	rp = (xtpage_t *) rmp->data;
fs/jfs/jfs_xtree.c-1003-	rp->header.self = *pxd;
--
fs/jfs/jfs_xtree.c=1216=xtSplitRoot(tid_t tid,
--
fs/jfs/jfs_xtree.c-1218-{
fs/jfs/jfs_xtree.c:1219:	xtpage_t *sp;
fs/jfs/jfs_xtree.c-1220-	struct metapage *rmp;
fs/jfs/jfs_xtree.c:1221:	xtpage_t *rp;
fs/jfs/jfs_xtree.c-1222-	s64 rbn;
--
fs/jfs/jfs_xtree.c-1230-
fs/jfs/jfs_xtree.c:1231:	sp = (xtpage_t *) &JFS_IP(ip)->i_xtroot;
fs/jfs/jfs_xtree.c-1232-
--
fs/jfs/jfs_xtree.c-1261-
fs/jfs/jfs_xtree.c:1262:	rp = (xtpage_t *) rmp->data;
fs/jfs/jfs_xtree.c-1263-	rp->header.flag =
--
fs/jfs/jfs_xtree.c=1351=int xtExtend(tid_t tid,		/* transaction id */
--
fs/jfs/jfs_xtree.c-1358-	struct metapage *mp;	/* meta-page buffer */
fs/jfs/jfs_xtree.c:1359:	xtpage_t *p;		/* base B+-tree index page */
fs/jfs/jfs_xtree.c-1360-	s64 bn;
--
fs/jfs/jfs_xtree.c=1513=int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
--
fs/jfs/jfs_xtree.c-1517-	struct metapage *mp;	/* meta-page buffer */
fs/jfs/jfs_xtree.c:1518:	xtpage_t *p;		/* base B+-tree index page */
fs/jfs/jfs_xtree.c-1519-	s64 bn;
--
fs/jfs/jfs_xtree.c=1956=int xtAppend(tid_t tid,		/* transaction id */
--
fs/jfs/jfs_xtree.c-1963-	struct metapage *mp;	/* meta-page buffer */
fs/jfs/jfs_xtree.c:1964:	xtpage_t *p;		/* base B+-tree index page */
fs/jfs/jfs_xtree.c-1965-	s64 bn, xaddr;
--
fs/jfs/jfs_xtree.c=2203=s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
--
fs/jfs/jfs_xtree.c-2206-	struct metapage *mp;
fs/jfs/jfs_xtree.c:2207:	xtpage_t *p;
fs/jfs/jfs_xtree.c-2208-	s64 bn;
--
fs/jfs/jfs_xtree.c=2758=s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
--
fs/jfs/jfs_xtree.c-2765-	struct metapage *mp;
fs/jfs/jfs_xtree.c:2766:	xtpage_t *p;
fs/jfs/jfs_xtree.c-2767-	struct btframe *parent;
--
fs/jfs/jfs_xtree.h=92=typedef union {
--
fs/jfs/jfs_xtree.h-94-	xad_t xad[XTPAGEMAXSLOT];	/* 16 * maxentry: xad array */
fs/jfs/jfs_xtree.h:95:} xtpage_t;
fs/jfs/jfs_xtree.h-96-
]

128/2 2026/06/26 21:16 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 101175
							output: 1652
							thoughts: 5556
						

Thoughts:
**Analysis of JFS Metadata Corruption Vulnerability and Proposed Fix**

As a seasoned expert in file system internals, I've thoroughly analyzed a critical vulnerability within the JFS file system, stemming from metadata corruption and leading to a crash. This involves a subtle but devastating flaw related to handling of the inline xtree root page, specifically the `header.flag` field and the `BT_ROOT` flag, and its improper handling during truncation and similar operations.

The root cause of the crash lies in the interaction between `xtTruncate` (and `dtDeleteUp`) and the handling of *pseudo-metapages* which are special metapage instances embedded directly within the inode structure to represent the root of the B-tree metadata. When the corrupted file system image leads to an `xtpage_t` that's meant to be the root page (identified by `bn == 0`), but the page's `header.flag` doesn't have the `BT_ROOT` bit set, it causes a cascade of incorrect operations.

Here's the breakdown of how the vulnerability plays out:
1.  The `xtTruncate` function begins by getting the root page (block number `bn = 0`) using `xt_getpage`. This function makes a crucial error: even though it checks other fields in `xtpage_t` such as `nextindex` and `maxentry`, it *fails to verify that `header.flag` has the `BT_ROOT` bit set for a root page*. It calls `BT_GETPAGE`, which sets `mp` to a pseudo-metapage (specifically, `&JFS_IP(ip)->bxflag` which is embedded in `jfs_inode_info`) and `p` to point to the actual inline xtree root (`&JFS_IP(ip)->i_xtroot`). This inline root is *also* of the same union type, so that `p` and `mp` are both valid pointers.
2.  In a corrupted image, the `i_xtroot.header.flag` might have been damaged (in this case, the `BT_ROOT` bit is missing).
3.  Later, during processing, `xtTruncate` (or, similarly, `dtDeleteUp`) checks `if (p->header.flag & BT_ROOT)` to determine if it is the root page. Due to the corruption, this check fails, causing the function to incorrectly treat the root page as a regular page (a "leaf page"). This causes a critical error in that it calls `discard_metapage(mp)`.
4.  `discard_metapage` is called on the pseudo-metapage pointer `mp`. `discard_metapage` will call `release_metapage(mp)`, bypassing the check `BT_IS_ROOT(mp)` which *should* prevent the call on pseudo-metapages, since it assumes the page is a real `metapage`.
5.  `release_metapage` then proceeds with operations that assume a regular `metapage`, calling `unlock_metapage(mp)`, which calls `wake_up(&mp->wait)`. This is where the crash happens.
6.  The issue stems from the fact that `mp->wait` is a memory location *not* belonging to a valid `metapage`. Rather, it's inside `bxflag`, which itself is embedded in `jfs_inode_info`. Accessing this address therefore results in an out-of-bounds read and write operation, causing a spinlock bad magic BUG, potentially overwriting adjacent memory regions or leading to an out-of-bounds array access, ultimately resulting in a system crash.

To fully resolve this vulnerability and prevent such a crash, we need to enforce the correct usage of the `BT_ROOT` flag. The fix consists of adding the following crucial check *within* `xt_getpage`:

```c
static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
{
	xtpage_t *p;
	int rc;

	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);

	if (rc)
		return ERR_PTR(rc);
	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
		(le16_to_cpu(p->header.nextindex) >
			le16_to_cpu(p->header.maxentry)) ||
		(le16_to_cpu(p->header.maxentry) >
			((bn == 0) ? XTROOTMAX


129/1 2026/06/26 21:17 agent history-explorer
4m Model:
gemini-3.1-pro-preview

Instruction:
You are an experienced Linux kernel developer researching prior art for fixing a kernel bug.
You are given a bug explanation. This explanation details the root cause of the bug resulting
from debugging, but does not provide the final fix strategy. Your goal is to explore how
similar bugs were fixed in the past in the same subsystem or files.

CRITICAL: Do NOT attempt to debug the issue further or write a patch for it yourself.
Your ONLY objective is to research and provide the necessary historical context.

Use the git-log tool with the Since parameter set to "3 years" to focus on recent history.
Search for commits that address issues with similar root causes (e.g. similar missing locks,
incorrect refcounting, or similar error path bugs) in the affected files.

Your final reply must summarize your findings: what idioms, locking rules, or common patterns
should be followed when writing a fix for this bug based on how previous similar bugs were addressed.
If you find no relevant past fixes, clearly state that.

Don't make assumptions about the kernel source code (it may be different from what you assume it is).
Extensively use the provided code access tools (codesearch-*, git-*, grepper, etc)
to examine the actual source code, and confirm any assumptions.

Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash is:

BUG: spinlock bad magic on CPU#0, syz-executor/6066
 lock: 0xffff888120999b48, .magic: ffffffff, .owner: �������� �������/-1902340672, .owner_cpu: 768
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in /app/workdir/cache/src/1583fc50e73bc268b47064ec35fa43904fad8ca1/kernel/locking/qspinlock.h:68:9
index 8945 is out of range for type 'unsigned long[8]'
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 ubsan_epilogue+0xa/0x30 lib/ubsan.c:233
 __ubsan_handle_out_of_bounds+0xe8/0xf0 lib/ubsan.c:455
 decode_tail kernel/locking/qspinlock.h:68 [inline]
 __pv_queued_spin_lock_slowpath+0xaf3/0xbc0 kernel/locking/qspinlock.c:285
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:35 [inline]
 queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:66 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x26c/0x2f0 kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
---[ end trace ]---


The explanation of the root cause of the bug is:

An excellent catch! The crash is caused by a corrupted JFS image that tricks the kernel into calling `release_metapage()` on a pseudo-metapage embedded within the inode, leading to an out-of-bounds memory access and a spinlock crash.

Here is the detailed root cause analysis and the proposed fix.

### Root Cause Analysis

1. **The Pseudo-Metapage:**
   When operating on the root page of an xtree or dtree (which is stored inline within the inode), JFS doesn't use a real `struct metapage`. Instead, `BT_GETPAGE` (called via `xt_getpage` for `bn == 0`) sets the metapage pointer `mp` to the address of `JFS_IP(ip)->bxflag`:
   ```c
   // fs/jfs/jfs_btree.h
   #define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\
   {\
       if ((BN) == 0)\
       {\
           MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
           P = (TYPE *)&JFS_IP(IP)->ROOT;\
           RC = 0;\
       }\
       // ...
   ```
   Because this is a pseudo-metapage, it does not have a valid `wait_queue_head_t wait` field. Accessing `mp->wait` (which is at offset 64 in `struct metapage`) actually reads out-of-bounds memory in `struct jfs_inode_info` (overlapping with `rdwrlock` or `anon_inode_list`).

2. **The Missing Validation:**
   In `xt_getpage()`, the code validates `nextindex` and `maxentry`, but it **fails to verify that the `BT_ROOT` flag is set** in `p->header.flag` for the root page (`bn == 0`). In the corrupted syzkaller image, the inline xtree root page (`i_xtroot`) has a corrupted `header.flag` where `BT_ROOT` is missing.

3. **The Vulnerable Path in `xtTruncate`:**
   When `xtTruncate()` processes this corrupted root page and it becomes empty, it checks if it is the root page by looking at the `BT_ROOT` flag:
   ```c
   // fs/jfs/jfs_xtree.c : xtTruncate()
           if (p->header.flag & BT_ROOT) {
               // ...
               XT_PUTPAGE(mp);
               goto out;
           } else {
               if (log) {
                   XT_PUTPAGE(mp);
               } else {
                   if (mp->lid)
                       lid_to_tlock(mp->lid)->flag |= tlckFREELOCK;

                   /* invalidate empty leaf page */
                   discard_metapage(mp);
               }
           }
   ```
   Because `BT_ROOT` is missing due to corruption, `xtTruncate` takes the `else` branch, mistakenly treating the root page as a regular leaf page, and calls `discard_metapage(mp)`.

4. **The Crash:**
   Unlike `XT_PUTPAGE` (which wraps `BT_PUTPAGE` and safely checks `!BT_IS_ROOT(mp)` before releasing), `discard_metapage()` calls `release_metapage(mp)` directly:
   ```c
   // fs/jfs/jfs_metapage.h
   static inline void discard_metapage(struct metapage *mp)
   {
       clear_bit(META_dirty, &mp->flag);
       set_bit(META_discard, &mp->flag);
       release_metapage(mp);
   }
   ```
   `release_metapage()` assumes `mp` is a real metapage and calls `unlock_metapage(mp)`, which executes `wake_up(&mp->wait)`. Since `mp` points to `&JFS_IP(ip)->bxflag`, this accesses garbage memory, resulting in the `spinlock bad magic` BUG or the UBSAN out-of-bounds array access.

### Proposed Fix

To fix this, we must enforce the invariant that the `BT_ROOT` flag is set **if and only if** `bn == 0`. 

**1. Fix in `xt_getpage` (`fs/jfs/jfs_xtree.c`):**
Add a check to ensure `BT_ROOT` consistency:
```c
static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
{
	xtpage_t *p;
	int rc;

	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);

	if (rc)
		return ERR_PTR(rc);
	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
	    (le16_to_cpu(p->header.nextindex) > le16_to_cpu(p->header.maxentry)) ||
	    (le16_to_cpu(p->header.maxentry) > ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {      // <--- ADD THIS CHECK
		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	}
	return p;
}
```

**2. Fix in `DT_GETPAGE` (`fs/jfs/jfs_dtree.c`):**
The exact same vulnerability exists for dtree pages (e.g., `dtDeleteUp` can crash the same way if `i_dtroot` is corrupted). The `DT_GETPAGE` macro should be updated to enforce the same `BT_ROOT` invariant:
```c
#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
do {									\
	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
	if (!(RC)) {							\
		if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {	\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree root page corrupt\n"); \
			MP = NULL;					\
			RC = -EIO;					\
		} else if ((BN) && !check_dtpage(P)) {			\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree page corrupt\n");	\
			MP = NULL;					\
			RC = -EIO;					\
		}							\
	}								\
} while (0)
```

Reply:
Based on a review of recent commits in the JFS subsystem over the last 3 years, the proposed fix aligns perfectly with how similar on-disk corruption bugs have been addressed. JFS has historically suffered from various out-of-bounds accesses and memory corruption issues due to missing validation of on-disk structures, and the maintainers have established a clear pattern for fixing them.

Here is a summary of the idioms, rules, and common patterns you should follow when writing the final patch:

### 1. Centralized Early Validation
Recent fixes in JFS consistently add strict invariant checks immediately at the point where structures are loaded from disk or memory, rather than at the point of use. 
- Commit `119e448bb50a` added `check_dtpage()` to validate `dtpage_t` integrity inside `DT_GETPAGE`.
- Commit `c83abc766aeb` added `check_dtroot()` to validate `dtroot_t` inside `copy_from_dinode()`.
- Commit `cce219b203c4` added `check_dmapctl()` to validate `dmapctl` pages when they are loaded.

Your proposed strategy of enforcing the `((bn == 0) != !!(p->header.flag & BT_ROOT))` invariant directly inside `xt_getpage()` and `DT_GETPAGE()` exactly follows this pattern. It catches the corruption early before functions like `xtTruncate()` or `dtDeleteUp()` can misinterpret the pseudo-metapage.

### 2. Standard Error Handling Pattern
When an invariant check fails, JFS follows a strict error-handling sequence to prevent resource leaks and notify the system:
1. **Log the error:** Call `jfs_error(ip->i_sb, "...")` to log the corruption and potentially mark the filesystem as read-only (depending on mount options).
2. **Release resources:** Call `BT_PUTPAGE(*mp)` to release the metapage.
3. **Clear pointers:** Set the metapage pointer to `NULL` to prevent double-frees or use-after-frees.
4. **Return an error:** Return `-EIO` (or `ERR_PTR(-EIO)` for functions returning pointers).

Your proposed additions to `xt_getpage()` and `DT_GETPAGE()` correctly implement this exact sequence.

### 3. Modernization of Macros to Inline Functions
In commit `1014354cd8d4` (June 2025), the maintainers replaced the legacy `XT_GETPAGE` macro with the `xt_getpage()` inline function to improve type safety and readability. 
- Your proposed fix for `xt_getpage()` correctly targets this new inline function.
- `DT_GETPAGE` is currently still a macro. While updating the macro directly (as you proposed) is perfectly acceptable and matches the current codebase, you might also consider taking the opportunity to refactor `DT_GETPAGE` into a `dt_getpage()` inline function, as this would be highly welcomed by the maintainers based on recent modernization efforts.

### Conclusion
Your root cause analysis is spot on, and the proposed fix is structurally complete. You do not need to introduce any new locking rules or complex state rollbacks. Simply enforcing the `BT_ROOT` invariant during page retrieval and returning `-EIO` with `jfs_error()` is the idiomatic way to fix this class of bugs in JFS.

130/2 2026/06/26 21:17 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 8906
							output: 28
							thoughts: 359
						

Thoughts:
**Analyzing Prior Art for JFS Kernel Bug Fix**

Okay, so we've got this JFS kernel bug, right? It's all about a missing validation of the `BT_ROOT` flag when dealing with the root page in `xt_getpage` and `DT_GETPAGE`. Specifically, syzkaller is throwing a corrupted image our way where `header.flag` is missing that `BT_ROOT` bit. This means `xtTruncate` then incorrectly treats the root page like a regular leaf, ends up calling `discard_metapage` which then calls `release_metapage`. Since the root page utilizes a pseudo-metapage that's embedded in the inode, calling `release_metapage` results in an out-of-bounds memory access and a spinlock crash. Classic.

The proposed fix – and this seems sound – is to simply add a check: `((bn == 0) != !!(p->header.flag & BT_ROOT))` within `xt_getpage` and `DT_GETPAGE`. That should catch the missing `BT_ROOT` situation.

Now, before we go ahead and commit this, we need to do our due diligence and check the history. We've got to ensure we're not just reinventing the wheel and to learn from the JFS past. Let's see how similar issues were handled previously, especially within the JFS subsystem.

We'll use `git log` with a "3 years" time frame. The real key here is to find commits with similar root causes within the relevant files. Think missing locks, incorrect reference counting, errors in the error handling path... anything with a similar failure mode, regardless of the exact code. The affected files are the usual suspects: `fs/jfs/jfs_xtree.c`, `fs/jfs/jfs_dtree.c`, and `fs/jfs/jfs_metapage.c`. And any others that seem relevant.

The goal is to distill the findings – what's the usual idiom? Are there specific locking rules or patterns we should adhere to when writing this fix? We want to identify any common practices or lessons learned within the JFS codebase regarding similar types of bugs.

Alright, let's start digging with `git log` and see what we can find in `fs/jfs/`. Hopefully this will give us some good guidance.



131/2 2026/06/26 21:17 tool git-log
0m Args:
map[PathPrefix:fs/jfs/ Since:3 years]

Results:
map[Output:a7cf1da7ac01 fs: Fix return in jfs_mkdir and orangefs_mkdir
dad98c5b2a05 jfs: avoid -Wtautological-constant-out-of-range-compare warning again
679330e4a7af JFS: always load filesystem UUID during mount
ca5848ae87d2 jfs: hold LOG_LOCK on umount to avoid null-ptr-deref
b15e4310633f jfs: Set the lbmDone flag at the end of lbmIODone
3c778ec88208 jfs: fix corrupted list in dbUpdatePMap
cce219b203c4 jfs: add dmapctl integrity check to prevent invalid operations
119e448bb50a jfs: add dtpage integrity check to prevent index/pointer overflows
c83abc766aeb jfs: add dtroot integrity check to prevent index out-of-bounds
0b2600f81cef treewide: change inode->i_ino from unsigned long to u64
]

132/2 2026/06/26 21:17 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10084
							output: 50
							thoughts: 135
						

Thoughts:
**Analyzing Recent JFS Integrity Checks**

Okay, let's dive into these recent commits. I want to understand the rationale behind these integrity checks and how they're addressing potential vulnerabilities in the JFS file system. Specifically, these commits around integrity are particularly interesting: `119e448bb50a`, `c83abc766aeb`, and `cce219b203c4`. It seems they're targeting specific areas - `dtpage`, `dtroot`, and `dmapctl` - to prevent potential overflows and out-of-bounds issues, and incorrect operations. This is good; these sorts of checks are critical for data consistency, and often prevent nastier problems down the line. I am particularly interested in how these have been implemented, given the performance overhead they inevitably incur. I'd need to assess whether the checks are comprehensive enough, and whether any of the checks have been implemented with the potential to slow performance.

I should also look at `3c778ec88208`, as it addresses a corrupted list in `dbUpdatePMap`. Fixing corruption at that level is crucial; it's a good move to proactively address corruption issues rather than waiting for them to surface as data loss or corruption. I need to understand what led to the corruption, and how the fix addresses the root cause. My instinct is that this corruption could be quite a big problem.

So, first, let's grab the full commit details for all of these; I want to see the code changes, understand the context, and evaluate the effectiveness of these integrity improvements. It's a question of making sure we're getting it right.



133/2 2026/06/26 21:17 tool git-show
0m Args:
map[Commit:119e448bb50a]

Results:
map[Output:commit 119e448bb50a5b2626e248c01f439095766e248b
Author: Yun Zhou <yun.zhou@windriver.com>
Date:   Thu Nov 20 23:44:00 2025 +0800

    jfs: add dtpage integrity check to prevent index/pointer overflows
    
    Add check_dtpage() to validate dtpage_t integrity, focusing on
    preventing index/pointer overflows from on-disk corruption.
    
    Key checks:
    - maxslot must be exactly DTPAGEMAXSLOT (128) as defined for dtpage
      slot array.
    - freecnt bounded by [0, DTPAGEMAXSLOT-1] (slot[0] reserved for header).
    - freelist validity: -1 when freecnt=0; 1~DTPAGEMAXSLOT-1 when non-zero,
      with linked list checks (no duplicates, proper termination via next=-1).
    - stblindex bounds: must be within range that avoids overlapping with
      stbl itself (stblindex < DTPAGEMAXSLOT - stblsize).
    - nextindex bounded by stbl size (stblsize << L2DTSLOTSIZE). stbl entries
      validity: within 1~DTPAGEMAXSLOT-1, no duplicates(excluding invalid
      entries marked as -1).
    
    Invoked when loading dtpage (in BT_GETPAGE macro context) to catch
    corruption early before directory operations trigger out-of-bounds access.
    
    Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 8abd9c7663ea..7669e268fe35 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -115,10 +115,7 @@ struct dtsplit {
 do {									\
 	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
 	if (!(RC)) {							\
-		if (((P)->header.nextindex >				\
-		     (((BN) == 0) ? DTROOTMAXSLOT : (P)->header.maxslot)) || \
-		    ((BN) && (((P)->header.maxslot > DTPAGEMAXSLOT) ||	\
-		    ((P)->header.stblindex >= DTPAGEMAXSLOT)))) {	\
+		if ((BN) && !check_dtpage(P)) {				\
 			BT_PUTPAGE(MP);					\
 			jfs_error((IP)->i_sb,				\
 				  "DT_GETPAGE: dtree page corrupt\n");	\
@@ -4383,3 +4380,107 @@ bool check_dtroot(dtroot_t *p)
 
 	return true;
 }
+
+bool check_dtpage(dtpage_t *p)
+{
+	DECLARE_BITMAP(bitmap, DTPAGEMAXSLOT) = {0};
+	const int stblsize = ((PSIZE >> L2DTSLOTSIZE) + 31) >> L2DTSLOTSIZE;
+	int i;
+
+	/* Validate maxslot (maximum number of slots in the page)
+	 * dtpage_t slot array is defined to hold up to DTPAGEMAXSLOT (128) slots
+	 */
+	if (unlikely(p->header.maxslot != DTPAGEMAXSLOT)) {
+		jfs_err("Bad maxslot:%d in dtpage (expected %d)\n",
+				p->header.maxslot, DTPAGEMAXSLOT);
+		return false;
+	}
+
+	/* freecnt cannot be negative or exceed DTPAGEMAXSLOT-1
+	 * (since slot[0] is occupied by the header).
+	 */
+	if (unlikely(p->header.freecnt < 0 ||
+				p->header.freecnt > DTPAGEMAXSLOT - 1)) {
+		jfs_err("Bad freecnt:%d in dtpage\n", p->header.freecnt);
+		return false;
+	} else if (p->header.freecnt == 0) {
+		/* No free slots: freelist must be -1 */
+		if (unlikely(p->header.freelist != -1)) {
+			jfs_err("freecnt=0 but freelist=%d in dtpage\n",
+					p->header.freelist);
+			return false;
+		}
+	} else {
+		int fsi;
+		/* When there are free slots, freelist must be a valid slot index in
+		 * 1~DTROOTMAXSLOT-1(since slot[0] is occupied by the header).
+		 */
+		if (unlikely(p->header.freelist < 1 ||
+					p->header.freelist >= DTPAGEMAXSLOT)) {
+			jfs_err("Bad freelist:%d in dtpage\n", p->header.freelist);
+			return false;
+		}
+
+		/* Traverse the free list to check validity of all node indices */
+		fsi = p->header.freelist;
+		for (i = 0; i < p->header.freecnt - 1; i++) {
+			/* Check for duplicate indices in the free list */
+			if (unlikely(__test_and_set_bit(fsi, bitmap))) {
+				jfs_err("duplicate index%d in slot in dtpage\n", fsi);
+				return false;
+			}
+			fsi = p->slot[fsi].next;
+
+			/* Ensure the next slot index in the free list is valid */
+			if (unlikely(fsi < 1 || fsi >= DTPAGEMAXSLOT)) {
+				jfs_err("Bad index:%d in slot in dtpage\n", fsi);
+				return false;
+			}
+		}
+
+		/* The last node in the free list must terminate with next = -1 */
+		if (unlikely(p->slot[fsi].next != -1)) {
+			jfs_err("Bad next:%d of the last slot in dtpage\n",
+					p->slot[fsi].next);
+			return false;
+		}
+	}
+
+	/* stbl must be little then DTPAGEMAXSLOT */
+	if (unlikely(p->header.stblindex >= DTPAGEMAXSLOT - stblsize)) {
+		jfs_err("Bad stblindex:%d in dtpage (stbl size %d)\n",
+				p->header.stblindex, stblsize);
+		return false;
+	}
+
+	/* nextindex must be little then stblsize*32 */
+	if (unlikely(p->header.nextindex > (stblsize << L2DTSLOTSIZE))) {
+		jfs_err("Bad nextindex:%d in dtpage (stbl size %d)\n",
+				p->header.nextindex, stblsize);
+		return false;
+	}
+
+	/* Validate stbl entries
+	 * Each entry is a slot index, valid range: -1 (invalid) or
+	 * [0, nextindex-1] (valid data slots)
+	 * (stblindex and higher slots are reserved for stbl itself)
+	 */
+	for (i = 0; i < p->header.nextindex; i++) {
+		int idx = DT_GETSTBL(p)[i];
+
+		/* Check if index is out of valid data slot range */
+		if (unlikely(idx < 1 || idx >= DTPAGEMAXSLOT)) {
+			jfs_err("Bad stbl[%d] index:%d (stblindex %d) in dtpage\n",
+					i, idx, p->header.stblindex);
+			return false;
+		}
+
+		/* Check for duplicate valid indices (skip -1) */
+		if (unlikely(__test_and_set_bit(idx, bitmap))) {
+			jfs_err("Duplicate index:%d in stbl of dtpage\n", idx);
+			return false;
+		}
+	}
+
+	return true;
+}
diff --git a/fs/jfs/jfs_dtree.h b/fs/jfs/jfs_dtree.h
index 94dc16123c87..dfc87b6690a9 100644
--- a/fs/jfs/jfs_dtree.h
+++ b/fs/jfs/jfs_dtree.h
@@ -255,4 +255,6 @@ extern int dtModify(tid_t tid, struct inode *ip, struct component_name * key,
 extern int jfs_readdir(struct file *file, struct dir_context *ctx);
 
 extern bool check_dtroot(dtroot_t *p);
+
+extern bool check_dtpage(dtpage_t *p);
 #endif				/* !_H_JFS_DTREE */
]

134/2 2026/06/26 21:17 tool git-show
0m Args:
map[Commit:c83abc766aeb]

Results:
map[Output:commit c83abc766aeb153e69cb46363bf7c9de0c9f3268
Author: Yun Zhou <yun.zhou@windriver.com>
Date:   Thu Nov 20 23:43:50 2025 +0800

    jfs: add dtroot integrity check to prevent index out-of-bounds
    
    Add check_dtroot() to validate dtroot_t integrity, focusing on preventing
    index/pointer overflows from on-disk corruption.
    
    Key checks:
     - freecnt bounded by [0, DTROOTMAXSLOT-1] (slot[0] reserved for header).
     - freelist validity: -1 when freecnt=0; 1~DTROOTMAXSLOT-1 when non-zero,
       with linked list checks (no duplicates, proper termination via next=-1).
     - stbl bounds: nextindex within stbl array size; entries within 0~8, no
       duplicates (excluding idx=0).
    
    Invoked in copy_from_dinode() when loading directory inodes, catching
    corruption early before directory operations trigger out-of-bounds access.
    
    This fixes the following UBSAN warning.
    
    [  101.832754][ T5960] ------------[ cut here ]------------
    [  101.832762][ T5960] UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dtree.c:3713:8
    [  101.832792][ T5960] index -1 is out of range for type 'struct dtslot[128]'
    [  101.832807][ T5960] CPU: 2 UID: 0 PID: 5960 Comm: 5f7f0caf9979e9d Tainted: G            E       6.18.0-rc4-00250-g2603eb907f03 #119 PREEMPT_{RT,(full
    [  101.832817][ T5960] Tainted: [E]=UNSIGNED_MODULE
    [  101.832819][ T5960] Hardware name: QEMU Ubuntu 25.04 PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
    [  101.832823][ T5960] Call Trace:
    [  101.832833][ T5960]  <TASK>
    [  101.832838][ T5960]  dump_stack_lvl+0x189/0x250
    [  101.832909][ T5960]  ? __pfx_dump_stack_lvl+0x10/0x10
    [  101.832925][ T5960]  ? __pfx__printk+0x10/0x10
    [  101.832934][ T5960]  ? rt_mutex_slowunlock+0x493/0x8a0
    [  101.832959][ T5960]  ubsan_epilogue+0xa/0x40
    [  101.832966][ T5960]  __ubsan_handle_out_of_bounds+0xe9/0xf0
    [  101.833007][ T5960]  dtInsertEntry+0x936/0x1430 [jfs]
    [  101.833094][ T5960]  dtSplitPage+0x2c8b/0x3ed0 [jfs]
    [  101.833177][ T5960]  ? __pfx_rt_mutex_slowunlock+0x10/0x10
    [  101.833193][ T5960]  dtInsert+0x109b/0x6000 [jfs]
    [  101.833283][ T5960]  ? rt_mutex_slowunlock+0x493/0x8a0
    [  101.833296][ T5960]  ? __pfx_rt_mutex_slowunlock+0x10/0x10
    [  101.833307][ T5960]  ? rt_spin_unlock+0x161/0x200
    [  101.833315][ T5960]  ? __pfx_dtInsert+0x10/0x10 [jfs]
    [  101.833391][ T5960]  ? txLock+0xaf9/0x1cb0 [jfs]
    [  101.833477][ T5960]  ? dtInitRoot+0x22a/0x670 [jfs]
    [  101.833556][ T5960]  jfs_mkdir+0x6ec/0xa70 [jfs]
    [  101.833636][ T5960]  ? __pfx_jfs_mkdir+0x10/0x10 [jfs]
    [  101.833721][ T5960]  ? generic_permission+0x2e5/0x690
    [  101.833760][ T5960]  ? bpf_lsm_inode_mkdir+0x9/0x20
    [  101.833776][ T5960]  vfs_mkdir+0x306/0x510
    [  101.833786][ T5960]  do_mkdirat+0x247/0x590
    [  101.833795][ T5960]  ? __pfx_do_mkdirat+0x10/0x10
    [  101.833804][ T5960]  ? getname_flags+0x1e5/0x540
    [  101.833815][ T5960]  __x64_sys_mkdir+0x6c/0x80
    [  101.833823][ T5960]  do_syscall_64+0xfa/0xfa0
    [  101.833832][ T5960]  ? lockdep_hardirqs_on+0x9c/0x150
    [  101.833840][ T5960]  ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
    [  101.833847][ T5960]  ? exc_page_fault+0xab/0x100
    [  101.833856][ T5960]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 9ab3f2fc61d1..8abd9c7663ea 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -4297,3 +4297,89 @@ int dtModify(tid_t tid, struct inode *ip,
 
 	return 0;
 }
+
+bool check_dtroot(dtroot_t *p)
+{
+	DECLARE_BITMAP(bitmap, DTROOTMAXSLOT) = {0};
+	int i;
+
+	/* freecnt cannot be negative or exceed DTROOTMAXSLOT-1
+	 * (since slot[0] is occupied by the header).
+	 */
+	if (unlikely(p->header.freecnt < 0 ||
+				p->header.freecnt > DTROOTMAXSLOT - 1)) {
+		jfs_err("Bad freecnt:%d in dtroot\n", p->header.freecnt);
+		return false;
+	} else if (p->header.freecnt == 0) {
+		/* No free slots: freelist must be -1 */
+		if (unlikely(p->header.freelist != -1)) {
+			jfs_err("freecnt=0, but freelist=%d in dtroot\n",
+					p->header.freelist);
+			return false;
+		}
+	} else {
+		int fsi, i;
+		/* When there are free slots, freelist must be a valid slot index in
+		 * 1~DTROOTMAXSLOT-1(since slot[0] is occupied by the header).
+		 */
+		if (unlikely(p->header.freelist < 1 ||
+					p->header.freelist >= DTROOTMAXSLOT)) {
+			jfs_err("Bad freelist:%d in dtroot\n", p->header.freelist);
+			return false;
+		}
+
+		/* Traverse the free list to check validity of all node indices */
+		fsi = p->header.freelist;
+		for (i = 0; i < p->header.freecnt - 1; i++) {
+			/* Check for duplicate indices in the free list */
+			if (unlikely(__test_and_set_bit(fsi, bitmap))) {
+				jfs_err("duplicate index%d in slot in dtroot\n", fsi);
+				return false;
+			}
+			fsi = p->slot[fsi].next;
+
+			/* Ensure the next slot index in the free list is valid */
+			if (unlikely(fsi < 1 || fsi >= DTROOTMAXSLOT)) {
+				jfs_err("Bad index:%d in slot in dtroot\n", fsi);
+				return false;
+			}
+		}
+
+		/* The last node in the free list must terminate with next = -1 */
+		if (unlikely(p->slot[fsi].next != -1)) {
+			jfs_err("Bad next:%d of the last slot in dtroot\n",
+					p->slot[fsi].next);
+			return false;
+		}
+	}
+
+	/* Validate nextindex (next free entry index in stbl)
+	 * stbl array has size 8 (indices 0~7).
+	 * It may get set to 8 when the last free slot has been filled.
+	 */
+	if (unlikely(p->header.nextindex > ARRAY_SIZE(p->header.stbl))) {
+		jfs_err("Bad nextindex:%d in dtroot\n", p->header.nextindex);
+		return false;
+	}
+
+	/* Validate index validity of stbl array (8 elements)
+	 * Each entry in stbl is a slot index, with valid range: -1 (invalid)
+	 * or 0~8 (slot[0]~slot[8])
+	 */
+	for (i = 0; i < p->header.nextindex; i++) {
+		int idx = p->header.stbl[i];
+
+		if (unlikely(idx < 0 || idx >= 9)) {
+			jfs_err("Bad index:%d of stbl[%d] in dtroot\n", idx, i);
+			return false; /* stbl entry points out of slot array range */
+		}
+
+		/* Check for duplicate valid indices (skip check for idx=0) */
+		if (unlikely(idx && __test_and_set_bit(idx, bitmap))) {
+			jfs_err("Duplicate index:%d in stbl in dtroot\n", idx);
+			return false;
+		}
+	}
+
+	return true;
+}
diff --git a/fs/jfs/jfs_dtree.h b/fs/jfs/jfs_dtree.h
index 1758289647a0..94dc16123c87 100644
--- a/fs/jfs/jfs_dtree.h
+++ b/fs/jfs/jfs_dtree.h
@@ -253,4 +253,6 @@ extern int dtModify(tid_t tid, struct inode *ip, struct component_name * key,
 		    ino_t * orig_ino, ino_t new_ino, int flag);
 
 extern int jfs_readdir(struct file *file, struct dir_context *ctx);
+
+extern bool check_dtroot(dtroot_t *p);
 #endif				/* !_H_JFS_DTREE */
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index 294a67327c73..fbb5f7966b75 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -3102,6 +3102,10 @@ static int copy_from_dinode(struct dinode * dip, struct inode *ip)
 
 	if (S_ISDIR(ip->i_mode)) {
 		memcpy(&jfs_ip->u.dir, &dip->u._dir, 384);
+		if (!check_dtroot(&jfs_ip->i_dtroot)) {
+			jfs_error(ip->i_sb, "Corrupt dtroot\n");
+			return -EIO;
+		}
 	} else if (S_ISREG(ip->i_mode) || S_ISLNK(ip->i_mode)) {
 		memcpy(&jfs_ip->i_xtroot, &dip->di_xtroot, 288);
 	} else
]

135/2 2026/06/26 21:17 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16646
							output: 38
							thoughts: 239
						

Thoughts:
**Analyzing Recent Commit and Vulnerability Fixes**

Okay, so I'm looking at these commits, `119e448bb50a` and `c83abc766aeb`, which seem pretty fresh, with a 2025 date... that's probably a typo in the timestamp, or maybe this dataset is from the future, ha! Anyway, they've introduced `check_dtpage()` and `check_dtroot()` which suggests they're aiming to beef up the integrity checks for the `dtpage_t` and `dtroot_t` structures. Good practice.

The core of the proposed fix, as I understand it, involves adding `((bn == 0) != !!(p->header.flag & BT_ROOT))` to `xt_getpage` and `DT_GETPAGE`. I need to think through this conditional carefully, ensuring it aligns with the logic of how `BT_ROOT` is meant to be handled. Essentially, the vulnerability centers around `i_dtroot` corruption causing crashes. That's a classic scenario, and the bug report correctly points out that this same weakness could affect dtree pages – for instance, in a function like `dtDeleteUp`.

The crucial bit, and what I want to ensure I haven't missed, is the statement: "The exact same vulnerability exists for dtree pages... The `DT_GETPAGE` macro should be updated to enforce the same `BT_ROOT` invariant". It reinforces that `DT_GETPAGE` needs the same protection. I need to make sure this fix is comprehensive, so I should now check for any other related commits, especially those that touch `xt_getpage` or the `BT_ROOT` flag, just to get a broader understanding of the overall approach to this issue. Let's see if there's any related work.



136/2 2026/06/26 21:17 tool git-log
0m Args:
map[CodeRegexp:BT_ROOT PathPrefix:fs/jfs/ Since:3 years]

Results:
map[Output:]

137/2 2026/06/26 21:17 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17333
							output: 31
							thoughts: 23
						

Thoughts:
Here's my take on the situation:

**Investigating the Build Tooling Repository**

Okay, so I'm digging into this code repository, specifically looking for changes related to `BT_ROOT`. It's been a while, apparently – the initial query returned *nothing* matching that pattern in the last three years. Hmm, that's definitely not what I expected. Three years is a long time in a rapidly evolving codebase, especially something as foundational as a build tool root. I need to rethink my approach. My initial query was probably too specific, or perhaps it's using a different naming convention. Let's start by backing off the time constraint completely. I need to broaden the search, removing that `Since` parameter. See if that gets me anywhere. It's time to refine my strategy.



138/2 2026/06/26 21:17 tool git-log
0m Args:
map[CodeRegexp:BT_ROOT PathPrefix:fs/jfs/]

Results:
map[Output:e471e5942c00 fs/jfs: Remove dead code
fec1878fe952 jfs: remove xtLookupList()
1da177e4c3f4 Linux-2.6.12-rc2
]

139/2 2026/06/26 21:17 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17633
							output: 45
							thoughts: 12
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Analyzing `xt_getpage` History**

Okay, first things first, I need to understand what's been happening with `xt_getpage`. I'm mentally pulling up the historical logs and change records related to that function, probably looking at revision control entries, performance monitoring data, and any recent deployments that might have impacted its behavior. My focus is on identifying any patterns or anomalies. Was there a specific commit that introduced a regression? Are there certain time periods where response times are abnormally high or errors are elevated? I'm cross-referencing this against recent system-wide changes, database load, and network conditions to see if the issue is isolated to `xt_getpage` or if it's symptomatic of a broader problem. I'm implicitly considering the various ways `xt_getpage` might be called - the different contexts and parameters - and if that information is readily available in the logging. Ultimately, I'm trying to quickly form a hypothesis about the root cause and determine the next steps for debugging. This could involve stepping through the code, profiling the function, or perhaps focusing on the data it consumes.



140/2 2026/06/26 21:17 tool git-log
0m Error:
log-in to see details

Args:
map[PathPrefix:fs/jfs/jfs_xtree.c Since:3 years SymbolName:xt_getpage]

Results:
map[Output:]

141/2 2026/06/26 21:17 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17964
							output: 45
							thoughts: 16
						

Thoughts:
Okay, here's the summary, assuming I'm thinking about the connection between a symbol name and its source path:

**Thinking About Symbol Names and Source Paths**

Right, so I'm processing this information, and it's hitting me: the relationship between this `SymbolName` and `SourcePath` – they're intrinsically linked. It's not a suggestion, it's a fundamental pairing. You can't really have one without the other in any meaningful context.

`SymbolName` gives you *what* you're dealing with – a variable, a function, a class, whatever. But it's the `SourcePath` that tells you *where* to find the definition, the implementation, the declaration. It's the grounding.

I can immediately think of several scenarios where this connection is crucial. Debugging? Absolutely. Refactoring? Essential. Code analysis? Forget about it without knowing both. Any kind of tooling that needs to understand the structure and location of code *must* link these pieces together. Without them, you're essentially blind.



142/2 2026/06/26 21:18 tool git-log
0m Args:
map[Since:3 years SourcePath:fs/jfs/jfs_xtree.c SymbolName:xt_getpage]

Results:
map[Output:1014354cd8d4 jfs: jfs_xtree: replace XT_GETPAGE macro with xt_getpage()
]

143/2 2026/06/26 21:18 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 18298
							output: 26
							thoughts: 18
						

Thoughts:
Okay, let's dive into this. Here's my take on those thoughts, as if they're my own:

**Analyzing the Identifier: `1014354cd8d4`**

Right, so we're starting with this identifier, `1014354cd8d4`. My immediate instinct, given my experience, is to start dissecting it. Based on its format, it *looks* like a hexadecimal string, which is highly suggestive. I'm already mentally running through the typical contexts where I encounter such identifiers: is this a hash, a transaction ID, a database key, a unique user identifier, or something entirely different? The length is also crucial. A longer hex string typically implies greater entropy and, consequently, a potentially larger key space or a complex piece of encoded data. Conversely, shorter strings may have specific meanings depending on the system in which they are used. The specific prefix or suffix if any, can also be useful, sometimes the first bits describe the structure, or the type of object. Without more context, I'm already forming hypotheses based on probability and likely scenarios. My next step would be to figure out *where* I've encountered similar strings before. If there's any related documentation, I’m reading it immediately!



144/2 2026/06/26 21:18 tool git-show
0m Args:
map[Commit:1014354cd8d4]

Results:
map[Output:commit 1014354cd8d40e81e9a6e9037a10ebfc0b656d27
Author: Suchit Karunakaran <suchitkarunakaran@gmail.com>
Date:   Thu Jun 5 23:26:34 2025 +0530

    jfs: jfs_xtree: replace XT_GETPAGE macro with xt_getpage()
    
    Replace legacy XT_GETPAGE macro with an inline function that returns a
    xtpage_t pointer and update all instances of XT_GETPAGE in jfs_xtree.c
    
    Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
    
    Simplified xt_getpage by removing size and rc arguments.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 5ee618d17e77..28c3cf960c6f 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -49,26 +49,6 @@
 
 #define XT_PAGE(IP, MP) BT_PAGE(IP, MP, xtpage_t, i_xtroot)
 
-/* get page buffer for specified block address */
-/* ToDo: Replace this ugly macro with a function */
-#define XT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
-do {									\
-	BT_GETPAGE(IP, BN, MP, xtpage_t, SIZE, P, RC, i_xtroot);	\
-	if (!(RC)) {							\
-		if ((le16_to_cpu((P)->header.nextindex) < XTENTRYSTART) || \
-		    (le16_to_cpu((P)->header.nextindex) >		\
-		     le16_to_cpu((P)->header.maxentry)) ||		\
-		    (le16_to_cpu((P)->header.maxentry) >		\
-		     (((BN) == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) { \
-			jfs_error((IP)->i_sb,				\
-				  "XT_GETPAGE: xtree page corrupt\n");	\
-			BT_PUTPAGE(MP);					\
-			MP = NULL;					\
-			RC = -EIO;					\
-		}							\
-	}								\
-} while (0)
-
 /* for consistency */
 #define XT_PUTPAGE(MP) BT_PUTPAGE(MP)
 
@@ -114,6 +94,42 @@ static int xtSplitPage(tid_t tid, struct inode *ip, struct xtsplit * split,
 static int xtSplitRoot(tid_t tid, struct inode *ip,
 		       struct xtsplit * split, struct metapage ** rmpp);
 
+/*
+ *	xt_getpage()
+ *
+ * function:	get the page buffer for a specified block address.
+ *
+ * parameters:
+ *	ip      - pointer to the inode
+ *	bn      - block number (s64) of the xtree page to be retrieved;
+ *	mp      - pointer to a metapage pointer where the page buffer is returned;
+ *
+ * returns:
+ *      A pointer to the xtree page (xtpage_t) on success, -EIO on error.
+ */
+
+static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
+{
+	xtpage_t *p;
+	int rc;
+
+	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);
+
+	if (rc)
+		return ERR_PTR(rc);
+	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
+		(le16_to_cpu(p->header.nextindex) >
+			le16_to_cpu(p->header.maxentry)) ||
+		(le16_to_cpu(p->header.maxentry) >
+			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
+		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
+		BT_PUTPAGE(*mp);
+		*mp = NULL;
+		return ERR_PTR(-EIO);
+	}
+	return p;
+}
+
 /*
  *	xtLookup()
  *
@@ -216,7 +232,6 @@ static int xtSearch(struct inode *ip, s64 xoff,	s64 *nextp,
 		    int *cmpp, struct btstack * btstack, int flag)
 {
 	struct jfs_inode_info *jfs_ip = JFS_IP(ip);
-	int rc = 0;
 	int cmp = 1;		/* init for empty page */
 	s64 bn;			/* block number */
 	struct metapage *mp;	/* page buffer */
@@ -252,9 +267,9 @@ static int xtSearch(struct inode *ip, s64 xoff,	s64 *nextp,
 	 */
 	for (bn = 0;;) {
 		/* get/pin the page to search */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		/* try sequential access heuristics with the previous
 		 * access entry in target leaf page:
@@ -807,10 +822,10 @@ xtSplitUp(tid_t tid,
 		 * insert router entry in parent for new right child page <rp>
 		 */
 		/* get/pin the parent page <sp> */
-		XT_GETPAGE(ip, parent->bn, smp, PSIZE, sp, rc);
-		if (rc) {
+		sp = xt_getpage(ip, parent->bn, &smp);
+		if (IS_ERR(sp)) {
 			XT_PUTPAGE(rcmp);
-			return rc;
+			return PTR_ERR(sp);
 		}
 
 		/*
@@ -1062,10 +1077,10 @@ xtSplitPage(tid_t tid, struct inode *ip,
 	 * update previous pointer of old next/right page of <sp>
 	 */
 	if (nextbn != 0) {
-		XT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
-		if (rc) {
+		p = xt_getpage(ip, nextbn, &mp);
+		if (IS_ERR(p)) {
 			XT_PUTPAGE(rmp);
-			goto clean_up;
+			return PTR_ERR(p);
 		}
 
 		BT_MARK_DIRTY(mp, ip);
@@ -1417,9 +1432,9 @@ int xtExtend(tid_t tid,		/* transaction id */
 			return rc;
 
 		/* get back old page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 		/*
 		 * if leaf root has been split, original root has been
 		 * copied to new child page, i.e., original entry now
@@ -1433,9 +1448,9 @@ int xtExtend(tid_t tid,		/* transaction id */
 			XT_PUTPAGE(mp);
 
 			/* get new child page */
-			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-			if (rc)
-				return rc;
+			p = xt_getpage(ip, bn, &mp);
+			if (IS_ERR(p))
+				return PTR_ERR(p);
 
 			BT_MARK_DIRTY(mp, ip);
 			if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -1711,9 +1726,9 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 			return rc;
 
 		/* get back old page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 		/*
 		 * if leaf root has been split, original root has been
 		 * copied to new child page, i.e., original entry now
@@ -1727,9 +1742,9 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 			XT_PUTPAGE(mp);
 
 			/* get new child page */
-			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-			if (rc)
-				return rc;
+			p = xt_getpage(ip, bn, &mp);
+			if (IS_ERR(p))
+				return PTR_ERR(p);
 
 			BT_MARK_DIRTY(mp, ip);
 			if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -1788,9 +1803,9 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 		XT_PUTPAGE(mp);
 
 		/* get new right page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		BT_MARK_DIRTY(mp, ip);
 		if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -1864,9 +1879,9 @@ printf("xtUpdate.updateLeft.split p:0x%p\n", p);
 			return rc;
 
 		/* get back old page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		/*
 		 * if leaf root has been split, original root has been
@@ -1881,9 +1896,9 @@ printf("xtUpdate.updateLeft.split p:0x%p\n", p);
 			XT_PUTPAGE(mp);
 
 			/* get new child page */
-			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-			if (rc)
-				return rc;
+			p = xt_getpage(ip, bn, &mp);
+			if (IS_ERR(p))
+				return PTR_ERR(p);
 
 			BT_MARK_DIRTY(mp, ip);
 			if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -2187,7 +2202,6 @@ void xtInitRoot(tid_t tid, struct inode *ip)
  */
 s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 {
-	int rc = 0;
 	s64 teof;
 	struct metapage *mp;
 	xtpage_t *p;
@@ -2268,9 +2282,9 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 	 * first access of each page:
 	 */
       getPage:
-	XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-	if (rc)
-		return rc;
+	p = xt_getpage(ip, bn, &mp);
+	if (IS_ERR(p))
+		return PTR_ERR(p);
 
 	/* process entries backward from last index */
 	index = le16_to_cpu(p->header.nextindex) - 1;
@@ -2506,9 +2520,9 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 
 	/* get back the parent page */
 	bn = parent->bn;
-	XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-	if (rc)
-		return rc;
+	p = xt_getpage(ip, bn, &mp);
+	if (IS_ERR(p))
+		return PTR_ERR(p);
 
 	index = parent->index;
 
@@ -2791,9 +2805,9 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
 		 * first access of each page:
 		 */
       getPage:
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		/* process entries backward from last index */
 		index = le16_to_cpu(p->header.nextindex) - 1;
@@ -2836,9 +2850,9 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
 
 	/* get back the parent page */
 	bn = parent->bn;
-	XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-	if (rc)
-		return rc;
+	p = xt_getpage(ip, bn, &mp);
+	if (IS_ERR(p))
+		return PTR_ERR(p);
 
 	index = parent->index;
 
]

145/2 2026/06/26 21:18 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 22319
							output: 29
							thoughts: 122
						

Thoughts:
**Analyzing a File System Vulnerability**

Okay, so this `xt_getpage` function was added a while back, back in June 2025 – that commit `1014354cd8d4` rings a bell. The bug report is interesting, it specifically calls out how a similar vulnerability exists with dtree pages, and mentions a potential crash in `dtDeleteUp` if the `i_dtroot` value is corrupted. The core of the problem seems to stem from a weakness in `DT_GETPAGE`. The explanation points to a missing invariant check, specifically a missing `BT_ROOT` check, which suggests we need to look at how that macro works. Right, time to dig into the code… Let's check out `DT_GETPAGE` in `fs/jfs/jfs_dtree.c` and see what's what.



146/2 2026/06/26 21:19 tool grepper
0m Args:
map[Expression:DT_GETPAGE PathPrefix:fs/jfs/]

Results:
map[Output:fs/jfs/jfs_dtree.c=102=struct dtsplit {
--
fs/jfs/jfs_dtree.c-113-/* get page buffer for specified block address */
fs/jfs/jfs_dtree.c:114:#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
fs/jfs/jfs_dtree.c-115-do {									\
--
fs/jfs/jfs_dtree.c-120-			jfs_error((IP)->i_sb,				\
fs/jfs/jfs_dtree.c:121:				  "DT_GETPAGE: dtree page corrupt\n");	\
fs/jfs/jfs_dtree.c-122-			MP = NULL;					\
--
fs/jfs/jfs_dtree.c=565=int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
--
fs/jfs/jfs_dtree.c-620-		/* get/pin the page to search */
fs/jfs/jfs_dtree.c:621:		DT_GETPAGE(ip, bn, mp, psize, p, rc);
fs/jfs/jfs_dtree.c-622-		if (rc)
--
fs/jfs/jfs_dtree.c=923=static int dtSplitUp(tid_t tid,
--
fs/jfs/jfs_dtree.c-1130-		/* get the parent page <sp> */
fs/jfs/jfs_dtree.c:1131:		DT_GETPAGE(ip, parent->bn, smp, PSIZE, sp, rc);
fs/jfs/jfs_dtree.c-1132-		if (rc) {
--
fs/jfs/jfs_dtree.c=1323=static int dtSplitPage(tid_t tid, struct inode *ip, struct dtsplit * split,
--
fs/jfs/jfs_dtree.c-1467-	if (nextbn != 0) {
fs/jfs/jfs_dtree.c:1468:		DT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-1469-		if (rc) {
--
fs/jfs/jfs_dtree.c=1635=static int dtExtendPage(tid_t tid,
--
fs/jfs/jfs_dtree.c-1665-	parent = BT_POP(btstack);
fs/jfs/jfs_dtree.c:1666:	DT_GETPAGE(ip, parent->bn, pmp, PSIZE, pp, rc);
fs/jfs/jfs_dtree.c-1667-	if (rc)
--
fs/jfs/jfs_dtree.c=2075=int dtDelete(tid_t tid,
--
fs/jfs/jfs_dtree.c-2122-				/* Read next leaf page */
fs/jfs/jfs_dtree.c:2123:				DT_GETPAGE(ip, le64_to_cpu(p->header.next),
fs/jfs/jfs_dtree.c-2124-					   nmp, PSIZE, np, rc);
--
fs/jfs/jfs_dtree.c=2230=static int dtDeleteUp(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_dtree.c-2300-		/* pin the parent page <sp> */
fs/jfs/jfs_dtree.c:2301:		DT_GETPAGE(ip, parent->bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2302-		if (rc)
--
fs/jfs/jfs_dtree.c=2442=static int dtRelink(tid_t tid, struct inode *ip, dtpage_t * p)
--
fs/jfs/jfs_dtree.c-2455-	if (nextbn != 0) {
fs/jfs/jfs_dtree.c:2456:		DT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2457-		if (rc)
--
fs/jfs/jfs_dtree.c-2484-	if (prevbn != 0) {
fs/jfs/jfs_dtree.c:2485:		DT_GETPAGE(ip, prevbn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2486-		if (rc)
--
fs/jfs/jfs_dtree.c=2613=static int add_missing_indices(struct inode *inode, s64 bn)
--
fs/jfs/jfs_dtree.c-2628-
fs/jfs/jfs_dtree.c:2629:	DT_GETPAGE(inode, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2630-
fs/jfs/jfs_dtree.c-2631-	if (rc) {
fs/jfs/jfs_dtree.c:2632:		printk(KERN_ERR "DT_GETPAGE failed!\n");
fs/jfs/jfs_dtree.c-2633-		goto end;
--
fs/jfs/jfs_dtree.c=2711=int jfs_readdir(struct file *file, struct dir_context *ctx)
--
fs/jfs/jfs_dtree.c-2793-			index = dirtab_slot.slot;
fs/jfs/jfs_dtree.c:2794:			DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2795-			if (rc) {
--
fs/jfs/jfs_dtree.c-3037-
fs/jfs/jfs_dtree.c:3038:		DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3039-		if (rc) {
--
fs/jfs/jfs_dtree.c=3057=static int dtReadFirst(struct inode *ip, struct btstack * btstack)
--
fs/jfs/jfs_dtree.c-3075-	for (bn = 0;;) {
fs/jfs/jfs_dtree.c:3076:		DT_GETPAGE(ip, bn, mp, psize, p, rc);
fs/jfs/jfs_dtree.c-3077-		if (rc)
--
fs/jfs/jfs_dtree.c=3136=static int dtReadNext(struct inode *ip, loff_t * offset,
--
fs/jfs/jfs_dtree.c-3219-	bn = parent->bn;
fs/jfs/jfs_dtree.c:3220:	DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3221-	if (rc)
--
fs/jfs/jfs_dtree.c-3240-		/* get next parent page */
fs/jfs/jfs_dtree.c:3241:		DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3242-		if (rc)
--
fs/jfs/jfs_dtree.c-3260-      c:
fs/jfs/jfs_dtree.c:3261:	DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3262-	if (rc)
--
fs/jfs/jfs_dtree.c-3281-		/* get next leaf page */
fs/jfs/jfs_dtree.c:3282:		DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3283-		if (rc)
]

147/2 2026/06/26 21:19 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24840
							output: 40
							thoughts: 28
						

Thoughts:
Okay, let's dive into this. Here's my thought process on this:

**Investigating the `DT_GETPAGE` Definition**

Alright, I need to understand what `DT_GETPAGE` does, and the best place to start is always the source code. Let me check the definition for `DT_GETPAGE` in `fs/jfs/jfs_dtree.c`. That file is where I expect to find the details relating to the data tree manipulation within the JFS filesystem, so this is a logical place to begin digging.



148/2 2026/06/26 21:19 tool read-file
0m Args:
map[File:fs/jfs/jfs_dtree.c FirstLine:110 LineCount:20]

Results:
map[Contents: 110:	
 111:	#define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 112:	
 113:	/* get page buffer for specified block address */
 114:	#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
 115:	do {									\
 116:		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
 117:		if (!(RC)) {							\
 118:			if ((BN) && !check_dtpage(P)) {				\
 119:				BT_PUTPAGE(MP);					\
 120:				jfs_error((IP)->i_sb,				\
 121:					  "DT_GETPAGE: dtree page corrupt\n");	\
 122:				MP = NULL;					\
 123:				RC = -EIO;					\
 124:			}							\
 125:		}								\
 126:	} while (0)
 127:	
 128:	/* for consistency */
 129:	#define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
]

149/2 2026/06/26 21:19 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 25377
							output: 28
							thoughts: 493
						

Thoughts:
**Analyzing the JFS `DT_GETPAGE` Vulnerability and Potential Solutions**

Okay, so `DT_GETPAGE` is still a macro lurking in `fs/jfs/jfs_dtree.c`. The explanation immediately flags a potential vulnerability – a corruption in `i_dtroot` could lead to crashes in functions like `dtDeleteUp`. The suggested fix proposes updating `DT_GETPAGE` itself, which, if I understand correctly, aims to enforce the `BT_ROOT` invariant. It looks like the change will integrate `BT_GETPAGE` and add checks to verify if the accessed dtree page is the root page as expected, and also check page validity. This makes sense; it's a straightforward attempt to ensure data integrity during page retrieval.

Now, the real question is whether this is an isolated issue or part of a broader pattern of vulnerabilities within JFS. The prompt is spot on; I need to look for similar bug fixes within the JFS codebase, specifically in this area. My goal is to extract idioms, locking rules, or general patterns that were followed in the past to address bugs that have the same root cause. I'll need to go back over the recent JFS commits, and look for fixes that involved similar error paths, missing locks, or refcounting issues. I'll need to examine how the JFS developers typically handled these kinds of integrity problems to determine the best approach here.



150/2 2026/06/26 21:19 tool git-log
0m Args:
map[PathPrefix:fs/jfs/ Since:3 years]

Results:
map[Output:a7cf1da7ac01 fs: Fix return in jfs_mkdir and orangefs_mkdir
dad98c5b2a05 jfs: avoid -Wtautological-constant-out-of-range-compare warning again
679330e4a7af JFS: always load filesystem UUID during mount
ca5848ae87d2 jfs: hold LOG_LOCK on umount to avoid null-ptr-deref
b15e4310633f jfs: Set the lbmDone flag at the end of lbmIODone
3c778ec88208 jfs: fix corrupted list in dbUpdatePMap
cce219b203c4 jfs: add dmapctl integrity check to prevent invalid operations
119e448bb50a jfs: add dtpage integrity check to prevent index/pointer overflows
c83abc766aeb jfs: add dtroot integrity check to prevent index out-of-bounds
0b2600f81cef treewide: change inode->i_ino from unsigned long to u64
]

151/2 2026/06/26 21:19 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 26474
							output: 33
							thoughts: 11
						

Thoughts:
Here's your summary:

**Thinking About Commit Limits**

Okay, I'm trying to get a better overview here. I'm hitting a roadblock in seeing enough of the commit history to really understand what's been happening. The current display seems too restrictive. My initial thought is, let's just *increase the limit*! Let's bump that number up and see what that gets us. I'm betting that'll immediately provide a more complete picture, enabling me to analyze the recent development activity more effectively. It's a fundamental troubleshooting step - before I start digging into filters or more complex querying, let's make sure I'm seeing enough of the underlying data. This will save me from assuming I have everything when, in fact, I'm only seeing the tip of the iceberg!



152/2 2026/06/26 21:19 tool git-log
0m Args:
map[Count:50 PathPrefix:fs/jfs/ Since:3 years]

Results:
map[Output:a7cf1da7ac01 fs: Fix return in jfs_mkdir and orangefs_mkdir
dad98c5b2a05 jfs: avoid -Wtautological-constant-out-of-range-compare warning again
679330e4a7af JFS: always load filesystem UUID during mount
ca5848ae87d2 jfs: hold LOG_LOCK on umount to avoid null-ptr-deref
b15e4310633f jfs: Set the lbmDone flag at the end of lbmIODone
3c778ec88208 jfs: fix corrupted list in dbUpdatePMap
cce219b203c4 jfs: add dmapctl integrity check to prevent invalid operations
119e448bb50a jfs: add dtpage integrity check to prevent index/pointer overflows
c83abc766aeb jfs: add dtroot integrity check to prevent index out-of-bounds
0b2600f81cef treewide: change inode->i_ino from unsigned long to u64
bf4afc53b77a Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
69050f8d6d07 treewide: Replace kmalloc with kmalloc_obj for non-scalar types
7833570dae83 jfs: avoid -Wtautological-constant-out-of-range-compare warning
6cbfdf89470e posix_acl: make posix_acl_to_xattr() alloc the buffer
7dd596bb35e5 jfs: add setlease file operation
eb0cfcf26571 jfs: Add missing set_freezable() for freezable kthread
9218dc26fd92 jfs: nlink overflow in jfs_rename
a6773e6932cb jfs: Rename _inline to avoid conflict with clang's '-fms-extensions'
b4dbfd8653b3 Coccinelle-based conversion to use ->i_state accessors
cafc6679824a jfs: replace hardcoded magic number with DTPAGEMAXSLOT constant
e551cc21bb0b JFS: Remove redundant 0 value initialization
69f7321ce725 JFS: Remove unnecessary parentheses
300b072df726 jfs: fix uninitialized waitqueue in transaction manager
7a5aa54fba2b jfs: Verify inode mode when loading from disk
fb49a4425cfa treewide: remove MIGRATEPAGE_SUCCESS
856db3759202 jfs: fix metapage reference count leak in dbAllocCtl
e9d8e2bf2320 fs: change write_begin/write_end interface to take struct kiocb *
b89798e79cf7 jfs: stop using write_cache_pages
2d91b3765cd0 jfs: truncate good inode pages when hard link is 0
1014354cd8d4 jfs: jfs_xtree: replace XT_GETPAGE macro with xt_getpage()
2d04df811642 jfs: Regular file corruption check
c214006856ff jfs: upper bound check of tree index in dbAllocAG
ca115d7e7546 tree-wide: s/struct fileattr/struct file_kattr/g
951ea2f4844c fs: convert simple use of generic_file_*_mmap() to .mmap_prepare()
05fb0e666495 new helper: set_default_d_op()
906d7ce3b59d jfs: implement migrate_folio for jfs_metapage_aops
5dff41a86377 jfs: fix array-index-out-of-bounds read in add_missing_indices
a4685408ff6c jfs: Fix null-ptr-deref in jfs_ioc_trim
37bfb464ddca jfs: validate AG parameters in dbMount() to prevent crashes
a8dfb2168906 jfs: add index corruption check to DT_GETPAGE()
88d5baf69082 Change inode_operations.mkdir to return struct dentry *
0d250b1c5248 fs/jfs: consolidate sanity checking in dbMount
ddf2846f22e8 jfs: add sanity check for agwidth in dbMount
b61e69bb1c04 jfs: Prevent copying of nlink with value 0 from disk inode
7fcbf789629c fs/jfs: Prevent integer overflow in AG size calculation
70ca3246ad20 fs/jfs: cast inactags to s64 to prevent potential overflow
9629d7d66c62 jfs: Fix uninit-value access of imap allocated in the diMount() function
fdf480da5837 jfs: fix slab-out-of-bounds read in ea_get()
b5799dd77054 jfs: add check read-only before truncation in jfs_truncate_nolock()
0176e69743ec jfs: add check read-only before txBeginAnon() call
]

153/2 2026/06/26 21:19 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28009
							output: 26
							thoughts: 393
						

Thoughts:
**Analyzing JFS Commit History: Sanity Checks and Corruption Fixes**

Alright, let's dive into some commit history for the JFS file system. My goal here is to get a sense of the types of issues that have been addressed recently, specifically focusing on those related to sanity checks and corruption. Scanning through, I'm seeing a pattern emerge.

First, I've got `a8dfb2168906`, which looks interesting right off the bat. It looks like the team is making a point to protect the data structures at the root level. I see a bunch of commits like `1014354cd8d4`, `2d04df811642`, `5dff41a86377`, `37bfb464ddca`, `0d250b1c5248` and `ddf2846f22e8`, `b61e69bb1c04`, `7fcbf789629c`, `70ca3246ad20`, `119e448bb50a`, `c83abc766aeb`, and `cce219b203c4`. This is a pretty solid cluster of fixes.

These all point towards robustifying the code against various failure modes. It looks like they are handling edge cases involving array indices, integer overflows, potential corruption of critical metadata structures during mounting, and preventing invalid operations. Good to see an explicit focus on data integrity, especially in a mature file system. I'll need to dig into each of these individually to get a better understanding of the specifics, but the general direction is clear.



154/2 2026/06/26 21:20 tool git-show
0m Args:
map[Commit:a8dfb2168906]

Results:
map[Output:commit a8dfb2168906944ea61acfc87846b816eeab882d
Author: Roman Smirnov <r.smirnov@omp.ru>
Date:   Wed Feb 26 11:25:22 2025 +0300

    jfs: add index corruption check to DT_GETPAGE()
    
    If the file system is corrupted, the header.stblindex variable
    may become greater than 127. Because of this, an array access out
    of bounds may occur:
    
    ------------[ cut here ]------------
    UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dtree.c:3096:10
    index 237 is out of range for type 'struct dtslot[128]'
    CPU: 0 UID: 0 PID: 5822 Comm: syz-executor740 Not tainted 6.13.0-rc4-syzkaller-00110-g4099a71718b0 #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
    Call Trace:
     <TASK>
     __dump_stack lib/dump_stack.c:94 [inline]
     dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
     ubsan_epilogue lib/ubsan.c:231 [inline]
     __ubsan_handle_out_of_bounds+0x121/0x150 lib/ubsan.c:429
     dtReadFirst+0x622/0xc50 fs/jfs/jfs_dtree.c:3096
     dtReadNext fs/jfs/jfs_dtree.c:3147 [inline]
     jfs_readdir+0x9aa/0x3c50 fs/jfs/jfs_dtree.c:2862
     wrap_directory_iterator+0x91/0xd0 fs/readdir.c:65
     iterate_dir+0x571/0x800 fs/readdir.c:108
     __do_sys_getdents64 fs/readdir.c:403 [inline]
     __se_sys_getdents64+0x1e2/0x4b0 fs/readdir.c:389
     do_syscall_x64 arch/x86/entry/common.c:52 [inline]
     do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
     </TASK>
    ---[ end trace ]---
    
    Add a stblindex check for corruption.
    
    Reported-by: syzbot <syzbot+9120834fc227768625ba@syzkaller.appspotmail.com>
    Closes: https://syzkaller.appspot.com/bug?extid=9120834fc227768625ba
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 8f85177f284b..93db6eec4465 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -117,7 +117,8 @@ do {									\
 	if (!(RC)) {							\
 		if (((P)->header.nextindex >				\
 		     (((BN) == 0) ? DTROOTMAXSLOT : (P)->header.maxslot)) || \
-		    ((BN) && ((P)->header.maxslot > DTPAGEMAXSLOT))) {	\
+		    ((BN) && (((P)->header.maxslot > DTPAGEMAXSLOT) ||	\
+		    ((P)->header.stblindex >= DTPAGEMAXSLOT)))) {	\
 			BT_PUTPAGE(MP);					\
 			jfs_error((IP)->i_sb,				\
 				  "DT_GETPAGE: dtree page corrupt\n");	\
]

155/2 2026/06/26 21:20 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 30005
							output: 26
							thoughts: 365
						

Thoughts:
**Analyzing JFS Bug Fixes for Pattern Recognition**

Okay, so `a8dfb2168906` initially patched `DT_GETPAGE` with a `stblindex` bound check, but `119e448bb50a` then swapped that out for a call to `check_dtpage(P)`. Interesting. I should note that.

Now, revisiting `1014354cd8d4`, the key is the replacement of the `XT_GETPAGE` macro with the `xt_getpage()` inline function. The bug description highlights the critical invariant: `BT_ROOT` *must* be set if and only if `bn == 0`. The fix clearly targets both `xt_getpage` and `DT_GETPAGE` within the JFS filesystem. The task is to identify common patterns for correcting these types of issues, specifically those related to corrupted images leading to out-of-bounds memory access.

I'm thinking, are there other instances within JFS where a corrupted image can exploit vulnerabilities related to improper data checks? Let's see... the prompt wants to understand how similar issues were tackled in the past within this subsystem and those specific files. It's really asking to see what idioms, locking rules, or common patterns are present in past fixes.

My first thought is to check out `2d04df811642 jfs: Regular file corruption check`. That seems like a promising starting point. I'll need to dig into the commit history and see if I can spot any recurring themes in how these types of vulnerabilities were addressed.



156/2 2026/06/26 21:20 tool git-show
0m Args:
map[Commit:2d04df811642]

Results:
map[Output:commit 2d04df8116426b6c7b9f8b9b371250f666a2a2fb
Author: Edward Adam Davis <eadavis@qq.com>
Date:   Wed Jun 4 14:48:43 2025 +0800

    jfs: Regular file corruption check
    
    The reproducer builds a corrupted file on disk with a negative i_size value.
    Add a check when opening this file to avoid subsequent operation failures.
    
    Reported-by: syzbot+630f6d40b3ccabc8e96e@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=630f6d40b3ccabc8e96e
    Tested-by: syzbot+630f6d40b3ccabc8e96e@syzkaller.appspotmail.com
    Signed-off-by: Edward Adam Davis <eadavis@qq.com>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

diff --git a/fs/jfs/file.c b/fs/jfs/file.c
index 01b6912e60f8..742cadd1f37e 100644
--- a/fs/jfs/file.c
+++ b/fs/jfs/file.c
@@ -44,6 +44,9 @@ static int jfs_open(struct inode *inode, struct file *file)
 {
 	int rc;
 
+	if (S_ISREG(inode->i_mode) && inode->i_size < 0)
+		return -EIO;
+
 	if ((rc = dquot_file_open(inode, file)))
 		return rc;
 
]

157/2 2026/06/26 21:20 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31224
							output: 26
							thoughts: 38
						

Thoughts:
Okay, let's dive into this commit, `5dff41a86377 jfs: fix array-index-out-of-bounds read in add_missing_indices`. *That title alone is a huge red flag*. Index-out-of-bounds errors are nasty, especially in a file system context. They can lead to data corruption, security vulnerabilities, or even system crashes, and I need to be sure the fix is sound. So let's see what's changed and what the root cause was. I'm going to look at the surrounding context, not just the diff itself. This isn't just about spotting the fix; it's about understanding the *why* and ensuring there aren't any other subtle issues lurking.

I'll be looking for comments, error handling, and potential edge cases. Does this fix a systemic problem in the `add_missing_indices` function, or is it a localized fix? Does the code now correctly handle all possible input scenarios? Did they use the right indexing? Is there a subtle off-by-one error lurking in this revised code? Did they test for negative cases and empty or very large arrays? I'll also check if the fix introduces any performance regressions or dependencies that could affect the overall stability of the JFS. It's time to dig deep.



158/2 2026/06/26 21:21 tool git-show
0m Args:
map[Commit:5dff41a86377]

Results:
map[Output:commit 5dff41a86377563f7a2b968aae00d25b4ceb37c9
Author: Aditya Dutt <duttaditya18@gmail.com>
Date:   Tue Apr 1 20:59:16 2025 +0530

    jfs: fix array-index-out-of-bounds read in add_missing_indices
    
    stbl is s8 but it must contain offsets into slot which can go from 0 to
    127.
    
    Added a bound check for that error and return -EIO if the check fails.
    Also make jfs_readdir return with error if add_missing_indices returns
    with an error.
    
    Reported-by: syzbot+b974bd41515f770c608b@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com./bug?extid=b974bd41515f770c608b
    Signed-off-by: Aditya Dutt <duttaditya18@gmail.com>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 93db6eec4465..ab11849cf9cc 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -2613,7 +2613,7 @@ void dtInitRoot(tid_t tid, struct inode *ip, u32 idotdot)
  *	     fsck.jfs should really fix this, but it currently does not.
  *	     Called from jfs_readdir when bad index is detected.
  */
-static void add_missing_indices(struct inode *inode, s64 bn)
+static int add_missing_indices(struct inode *inode, s64 bn)
 {
 	struct ldtentry *d;
 	struct dt_lock *dtlck;
@@ -2622,7 +2622,7 @@ static void add_missing_indices(struct inode *inode, s64 bn)
 	struct lv *lv;
 	struct metapage *mp;
 	dtpage_t *p;
-	int rc;
+	int rc = 0;
 	s8 *stbl;
 	tid_t tid;
 	struct tlock *tlck;
@@ -2647,6 +2647,16 @@ static void add_missing_indices(struct inode *inode, s64 bn)
 
 	stbl = DT_GETSTBL(p);
 	for (i = 0; i < p->header.nextindex; i++) {
+		if (stbl[i] < 0) {
+			jfs_err("jfs: add_missing_indices: Invalid stbl[%d] = %d for inode %ld, block = %lld",
+				i, stbl[i], (long)inode->i_ino, (long long)bn);
+			rc = -EIO;
+
+			DT_PUTPAGE(mp);
+			txAbort(tid, 0);
+			goto end;
+		}
+
 		d = (struct ldtentry *) &p->slot[stbl[i]];
 		index = le32_to_cpu(d->index);
 		if ((index < 2) || (index >= JFS_IP(inode)->next_index)) {
@@ -2664,6 +2674,7 @@ static void add_missing_indices(struct inode *inode, s64 bn)
 	(void) txCommit(tid, 1, &inode, 0);
 end:
 	txEnd(tid);
+	return rc;
 }
 
 /*
@@ -3017,7 +3028,8 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
 		}
 
 		if (fix_page) {
-			add_missing_indices(ip, bn);
+			if ((rc = add_missing_indices(ip, bn)))
+				goto out;
 			page_fixed = 1;
 		}
 
]

159/2 2026/06/26 21:21 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 32673
							output: 26
							thoughts: 31
						

Thoughts:
Okay, let's dive into this commit, `cce219b203c4 jfs: add dmapctl integrity check to prevent invalid operations`. My initial thought is, "Ah, good, a proactive measure against corruption, always a welcome sight." I see this is related to JFS, which is a filesystem, and the specific area of focus is `dmapctl`, which I immediately recognize as the "dynamic map control" subsystem. That rings alarm bells—any change near the core structures of how the filesystem manages its free space warrants extra scrutiny.

My expert instinct tells me that "preventing invalid operations" is the key phrase here. It sounds like they're identifying a potential flaw, a vulnerability where a malformed or corrupted `dmapctl` could lead to serious problems: data loss, filesystem corruption, or even complete system crashes. This is exactly the kind of bug that *needs* catching. I'm wondering what the specific nature of the integrity check is. Is it a simple sanity check on values? Or a more robust verification of consistency with other data structures? I need to know the specifics to assess the effectiveness.

I'm mentally preparing to consider things like, what edge cases are they protecting against? What are the potential performance impacts of this check? Will it add significant overhead to common filesystem operations? And, is this integrated cleanly into the existing error handling? It's crucial that this check not just detect problems, but also gracefully handle them. I anticipate I'll be digging into the code soon, evaluating the implementation's robustness and how well it addresses the risk. I'm also curious to see if this is related to any existing bug reports or known issues in JFS.



160/2 2026/06/26 21:21 tool git-show
0m Args:
map[Commit:cce219b203c4]

Results:
map[Output:commit cce219b203c4b9cb445e910c7090d1f58af847c5
Author: Yun Zhou <yun.zhou@windriver.com>
Date:   Fri Nov 28 23:51:50 2025 +0800

    jfs: add dmapctl integrity check to prevent invalid operations
    
    Add check_dmapctl() to validate dmapctl structure integrity, focusing on
    preventing invalid operations caused by on-disk corruption.
    
    Key checks:
     - nleafs bounded by [0, LPERCTL] (maximum leaf nodes per dmapctl).
     - l2nleafs bounded by [0, L2LPERCTL] and consistent with nleafs
       (nleafs must be 2^l2nleafs).
     - leafidx must be exactly CTLLEAFIND (expected leaf index position).
     - height bounded by [0, L2LPERCTL >> 1] (valid tree height range).
     - budmin validity: NOFREE only if nleafs=0; otherwise >= BUDMIN.
     - Leaf nodes fit within stree array (leafidx + nleafs <= CTLTREESIZE).
     - Leaf node values are either non-negative or NOFREE.
    
    Invoked in dbAllocAG(), dbFindCtl(), dbAdjCtl() and dbExtendFS() when
    accessing dmapctl pages, catching corruption early before dmap operations
    trigger invalid memory access or logic errors.
    
    This fixes the following UBSAN warning.
    
    [58245.668090][T14017] ------------[ cut here ]------------
    [58245.668103][T14017] UBSAN: shift-out-of-bounds in fs/jfs/jfs_dmap.c:2641:11
    [58245.668119][T14017] shift exponent 110 is too large for 32-bit type 'int'
    [58245.668137][T14017] CPU: 0 UID: 0 PID: 14017 Comm: 4c1966e88c28fa9 Tainted: G            E       6.18.0-rc4-00253-g21ce5d4ba045-dirty #124 PREEMPT_{RT,(full)}
    [58245.668174][T14017] Tainted: [E]=UNSIGNED_MODULE
    [58245.668176][T14017] Hardware name: QEMU Ubuntu 25.04 PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
    [58245.668184][T14017] Call Trace:
    [58245.668200][T14017]  <TASK>
    [58245.668208][T14017]  dump_stack_lvl+0x189/0x250
    [58245.668288][T14017]  ? __pfx_dump_stack_lvl+0x10/0x10
    [58245.668301][T14017]  ? __pfx__printk+0x10/0x10
    [58245.668315][T14017]  ? lock_metapage+0x303/0x400 [jfs]
    [58245.668406][T14017]  ubsan_epilogue+0xa/0x40
    [58245.668422][T14017]  __ubsan_handle_shift_out_of_bounds+0x386/0x410
    [58245.668462][T14017]  dbSplit+0x1f8/0x200 [jfs]
    [58245.668543][T14017]  dbAdjCtl+0x34c/0xa20 [jfs]
    [58245.668628][T14017]  dbAllocNear+0x2ee/0x3d0 [jfs]
    [58245.668710][T14017]  dbAlloc+0x933/0xba0 [jfs]
    [58245.668797][T14017]  ea_write+0x374/0xdd0 [jfs]
    [58245.668888][T14017]  ? __pfx_ea_write+0x10/0x10 [jfs]
    [58245.668966][T14017]  ? __jfs_setxattr+0x76e/0x1120 [jfs]
    [58245.669046][T14017]  __jfs_setxattr+0xa01/0x1120 [jfs]
    [58245.669135][T14017]  ? __pfx___jfs_setxattr+0x10/0x10 [jfs]
    [58245.669216][T14017]  ? mutex_lock_nested+0x154/0x1d0
    [58245.669252][T14017]  ? __jfs_xattr_set+0xb9/0x170 [jfs]
    [58245.669333][T14017]  __jfs_xattr_set+0xda/0x170 [jfs]
    [58245.669430][T14017]  ? __pfx___jfs_xattr_set+0x10/0x10 [jfs]
    [58245.669509][T14017]  ? xattr_full_name+0x6f/0x90
    [58245.669546][T14017]  ? jfs_xattr_set+0x33/0x60 [jfs]
    [58245.669636][T14017]  ? __pfx_jfs_xattr_set+0x10/0x10 [jfs]
    [58245.669726][T14017]  __vfs_setxattr+0x43c/0x480
    [58245.669743][T14017]  __vfs_setxattr_noperm+0x12d/0x660
    [58245.669756][T14017]  vfs_setxattr+0x16b/0x2f0
    [58245.669768][T14017]  ? __pfx_vfs_setxattr+0x10/0x10
    [58245.669782][T14017]  filename_setxattr+0x274/0x600
    [58245.669795][T14017]  ? __pfx_filename_setxattr+0x10/0x10
    [58245.669806][T14017]  ? getname_flags+0x1e5/0x540
    [58245.669829][T14017]  path_setxattrat+0x364/0x3a0
    [58245.669840][T14017]  ? __pfx_path_setxattrat+0x10/0x10
    [58245.669859][T14017]  ? __se_sys_chdir+0x1b9/0x280
    [58245.669876][T14017]  __x64_sys_lsetxattr+0xbf/0xe0
    [58245.669888][T14017]  do_syscall_64+0xfa/0xfa0
    [58245.669901][T14017]  ? lockdep_hardirqs_on+0x9c/0x150
    [58245.669913][T14017]  ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
    [58245.669927][T14017]  ? exc_page_fault+0xab/0x100
    [58245.669937][T14017]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    Reported-by: syzbot+4c1966e88c28fa96e053@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=4c1966e88c28fa96e053
    Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 2abe8cc02ee6..a841cf21da7d 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -133,6 +133,93 @@ static const s8 budtab[256] = {
 	2, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1
 };
 
+/*
+ * check_dmapctl - Validate integrity of a dmapctl structure
+ * @dcp: Pointer to the dmapctl structure to check
+ *
+ * Return: true if valid, false if corrupted
+ */
+static bool check_dmapctl(struct dmapctl *dcp)
+{
+	s8 budmin = dcp->budmin;
+	u32 nleafs, l2nleafs, leafidx, height;
+	int i;
+
+	nleafs = le32_to_cpu(dcp->nleafs);
+	/* Check basic field ranges */
+	if (unlikely(nleafs > LPERCTL)) {
+		jfs_err("dmapctl: invalid nleafs %u (max %u)",
+			nleafs, LPERCTL);
+		return false;
+	}
+
+	l2nleafs = le32_to_cpu(dcp->l2nleafs);
+	if (unlikely(l2nleafs > L2LPERCTL)) {
+		jfs_err("dmapctl: invalid l2nleafs %u (max %u)",
+			l2nleafs, L2LPERCTL);
+		return false;
+	}
+
+	/* Verify nleafs matches l2nleafs (must be power of two) */
+	if (unlikely((1U << l2nleafs) != nleafs)) {
+		jfs_err("dmapctl: nleafs %u != 2^%u",
+			nleafs, l2nleafs);
+		return false;
+	}
+
+	leafidx = le32_to_cpu(dcp->leafidx);
+	/* Check leaf index matches expected position */
+	if (unlikely(leafidx != CTLLEAFIND)) {
+		jfs_err("dmapctl: invalid leafidx %u (expected %u)",
+			leafidx, CTLLEAFIND);
+		return false;
+	}
+
+	height = le32_to_cpu(dcp->height);
+	/* Check tree height is within valid range */
+	if (unlikely(height > (L2LPERCTL >> 1))) {
+		jfs_err("dmapctl: invalid height %u (max %u)",
+			height, L2LPERCTL >> 1);
+		return false;
+	}
+
+	/* Check budmin is valid (cannot be NOFREE for non-empty tree) */
+	if (budmin == NOFREE) {
+		if (unlikely(nleafs > 0)) {
+			jfs_err("dmapctl: budmin is NOFREE but nleafs %u",
+				nleafs);
+			return false;
+		}
+	} else if (unlikely(budmin < BUDMIN)) {
+		jfs_err("dmapctl: invalid budmin %d (min %d)",
+			budmin, BUDMIN);
+		return false;
+	}
+
+	/* Check leaf nodes fit within stree array */
+	if (unlikely(leafidx + nleafs > CTLTREESIZE)) {
+		jfs_err("dmapctl: leaf range exceeds stree size (end %u > %u)",
+			leafidx + nleafs, CTLTREESIZE);
+		return false;
+	}
+
+	/* Check leaf nodes have valid values */
+	for (i = leafidx; i < leafidx + nleafs; i++) {
+		s8 val = dcp->stree[i];
+
+		if (unlikely(val < NOFREE)) {
+			jfs_err("dmapctl: invalid leaf value %d at index %d",
+					val, i);
+			return false;
+		} else if (unlikely(val > 31)) {
+			jfs_err("dmapctl: leaf value %d too large at index %d", val, i);
+			return false;
+		}
+	}
+
+	return true;
+}
+
 /*
  * NAME:	dbMount()
  *
@@ -1372,7 +1459,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
 	dcp = (struct dmapctl *) mp->data;
 	budmin = dcp->budmin;
 
-	if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
+	if (unlikely(!check_dmapctl(dcp))) {
 		jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmapctl page\n");
 		release_metapage(mp);
 		return -EIO;
@@ -1702,7 +1789,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
 		dcp = (struct dmapctl *) mp->data;
 		budmin = dcp->budmin;
 
-		if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
+		if (unlikely(!check_dmapctl(dcp))) {
 			jfs_error(bmp->db_ipbmap->i_sb,
 				  "Corrupt dmapctl page\n");
 			release_metapage(mp);
@@ -2485,7 +2572,7 @@ dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level)
 		return -EIO;
 	dcp = (struct dmapctl *) mp->data;
 
-	if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
+	if (unlikely(!check_dmapctl(dcp))) {
 		jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmapctl page\n");
 		release_metapage(mp);
 		return -EIO;
@@ -3454,6 +3541,11 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno,	s64 nblocks)
 		return -EIO;
 	}
 	l2dcp = (struct dmapctl *) l2mp->data;
+	if (unlikely(!check_dmapctl(l2dcp))) {
+		jfs_error(ipbmap->i_sb, "Corrupt dmapctl page\n");
+		release_metapage(l2mp);
+		return -EIO;
+	}
 
 	/* compute start L1 */
 	k = blkno >> L2MAXL1SIZE;
@@ -3471,6 +3563,10 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno,	s64 nblocks)
 			if (l1mp == NULL)
 				goto errout;
 			l1dcp = (struct dmapctl *) l1mp->data;
+			if (unlikely(!check_dmapctl(l1dcp))) {
+				jfs_error(ipbmap->i_sb, "Corrupt dmapctl page\n");
+				goto errout;
+			}
 
 			/* compute start L0 */
 			j = (blkno & (MAXL1SIZE - 1)) >> L2MAXL0SIZE;
@@ -3484,6 +3580,10 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno,	s64 nblocks)
 				goto errout;
 
 			l1dcp = (struct dmapctl *) l1mp->data;
+			if (unlikely(!check_dmapctl(l1dcp))) {
+				jfs_error(ipbmap->i_sb, "Corrupt dmapctl page\n");
+				goto errout;
+			}
 
 			/* compute start L0 */
 			j = 0;
@@ -3503,6 +3603,10 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno,	s64 nblocks)
 				if (l0mp == NULL)
 					goto errout;
 				l0dcp = (struct dmapctl *) l0mp->data;
+				if (unlikely(!check_dmapctl(l0dcp))) {
+					jfs_error(ipbmap->i_sb, "Corrupt dmapctl page\n");
+					goto errout;
+				}
 
 				/* compute start dmap */
 				i = (blkno & (MAXL0SIZE - 1)) >>
@@ -3518,6 +3622,10 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno,	s64 nblocks)
 					goto errout;
 
 				l0dcp = (struct dmapctl *) l0mp->data;
+				if (unlikely(!check_dmapctl(l0dcp))) {
+					jfs_error(ipbmap->i_sb, "Corrupt dmapctl page\n");
+					goto errout;
+				}
 
 				/* compute start dmap */
 				i = 0;
]

161/2 2026/06/26 21:21 llm history-explorer
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 38174
							output: 750
							thoughts: 1206
						

Thoughts:
**JFS Corruption Fix Idioms: A Review**

Okay, so looking at this, it's clear we're dealing with a recurring problem in JFS: the lack of robust validation of on-disk structures leading to memory corruption. We've seen it with `dtpage`, `dtroot`, `dmapctl`, and now, apparently, the root page itself. My takeaway here is that the pattern is *very* well-defined, and it's something we should absolutely adhere to when writing the fix.

The key is that validation *must* happen at the point where we load these structures from disk. We're talking about routines like `xt_getpage` and `DT_GETPAGE`. That's the choke point. We don't want to trust *anything* we pull off disk. This means that *before* we start using it, we need to check if the `BT_ROOT` flag is set correctly. The proposed `((bn == 0) != !!(p->header.flag & BT_ROOT))` check is spot-on.

Then, when we catch an error, the error handling is standardized as well. We're looking at `jfs_error()` (or `jfs_err()`) to log the issue, releasing any resources (metapages are critical here - `BT_PUTPAGE` or `release_metapage`), setting the metapage pointer to `NULL`, and then the return of `-EIO`. That's the mantra. It’s what we see in commits like `119e448bb50a`, `c83abc766aeb`, `cce219b203c4`, and `a8dfb2168906`, to name just a few.

The recent change to inline functions for `XT_GETPAGE` (commit `1014354cd8d4`) is also something to consider. While it's fine to update the macro as proposed, in this case, converting `DT_GETPAGE` to an inline function `dt_getpage` would likely be considered consistent with the JFS’s evolution.

In short, the proposed fix for the `BT_ROOT` flag validation fits the JFS pattern perfectly. We're validating at load, we're being strict with our invariants, we're handling the error gracefully, and if we're feeling particularly modern, we'll try an inline function. I'm satisfied that this aligns with the prevailing idioms in the subsystem.



162/1 2026/06/26 21:22 action kernel-scratch-checkouter
0m Results:
map[KernelScratchSrc:/app/workdir/cache/tmp/tmp472945638]

163/1 2026/06/26 21:22 loop
49m
164/2 2026/06/26 21:22 iteration 0
49m
165/3 2026/06/26 21:22 agent patch-generator
14m Model:
gemini-3.1-pro-preview

Instruction:
You are an experienced Linux kernel developer tasked with creating a fix for a kernel bug.
You will be given a crash report, an initial explanation of the root cause done by another
kernel expert, and a summary of how similar bugs were fixed in the past.

Use the codeeditor tool to do code edits.
Note: you will not see your changes when looking at the code using codesearch tools.
Use the patch-diff tool to review the modifications you applied.

Your final reply should contain explanation of what you did in the patch and why
(details not present in the initial explanation of the bug).

Your fix must not just prevent the given crash, but also be the best fix for the underlying
root cause from the software engineering point of view. There can be several ways to fix the
same bug. Consider alternatives, and pick the best one. For example, additional checks may be
added at different locations/functions, it's usually better to place them earlier in the
execution to avoid multiple checks at various locations later.

Frequently the same coding mistake is done in several locations in the source code.
Check if your fix should be extended/applied to similar cases around to fix other similar bugs.
But don't go too wide, don't try to fix problems kernel-wide, fix similar issues
in the same file only.


If you are changing post-conditions of a function, consider all callers of the functions,
and if they need to be updated to handle new post-conditions. For example, if you make
a function that previously never returned a NULL, return NULL, consider if callers
need to be updated to handle NULL return value.



Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash that corresponds to the bug is:

BUG: spinlock bad magic on CPU#0, syz-executor/6066
 lock: 0xffff888120999b48, .magic: ffffffff, .owner: �������� �������/-1902340672, .owner_cpu: 768
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in /app/workdir/cache/src/1583fc50e73bc268b47064ec35fa43904fad8ca1/kernel/locking/qspinlock.h:68:9
index 8945 is out of range for type 'unsigned long[8]'
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 ubsan_epilogue+0xa/0x30 lib/ubsan.c:233
 __ubsan_handle_out_of_bounds+0xe8/0xf0 lib/ubsan.c:455
 decode_tail kernel/locking/qspinlock.h:68 [inline]
 __pv_queued_spin_lock_slowpath+0xaf3/0xbc0 kernel/locking/qspinlock.c:285
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:35 [inline]
 queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:66 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x26c/0x2f0 kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
---[ end trace ]---


The explanation of the root cause of the bug is:

An excellent catch! The crash is caused by a corrupted JFS image that tricks the kernel into calling `release_metapage()` on a pseudo-metapage embedded within the inode, leading to an out-of-bounds memory access and a spinlock crash.

Here is the detailed root cause analysis and the proposed fix.

### Root Cause Analysis

1. **The Pseudo-Metapage:**
   When operating on the root page of an xtree or dtree (which is stored inline within the inode), JFS doesn't use a real `struct metapage`. Instead, `BT_GETPAGE` (called via `xt_getpage` for `bn == 0`) sets the metapage pointer `mp` to the address of `JFS_IP(ip)->bxflag`:
   ```c
   // fs/jfs/jfs_btree.h
   #define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\
   {\
       if ((BN) == 0)\
       {\
           MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
           P = (TYPE *)&JFS_IP(IP)->ROOT;\
           RC = 0;\
       }\
       // ...
   ```
   Because this is a pseudo-metapage, it does not have a valid `wait_queue_head_t wait` field. Accessing `mp->wait` (which is at offset 64 in `struct metapage`) actually reads out-of-bounds memory in `struct jfs_inode_info` (overlapping with `rdwrlock` or `anon_inode_list`).

2. **The Missing Validation:**
   In `xt_getpage()`, the code validates `nextindex` and `maxentry`, but it **fails to verify that the `BT_ROOT` flag is set** in `p->header.flag` for the root page (`bn == 0`). In the corrupted syzkaller image, the inline xtree root page (`i_xtroot`) has a corrupted `header.flag` where `BT_ROOT` is missing.

3. **The Vulnerable Path in `xtTruncate`:**
   When `xtTruncate()` processes this corrupted root page and it becomes empty, it checks if it is the root page by looking at the `BT_ROOT` flag:
   ```c
   // fs/jfs/jfs_xtree.c : xtTruncate()
           if (p->header.flag & BT_ROOT) {
               // ...
               XT_PUTPAGE(mp);
               goto out;
           } else {
               if (log) {
                   XT_PUTPAGE(mp);
               } else {
                   if (mp->lid)
                       lid_to_tlock(mp->lid)->flag |= tlckFREELOCK;

                   /* invalidate empty leaf page */
                   discard_metapage(mp);
               }
           }
   ```
   Because `BT_ROOT` is missing due to corruption, `xtTruncate` takes the `else` branch, mistakenly treating the root page as a regular leaf page, and calls `discard_metapage(mp)`.

4. **The Crash:**
   Unlike `XT_PUTPAGE` (which wraps `BT_PUTPAGE` and safely checks `!BT_IS_ROOT(mp)` before releasing), `discard_metapage()` calls `release_metapage(mp)` directly:
   ```c
   // fs/jfs/jfs_metapage.h
   static inline void discard_metapage(struct metapage *mp)
   {
       clear_bit(META_dirty, &mp->flag);
       set_bit(META_discard, &mp->flag);
       release_metapage(mp);
   }
   ```
   `release_metapage()` assumes `mp` is a real metapage and calls `unlock_metapage(mp)`, which executes `wake_up(&mp->wait)`. Since `mp` points to `&JFS_IP(ip)->bxflag`, this accesses garbage memory, resulting in the `spinlock bad magic` BUG or the UBSAN out-of-bounds array access.

### Proposed Fix

To fix this, we must enforce the invariant that the `BT_ROOT` flag is set **if and only if** `bn == 0`. 

**1. Fix in `xt_getpage` (`fs/jfs/jfs_xtree.c`):**
Add a check to ensure `BT_ROOT` consistency:
```c
static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
{
	xtpage_t *p;
	int rc;

	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);

	if (rc)
		return ERR_PTR(rc);
	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
	    (le16_to_cpu(p->header.nextindex) > le16_to_cpu(p->header.maxentry)) ||
	    (le16_to_cpu(p->header.maxentry) > ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {      // <--- ADD THIS CHECK
		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	}
	return p;
}
```

**2. Fix in `DT_GETPAGE` (`fs/jfs/jfs_dtree.c`):**
The exact same vulnerability exists for dtree pages (e.g., `dtDeleteUp` can crash the same way if `i_dtroot` is corrupted). The `DT_GETPAGE` macro should be updated to enforce the same `BT_ROOT` invariant:
```c
#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
do {									\
	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
	if (!(RC)) {							\
		if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {	\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree root page corrupt\n"); \
			MP = NULL;					\
			RC = -EIO;					\
		} else if ((BN) && !check_dtpage(P)) {			\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree page corrupt\n");	\
			MP = NULL;					\
			RC = -EIO;					\
		}							\
	}								\
} while (0)
```


Historical context on how similar bugs were fixed in the past:

Based on a review of recent commits in the JFS subsystem over the last 3 years, the proposed fix aligns perfectly with how similar on-disk corruption bugs have been addressed. JFS has historically suffered from various out-of-bounds accesses and memory corruption issues due to missing validation of on-disk structures, and the maintainers have established a clear pattern for fixing them.

Here is a summary of the idioms, rules, and common patterns you should follow when writing the final patch:

### 1. Centralized Early Validation
Recent fixes in JFS consistently add strict invariant checks immediately at the point where structures are loaded from disk or memory, rather than at the point of use. 
- Commit `119e448bb50a` added `check_dtpage()` to validate `dtpage_t` integrity inside `DT_GETPAGE`.
- Commit `c83abc766aeb` added `check_dtroot()` to validate `dtroot_t` inside `copy_from_dinode()`.
- Commit `cce219b203c4` added `check_dmapctl()` to validate `dmapctl` pages when they are loaded.

Your proposed strategy of enforcing the `((bn == 0) != !!(p->header.flag & BT_ROOT))` invariant directly inside `xt_getpage()` and `DT_GETPAGE()` exactly follows this pattern. It catches the corruption early before functions like `xtTruncate()` or `dtDeleteUp()` can misinterpret the pseudo-metapage.

### 2. Standard Error Handling Pattern
When an invariant check fails, JFS follows a strict error-handling sequence to prevent resource leaks and notify the system:
1. **Log the error:** Call `jfs_error(ip->i_sb, "...")` to log the corruption and potentially mark the filesystem as read-only (depending on mount options).
2. **Release resources:** Call `BT_PUTPAGE(*mp)` to release the metapage.
3. **Clear pointers:** Set the metapage pointer to `NULL` to prevent double-frees or use-after-frees.
4. **Return an error:** Return `-EIO` (or `ERR_PTR(-EIO)` for functions returning pointers).

Your proposed additions to `xt_getpage()` and `DT_GETPAGE()` correctly implement this exact sequence.

### 3. Modernization of Macros to Inline Functions
In commit `1014354cd8d4` (June 2025), the maintainers replaced the legacy `XT_GETPAGE` macro with the `xt_getpage()` inline function to improve type safety and readability. 
- Your proposed fix for `xt_getpage()` correctly targets this new inline function.
- `DT_GETPAGE` is currently still a macro. While updating the macro directly (as you proposed) is perfectly acceptable and matches the current codebase, you might also consider taking the opportunity to refactor `DT_GETPAGE` into a `dt_getpage()` inline function, as this would be highly welcomed by the maintainers based on recent modernization efforts.

### Conclusion
Your root cause analysis is spot on, and the proposed fix is structurally complete. You do not need to introduce any new locking rules or complex state rollbacks. Simply enforcing the `BT_ROOT` invariant during page retrieval and returning `-EIO` with `jfs_error()` is the idiomatic way to fix this class of bugs in JFS.




Reply:
I have applied the fix to address the spinlock crash caused by out-of-bounds memory access on the pseudo-metapage.

### What I did in the patch
1. **Updated `xt_getpage()` in `fs/jfs/jfs_xtree.c`**: Added a validation check `((bn == 0) != !!(p->header.flag & BT_ROOT))` to ensure that the `BT_ROOT` flag is set if and only if the block number is 0 (the root page). If this invariant is violated, it logs an error, releases the metapage, and returns `-EIO`.
2. **Updated `DT_GETPAGE` macro in `fs/jfs/jfs_dtree.c`**: Added the exact same invariant check for dtree pages. If the check fails, it follows the standard JFS error handling pattern (logging, releasing the metapage, and returning `-EIO`).

### Why I did it this way
- **Centralized Early Validation**: By adding the checks directly in `xt_getpage()` and `DT_GETPAGE`, we catch the corruption immediately when the page is loaded from disk or memory. This prevents any downstream functions (like `xtTruncate()` or `dtDeleteUp()`) from misinterpreting the pseudo-metapage and taking incorrect code paths (such as calling `discard_metapage()` on it).
- **Consistency with JFS Patterns**: The fix strictly follows the established error-handling sequence in JFS (log error, `BT_PUTPAGE`, set pointer to `NULL`, return `-EIO`).
- **Updating the Macro vs. Refactoring**: While refactoring `DT_GETPAGE` into an inline function (similar to what was recently done for `xt_getpage`) is a good modernization step, it would require modifying all 18 call sites of `DT_GETPAGE` across `fs/jfs/jfs_dtree.c`. To keep the fix focused, minimal, and less error-prone for backporting, I chose to update the macro directly. This perfectly matches the current codebase and safely resolves the vulnerability.

166/4 2026/06/26 21:22 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10116
							output: 40
							thoughts: 213
						

Thoughts:
**Analyzing a JFS Bug and Proposed Fix**

Okay, so I've got a tricky JFS bug to unravel here. It seems like a corrupted image can trick the system into thinking a pseudo-metapage – one embedded within an inode – is a regular metapage. The root of the problem is the missing `BT_ROOT` flag in the header of this rogue page. That causes `discard_metapage()` to get called, which, in turn, calls `release_metapage()`. And *that's* where the crash happens: `release_metapage()` attempts to access `mp->wait`, which is way out of bounds and causes a spinlock to trigger. A classic case of data corruption leading to a nasty kernel panic.

The fix, and it seems like a solid one, revolves around enforcing an invariant. We need to ensure that the `BT_ROOT` flag is *only* set when `bn` is 0, meaning it's the root page. This seems like a reasonable constraint to maintain data integrity.

My job now is to implement this. I’ll need to put this check into `xt_getpage()` and `DT_GETPAGE()`. I'm starting with `xt_getpage` within `fs/jfs/jfs_xtree.c`. I have a good idea of how this goes, I need to make sure this doesn't introduce any performance regressions. Let's dig into the code and see how we can best implement this.



167/4 2026/06/26 21:23 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/jfs/jfs_xtree.c Name:xt_getpage]

Results:
map[SourceCode: 111:	static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
 112:	{
 113:		xtpage_t *p;
 114:		int rc;
 115:	
 116:		BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);
 117:	
 118:		if (rc)
 119:			return ERR_PTR(rc);
 120:		if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
 121:			(le16_to_cpu(p->header.nextindex) >
 122:				le16_to_cpu(p->header.maxentry)) ||
 123:			(le16_to_cpu(p->header.maxentry) >
 124:				((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
 125:			jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
 126:			BT_PUTPAGE(*mp);
 127:			*mp = NULL;
 128:			return ERR_PTR(-EIO);
 129:		}
 130:		return p;
 131:	}
 SourceFile:fs/jfs/jfs_xtree.c]

168/4 2026/06/26 21:23 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11097
							output: 40
							thoughts: 179
						

Thoughts:
**Modifying `xt_getpage` and Investigating `jfs_dtree.c`**

Okay, so I need to refine the error checking within `xt_getpage`. Specifically, I'm going to add a check for the `BT_ROOT` flag within the conditions that determine validity. Right now, this code...

```c
	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
		(le16_to_cpu(p->header.nextindex) >
			le16_to_cpu(p->header.maxentry)) ||
		(le16_to_cpu(p->header.maxentry) >
			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
		((bn == 0) != !!(p->header.flag & BT_ROOT))) {
```

... seems like the logical place to insert that check. I want to make certain that root nodes are being identified and handled appropriately. A subtle oversight here could lead to some nasty corruption down the line.

Now, as I'm thinking about X-tree structures, I want to take a look at the D-tree implementation, too. I think I'll go check `DT_GETPAGE` in `fs/jfs/jfs_dtree.c`. There might be something relevant to this root node business there, perhaps in how the JFS filesystem handles its D-trees. Gotta stay thorough!



169/4 2026/06/26 21:23 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[ContextFile:fs/jfs/jfs_dtree.c Name:DT_GETPAGE]

Results:
map[SourceCode: SourceFile:]

170/4 2026/06/26 21:23 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11670
							output: 20
							thoughts: 28
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Debugging a Potential `DT_GETPAGE` Issue**

Right, so `DT_GETPAGE`... that's a macro, isn't it? Probably defined somewhere in the include files. I'm going to need to dig that out to understand the context. Let's see... I'll jump straight into the search. Need to figure out where that thing is declared so I can see what it expands to and the surrounding code. Gotta get to the bottom of this.



171/4 2026/06/26 21:24 tool grepper
0m Args:
map[Expression:#define DT_GETPAGE]

Results:
map[Output:fs/jfs/jfs_dtree.c=102=struct dtsplit {
--
fs/jfs/jfs_dtree.c-113-/* get page buffer for specified block address */
fs/jfs/jfs_dtree.c:114:#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
fs/jfs/jfs_dtree.c-115-do {									\
]

172/4 2026/06/26 21:24 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 11962
							output: 40
							thoughts: 25
						

Thoughts:
Here's a summary of my thought process, as requested:

**Diving into `jfs_dtree.c`**

Okay, time to get my hands dirty. I'm going to take a look at the JFS directory tree code, specifically around line 114 in `fs/jfs/jfs_dtree.c`. I need to understand what's happening there, and I have a specific question in mind, so I'll be looking for clues to that answer. I'll probably be tracing execution paths and variable values to get a clear picture. Let's see what interesting things the developers did here.



173/4 2026/06/26 21:24 tool read-file
0m Args:
map[File:fs/jfs/jfs_dtree.c FirstLine:110 LineCount:30]

Results:
map[Contents: 110:	
 111:	#define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 112:	
 113:	/* get page buffer for specified block address */
 114:	#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
 115:	do {									\
 116:		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
 117:		if (!(RC)) {							\
 118:			if ((BN) && !check_dtpage(P)) {				\
 119:				BT_PUTPAGE(MP);					\
 120:				jfs_error((IP)->i_sb,				\
 121:					  "DT_GETPAGE: dtree page corrupt\n");	\
 122:				MP = NULL;					\
 123:				RC = -EIO;					\
 124:			}							\
 125:		}								\
 126:	} while (0)
 127:	
 128:	/* for consistency */
 129:	#define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
 130:	
 131:	#define DT_GETSEARCH(IP, LEAF, BN, MP, P, INDEX) \
 132:		BT_GETSEARCH(IP, LEAF, BN, MP, dtpage_t, P, INDEX, i_dtroot)
 133:	
 134:	/*
 135:	 * forward references
 136:	 */
 137:	static int dtSplitUp(tid_t tid, struct inode *ip,
 138:			     struct dtsplit * split, struct btstack * btstack);
 139:	
]

174/4 2026/06/26 21:24 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 12669
							output: 53
							thoughts: 219
						

Thoughts:
**Refactoring DT_GETPAGE: A Modernization Opportunity**

Okay, so the historical context suggests that directly updating the `DT_GETPAGE` macro is fine for now, but the maintainers are pushing for modernization. It sounds like they'd be pleased if I refactored `DT_GETPAGE` into an inline function `dt_getpage()`. That's interesting, and worth exploring. Let's see if we can do this.

Alright, let's break this down. `DT_GETPAGE` takes `IP`, `BN`, `MP`, `SIZE`, `P`, and `RC`. Hmm, it modifies `MP`, `P`, and `RC`. If I convert this to an inline function, it makes sense to have it *return* `P` (or `ERR_PTR(RC)` in case of an error), and then pass `IP`, `BN`, and `MP` as a `struct metapage **`. That seems conceptually clean. But there's `SIZE`! What's the deal with `SIZE`? Is it a constant, or does it change? I need to understand how `DT_GETPAGE` is used across the codebase before I can make a decision on whether or not it's actually possible to change `SIZE`. I'll have to investigate the calls to `DT_GETPAGE` to see if there's any variation there.



175/4 2026/06/26 21:24 tool codesearch-find-references
0m Error:
log-in to see details

Args:
map[ContextFile:fs/jfs/jfs_dtree.c IncludeSnippetLines:1 Name:DT_GETPAGE SourceTreePrefix:]

Results:
map[References:<nil> TruncatedOutput:false]

176/4 2026/06/26 21:24 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 13259
							output: 18
							thoughts: 32
						

Thoughts:
Okay, here's my interpretation of those thoughts, tailored for an expert audience, presented in the first person:

**Investigating Macro Reference Resolution**

Right, so I'm hitting a snag with my usual approach. It seems the standard `codesearch-find-references` isn't playing nicely with this particular construct. My immediate hunch is that it's a macro; those can be tricky for static analysis tools. They often require the code to be expanded before reference resolution can occur accurately.

Hmm, okay. Since the usual methods aren't working as expected, I'll bypass that and try `grepper` instead. I'll take a more literal, text-based approach for the moment. Hopefully this will reveal the definition and usages. I'm hoping to get some basic, raw results. Then I can use those to start deducing the logic in more detail.



177/4 2026/06/26 21:24 tool grepper
0m Args:
map[Expression:DT_GETPAGE]

Results:
map[Output:fs/jfs/jfs_dtree.c=102=struct dtsplit {
--
fs/jfs/jfs_dtree.c-113-/* get page buffer for specified block address */
fs/jfs/jfs_dtree.c:114:#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
fs/jfs/jfs_dtree.c-115-do {									\
--
fs/jfs/jfs_dtree.c-120-			jfs_error((IP)->i_sb,				\
fs/jfs/jfs_dtree.c:121:				  "DT_GETPAGE: dtree page corrupt\n");	\
fs/jfs/jfs_dtree.c-122-			MP = NULL;					\
--
fs/jfs/jfs_dtree.c=565=int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
--
fs/jfs/jfs_dtree.c-620-		/* get/pin the page to search */
fs/jfs/jfs_dtree.c:621:		DT_GETPAGE(ip, bn, mp, psize, p, rc);
fs/jfs/jfs_dtree.c-622-		if (rc)
--
fs/jfs/jfs_dtree.c=923=static int dtSplitUp(tid_t tid,
--
fs/jfs/jfs_dtree.c-1130-		/* get the parent page <sp> */
fs/jfs/jfs_dtree.c:1131:		DT_GETPAGE(ip, parent->bn, smp, PSIZE, sp, rc);
fs/jfs/jfs_dtree.c-1132-		if (rc) {
--
fs/jfs/jfs_dtree.c=1323=static int dtSplitPage(tid_t tid, struct inode *ip, struct dtsplit * split,
--
fs/jfs/jfs_dtree.c-1467-	if (nextbn != 0) {
fs/jfs/jfs_dtree.c:1468:		DT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-1469-		if (rc) {
--
fs/jfs/jfs_dtree.c=1635=static int dtExtendPage(tid_t tid,
--
fs/jfs/jfs_dtree.c-1665-	parent = BT_POP(btstack);
fs/jfs/jfs_dtree.c:1666:	DT_GETPAGE(ip, parent->bn, pmp, PSIZE, pp, rc);
fs/jfs/jfs_dtree.c-1667-	if (rc)
--
fs/jfs/jfs_dtree.c=2075=int dtDelete(tid_t tid,
--
fs/jfs/jfs_dtree.c-2122-				/* Read next leaf page */
fs/jfs/jfs_dtree.c:2123:				DT_GETPAGE(ip, le64_to_cpu(p->header.next),
fs/jfs/jfs_dtree.c-2124-					   nmp, PSIZE, np, rc);
--
fs/jfs/jfs_dtree.c=2230=static int dtDeleteUp(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_dtree.c-2300-		/* pin the parent page <sp> */
fs/jfs/jfs_dtree.c:2301:		DT_GETPAGE(ip, parent->bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2302-		if (rc)
--
fs/jfs/jfs_dtree.c=2442=static int dtRelink(tid_t tid, struct inode *ip, dtpage_t * p)
--
fs/jfs/jfs_dtree.c-2455-	if (nextbn != 0) {
fs/jfs/jfs_dtree.c:2456:		DT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2457-		if (rc)
--
fs/jfs/jfs_dtree.c-2484-	if (prevbn != 0) {
fs/jfs/jfs_dtree.c:2485:		DT_GETPAGE(ip, prevbn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2486-		if (rc)
--
fs/jfs/jfs_dtree.c=2613=static int add_missing_indices(struct inode *inode, s64 bn)
--
fs/jfs/jfs_dtree.c-2628-
fs/jfs/jfs_dtree.c:2629:	DT_GETPAGE(inode, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2630-
fs/jfs/jfs_dtree.c-2631-	if (rc) {
fs/jfs/jfs_dtree.c:2632:		printk(KERN_ERR "DT_GETPAGE failed!\n");
fs/jfs/jfs_dtree.c-2633-		goto end;
--
fs/jfs/jfs_dtree.c=2711=int jfs_readdir(struct file *file, struct dir_context *ctx)
--
fs/jfs/jfs_dtree.c-2793-			index = dirtab_slot.slot;
fs/jfs/jfs_dtree.c:2794:			DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2795-			if (rc) {
--
fs/jfs/jfs_dtree.c-3037-
fs/jfs/jfs_dtree.c:3038:		DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3039-		if (rc) {
--
fs/jfs/jfs_dtree.c=3057=static int dtReadFirst(struct inode *ip, struct btstack * btstack)
--
fs/jfs/jfs_dtree.c-3075-	for (bn = 0;;) {
fs/jfs/jfs_dtree.c:3076:		DT_GETPAGE(ip, bn, mp, psize, p, rc);
fs/jfs/jfs_dtree.c-3077-		if (rc)
--
fs/jfs/jfs_dtree.c=3136=static int dtReadNext(struct inode *ip, loff_t * offset,
--
fs/jfs/jfs_dtree.c-3219-	bn = parent->bn;
fs/jfs/jfs_dtree.c:3220:	DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3221-	if (rc)
--
fs/jfs/jfs_dtree.c-3240-		/* get next parent page */
fs/jfs/jfs_dtree.c:3241:		DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3242-		if (rc)
--
fs/jfs/jfs_dtree.c-3260-      c:
fs/jfs/jfs_dtree.c:3261:	DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3262-	if (rc)
--
fs/jfs/jfs_dtree.c-3281-		/* get next leaf page */
fs/jfs/jfs_dtree.c:3282:		DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3283-		if (rc)
]

178/4 2026/06/26 21:24 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15675
							output: 38
							thoughts: 53
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm well-versed in system internals and probably dealing with some form of data structure or paging scheme:

**Internal Musings on Data Retrieval**

Right, so `DT_GETPAGE` seems primarily geared towards working with `PSIZE`. I've usually seen them paired together. Hmm, but I seem to recall that lowercase `psize` is also floating around in the codebase, particularly in the `dtSearch` and `dtReadFirst` functions. That's a little peculiar. The naming convention isn't entirely consistent there, so I'd better double-check the definition and usage of `psize` within `dtSearch` to clarify what's going on. I need to understand if it's acting as a synonym, a related variable or a direct usage.



179/4 2026/06/26 21:24 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/jfs/jfs_dtree.c Name:dtSearch]

Results:
map[SourceCode: 554:	/*
 555:	 *	dtSearch()
 556:	 *
 557:	 * function:
 558:	 *	Search for the entry with specified key
 559:	 *
 560:	 * parameter:
 561:	 *
 562:	 * return: 0 - search result on stack, leaf page pinned;
 563:	 *	   errno - I/O error
 564:	 */
 565:	int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
 566:		     struct btstack * btstack, int flag)
 567:	{
 568:		int rc = 0;
 569:		int cmp = 1;		/* init for empty page */
 570:		s64 bn;
 571:		struct metapage *mp;
 572:		dtpage_t *p;
 573:		s8 *stbl;
 574:		int base, index, lim;
 575:		struct btframe *btsp;
 576:		pxd_t *pxd;
 577:		int psize = 288;	/* initial in-line directory */
 578:		ino_t inumber;
 579:		struct component_name ciKey;
 580:		struct super_block *sb = ip->i_sb;
 581:	
 582:		ciKey.name = kmalloc_array(JFS_NAME_MAX + 1, sizeof(wchar_t),
 583:					   GFP_NOFS);
 584:		if (!ciKey.name) {
 585:			rc = -ENOMEM;
 586:			goto dtSearch_Exit2;
 587:		}
 588:	
 589:	
 590:		/* uppercase search key for c-i directory */
 591:		UniStrcpy(ciKey.name, key->name);
 592:		ciKey.namlen = key->namlen;
 593:	
 594:		/* only uppercase if case-insensitive support is on */
 595:		if ((JFS_SBI(sb)->mntflag & JFS_OS2) == JFS_OS2) {
 596:			ciToUpper(&ciKey);
 597:		}
 598:		BT_CLR(btstack);	/* reset stack */
 599:	
 600:		/* init level count for max pages to split */
 601:		btstack->nsplit = 1;
 602:	
 603:		/*
 604:		 *	search down tree from root:
 605:		 *
 606:		 * between two consecutive entries of <Ki, Pi> and <Kj, Pj> of
 607:		 * internal page, child page Pi contains entry with k, Ki <= K < Kj.
 608:		 *
 609:		 * if entry with search key K is not found
 610:		 * internal page search find the entry with largest key Ki
 611:		 * less than K which point to the child page to search;
 612:		 * leaf page search find the entry with smallest key Kj
 613:		 * greater than K so that the returned index is the position of
 614:		 * the entry to be shifted right for insertion of new entry.
 615:		 * for empty tree, search key is greater than any key of the tree.
 616:		 *
 617:		 * by convention, root bn = 0.
 618:		 */
 619:		for (bn = 0;;) {
 620:			/* get/pin the page to search */
 621:			DT_GETPAGE(ip, bn, mp, psize, p, rc);
 622:			if (rc)
 623:				goto dtSearch_Exit1;
 624:	
 625:			/* get sorted entry table of the page */
 626:			stbl = DT_GETSTBL(p);
 627:	
 628:			/*
 629:			 * binary search with search key K on the current page.
 630:			 */
 631:			for (base = 0, lim = p->header.nextindex; lim; lim >>= 1) {
 632:				index = base + (lim >> 1);
 633:	
 634:				if (stbl[index] < 0) {
 635:					rc = -EIO;
 636:					goto out;
 637:				}
 638:	
 639:				if (p->header.flag & BT_LEAF) {
 640:					/* uppercase leaf name to compare */
 641:					cmp =
 642:					    ciCompare(&ciKey, p, stbl[index],
 643:						      JFS_SBI(sb)->mntflag);
 644:				} else {
 645:					/* router key is in uppercase */
 646:	
 647:					cmp = dtCompare(&ciKey, p, stbl[index]);
 648:	
 649:	
 650:				}
 651:				if (cmp == 0) {
 652:					/*
 653:					 *	search hit
 654:					 */
 655:					/* search hit - leaf page:
 656:					 * return the entry found
 657:					 */
 658:					if (p->header.flag & BT_LEAF) {
 659:						inumber = le32_to_cpu(
 660:				((struct ldtentry *) & p->slot[stbl[index]])->inumber);
 661:	
 662:						/*
 663:						 * search for JFS_LOOKUP
 664:						 */
 665:						if (flag == JFS_LOOKUP) {
 666:							*data = inumber;
 667:							rc = 0;
 668:							goto out;
 669:						}
 670:	
 671:						/*
 672:						 * search for JFS_CREATE
 673:						 */
 674:						if (flag == JFS_CREATE) {
 675:							*data = inumber;
 676:							rc = -EEXIST;
 677:							goto out;
 678:						}
 679:	
 680:						/*
 681:						 * search for JFS_REMOVE or JFS_RENAME
 682:						 */
 683:						if ((flag == JFS_REMOVE ||
 684:						     flag == JFS_RENAME) &&
 685:						    *data != inumber) {
 686:							rc = -ESTALE;
 687:							goto out;
 688:						}
 689:	
 690:						/*
 691:						 * JFS_REMOVE|JFS_FINDDIR|JFS_RENAME
 692:						 */
 693:						/* save search result */
 694:						*data = inumber;
 695:						btsp = btstack->top;
 696:						btsp->bn = bn;
 697:						btsp->index = index;
 698:						btsp->mp = mp;
 699:	
 700:						rc = 0;
 701:						goto dtSearch_Exit1;
 702:					}
 703:	
 704:					/* search hit - internal page:
 705:					 * descend/search its child page
 706:					 */
 707:					goto getChild;
 708:				}
 709:	
 710:				if (cmp > 0) {
 711:					base = index + 1;
 712:					--lim;
 713:				}
 714:			}
 715:	
 716:			/*
 717:			 *	search miss
 718:			 *
 719:			 * base is the smallest index with key (Kj) greater than
 720:			 * search key (K) and may be zero or (maxindex + 1) index.
 721:			 */
 722:			/*
 723:			 * search miss - leaf page
 724:			 *
 725:			 * return location of entry (base) where new entry with
 726:			 * search key K is to be inserted.
 727:			 */
 728:			if (p->header.flag & BT_LEAF) {
 729:				/*
 730:				 * search for JFS_LOOKUP, JFS_REMOVE, or JFS_RENAME
 731:				 */
 732:				if (flag == JFS_LOOKUP || flag == JFS_REMOVE ||
 733:				    flag == JFS_RENAME) {
 734:					rc = -ENOENT;
 735:					goto out;
 736:				}
 737:	
 738:				/*
 739:				 * search for JFS_CREATE|JFS_FINDDIR:
 740:				 *
 741:				 * save search result
 742:				 */
 743:				*data = 0;
 744:				btsp = btstack->top;
 745:				btsp->bn = bn;
 746:				btsp->index = base;
 747:				btsp->mp = mp;
 748:	
 749:				rc = 0;
 750:				goto dtSearch_Exit1;
 751:			}
 752:	
 753:			/*
 754:			 * search miss - internal page
 755:			 *
 756:			 * if base is non-zero, decrement base by one to get the parent
 757:			 * entry of the child page to search.
 758:			 */
 759:			index = base ? base - 1 : base;
 760:	
 761:			/*
 762:			 * go down to child page
 763:			 */
 764:		      getChild:
 765:			/* update max. number of pages to split */
 766:			if (BT_STACK_FULL(btstack)) {
 767:				/* Something's corrupted, mark filesystem dirty so
 768:				 * chkdsk will fix it.
 769:				 */
 770:				jfs_error(sb, "stack overrun!\n");
 771:				BT_STACK_DUMP(btstack);
 772:				rc = -EIO;
 773:				goto out;
 774:			}
 775:			btstack->nsplit++;
 776:	
 777:			/* push (bn, index) of the parent page/entry */
 778:			BT_PUSH(btstack, bn, index);
 779:	
 780:			/* get the child page block number */
 781:			pxd = (pxd_t *) & p->slot[stbl[index]];
 782:			bn = addressPXD(pxd);
 783:			psize = lengthPXD(pxd) << JFS_SBI(ip->i_sb)->l2bsize;
 784:	
 785:			/* unpin the parent page */
 786:			DT_PUTPAGE(mp);
 787:		}
 788:	
 789:	      out:
 790:		DT_PUTPAGE(mp);
 791:	
 792:	      dtSearch_Exit1:
 793:	
 794:		kfree(ciKey.name);
 795:	
 796:	      dtSearch_Exit2:
 797:	
 798:		return rc;
 799:	}
 SourceFile:fs/jfs/jfs_dtree.c]

180/4 2026/06/26 21:24 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 19210
							output: 25
							thoughts: 417
						

Thoughts:
**Refactoring `DT_GETPAGE` in JFS D-Tree Code**

Okay, so `DT_GETPAGE` is a macro, and the code uses it because it modifies `mp`, `p`, and `rc` directly. My initial thought was to refactor it as an inline function, like this:

```c
static inline dtpage_t *dt_getpage(struct inode *ip, s64 bn, struct metapage **mp, int size)
{
	dtpage_t *p;
	int rc;

	BT_GETPAGE(ip, bn, *mp, dtpage_t, size, p, rc, i_dtroot);

	if (rc)
		return ERR_PTR(rc);
	if (((bn == 0) != !!(p->header.flag & BT_ROOT)) ||
	    (bn && !check_dtpage(p))) {
		BT_PUTPAGE(*mp);
		jfs_error(ip->i_sb, "dt_getpage: dtree page corrupt\n");
		*mp = NULL;
		return ERR_PTR(-EIO);
	}
	return p;
}
```

However, I'd have to change all 18 occurrences of `DT_GETPAGE` in `fs/jfs/jfs_dtree.c` if I go that route. The prompt suggests updating the macro directly is acceptable.  The question is, does refactoring it into an inline function offer significant advantages, given the codebase's recent modernization efforts? I should examine how `xt_getpage` was refactored, which might offer insight on how to proceed.



181/4 2026/06/26 21:24 tool git-log
10m Error:
log-in to see details

Args:
map[CodeRegexp:xt_getpage Count:5]

Results:
map[Output:]

182/4 2026/06/26 21:34 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 20055
							output: 43
							thoughts: 19
						

Thoughts:
Okay, here's my attempt at summarizing the thought process, as if it were my own, and directed towards an expert audience.

**Diving Deep into the JFS Xtree Code**

Alright, let's zero in on `fs/jfs/jfs_xtree.c`. I need to understand this `xtree` implementation within JFS, and I'm going to focus on this particular file as a starting point. There's a lot of complexity in any filesystem, but the xtree routines are crucial for index management and indirect block allocation, so they're a good place to begin. My initial goals are to understand how the xtree's are structured, and how it handles allocation. I will likely start by tracing a simple create and deletion operation to see exactly how the xtree structures are accessed and modified. Then I need to identify where any optimization points might be. I'm hoping it's well-commented, but experience tells me I should anticipate having to work through the logic carefully, and be prepared to debug as needed.



183/4 2026/06/26 21:35 tool git-log
0m Args:
map[CodeRegexp:xt_getpage Count:5 PathPrefix:fs/jfs/jfs_xtree.c]

Results:
map[Output:1014354cd8d4 jfs: jfs_xtree: replace XT_GETPAGE macro with xt_getpage()
]

184/4 2026/06/26 21:35 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 20386
							output: 26
							thoughts: 18
						

Thoughts:
Okay, here's my interpretation of what's going on, framed as a thought process I might have while reviewing commit `1014354cd8d4`:

**Diving into the Code: Understanding the Context**

Alright, let's take a look at commit `1014354cd8d4`. Time to get my bearings. I need to understand what this commit is *really* trying to accomplish, beyond just the surface level changes. I'm going to start by quickly scanning the diff to get a high-level overview – what files were touched, and what's the general direction of the modifications? Are we talking about a bug fix, a new feature, a refactor, or something else entirely?

I'm focusing on the context. Why was this change made? Was it in response to a specific bug report or feature request? Are there any related issues or pull requests I should be aware of? Are there any architectural implications, or dependencies on other parts of the system? I'm already anticipating questions I might need to ask the author later.

Now, let's look at the code itself. I'm going to try to identify the critical sections of the changes and how they might impact the existing architecture. I'm looking for patterns, potential side effects, and of course, any obvious problems like regressions, or security vulnerabilities. My main focus at this point is on understanding the "why" and "how". Does the code adhere to the established coding style and best practices? Are there any areas that feel particularly complex or could be simplified? I'm paying close attention to any areas that seem risky. I'm prepared to dive deeper if something warrants further investigation.



185/4 2026/06/26 21:35 tool git-show
0m Args:
map[Commit:1014354cd8d4]

Results:
map[Output:commit 1014354cd8d40e81e9a6e9037a10ebfc0b656d27
Author: Suchit Karunakaran <suchitkarunakaran@gmail.com>
Date:   Thu Jun 5 23:26:34 2025 +0530

    jfs: jfs_xtree: replace XT_GETPAGE macro with xt_getpage()
    
    Replace legacy XT_GETPAGE macro with an inline function that returns a
    xtpage_t pointer and update all instances of XT_GETPAGE in jfs_xtree.c
    
    Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
    
    Simplified xt_getpage by removing size and rc arguments.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 5ee618d17e77..28c3cf960c6f 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -49,26 +49,6 @@
 
 #define XT_PAGE(IP, MP) BT_PAGE(IP, MP, xtpage_t, i_xtroot)
 
-/* get page buffer for specified block address */
-/* ToDo: Replace this ugly macro with a function */
-#define XT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
-do {									\
-	BT_GETPAGE(IP, BN, MP, xtpage_t, SIZE, P, RC, i_xtroot);	\
-	if (!(RC)) {							\
-		if ((le16_to_cpu((P)->header.nextindex) < XTENTRYSTART) || \
-		    (le16_to_cpu((P)->header.nextindex) >		\
-		     le16_to_cpu((P)->header.maxentry)) ||		\
-		    (le16_to_cpu((P)->header.maxentry) >		\
-		     (((BN) == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) { \
-			jfs_error((IP)->i_sb,				\
-				  "XT_GETPAGE: xtree page corrupt\n");	\
-			BT_PUTPAGE(MP);					\
-			MP = NULL;					\
-			RC = -EIO;					\
-		}							\
-	}								\
-} while (0)
-
 /* for consistency */
 #define XT_PUTPAGE(MP) BT_PUTPAGE(MP)
 
@@ -114,6 +94,42 @@ static int xtSplitPage(tid_t tid, struct inode *ip, struct xtsplit * split,
 static int xtSplitRoot(tid_t tid, struct inode *ip,
 		       struct xtsplit * split, struct metapage ** rmpp);
 
+/*
+ *	xt_getpage()
+ *
+ * function:	get the page buffer for a specified block address.
+ *
+ * parameters:
+ *	ip      - pointer to the inode
+ *	bn      - block number (s64) of the xtree page to be retrieved;
+ *	mp      - pointer to a metapage pointer where the page buffer is returned;
+ *
+ * returns:
+ *      A pointer to the xtree page (xtpage_t) on success, -EIO on error.
+ */
+
+static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
+{
+	xtpage_t *p;
+	int rc;
+
+	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);
+
+	if (rc)
+		return ERR_PTR(rc);
+	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
+		(le16_to_cpu(p->header.nextindex) >
+			le16_to_cpu(p->header.maxentry)) ||
+		(le16_to_cpu(p->header.maxentry) >
+			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
+		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
+		BT_PUTPAGE(*mp);
+		*mp = NULL;
+		return ERR_PTR(-EIO);
+	}
+	return p;
+}
+
 /*
  *	xtLookup()
  *
@@ -216,7 +232,6 @@ static int xtSearch(struct inode *ip, s64 xoff,	s64 *nextp,
 		    int *cmpp, struct btstack * btstack, int flag)
 {
 	struct jfs_inode_info *jfs_ip = JFS_IP(ip);
-	int rc = 0;
 	int cmp = 1;		/* init for empty page */
 	s64 bn;			/* block number */
 	struct metapage *mp;	/* page buffer */
@@ -252,9 +267,9 @@ static int xtSearch(struct inode *ip, s64 xoff,	s64 *nextp,
 	 */
 	for (bn = 0;;) {
 		/* get/pin the page to search */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		/* try sequential access heuristics with the previous
 		 * access entry in target leaf page:
@@ -807,10 +822,10 @@ xtSplitUp(tid_t tid,
 		 * insert router entry in parent for new right child page <rp>
 		 */
 		/* get/pin the parent page <sp> */
-		XT_GETPAGE(ip, parent->bn, smp, PSIZE, sp, rc);
-		if (rc) {
+		sp = xt_getpage(ip, parent->bn, &smp);
+		if (IS_ERR(sp)) {
 			XT_PUTPAGE(rcmp);
-			return rc;
+			return PTR_ERR(sp);
 		}
 
 		/*
@@ -1062,10 +1077,10 @@ xtSplitPage(tid_t tid, struct inode *ip,
 	 * update previous pointer of old next/right page of <sp>
 	 */
 	if (nextbn != 0) {
-		XT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
-		if (rc) {
+		p = xt_getpage(ip, nextbn, &mp);
+		if (IS_ERR(p)) {
 			XT_PUTPAGE(rmp);
-			goto clean_up;
+			return PTR_ERR(p);
 		}
 
 		BT_MARK_DIRTY(mp, ip);
@@ -1417,9 +1432,9 @@ int xtExtend(tid_t tid,		/* transaction id */
 			return rc;
 
 		/* get back old page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 		/*
 		 * if leaf root has been split, original root has been
 		 * copied to new child page, i.e., original entry now
@@ -1433,9 +1448,9 @@ int xtExtend(tid_t tid,		/* transaction id */
 			XT_PUTPAGE(mp);
 
 			/* get new child page */
-			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-			if (rc)
-				return rc;
+			p = xt_getpage(ip, bn, &mp);
+			if (IS_ERR(p))
+				return PTR_ERR(p);
 
 			BT_MARK_DIRTY(mp, ip);
 			if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -1711,9 +1726,9 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 			return rc;
 
 		/* get back old page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 		/*
 		 * if leaf root has been split, original root has been
 		 * copied to new child page, i.e., original entry now
@@ -1727,9 +1742,9 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 			XT_PUTPAGE(mp);
 
 			/* get new child page */
-			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-			if (rc)
-				return rc;
+			p = xt_getpage(ip, bn, &mp);
+			if (IS_ERR(p))
+				return PTR_ERR(p);
 
 			BT_MARK_DIRTY(mp, ip);
 			if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -1788,9 +1803,9 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 		XT_PUTPAGE(mp);
 
 		/* get new right page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		BT_MARK_DIRTY(mp, ip);
 		if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -1864,9 +1879,9 @@ printf("xtUpdate.updateLeft.split p:0x%p\n", p);
 			return rc;
 
 		/* get back old page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		/*
 		 * if leaf root has been split, original root has been
@@ -1881,9 +1896,9 @@ printf("xtUpdate.updateLeft.split p:0x%p\n", p);
 			XT_PUTPAGE(mp);
 
 			/* get new child page */
-			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-			if (rc)
-				return rc;
+			p = xt_getpage(ip, bn, &mp);
+			if (IS_ERR(p))
+				return PTR_ERR(p);
 
 			BT_MARK_DIRTY(mp, ip);
 			if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -2187,7 +2202,6 @@ void xtInitRoot(tid_t tid, struct inode *ip)
  */
 s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 {
-	int rc = 0;
 	s64 teof;
 	struct metapage *mp;
 	xtpage_t *p;
@@ -2268,9 +2282,9 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 	 * first access of each page:
 	 */
       getPage:
-	XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-	if (rc)
-		return rc;
+	p = xt_getpage(ip, bn, &mp);
+	if (IS_ERR(p))
+		return PTR_ERR(p);
 
 	/* process entries backward from last index */
 	index = le16_to_cpu(p->header.nextindex) - 1;
@@ -2506,9 +2520,9 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 
 	/* get back the parent page */
 	bn = parent->bn;
-	XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-	if (rc)
-		return rc;
+	p = xt_getpage(ip, bn, &mp);
+	if (IS_ERR(p))
+		return PTR_ERR(p);
 
 	index = parent->index;
 
@@ -2791,9 +2805,9 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
 		 * first access of each page:
 		 */
       getPage:
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		/* process entries backward from last index */
 		index = le16_to_cpu(p->header.nextindex) - 1;
@@ -2836,9 +2850,9 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
 
 	/* get back the parent page */
 	bn = parent->bn;
-	XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-	if (rc)
-		return rc;
+	p = xt_getpage(ip, bn, &mp);
+	if (IS_ERR(p))
+		return PTR_ERR(p);
 
 	index = parent->index;
 
]

186/4 2026/06/26 21:35 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24495
							output: 18
							thoughts: 281
						

Thoughts:
**Refactoring `DT_GETPAGE`**

Okay, so I need to update the `DT_GETPAGE` macro, as suggested. Let me see... if I make that change to `dt_getpage`, I'm going to have to touch all eighteen instances. The prompt mentions a refactoring opportunity, turning it into an inline function, which would be well-received, given the codebase's recent modernization.

Well, if I refactor, I still have to change all eighteen occurrences. The question is, which is the path of least resistance? Is it easier to go macro or function?

It looks like the macro takes `ip, bn, mp, psize, p, rc` as arguments and assigns a value to `p`. I *could* just use `sed` or the code editor to replace all those instances. The suggested function call is `p = dt_getpage(ip, bn, &mp, psize);` which means I'll have to add an error check `IS_ERR(p)` and `PTR_ERR(p)`.

Hold on... I need to check how `psize` and `PSIZE` are used within the context of `DT_GETPAGE`. I'm going to need to look at all those calls.
Let's check those in `fs/jfs/jfs_dtree.c`.



187/4 2026/06/26 21:35 tool grepper
0m Args:
map[Expression:DT_GETPAGE]

Results:
map[Output:fs/jfs/jfs_dtree.c=102=struct dtsplit {
--
fs/jfs/jfs_dtree.c-113-/* get page buffer for specified block address */
fs/jfs/jfs_dtree.c:114:#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
fs/jfs/jfs_dtree.c-115-do {									\
--
fs/jfs/jfs_dtree.c-120-			jfs_error((IP)->i_sb,				\
fs/jfs/jfs_dtree.c:121:				  "DT_GETPAGE: dtree page corrupt\n");	\
fs/jfs/jfs_dtree.c-122-			MP = NULL;					\
--
fs/jfs/jfs_dtree.c=565=int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
--
fs/jfs/jfs_dtree.c-620-		/* get/pin the page to search */
fs/jfs/jfs_dtree.c:621:		DT_GETPAGE(ip, bn, mp, psize, p, rc);
fs/jfs/jfs_dtree.c-622-		if (rc)
--
fs/jfs/jfs_dtree.c=923=static int dtSplitUp(tid_t tid,
--
fs/jfs/jfs_dtree.c-1130-		/* get the parent page <sp> */
fs/jfs/jfs_dtree.c:1131:		DT_GETPAGE(ip, parent->bn, smp, PSIZE, sp, rc);
fs/jfs/jfs_dtree.c-1132-		if (rc) {
--
fs/jfs/jfs_dtree.c=1323=static int dtSplitPage(tid_t tid, struct inode *ip, struct dtsplit * split,
--
fs/jfs/jfs_dtree.c-1467-	if (nextbn != 0) {
fs/jfs/jfs_dtree.c:1468:		DT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-1469-		if (rc) {
--
fs/jfs/jfs_dtree.c=1635=static int dtExtendPage(tid_t tid,
--
fs/jfs/jfs_dtree.c-1665-	parent = BT_POP(btstack);
fs/jfs/jfs_dtree.c:1666:	DT_GETPAGE(ip, parent->bn, pmp, PSIZE, pp, rc);
fs/jfs/jfs_dtree.c-1667-	if (rc)
--
fs/jfs/jfs_dtree.c=2075=int dtDelete(tid_t tid,
--
fs/jfs/jfs_dtree.c-2122-				/* Read next leaf page */
fs/jfs/jfs_dtree.c:2123:				DT_GETPAGE(ip, le64_to_cpu(p->header.next),
fs/jfs/jfs_dtree.c-2124-					   nmp, PSIZE, np, rc);
--
fs/jfs/jfs_dtree.c=2230=static int dtDeleteUp(tid_t tid, struct inode *ip,
--
fs/jfs/jfs_dtree.c-2300-		/* pin the parent page <sp> */
fs/jfs/jfs_dtree.c:2301:		DT_GETPAGE(ip, parent->bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2302-		if (rc)
--
fs/jfs/jfs_dtree.c=2442=static int dtRelink(tid_t tid, struct inode *ip, dtpage_t * p)
--
fs/jfs/jfs_dtree.c-2455-	if (nextbn != 0) {
fs/jfs/jfs_dtree.c:2456:		DT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2457-		if (rc)
--
fs/jfs/jfs_dtree.c-2484-	if (prevbn != 0) {
fs/jfs/jfs_dtree.c:2485:		DT_GETPAGE(ip, prevbn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2486-		if (rc)
--
fs/jfs/jfs_dtree.c=2613=static int add_missing_indices(struct inode *inode, s64 bn)
--
fs/jfs/jfs_dtree.c-2628-
fs/jfs/jfs_dtree.c:2629:	DT_GETPAGE(inode, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2630-
fs/jfs/jfs_dtree.c-2631-	if (rc) {
fs/jfs/jfs_dtree.c:2632:		printk(KERN_ERR "DT_GETPAGE failed!\n");
fs/jfs/jfs_dtree.c-2633-		goto end;
--
fs/jfs/jfs_dtree.c=2711=int jfs_readdir(struct file *file, struct dir_context *ctx)
--
fs/jfs/jfs_dtree.c-2793-			index = dirtab_slot.slot;
fs/jfs/jfs_dtree.c:2794:			DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-2795-			if (rc) {
--
fs/jfs/jfs_dtree.c-3037-
fs/jfs/jfs_dtree.c:3038:		DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3039-		if (rc) {
--
fs/jfs/jfs_dtree.c=3057=static int dtReadFirst(struct inode *ip, struct btstack * btstack)
--
fs/jfs/jfs_dtree.c-3075-	for (bn = 0;;) {
fs/jfs/jfs_dtree.c:3076:		DT_GETPAGE(ip, bn, mp, psize, p, rc);
fs/jfs/jfs_dtree.c-3077-		if (rc)
--
fs/jfs/jfs_dtree.c=3136=static int dtReadNext(struct inode *ip, loff_t * offset,
--
fs/jfs/jfs_dtree.c-3219-	bn = parent->bn;
fs/jfs/jfs_dtree.c:3220:	DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3221-	if (rc)
--
fs/jfs/jfs_dtree.c-3240-		/* get next parent page */
fs/jfs/jfs_dtree.c:3241:		DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3242-		if (rc)
--
fs/jfs/jfs_dtree.c-3260-      c:
fs/jfs/jfs_dtree.c:3261:	DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3262-	if (rc)
--
fs/jfs/jfs_dtree.c-3281-		/* get next leaf page */
fs/jfs/jfs_dtree.c:3282:		DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
fs/jfs/jfs_dtree.c-3283-		if (rc)
]

188/4 2026/06/26 21:35 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 27267
							output: 383
							thoughts: 67
						

Thoughts:
Okay, here's my thought process on this task:

**Macro Update Decision**

Right, the prompt is clear: direct macro updates are perfectly fine and, in fact, preferred given the codebase. That's fantastic. Considering the alternatives, updating the macro directly sounds significantly simpler and less prone to introducing subtle errors compared to, say, trying to refactor everything. Let's stick with that approach.

Now, where was I? Right, editing `fs/jfs/jfs_xtree.c` is the first step. Let's get to work!



189/4 2026/06/26 21:36 tool codeeditor
0m Args:
map[CurrentCode:	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
		(le16_to_cpu(p->header.nextindex) >
			le16_to_cpu(p->header.maxentry)) ||
		(le16_to_cpu(p->header.maxentry) >
			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	} NewCode:	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
		(le16_to_cpu(p->header.nextindex) >
			le16_to_cpu(p->header.maxentry)) ||
		(le16_to_cpu(p->header.maxentry) >
			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
		((bn == 0) != !!(p->header.flag & BT_ROOT))) {
		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	} SourceFile:fs/jfs/jfs_xtree.c]

Results:
map[]

190/4 2026/06/26 21:36 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 27845
							output: 453
							thoughts: 19
						

Thoughts:
Here's my take on the task, presented as a first-person account from the perspective of an expert:

**Diving into `jfs_dtree.c`**

Alright, time to get my hands dirty with `fs/jfs/jfs_dtree.c`. This is where the direct, tree-based data management for JFS lives, and it's a critical part of the file system's overall performance. I need to focus. I've worked with d-trees (directory trees) in JFS before; I understand the core principles, the on-disk structures, and the implications of changes here. I'm thinking about the d-tree as an extension of the i-node for holding the file directory data blocks. I remember reading through this file for error-checking the directory entries and now I need to dive back into it. This section really is the cornerstone. I need to make sure this code is robust, efficient, and aligns perfectly with the overall JFS architecture and performance goals. I will take a methodical approach, double-checking the code to see if there are any obvious low-hanging fruit for improvement.



191/4 2026/06/26 21:36 tool codeeditor
0m Args:
map[CurrentCode:#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
do {									\
	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
	if (!(RC)) {							\
		if ((BN) && !check_dtpage(P)) {				\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree page corrupt\n");	\
			MP = NULL;					\
			RC = -EIO;					\
		}							\
	}								\
} while (0) NewCode:#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
do {									\
	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
	if (!(RC)) {							\
		if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {	\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree root page corrupt\n"); \
			MP = NULL;					\
			RC = -EIO;					\
		} else if ((BN) && !check_dtpage(P)) {			\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree page corrupt\n");	\
			MP = NULL;					\
			RC = -EIO;					\
		}							\
	}								\
} while (0) SourceFile:fs/jfs/jfs_dtree.c]

Results:
map[]

192/4 2026/06/26 21:36 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28566
							output: 15
							thoughts: 7
						

Thoughts:
Okay, I'm ready to delve into this diff. Let's get to it.



193/4 2026/06/26 21:36 tool patch-diff
0m Args:
map[File:]

Results:
map[Output:diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index ac0f79faf..666650acb 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -108,29 +108,35 @@ struct dtsplit {
 	struct pxdlist *pxdlist;
 };
 
 #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 
 /* get page buffer for specified block address */
 #define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
 do {									\
 	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
 	if (!(RC)) {							\
-		if ((BN) && !check_dtpage(P)) {				\
+		if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {	\
+			BT_PUTPAGE(MP);					\
+			jfs_error((IP)->i_sb,				\
+				  "DT_GETPAGE: dtree root page corrupt\n"); \
+			MP = NULL;					\
+			RC = -EIO;					\
+		} else if ((BN) && !check_dtpage(P)) {			\
 			BT_PUTPAGE(MP);					\
 			jfs_error((IP)->i_sb,				\
 				  "DT_GETPAGE: dtree page corrupt\n");	\
 			MP = NULL;					\
 			RC = -EIO;					\
 		}							\
 	}								\
 } while (0)
 
 /* for consistency */
 #define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
 
 #define DT_GETSEARCH(IP, LEAF, BN, MP, P, INDEX) \
 	BT_GETSEARCH(IP, LEAF, BN, MP, dtpage_t, P, INDEX, i_dtroot)
 
 /*
  * forward references
  */
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 28c3cf960..3a5f9d035 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -111,27 +111,28 @@ static int xtSplitRoot(tid_t tid, struct inode *ip,
 static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
 {
 	xtpage_t *p;
 	int rc;
 
 	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);
 
 	if (rc)
 		return ERR_PTR(rc);
 	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
 		(le16_to_cpu(p->header.nextindex) >
 			le16_to_cpu(p->header.maxentry)) ||
 		(le16_to_cpu(p->header.maxentry) >
-			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
+			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
+		((bn == 0) != !!(p->header.flag & BT_ROOT))) {
 		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
 		BT_PUTPAGE(*mp);
 		*mp = NULL;
 		return ERR_PTR(-EIO);
 	}
 	return p;
 }
 
 /*
  *	xtLookup()
  *
  * function: map a single page into a physical extent;
  */
]

194/4 2026/06/26 21:36 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 29653
							output: 18
							thoughts: 159
						

Thoughts:
**Analyzing the Patch's Impact**

Okay, so the diff is precisely what was requested, which is a good starting point. My root cause analysis confirms the issue: the pseudo-metapage in the inode is missing a valid wait queue. This leads to out-of-bounds memory access during `discard_metapage()` because the `BT_ROOT` flag is absent in the corrupted image. This absence results in `xtTruncate()` incorrectly treating the root page as a regular leaf page.

The proposed solution looks solid. It enforces a critical invariant: that `BT_ROOT` is *only* set when `bn` is zero, which is the root page. This fix is implemented within `xt_getpage()` and `DT_GETPAGE()`, which is appropriate given their role in page retrieval.

I'm comfortable with the patch's central logic. However, I want to perform a quick sanity check. I'll need to confirm if `BT_GETPAGE` is used directly in any other areas of the code base. A quick code search to ensure this isn't a wider issue seems prudent to rule out any unforeseen consequences of the new constraints.



195/4 2026/06/26 21:37 tool grepper
0m Args:
map[Expression:BT_GETPAGE]

Results:
map[Output:fs/jfs/jfs_btree.h=17=struct btpage {
--
fs/jfs/jfs_btree.h-53-/* get the page buffer and the page for specified block address */
fs/jfs/jfs_btree.h:54:#define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\
fs/jfs/jfs_btree.h-55-{\
--
fs/jfs/jfs_dtree.c=115=do {									\
fs/jfs/jfs_dtree.c:116:	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
fs/jfs/jfs_dtree.c-117-	if (!(RC)) {							\
--
fs/jfs/jfs_xtree.c=111=static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
--
fs/jfs/jfs_xtree.c-115-
fs/jfs/jfs_xtree.c:116:	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);
fs/jfs/jfs_xtree.c-117-
]

196/4 2026/06/26 21:37 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 30425
							output: 15
							thoughts: 147
						

Thoughts:
**Final Thoughts on the JFS Fix**

Okay, so I've confirmed it. `BT_GETPAGE` is exclusively used within `DT_GETPAGE` and `xt_getpage`. This means the correction is solid and complete.

Now, I need to craft the final response. I'll clearly articulate that I've introduced the invariant check for `BT_ROOT` in both `xt_getpage()` and `DT_GETPAGE()`. Regarding the `DT_GETPAGE` macro, I opted for a direct update of the macro itself. This was the simpler and safer route, avoiding the potential pitfalls of refactoring it into an inline function. Imagine, I'd have to touch 18 instances within `fs/jfs/jfs_dtree.c`! No, sticking with the macro keeps things clean.

The whole approach also aligns perfectly with the existing JFS style: centralized, early validation, and standard error handling. We're keeping things consistent and robust.



197/4 2026/06/26 21:37 tool patch-diff
0m Args:
map[File:]

Results:
map[Output:diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index ac0f79faf..666650acb 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -108,29 +108,35 @@ struct dtsplit {
 	struct pxdlist *pxdlist;
 };
 
 #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 
 /* get page buffer for specified block address */
 #define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
 do {									\
 	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
 	if (!(RC)) {							\
-		if ((BN) && !check_dtpage(P)) {				\
+		if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {	\
+			BT_PUTPAGE(MP);					\
+			jfs_error((IP)->i_sb,				\
+				  "DT_GETPAGE: dtree root page corrupt\n"); \
+			MP = NULL;					\
+			RC = -EIO;					\
+		} else if ((BN) && !check_dtpage(P)) {			\
 			BT_PUTPAGE(MP);					\
 			jfs_error((IP)->i_sb,				\
 				  "DT_GETPAGE: dtree page corrupt\n");	\
 			MP = NULL;					\
 			RC = -EIO;					\
 		}							\
 	}								\
 } while (0)
 
 /* for consistency */
 #define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
 
 #define DT_GETSEARCH(IP, LEAF, BN, MP, P, INDEX) \
 	BT_GETSEARCH(IP, LEAF, BN, MP, dtpage_t, P, INDEX, i_dtroot)
 
 /*
  * forward references
  */
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 28c3cf960..3a5f9d035 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -111,27 +111,28 @@ static int xtSplitRoot(tid_t tid, struct inode *ip,
 static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
 {
 	xtpage_t *p;
 	int rc;
 
 	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);
 
 	if (rc)
 		return ERR_PTR(rc);
 	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
 		(le16_to_cpu(p->header.nextindex) >
 			le16_to_cpu(p->header.maxentry)) ||
 		(le16_to_cpu(p->header.maxentry) >
-			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
+			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
+		((bn == 0) != !!(p->header.flag & BT_ROOT))) {
 		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
 		BT_PUTPAGE(*mp);
 		*mp = NULL;
 		return ERR_PTR(-EIO);
 	}
 	return p;
 }
 
 /*
  *	xtLookup()
  *
  * function: map a single page into a physical extent;
  */
]

198/4 2026/06/26 21:37 llm patch-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31843
							output: 458
							thoughts: 15
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Finalizing the Response: Diff Confirmed**

Alright, the diff checks out. No lingering edge cases, no unexpected regressions. The logic holds, the tests pass, and the impact assessment aligns with the design. It's clean, correct, and represents the best solution to the problem, as agreed upon. Time to move past the verification phase and get to crafting the final response. My attention now shifts to clear and concise communication. My goal is to ensure the response is not only technically sound, but also effectively conveys the solution, its implications, and any necessary considerations to the intended audience, while maintaining professional standards. Let's make sure it's succinct, informative, and leaves no room for ambiguity.



199/3 2026/06/26 21:37 action test-patch
34m Results:
map[PatchDiff:diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index ac0f79faf..bbb157daf 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -111,19 +111,26 @@ struct dtsplit {
 #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 
 /* get page buffer for specified block address */
-#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
-do {									\
-	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
-	if (!(RC)) {							\
-		if ((BN) && !check_dtpage(P)) {				\
-			BT_PUTPAGE(MP);					\
-			jfs_error((IP)->i_sb,				\
-				  "DT_GETPAGE: dtree page corrupt\n");	\
-			MP = NULL;					\
-			RC = -EIO;					\
-		}							\
-	}								\
-} while (0)
+#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)                                       \
+	do {                                                                      \
+		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);          \
+		if (!(RC)) {                                                      \
+			if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {      \
+				BT_PUTPAGE(MP);                                   \
+				jfs_error(                                        \
+					(IP)->i_sb,                               \
+					"DT_GETPAGE: dtree root page corrupt\n"); \
+				MP = NULL;                                        \
+				RC = -EIO;                                        \
+			} else if ((BN) && !check_dtpage(P)) {                    \
+				BT_PUTPAGE(MP);                                   \
+				jfs_error((IP)->i_sb,                             \
+					  "DT_GETPAGE: dtree page corrupt\n");    \
+				MP = NULL;                                        \
+				RC = -EIO;                                        \
+			}                                                         \
+		}                                                                 \
+	} while (0)
 
 /* for consistency */
 #define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 28c3cf960..6d960dd96 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -118,10 +118,11 @@ static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **m
 	if (rc)
 		return ERR_PTR(rc);
 	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
-		(le16_to_cpu(p->header.nextindex) >
-			le16_to_cpu(p->header.maxentry)) ||
-		(le16_to_cpu(p->header.maxentry) >
-			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
+	    (le16_to_cpu(p->header.nextindex) >
+	     le16_to_cpu(p->header.maxentry)) ||
+	    (le16_to_cpu(p->header.maxentry) >
+	     ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
+	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {
 		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
 		BT_PUTPAGE(*mp);
 		*mp = NULL;
 TestError:]

200/1 2026/06/26 22:12 agent fixes-finder
1m Model:
gemini-3.1-pro-preview

Results:
map[FixesHash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2]

Instruction:
You are an experienced Linux kernel developer tasked with identifying the commit
that introduced the bug being fixed. Identifying the correct buggy commit is crucial
for proper kernel maintenance (backporting to stable trees, etc.).

Your investigation strategy:
1. Examine the patch that fixes the bug. Use git tools (like git-log or git-blame)
   to trace the history of the lines or functions modified by the patch.
2. Analyze the stack trace in the crash report. Identify the key files and functions
   involved in the crash and investigate their history to see when the problematic
   logic was introduced.
3. Compare the bug explanation with the commit history to find the point where
   the described logic error first appeared.

A bug is typically introduced when a piece of code is first written, or when
a refactoring changed its logic in a way that introduced the bug.
Trace the history of relevant symbols or find when specific code patterns were introduced/removed.

You must provide exactly one bug-introducing commit hash.
If you are unable to confidently determine the bug-introducing commit after investigation,
return an empty string rather than guessing.

Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
The crash is:

BUG: spinlock bad magic on CPU#0, syz-executor/6066
 lock: 0xffff888120999b48, .magic: ffffffff, .owner: �������� �������/-1902340672, .owner_cpu: 768
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in /app/workdir/cache/src/1583fc50e73bc268b47064ec35fa43904fad8ca1/kernel/locking/qspinlock.h:68:9
index 8945 is out of range for type 'unsigned long[8]'
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 ubsan_epilogue+0xa/0x30 lib/ubsan.c:233
 __ubsan_handle_out_of_bounds+0xe8/0xf0 lib/ubsan.c:455
 decode_tail kernel/locking/qspinlock.h:68 [inline]
 __pv_queued_spin_lock_slowpath+0xaf3/0xbc0 kernel/locking/qspinlock.c:285
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:35 [inline]
 queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:66 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x26c/0x2f0 kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
---[ end trace ]---



The explanation of the root cause is:

An excellent catch! The crash is caused by a corrupted JFS image that tricks the kernel into calling `release_metapage()` on a pseudo-metapage embedded within the inode, leading to an out-of-bounds memory access and a spinlock crash.

Here is the detailed root cause analysis and the proposed fix.

### Root Cause Analysis

1. **The Pseudo-Metapage:**
   When operating on the root page of an xtree or dtree (which is stored inline within the inode), JFS doesn't use a real `struct metapage`. Instead, `BT_GETPAGE` (called via `xt_getpage` for `bn == 0`) sets the metapage pointer `mp` to the address of `JFS_IP(ip)->bxflag`:
   ```c
   // fs/jfs/jfs_btree.h
   #define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\
   {\
       if ((BN) == 0)\
       {\
           MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
           P = (TYPE *)&JFS_IP(IP)->ROOT;\
           RC = 0;\
       }\
       // ...
   ```
   Because this is a pseudo-metapage, it does not have a valid `wait_queue_head_t wait` field. Accessing `mp->wait` (which is at offset 64 in `struct metapage`) actually reads out-of-bounds memory in `struct jfs_inode_info` (overlapping with `rdwrlock` or `anon_inode_list`).

2. **The Missing Validation:**
   In `xt_getpage()`, the code validates `nextindex` and `maxentry`, but it **fails to verify that the `BT_ROOT` flag is set** in `p->header.flag` for the root page (`bn == 0`). In the corrupted syzkaller image, the inline xtree root page (`i_xtroot`) has a corrupted `header.flag` where `BT_ROOT` is missing.

3. **The Vulnerable Path in `xtTruncate`:**
   When `xtTruncate()` processes this corrupted root page and it becomes empty, it checks if it is the root page by looking at the `BT_ROOT` flag:
   ```c
   // fs/jfs/jfs_xtree.c : xtTruncate()
           if (p->header.flag & BT_ROOT) {
               // ...
               XT_PUTPAGE(mp);
               goto out;
           } else {
               if (log) {
                   XT_PUTPAGE(mp);
               } else {
                   if (mp->lid)
                       lid_to_tlock(mp->lid)->flag |= tlckFREELOCK;

                   /* invalidate empty leaf page */
                   discard_metapage(mp);
               }
           }
   ```
   Because `BT_ROOT` is missing due to corruption, `xtTruncate` takes the `else` branch, mistakenly treating the root page as a regular leaf page, and calls `discard_metapage(mp)`.

4. **The Crash:**
   Unlike `XT_PUTPAGE` (which wraps `BT_PUTPAGE` and safely checks `!BT_IS_ROOT(mp)` before releasing), `discard_metapage()` calls `release_metapage(mp)` directly:
   ```c
   // fs/jfs/jfs_metapage.h
   static inline void discard_metapage(struct metapage *mp)
   {
       clear_bit(META_dirty, &mp->flag);
       set_bit(META_discard, &mp->flag);
       release_metapage(mp);
   }
   ```
   `release_metapage()` assumes `mp` is a real metapage and calls `unlock_metapage(mp)`, which executes `wake_up(&mp->wait)`. Since `mp` points to `&JFS_IP(ip)->bxflag`, this accesses garbage memory, resulting in the `spinlock bad magic` BUG or the UBSAN out-of-bounds array access.

### Proposed Fix

To fix this, we must enforce the invariant that the `BT_ROOT` flag is set **if and only if** `bn == 0`. 

**1. Fix in `xt_getpage` (`fs/jfs/jfs_xtree.c`):**
Add a check to ensure `BT_ROOT` consistency:
```c
static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
{
	xtpage_t *p;
	int rc;

	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);

	if (rc)
		return ERR_PTR(rc);
	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
	    (le16_to_cpu(p->header.nextindex) > le16_to_cpu(p->header.maxentry)) ||
	    (le16_to_cpu(p->header.maxentry) > ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {      // <--- ADD THIS CHECK
		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	}
	return p;
}
```

**2. Fix in `DT_GETPAGE` (`fs/jfs/jfs_dtree.c`):**
The exact same vulnerability exists for dtree pages (e.g., `dtDeleteUp` can crash the same way if `i_dtroot` is corrupted). The `DT_GETPAGE` macro should be updated to enforce the same `BT_ROOT` invariant:
```c
#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
do {									\
	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
	if (!(RC)) {							\
		if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {	\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree root page corrupt\n"); \
			MP = NULL;					\
			RC = -EIO;					\
		} else if ((BN) && !check_dtpage(P)) {			\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree page corrupt\n");	\
			MP = NULL;					\
			RC = -EIO;					\
		}							\
	}								\
} while (0)
```


The patch that fixes the bug is:

diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index ac0f79faf..bbb157daf 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -111,19 +111,26 @@ struct dtsplit {
 #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 
 /* get page buffer for specified block address */
-#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
-do {									\
-	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
-	if (!(RC)) {							\
-		if ((BN) && !check_dtpage(P)) {				\
-			BT_PUTPAGE(MP);					\
-			jfs_error((IP)->i_sb,				\
-				  "DT_GETPAGE: dtree page corrupt\n");	\
-			MP = NULL;					\
-			RC = -EIO;					\
-		}							\
-	}								\
-} while (0)
+#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)                                       \
+	do {                                                                      \
+		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);          \
+		if (!(RC)) {                                                      \
+			if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {      \
+				BT_PUTPAGE(MP);                                   \
+				jfs_error(                                        \
+					(IP)->i_sb,                               \
+					"DT_GETPAGE: dtree root page corrupt\n"); \
+				MP = NULL;                                        \
+				RC = -EIO;                                        \
+			} else if ((BN) && !check_dtpage(P)) {                    \
+				BT_PUTPAGE(MP);                                   \
+				jfs_error((IP)->i_sb,                             \
+					  "DT_GETPAGE: dtree page corrupt\n");    \
+				MP = NULL;                                        \
+				RC = -EIO;                                        \
+			}                                                         \
+		}                                                                 \
+	} while (0)
 
 /* for consistency */
 #define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 28c3cf960..6d960dd96 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -118,10 +118,11 @@ static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **m
 	if (rc)
 		return ERR_PTR(rc);
 	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
-		(le16_to_cpu(p->header.nextindex) >
-			le16_to_cpu(p->header.maxentry)) ||
-		(le16_to_cpu(p->header.maxentry) >
-			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
+	    (le16_to_cpu(p->header.nextindex) >
+	     le16_to_cpu(p->header.maxentry)) ||
+	    (le16_to_cpu(p->header.maxentry) >
+	     ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
+	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {
 		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
 		BT_PUTPAGE(*mp);
 		*mp = NULL;


Search for the commit(s) that introduced this bug.

201/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10092
							output: 56
							thoughts: 177
						

Thoughts:
**Debugging a JFS Root Page Issue**

Okay, so I've pinned down the bug. It's in the JFS file system, and it looks like the culprit is how it's handling pseudo-metapages for the root pages of the xtree and dtree structures. That's a good start. The proposed fix, which involves adding a check: `((bn == 0) != !!(p->header.flag & BT_ROOT))` within `xt_getpage` and `DT_GETPAGE`, seems reasonable on the surface. Now, I need to understand *when* this issue was introduced.

The critical next step is to figure out the history of `xt_getpage` and `DT_GETPAGE`. I need to identify when these functions were introduced, or, more specifically, when the logic that allows `bn == 0` without properly checking the `BT_ROOT` flag appeared. My best bet is to dive into the code's version history. I'll focus on `fs/jfs/jfs_xtree.c` and `fs/jfs/jfs_dtree.c` specifically.

I'll use `git log` to trace the evolution of these files and pinpoint the relevant commits. That should give me a solid timeframe for when the problematic code was likely introduced and, ideally, provide some context about the reasoning behind the implementation. This should provide me with the specific commit(s) I need to see the reasoning behind the design, and where the issue lies.



202/2 2026/06/26 22:12 tool git-log
0m Error:
log-in to see details

Args:
map[PathPrefix:fs/jfs/jfs_xtree.c SourcePath:fs/jfs/jfs_xtree.c SymbolName:xt_getpage]

Results:
map[Output:]

203/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10671
							output: 38
							thoughts: 19
						

Thoughts:
Okay, here's my summary, tailored as if I'm an expert in the field thinking through this:

**Streamlining Data References**

Right, so I'm thinking about the way we're handling symbols and their paths. It's becoming clear that for clarity and efficiency, I should be using `SymbolName` and `SourcePath` directly, without relying on that `PathPrefix` parameter in the context where I'm working now. The `PathPrefix` has its place, but in this specific part of the code/system, it’s just adding an unnecessary layer of indirection. It’s making things harder to reason about and potentially slowing things down. Going with the raw `SymbolName` and `SourcePath` will keep things cleaner and more intuitive. Seems obvious, really.



204/2 2026/06/26 22:12 tool git-log
0m Args:
map[SourcePath:fs/jfs/jfs_xtree.c SymbolName:xt_getpage]

Results:
map[Output:1014354cd8d4 jfs: jfs_xtree: replace XT_GETPAGE macro with xt_getpage()
f720e3ba5586 JFS: Whitespace cleanup and remove some dead code
1da177e4c3f4 Linux-2.6.12-rc2
]

205/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10989
							output: 26
							thoughts: 19
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Diving into Commit 1014354cd8d4**

Alright, let's pull up that commit hash: `1014354cd8d4`. Hmm, the first thing I'm doing is seeing what's been changed, what was committed, the files affected. My goal is to quickly understand the impact of these changes. I'll be looking for clues immediately: what's been added, removed, or modified? Were there bug fixes? New feature implementations? Code refactoring? Any potential breaking changes or vulnerabilities?

Now, given my level of expertise, I'm already formulating some hypotheses about the work. I'll pay close attention to the specific lines of code, the context within the larger project, and any associated commit messages or PR descriptions (if available). The diff itself is the primary source, but I'll consider it only in terms of what I would expect to see, or would have written myself, given the context. I'm scanning for patterns, stylistic choices, adherence to coding standards, and any potential inefficiencies. I'm checking for edge cases, performance implications, and how this change interacts with existing systems. My experience allows me to anticipate and potentially raise questions about the code, but I'll need to see if my hypotheses bear out in the code itself.



206/2 2026/06/26 22:12 tool git-show
0m Args:
map[Commit:1014354cd8d4]

Results:
map[Output:commit 1014354cd8d40e81e9a6e9037a10ebfc0b656d27
Author: Suchit Karunakaran <suchitkarunakaran@gmail.com>
Date:   Thu Jun 5 23:26:34 2025 +0530

    jfs: jfs_xtree: replace XT_GETPAGE macro with xt_getpage()
    
    Replace legacy XT_GETPAGE macro with an inline function that returns a
    xtpage_t pointer and update all instances of XT_GETPAGE in jfs_xtree.c
    
    Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
    
    Simplified xt_getpage by removing size and rc arguments.
    
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 5ee618d17e77..28c3cf960c6f 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -49,26 +49,6 @@
 
 #define XT_PAGE(IP, MP) BT_PAGE(IP, MP, xtpage_t, i_xtroot)
 
-/* get page buffer for specified block address */
-/* ToDo: Replace this ugly macro with a function */
-#define XT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
-do {									\
-	BT_GETPAGE(IP, BN, MP, xtpage_t, SIZE, P, RC, i_xtroot);	\
-	if (!(RC)) {							\
-		if ((le16_to_cpu((P)->header.nextindex) < XTENTRYSTART) || \
-		    (le16_to_cpu((P)->header.nextindex) >		\
-		     le16_to_cpu((P)->header.maxentry)) ||		\
-		    (le16_to_cpu((P)->header.maxentry) >		\
-		     (((BN) == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) { \
-			jfs_error((IP)->i_sb,				\
-				  "XT_GETPAGE: xtree page corrupt\n");	\
-			BT_PUTPAGE(MP);					\
-			MP = NULL;					\
-			RC = -EIO;					\
-		}							\
-	}								\
-} while (0)
-
 /* for consistency */
 #define XT_PUTPAGE(MP) BT_PUTPAGE(MP)
 
@@ -114,6 +94,42 @@ static int xtSplitPage(tid_t tid, struct inode *ip, struct xtsplit * split,
 static int xtSplitRoot(tid_t tid, struct inode *ip,
 		       struct xtsplit * split, struct metapage ** rmpp);
 
+/*
+ *	xt_getpage()
+ *
+ * function:	get the page buffer for a specified block address.
+ *
+ * parameters:
+ *	ip      - pointer to the inode
+ *	bn      - block number (s64) of the xtree page to be retrieved;
+ *	mp      - pointer to a metapage pointer where the page buffer is returned;
+ *
+ * returns:
+ *      A pointer to the xtree page (xtpage_t) on success, -EIO on error.
+ */
+
+static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
+{
+	xtpage_t *p;
+	int rc;
+
+	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);
+
+	if (rc)
+		return ERR_PTR(rc);
+	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
+		(le16_to_cpu(p->header.nextindex) >
+			le16_to_cpu(p->header.maxentry)) ||
+		(le16_to_cpu(p->header.maxentry) >
+			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
+		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
+		BT_PUTPAGE(*mp);
+		*mp = NULL;
+		return ERR_PTR(-EIO);
+	}
+	return p;
+}
+
 /*
  *	xtLookup()
  *
@@ -216,7 +232,6 @@ static int xtSearch(struct inode *ip, s64 xoff,	s64 *nextp,
 		    int *cmpp, struct btstack * btstack, int flag)
 {
 	struct jfs_inode_info *jfs_ip = JFS_IP(ip);
-	int rc = 0;
 	int cmp = 1;		/* init for empty page */
 	s64 bn;			/* block number */
 	struct metapage *mp;	/* page buffer */
@@ -252,9 +267,9 @@ static int xtSearch(struct inode *ip, s64 xoff,	s64 *nextp,
 	 */
 	for (bn = 0;;) {
 		/* get/pin the page to search */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		/* try sequential access heuristics with the previous
 		 * access entry in target leaf page:
@@ -807,10 +822,10 @@ xtSplitUp(tid_t tid,
 		 * insert router entry in parent for new right child page <rp>
 		 */
 		/* get/pin the parent page <sp> */
-		XT_GETPAGE(ip, parent->bn, smp, PSIZE, sp, rc);
-		if (rc) {
+		sp = xt_getpage(ip, parent->bn, &smp);
+		if (IS_ERR(sp)) {
 			XT_PUTPAGE(rcmp);
-			return rc;
+			return PTR_ERR(sp);
 		}
 
 		/*
@@ -1062,10 +1077,10 @@ xtSplitPage(tid_t tid, struct inode *ip,
 	 * update previous pointer of old next/right page of <sp>
 	 */
 	if (nextbn != 0) {
-		XT_GETPAGE(ip, nextbn, mp, PSIZE, p, rc);
-		if (rc) {
+		p = xt_getpage(ip, nextbn, &mp);
+		if (IS_ERR(p)) {
 			XT_PUTPAGE(rmp);
-			goto clean_up;
+			return PTR_ERR(p);
 		}
 
 		BT_MARK_DIRTY(mp, ip);
@@ -1417,9 +1432,9 @@ int xtExtend(tid_t tid,		/* transaction id */
 			return rc;
 
 		/* get back old page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 		/*
 		 * if leaf root has been split, original root has been
 		 * copied to new child page, i.e., original entry now
@@ -1433,9 +1448,9 @@ int xtExtend(tid_t tid,		/* transaction id */
 			XT_PUTPAGE(mp);
 
 			/* get new child page */
-			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-			if (rc)
-				return rc;
+			p = xt_getpage(ip, bn, &mp);
+			if (IS_ERR(p))
+				return PTR_ERR(p);
 
 			BT_MARK_DIRTY(mp, ip);
 			if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -1711,9 +1726,9 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 			return rc;
 
 		/* get back old page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 		/*
 		 * if leaf root has been split, original root has been
 		 * copied to new child page, i.e., original entry now
@@ -1727,9 +1742,9 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 			XT_PUTPAGE(mp);
 
 			/* get new child page */
-			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-			if (rc)
-				return rc;
+			p = xt_getpage(ip, bn, &mp);
+			if (IS_ERR(p))
+				return PTR_ERR(p);
 
 			BT_MARK_DIRTY(mp, ip);
 			if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -1788,9 +1803,9 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 		XT_PUTPAGE(mp);
 
 		/* get new right page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		BT_MARK_DIRTY(mp, ip);
 		if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -1864,9 +1879,9 @@ printf("xtUpdate.updateLeft.split p:0x%p\n", p);
 			return rc;
 
 		/* get back old page */
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		/*
 		 * if leaf root has been split, original root has been
@@ -1881,9 +1896,9 @@ printf("xtUpdate.updateLeft.split p:0x%p\n", p);
 			XT_PUTPAGE(mp);
 
 			/* get new child page */
-			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-			if (rc)
-				return rc;
+			p = xt_getpage(ip, bn, &mp);
+			if (IS_ERR(p))
+				return PTR_ERR(p);
 
 			BT_MARK_DIRTY(mp, ip);
 			if (!test_cflag(COMMIT_Nolink, ip)) {
@@ -2187,7 +2202,6 @@ void xtInitRoot(tid_t tid, struct inode *ip)
  */
 s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 {
-	int rc = 0;
 	s64 teof;
 	struct metapage *mp;
 	xtpage_t *p;
@@ -2268,9 +2282,9 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 	 * first access of each page:
 	 */
       getPage:
-	XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-	if (rc)
-		return rc;
+	p = xt_getpage(ip, bn, &mp);
+	if (IS_ERR(p))
+		return PTR_ERR(p);
 
 	/* process entries backward from last index */
 	index = le16_to_cpu(p->header.nextindex) - 1;
@@ -2506,9 +2520,9 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 
 	/* get back the parent page */
 	bn = parent->bn;
-	XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-	if (rc)
-		return rc;
+	p = xt_getpage(ip, bn, &mp);
+	if (IS_ERR(p))
+		return PTR_ERR(p);
 
 	index = parent->index;
 
@@ -2791,9 +2805,9 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
 		 * first access of each page:
 		 */
       getPage:
-		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc)
-			return rc;
+		p = xt_getpage(ip, bn, &mp);
+		if (IS_ERR(p))
+			return PTR_ERR(p);
 
 		/* process entries backward from last index */
 		index = le16_to_cpu(p->header.nextindex) - 1;
@@ -2836,9 +2850,9 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
 
 	/* get back the parent page */
 	bn = parent->bn;
-	XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-	if (rc)
-		return rc;
+	p = xt_getpage(ip, bn, &mp);
+	if (IS_ERR(p))
+		return PTR_ERR(p);
 
 	index = parent->index;
 
]

207/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15039
							output: 38
							thoughts: 462
						

Thoughts:
**Analyzing the `xt_getpage` Implementation and Identifying a Potential Issue**

Okay, so I'm looking at commit `1014354cd8d40e81e9a6e9037a10ebfc0b656d27`, which replaces the `XT_GETPAGE` macro with the function `xt_getpage`. This macro was originally introduced way back in `1da177e4c3f4`, around the Linux-2.6.12-rc2 era. The macro itself looks like this:

```c
#define XT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
do {									\
	BT_GETPAGE(IP, BN, MP, xtpage_t, SIZE, P, RC, i_xtroot);	\
	if (!(RC)) {							\
		if ((le16_to_cpu((P)->header.nextindex) < XTENTRYSTART) || \
		    (le16_to_cpu((P)->header.nextindex) >		\
		     le16_to_cpu((P)->header.maxentry)) ||		\
		    (le16_to_cpu((P)->header.maxentry) >		\
		     (((BN) == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) { \
			jfs_error((IP)->i_sb,				\
				  "XT_GETPAGE: xtree page corrupt\n");	\
			BT_PUTPAGE(MP);					\
			MP = NULL;					\
			RC = -EIO;					\
		}							\
	}								\
} while (0)
```

Now, the interesting thing here is the behavior of `BT_GETPAGE` when `BN == 0`. I know that `BT_GETPAGE` actually handles this case by returning a pseudo-metapage. And the critical thought is that neither the macro, nor the new function `xt_getpage`, explicitly checks if `BT_ROOT` is set when `BN == 0`. This smells like a potential bug. It's a subtle point, but an important one for the integrity of the xtree structure.

The same concern applies to `DT_GETPAGE` as well. I'm going to take a closer look at the history of `DT_GETPAGE` to see if there's anything similar there.



208/2 2026/06/26 22:12 tool git-log
0m Error:
log-in to see details

Args:
map[SourcePath:fs/jfs/jfs_dtree.c SymbolName:DT_GETPAGE]

Results:
map[Output:]

209/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16127
							output: 41
							thoughts: 36
						

Thoughts:
Okay, here's my interpretation of those thoughts, tailored for an expert audience:

**Investigating a Potential Symbol Lookup Issue**

Right, so I'm thinking about how to track down the source of this issue, and the `DT_GETPAGE` macro jumps out. Because it's a macro, the direct usage of `SymbolName` might be problematic or even ineffective in this particular context. I need to get at the source.

That's where `git-log` combined with `CodeRegexp` will likely come to my rescue. By searching for a pattern surrounding the macro usage within the project history, I can likely pinpoint the exact commit(s) responsible. This should allow me to trace the relevant changes and potentially identify the issue's root cause with reasonable efficiency. This is a solid starting point for troubleshooting.



210/2 2026/06/26 22:12 tool git-log
0m Args:
map[CodeRegexp:#define DT_GETPAGE PathPrefix:fs/jfs/jfs_dtree.c]

Results:
map[Output:eb8630d7d2fd jfs: Update jfs_error
1da177e4c3f4 Linux-2.6.12-rc2
]

211/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16433
							output: 25
							thoughts: 16
						

Thoughts:
Okay, here's my interpretation of that "thought," presented as a first-person summary, keeping in mind my expert perspective:

**Decoding the Identifier: eb8630d7d2fd**

Right, let's break this down. Seeing `eb8630d7d2fd` immediately triggers a mental checklist. First, the format screams *identifier* or *hash* of some kind. The length and hexadecimal nature are the giveaways. It's likely a unique key, a fingerprint, or a code referencing something larger. Is this a commit hash? A file ID? A database key? The possibilities are vast, really.

My expertise tells me I need context to understand it fully. Without that, I can only make educated guesses. The length is probably 128 bits, typical for many cryptographic hash functions like SHA-1 or MD5 or newer ones. But, given that those are increasingly deprecated, it's more likely a longer hash is being used or some other identifier altogether. I'm going to want to know the system where this appears and how the data is stored to understand its meaning. This could be a pointer to a specific state in an application, a log entry, or a representation of some sort of data. Ultimately, without context it's a piece of a puzzle without the picture.



212/2 2026/06/26 22:12 tool git-show
0m Args:
map[Commit:eb8630d7d2fd]

Results:
map[Output:commit eb8630d7d2fd13589e6a7a3ae2fe1f75f867fbed
Author: Joe Perches <joe@perches.com>
Date:   Tue Jun 4 16:39:15 2013 -0700

    jfs: Update jfs_error
    
    Use a more current logging style.
    
    Add __printf format and argument verification.
    
    Remove embedded function names from formats.
    Add %pf, __builtin_return_address(0) to jfs_error.
    Add newlines to formats for kernel style consistency.
    (One format already had an erroneous newline)
    Coalesce formats and align arguments.
    
    Object size reduced ~1KiB.
    
    $ size fs/jfs/built-in.o*
       text    data     bss     dec     hex filename
     201891   35488   63936  301315   49903 fs/jfs/built-in.o.new
     202821   35488   64192  302501   49da5 fs/jfs/built-in.o.old
    
    Signed-off-by: Joe Perches <joe@perches.com>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 9a55f53be5ff..370d7b6c5942 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -346,8 +346,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks)
 		printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n",
 		       (unsigned long long) blkno,
 		       (unsigned long long) nblocks);
-		jfs_error(ip->i_sb,
-			  "dbFree: block to be freed is outside the map");
+		jfs_error(ip->i_sb, "block to be freed is outside the map\n");
 		return -EIO;
 	}
 
@@ -384,7 +383,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks)
 
 		/* free the blocks. */
 		if ((rc = dbFreeDmap(bmp, dp, blkno, nb))) {
-			jfs_error(ip->i_sb, "dbFree: error in block map\n");
+			jfs_error(ip->i_sb, "error in block map\n");
 			release_metapage(mp);
 			IREAD_UNLOCK(ipbmap);
 			return (rc);
@@ -441,8 +440,7 @@ dbUpdatePMap(struct inode *ipbmap,
 		printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n",
 		       (unsigned long long) blkno,
 		       (unsigned long long) nblocks);
-		jfs_error(ipbmap->i_sb,
-			  "dbUpdatePMap: blocks are outside the map");
+		jfs_error(ipbmap->i_sb, "blocks are outside the map\n");
 		return -EIO;
 	}
 
@@ -726,7 +724,7 @@ int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results)
 
 	/* the hint should be within the map */
 	if (hint >= mapSize) {
-		jfs_error(ip->i_sb, "dbAlloc: the hint is outside the map");
+		jfs_error(ip->i_sb, "the hint is outside the map\n");
 		return -EIO;
 	}
 
@@ -1057,8 +1055,7 @@ static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks)
 	bmp = sbi->bmap;
 	if (lastblkno < 0 || lastblkno >= bmp->db_mapsize) {
 		IREAD_UNLOCK(ipbmap);
-		jfs_error(ip->i_sb,
-			  "dbExtend: the block is outside the filesystem");
+		jfs_error(ip->i_sb, "the block is outside the filesystem\n");
 		return -EIO;
 	}
 
@@ -1134,8 +1131,7 @@ static int dbAllocNext(struct bmap * bmp, struct dmap * dp, s64 blkno,
 	u32 mask;
 
 	if (dp->tree.leafidx != cpu_to_le32(LEAFIND)) {
-		jfs_error(bmp->db_ipbmap->i_sb,
-			  "dbAllocNext: Corrupt dmap page");
+		jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmap page\n");
 		return -EIO;
 	}
 
@@ -1265,8 +1261,7 @@ dbAllocNear(struct bmap * bmp,
 	s8 *leaf;
 
 	if (dp->tree.leafidx != cpu_to_le32(LEAFIND)) {
-		jfs_error(bmp->db_ipbmap->i_sb,
-			  "dbAllocNear: Corrupt dmap page");
+		jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmap page\n");
 		return -EIO;
 	}
 
@@ -1381,8 +1376,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
 	 */
 	if (l2nb > bmp->db_agl2size) {
 		jfs_error(bmp->db_ipbmap->i_sb,
-			  "dbAllocAG: allocation request is larger than the "
-			  "allocation group size");
+			  "allocation request is larger than the allocation group size\n");
 		return -EIO;
 	}
 
@@ -1417,7 +1411,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
 			       (unsigned long long) blkno,
 			       (unsigned long long) nblocks);
 			jfs_error(bmp->db_ipbmap->i_sb,
-				  "dbAllocAG: dbAllocCtl failed in free AG");
+				  "dbAllocCtl failed in free AG\n");
 		}
 		return (rc);
 	}
@@ -1433,8 +1427,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
 	budmin = dcp->budmin;
 
 	if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
-		jfs_error(bmp->db_ipbmap->i_sb,
-			  "dbAllocAG: Corrupt dmapctl page");
+		jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmapctl page\n");
 		release_metapage(mp);
 		return -EIO;
 	}
@@ -1475,7 +1468,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
 			}
 			if (n == 4) {
 				jfs_error(bmp->db_ipbmap->i_sb,
-					  "dbAllocAG: failed descending stree");
+					  "failed descending stree\n");
 				release_metapage(mp);
 				return -EIO;
 			}
@@ -1515,8 +1508,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
 				       &blkno))) {
 				if (rc == -ENOSPC) {
 					jfs_error(bmp->db_ipbmap->i_sb,
-						  "dbAllocAG: control page "
-						  "inconsistent");
+						  "control page inconsistent\n");
 					return -EIO;
 				}
 				return (rc);
@@ -1528,7 +1520,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
 		rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
 		if (rc == -ENOSPC) {
 			jfs_error(bmp->db_ipbmap->i_sb,
-				  "dbAllocAG: unable to allocate blocks");
+				  "unable to allocate blocks\n");
 			rc = -EIO;
 		}
 		return (rc);
@@ -1587,8 +1579,7 @@ static int dbAllocAny(struct bmap * bmp, s64 nblocks, int l2nb, s64 * results)
 	 */
 	rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
 	if (rc == -ENOSPC) {
-		jfs_error(bmp->db_ipbmap->i_sb,
-			  "dbAllocAny: unable to allocate blocks");
+		jfs_error(bmp->db_ipbmap->i_sb, "unable to allocate blocks\n");
 		return -EIO;
 	}
 	return (rc);
@@ -1652,8 +1643,7 @@ s64 dbDiscardAG(struct inode *ip, int agno, s64 minlen)
 	range_cnt = min_t(u64, max_ranges + 1, 32 * 1024);
 	totrim = kmalloc(sizeof(struct range2trim) * range_cnt, GFP_NOFS);
 	if (totrim == NULL) {
-		jfs_error(bmp->db_ipbmap->i_sb,
-			  "dbDiscardAG: no memory for trim array");
+		jfs_error(bmp->db_ipbmap->i_sb, "no memory for trim array\n");
 		IWRITE_UNLOCK(ipbmap);
 		return 0;
 	}
@@ -1682,8 +1672,7 @@ s64 dbDiscardAG(struct inode *ip, int agno, s64 minlen)
 			nblocks = 1 << l2nb;
 		} else {
 			/* Trim any already allocated blocks */
-			jfs_error(bmp->db_ipbmap->i_sb,
-				"dbDiscardAG: -EIO");
+			jfs_error(bmp->db_ipbmap->i_sb, "-EIO\n");
 			break;
 		}
 
@@ -1761,7 +1750,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
 
 		if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
 			jfs_error(bmp->db_ipbmap->i_sb,
-				  "dbFindCtl: Corrupt dmapctl page");
+				  "Corrupt dmapctl page\n");
 			release_metapage(mp);
 			return -EIO;
 		}
@@ -1782,7 +1771,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
 		if (rc) {
 			if (lev != level) {
 				jfs_error(bmp->db_ipbmap->i_sb,
-					  "dbFindCtl: dmap inconsistent");
+					  "dmap inconsistent\n");
 				return -EIO;
 			}
 			return -ENOSPC;
@@ -1906,7 +1895,7 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
 		if (dp->tree.stree[ROOT] != L2BPERDMAP) {
 			release_metapage(mp);
 			jfs_error(bmp->db_ipbmap->i_sb,
-				  "dbAllocCtl: the dmap is not all free");
+				  "the dmap is not all free\n");
 			rc = -EIO;
 			goto backout;
 		}
@@ -1953,7 +1942,7 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
 			 * to indicate that we have leaked blocks.
 			 */
 			jfs_error(bmp->db_ipbmap->i_sb,
-				  "dbAllocCtl: I/O Error: Block Leakage.");
+				  "I/O Error: Block Leakage\n");
 			continue;
 		}
 		dp = (struct dmap *) mp->data;
@@ -1965,8 +1954,7 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
 			 * to indicate that we have leaked blocks.
 			 */
 			release_metapage(mp);
-			jfs_error(bmp->db_ipbmap->i_sb,
-				  "dbAllocCtl: Block Leakage.");
+			jfs_error(bmp->db_ipbmap->i_sb, "Block Leakage\n");
 			continue;
 		}
 
@@ -2263,8 +2251,7 @@ static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
 			for (; nwords > 0; nwords -= nw) {
 				if (leaf[word] < BUDMIN) {
 					jfs_error(bmp->db_ipbmap->i_sb,
-						  "dbAllocBits: leaf page "
-						  "corrupt");
+						  "leaf page corrupt\n");
 					break;
 				}
 
@@ -2536,8 +2523,7 @@ dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level)
 	dcp = (struct dmapctl *) mp->data;
 
 	if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
-		jfs_error(bmp->db_ipbmap->i_sb,
-			  "dbAdjCtl: Corrupt dmapctl page");
+		jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmapctl page\n");
 		release_metapage(mp);
 		return -EIO;
 	}
@@ -2638,8 +2624,7 @@ dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level)
 			assert(level == bmp->db_maxlevel);
 			if (bmp->db_maxfreebud != oldroot) {
 				jfs_error(bmp->db_ipbmap->i_sb,
-					  "dbAdjCtl: the maximum free buddy is "
-					  "not the old root");
+					  "the maximum free buddy is not the old root\n");
 			}
 			bmp->db_maxfreebud = dcp->stree[ROOT];
 		}
@@ -3481,7 +3466,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno,	s64 nblocks)
 	p = BMAPBLKNO + nbperpage;	/* L2 page */
 	l2mp = read_metapage(ipbmap, p, PSIZE, 0);
 	if (!l2mp) {
-		jfs_error(ipbmap->i_sb, "dbExtendFS: L2 page could not be read");
+		jfs_error(ipbmap->i_sb, "L2 page could not be read\n");
 		return -EIO;
 	}
 	l2dcp = (struct dmapctl *) l2mp->data;
@@ -3646,8 +3631,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno,	s64 nblocks)
 		}
 	}			/* for each L1 in a L2 */
 
-	jfs_error(ipbmap->i_sb,
-		  "dbExtendFS: function has not returned as expected");
+	jfs_error(ipbmap->i_sb, "function has not returned as expected\n");
 errout:
 	if (l0mp)
 		release_metapage(l0mp);
@@ -3717,7 +3701,7 @@ void dbFinalizeBmap(struct inode *ipbmap)
 		}
 		if (bmp->db_agpref >= bmp->db_numag) {
 			jfs_error(ipbmap->i_sb,
-				  "cannot find ag with average freespace");
+				  "cannot find ag with average freespace\n");
 		}
 	}
 
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 0ddbeceafc62..c89424e71a0a 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -124,21 +124,21 @@ struct dtsplit {
 #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 
 /* get page buffer for specified block address */
-#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)\
-{\
-	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot)\
-	if (!(RC))\
-	{\
-		if (((P)->header.nextindex > (((BN)==0)?DTROOTMAXSLOT:(P)->header.maxslot)) ||\
-		    ((BN) && ((P)->header.maxslot > DTPAGEMAXSLOT)))\
-		{\
-			BT_PUTPAGE(MP);\
-			jfs_error((IP)->i_sb, "DT_GETPAGE: dtree page corrupt");\
-			MP = NULL;\
-			RC = -EIO;\
-		}\
-	}\
-}
+#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
+do {									\
+	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
+	if (!(RC)) {							\
+		if (((P)->header.nextindex >				\
+		     (((BN) == 0) ? DTROOTMAXSLOT : (P)->header.maxslot)) || \
+		    ((BN) && ((P)->header.maxslot > DTPAGEMAXSLOT))) {	\
+			BT_PUTPAGE(MP);					\
+			jfs_error((IP)->i_sb,				\
+				  "DT_GETPAGE: dtree page corrupt\n");	\
+			MP = NULL;					\
+			RC = -EIO;					\
+		}							\
+	}								\
+} while (0)
 
 /* for consistency */
 #define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
@@ -776,7 +776,7 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
 			/* Something's corrupted, mark filesystem dirty so
 			 * chkdsk will fix it.
 			 */
-			jfs_error(sb, "stack overrun in dtSearch!");
+			jfs_error(sb, "stack overrun!\n");
 			BT_STACK_DUMP(btstack);
 			rc = -EIO;
 			goto out;
@@ -3252,8 +3252,7 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 				/* Sanity Check */
 				if (d_namleft == 0) {
 					jfs_error(ip->i_sb,
-						  "JFS:Dtree error: ino = "
-						  "%ld, bn=%Ld, index = %d",
+						  "JFS:Dtree error: ino = %ld, bn=%lld, index = %d\n",
 						  (long)ip->i_ino,
 						  (long long)bn,
 						  i);
@@ -3373,7 +3372,7 @@ static int dtReadFirst(struct inode *ip, struct btstack * btstack)
 		 */
 		if (BT_STACK_FULL(btstack)) {
 			DT_PUTPAGE(mp);
-			jfs_error(ip->i_sb, "dtReadFirst: btstack overrun");
+			jfs_error(ip->i_sb, "btstack overrun\n");
 			BT_STACK_DUMP(btstack);
 			return -EIO;
 		}
diff --git a/fs/jfs/jfs_extent.c b/fs/jfs/jfs_extent.c
index e5fe8506ed16..2ae7d59ab10a 100644
--- a/fs/jfs/jfs_extent.c
+++ b/fs/jfs/jfs_extent.c
@@ -388,7 +388,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
 
 	if ((rc == 0) && xlen) {
 		if (xlen != nbperpage) {
-			jfs_error(ip->i_sb, "extHint: corrupt xtree");
+			jfs_error(ip->i_sb, "corrupt xtree\n");
 			rc = -EIO;
 		}
 		XADaddress(xp, xaddr);
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index f7e042b63ddb..f321986e73d2 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -386,7 +386,7 @@ int diRead(struct inode *ip)
 	dp += rel_inode;
 
 	if (ip->i_ino != le32_to_cpu(dp->di_number)) {
-		jfs_error(ip->i_sb, "diRead: i_ino != di_number");
+		jfs_error(ip->i_sb, "i_ino != di_number\n");
 		rc = -EIO;
 	} else if (le32_to_cpu(dp->di_nlink) == 0)
 		rc = -ESTALE;
@@ -625,7 +625,7 @@ int diWrite(tid_t tid, struct inode *ip)
 	if (!addressPXD(&(jfs_ip->ixpxd)) ||
 	    (lengthPXD(&(jfs_ip->ixpxd)) !=
 	     JFS_IP(ipimap)->i_imap->im_nbperiext)) {
-		jfs_error(ip->i_sb, "diWrite: ixpxd invalid");
+		jfs_error(ip->i_sb, "ixpxd invalid\n");
 		return -EIO;
 	}
 
@@ -893,8 +893,7 @@ int diFree(struct inode *ip)
 	if (iagno >= imap->im_nextiag) {
 		print_hex_dump(KERN_ERR, "imap: ", DUMP_PREFIX_ADDRESS, 16, 4,
 			       imap, 32, 0);
-		jfs_error(ip->i_sb,
-			  "diFree: inum = %d, iagno = %d, nextiag = %d",
+		jfs_error(ip->i_sb, "inum = %d, iagno = %d, nextiag = %d\n",
 			  (uint) inum, iagno, imap->im_nextiag);
 		return -EIO;
 	}
@@ -930,15 +929,14 @@ int diFree(struct inode *ip)
 	mask = HIGHORDER >> bitno;
 
 	if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) {
-		jfs_error(ip->i_sb,
-			  "diFree: wmap shows inode already free");
+		jfs_error(ip->i_sb, "wmap shows inode already free\n");
 	}
 
 	if (!addressPXD(&iagp->inoext[extno])) {
 		release_metapage(mp);
 		IREAD_UNLOCK(ipimap);
 		AG_UNLOCK(imap, agno);
-		jfs_error(ip->i_sb, "diFree: invalid inoext");
+		jfs_error(ip->i_sb, "invalid inoext\n");
 		return -EIO;
 	}
 
@@ -950,7 +948,7 @@ int diFree(struct inode *ip)
 		release_metapage(mp);
 		IREAD_UNLOCK(ipimap);
 		AG_UNLOCK(imap, agno);
-		jfs_error(ip->i_sb, "diFree: numfree > numinos");
+		jfs_error(ip->i_sb, "numfree > numinos\n");
 		return -EIO;
 	}
 	/*
@@ -1199,7 +1197,7 @@ int diFree(struct inode *ip)
 	 * for the inode being freed.
 	 */
 	if (iagp->pmap[extno] != 0) {
-		jfs_error(ip->i_sb, "diFree: the pmap does not show inode free");
+		jfs_error(ip->i_sb, "the pmap does not show inode free\n");
 	}
 	iagp->wmap[extno] = 0;
 	PXDlength(&iagp->inoext[extno], 0);
@@ -1518,8 +1516,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
 					release_metapage(mp);
 					AG_UNLOCK(imap, agno);
 					jfs_error(ip->i_sb,
-						  "diAlloc: can't find free bit "
-						  "in wmap");
+						  "can't find free bit in wmap\n");
 					return -EIO;
 				}
 
@@ -1660,7 +1657,7 @@ diAllocAG(struct inomap * imap, int agno, bool dir, struct inode *ip)
 	numinos = imap->im_agctl[agno].numinos;
 
 	if (numfree > numinos) {
-		jfs_error(ip->i_sb, "diAllocAG: numfree > numinos");
+		jfs_error(ip->i_sb, "numfree > numinos\n");
 		return -EIO;
 	}
 
@@ -1811,8 +1808,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
 	if (!iagp->nfreeinos) {
 		IREAD_UNLOCK(imap->im_ipimap);
 		release_metapage(mp);
-		jfs_error(ip->i_sb,
-			  "diAllocIno: nfreeinos = 0, but iag on freelist");
+		jfs_error(ip->i_sb, "nfreeinos = 0, but iag on freelist\n");
 		return -EIO;
 	}
 
@@ -1824,7 +1820,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
 			IREAD_UNLOCK(imap->im_ipimap);
 			release_metapage(mp);
 			jfs_error(ip->i_sb,
-				  "diAllocIno: free inode not found in summary map");
+				  "free inode not found in summary map\n");
 			return -EIO;
 		}
 
@@ -1839,7 +1835,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
 	if (rem >= EXTSPERSUM) {
 		IREAD_UNLOCK(imap->im_ipimap);
 		release_metapage(mp);
-		jfs_error(ip->i_sb, "diAllocIno: no free extent found");
+		jfs_error(ip->i_sb, "no free extent found\n");
 		return -EIO;
 	}
 	extno = (sword << L2EXTSPERSUM) + rem;
@@ -1850,7 +1846,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
 	if (rem >= INOSPEREXT) {
 		IREAD_UNLOCK(imap->im_ipimap);
 		release_metapage(mp);
-		jfs_error(ip->i_sb, "diAllocIno: free inode not found");
+		jfs_error(ip->i_sb, "free inode not found\n");
 		return -EIO;
 	}
 
@@ -1936,7 +1932,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)
 		IREAD_LOCK(imap->im_ipimap, RDWRLOCK_IMAP);
 		if ((rc = diIAGRead(imap, iagno, &mp))) {
 			IREAD_UNLOCK(imap->im_ipimap);
-			jfs_error(ip->i_sb, "diAllocExt: error reading iag");
+			jfs_error(ip->i_sb, "error reading iag\n");
 			return rc;
 		}
 		iagp = (struct iag *) mp->data;
@@ -1948,8 +1944,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)
 		if (sword >= SMAPSZ) {
 			release_metapage(mp);
 			IREAD_UNLOCK(imap->im_ipimap);
-			jfs_error(ip->i_sb,
-				  "diAllocExt: free ext summary map not found");
+			jfs_error(ip->i_sb, "free ext summary map not found\n");
 			return -EIO;
 		}
 		if (~iagp->extsmap[sword])
@@ -1962,7 +1957,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)
 	if (rem >= EXTSPERSUM) {
 		release_metapage(mp);
 		IREAD_UNLOCK(imap->im_ipimap);
-		jfs_error(ip->i_sb, "diAllocExt: free extent not found");
+		jfs_error(ip->i_sb, "free extent not found\n");
 		return -EIO;
 	}
 	extno = (sword << L2EXTSPERSUM) + rem;
@@ -2081,8 +2076,7 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino)
 		if (bmp)
 			release_metapage(bmp);
 
-		jfs_error(imap->im_ipimap->i_sb,
-			  "diAllocBit: iag inconsistent");
+		jfs_error(imap->im_ipimap->i_sb, "iag inconsistent\n");
 		return -EIO;
 	}
 
@@ -2189,7 +2183,7 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
 	/* better have free extents.
 	 */
 	if (!iagp->nfreeexts) {
-		jfs_error(imap->im_ipimap->i_sb, "diNewExt: no free extents");
+		jfs_error(imap->im_ipimap->i_sb, "no free extents\n");
 		return -EIO;
 	}
 
@@ -2261,7 +2255,7 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
 			}
 			if (ciagp == NULL) {
 				jfs_error(imap->im_ipimap->i_sb,
-					  "diNewExt: ciagp == NULL");
+					  "ciagp == NULL\n");
 				rc = -EIO;
 				goto error_out;
 			}
@@ -2498,7 +2492,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
 			IWRITE_UNLOCK(ipimap);
 			IAGFREE_UNLOCK(imap);
 			jfs_error(imap->im_ipimap->i_sb,
-				  "diNewIAG: ipimap->i_size is wrong");
+				  "ipimap->i_size is wrong\n");
 			return -EIO;
 		}
 
@@ -2758,8 +2752,7 @@ diUpdatePMap(struct inode *ipimap,
 	iagno = INOTOIAG(inum);
 	/* make sure that the iag is contained within the map */
 	if (iagno >= imap->im_nextiag) {
-		jfs_error(ipimap->i_sb,
-			  "diUpdatePMap: the iag is outside the map");
+		jfs_error(ipimap->i_sb, "the iag is outside the map\n");
 		return -EIO;
 	}
 	/* read the iag */
@@ -2788,13 +2781,13 @@ diUpdatePMap(struct inode *ipimap,
 		 */
 		if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) {
 			jfs_error(ipimap->i_sb,
-				  "diUpdatePMap: inode %ld not marked as "
-				  "allocated in wmap!", inum);
+				  "inode %ld not marked as allocated in wmap!\n",
+				  inum);
 		}
 		if (!(le32_to_cpu(iagp->pmap[extno]) & mask)) {
 			jfs_error(ipimap->i_sb,
-				  "diUpdatePMap: inode %ld not marked as "
-				  "allocated in pmap!", inum);
+				  "inode %ld not marked as allocated in pmap!\n",
+				  inum);
 		}
 		/* update the bitmap for the extent of the freed inode */
 		iagp->pmap[extno] &= cpu_to_le32(~mask);
@@ -2809,15 +2802,13 @@ diUpdatePMap(struct inode *ipimap,
 		if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) {
 			release_metapage(mp);
 			jfs_error(ipimap->i_sb,
-				  "diUpdatePMap: the inode is not allocated in "
-				  "the working map");
+				  "the inode is not allocated in the working map\n");
 			return -EIO;
 		}
 		if ((le32_to_cpu(iagp->pmap[extno]) & mask) != 0) {
 			release_metapage(mp);
 			jfs_error(ipimap->i_sb,
-				  "diUpdatePMap: the inode is not free in the "
-				  "persistent map");
+				  "the inode is not free in the persistent map\n");
 			return -EIO;
 		}
 		/* update the bitmap for the extent of the allocated inode */
@@ -2909,8 +2900,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
 		iagp = (struct iag *) bp->data;
 		if (le32_to_cpu(iagp->iagnum) != i) {
 			release_metapage(bp);
-			jfs_error(ipimap->i_sb,
-				  "diExtendFs: unexpected value of iagnum");
+			jfs_error(ipimap->i_sb, "unexpected value of iagnum\n");
 			return -EIO;
 		}
 
@@ -2986,8 +2976,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
 
 	if (xnuminos != atomic_read(&imap->im_numinos) ||
 	    xnumfree != atomic_read(&imap->im_numfree)) {
-		jfs_error(ipimap->i_sb,
-			  "diExtendFs: numinos or numfree incorrect");
+		jfs_error(ipimap->i_sb, "numinos or numfree incorrect\n");
 		return -EIO;
 	}
 
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 6740d34cd82b..6052c0d39382 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -646,7 +646,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
 	if (mp) {
 		if (mp->logical_size != size) {
 			jfs_error(inode->i_sb,
-				  "__get_metapage: mp->logical_size != size");
+				  "get_mp->logical_size != size\n");
 			jfs_err("logical_size = %d, size = %d",
 				mp->logical_size, size);
 			dump_stack();
@@ -657,8 +657,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
 		if (test_bit(META_discard, &mp->flag)) {
 			if (!new) {
 				jfs_error(inode->i_sb,
-					  "__get_metapage: using a "
-					  "discarded metapage");
+					  "using a discarded metapage\n");
 				discard_metapage(mp);
 				goto unlock;
 			}
diff --git a/fs/jfs/jfs_superblock.h b/fs/jfs/jfs_superblock.h
index 884fc21ab8ee..04847b8d3070 100644
--- a/fs/jfs/jfs_superblock.h
+++ b/fs/jfs/jfs_superblock.h
@@ -108,6 +108,7 @@ struct jfs_superblock {
 
 extern int readSuper(struct super_block *, struct buffer_head **);
 extern int updateSuper(struct super_block *, uint);
+__printf(2, 3)
 extern void jfs_error(struct super_block *, const char *, ...);
 extern int jfs_mount(struct super_block *);
 extern int jfs_mount_rw(struct super_block *, int);
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 5fcc02eaa64c..564c4f279ac6 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -2684,7 +2684,7 @@ void txAbort(tid_t tid, int dirty)
 	 * mark filesystem dirty
 	 */
 	if (dirty)
-		jfs_error(tblk->sb, "txAbort");
+		jfs_error(tblk->sb, "\n");
 
 	return;
 }
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 6c50871e6220..5ad7748860ce 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -64,22 +64,23 @@
 
 /* get page buffer for specified block address */
 /* ToDo: Replace this ugly macro with a function */
-#define XT_GETPAGE(IP, BN, MP, SIZE, P, RC)\
-{\
-	BT_GETPAGE(IP, BN, MP, xtpage_t, SIZE, P, RC, i_xtroot)\
-	if (!(RC))\
-	{\
-		if ((le16_to_cpu((P)->header.nextindex) < XTENTRYSTART) ||\
-		    (le16_to_cpu((P)->header.nextindex) > le16_to_cpu((P)->header.maxentry)) ||\
-		    (le16_to_cpu((P)->header.maxentry) > (((BN)==0)?XTROOTMAXSLOT:PSIZE>>L2XTSLOTSIZE)))\
-		{\
-			jfs_error((IP)->i_sb, "XT_GETPAGE: xtree page corrupt");\
-			BT_PUTPAGE(MP);\
-			MP = NULL;\
-			RC = -EIO;\
-		}\
-	}\
-}
+#define XT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
+do {									\
+	BT_GETPAGE(IP, BN, MP, xtpage_t, SIZE, P, RC, i_xtroot);	\
+	if (!(RC)) {							\
+		if ((le16_to_cpu((P)->header.nextindex) < XTENTRYSTART) || \
+		    (le16_to_cpu((P)->header.nextindex) >		\
+		     le16_to_cpu((P)->header.maxentry)) ||		\
+		    (le16_to_cpu((P)->header.maxentry) >		\
+		     (((BN) == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) { \
+			jfs_error((IP)->i_sb,				\
+				  "XT_GETPAGE: xtree page corrupt\n");	\
+			BT_PUTPAGE(MP);					\
+			MP = NULL;					\
+			RC = -EIO;					\
+		}							\
+	}								\
+} while (0)
 
 /* for consistency */
 #define XT_PUTPAGE(MP) BT_PUTPAGE(MP)
@@ -499,7 +500,7 @@ static int xtSearch(struct inode *ip, s64 xoff,	s64 *nextp,
 
 		/* push (bn, index) of the parent page/entry */
 		if (BT_STACK_FULL(btstack)) {
-			jfs_error(ip->i_sb, "stack overrun in xtSearch!");
+			jfs_error(ip->i_sb, "stack overrun!\n");
 			XT_PUTPAGE(mp);
 			return -EIO;
 		}
@@ -1385,7 +1386,7 @@ int xtExtend(tid_t tid,		/* transaction id */
 
 	if (cmp != 0) {
 		XT_PUTPAGE(mp);
-		jfs_error(ip->i_sb, "xtExtend: xtSearch did not find extent");
+		jfs_error(ip->i_sb, "xtSearch did not find extent\n");
 		return -EIO;
 	}
 
@@ -1393,7 +1394,7 @@ int xtExtend(tid_t tid,		/* transaction id */
 	xad = &p->xad[index];
 	if ((offsetXAD(xad) + lengthXAD(xad)) != xoff) {
 		XT_PUTPAGE(mp);
-		jfs_error(ip->i_sb, "xtExtend: extension is not contiguous");
+		jfs_error(ip->i_sb, "extension is not contiguous\n");
 		return -EIO;
 	}
 
@@ -1552,7 +1553,7 @@ printf("xtTailgate: nxoff:0x%lx nxlen:0x%x nxaddr:0x%lx\n",
 
 	if (cmp != 0) {
 		XT_PUTPAGE(mp);
-		jfs_error(ip->i_sb, "xtTailgate: couldn't find extent");
+		jfs_error(ip->i_sb, "couldn't find extent\n");
 		return -EIO;
 	}
 
@@ -1560,8 +1561,7 @@ printf("xtTailgate: nxoff:0x%lx nxlen:0x%x nxaddr:0x%lx\n",
 	nextindex = le16_to_cpu(p->header.nextindex);
 	if (index != nextindex - 1) {
 		XT_PUTPAGE(mp);
-		jfs_error(ip->i_sb,
-			  "xtTailgate: the entry found is not the last entry");
+		jfs_error(ip->i_sb, "the entry found is not the last entry\n");
 		return -EIO;
 	}
 
@@ -1734,7 +1734,7 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 
 	if (cmp != 0) {
 		XT_PUTPAGE(mp);
-		jfs_error(ip->i_sb, "xtUpdate: Could not find extent");
+		jfs_error(ip->i_sb, "Could not find extent\n");
 		return -EIO;
 	}
 
@@ -1758,7 +1758,7 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 	    (nxoff + nxlen > xoff + xlen)) {
 		XT_PUTPAGE(mp);
 		jfs_error(ip->i_sb,
-			  "xtUpdate: nXAD in not completely contained within XAD");
+			  "nXAD in not completely contained within XAD\n");
 		return -EIO;
 	}
 
@@ -1907,7 +1907,7 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 
 	if (xoff >= nxoff) {
 		XT_PUTPAGE(mp);
-		jfs_error(ip->i_sb, "xtUpdate: xoff >= nxoff");
+		jfs_error(ip->i_sb, "xoff >= nxoff\n");
 		return -EIO;
 	}
 /* #endif _JFS_WIP_COALESCE */
@@ -2048,14 +2048,13 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 
 		if (cmp != 0) {
 			XT_PUTPAGE(mp);
-			jfs_error(ip->i_sb, "xtUpdate: xtSearch failed");
+			jfs_error(ip->i_sb, "xtSearch failed\n");
 			return -EIO;
 		}
 
 		if (index0 != index) {
 			XT_PUTPAGE(mp);
-			jfs_error(ip->i_sb,
-				  "xtUpdate: unexpected value of index");
+			jfs_error(ip->i_sb, "unexpected value of index\n");
 			return -EIO;
 		}
 	}
@@ -3650,7 +3649,7 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
       getChild:
 	/* save current parent entry for the child page */
 	if (BT_STACK_FULL(&btstack)) {
-		jfs_error(ip->i_sb, "stack overrun in xtTruncate!");
+		jfs_error(ip->i_sb, "stack overrun!\n");
 		XT_PUTPAGE(mp);
 		return -EIO;
 	}
@@ -3751,8 +3750,7 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
 
 		if (cmp != 0) {
 			XT_PUTPAGE(mp);
-			jfs_error(ip->i_sb,
-				  "xtTruncate_pmap: did not find extent");
+			jfs_error(ip->i_sb, "did not find extent\n");
 			return -EIO;
 		}
 	} else {
@@ -3851,7 +3849,7 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
       getChild:
 	/* save current parent entry for the child page */
 	if (BT_STACK_FULL(&btstack)) {
-		jfs_error(ip->i_sb, "stack overrun in xtTruncate_pmap!");
+		jfs_error(ip->i_sb, "stack overrun!\n");
 		XT_PUTPAGE(mp);
 		return -EIO;
 	}
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 3b91a7ad6086..eb9799bb367c 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1176,7 +1176,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 				if (!S_ISDIR(old_ip->i_mode) && new_ip)
 					IWRITE_UNLOCK(new_ip);
 				jfs_error(new_ip->i_sb,
-					  "jfs_rename: new_ip->i_nlink != 0");
+					  "new_ip->i_nlink != 0\n");
 				return -EIO;
 			}
 			tblk = tid_to_tblock(tid);
diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c
index 8d0c1c7c0820..90b3bc21e9b0 100644
--- a/fs/jfs/resize.c
+++ b/fs/jfs/resize.c
@@ -530,7 +530,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
 	goto resume;
 
       error_out:
-	jfs_error(sb, "jfs_extendfs");
+	jfs_error(sb, "\n");
 
       resume:
 	/*
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 788e0a9c1fb0..6669aa2042c3 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -92,16 +92,20 @@ static void jfs_handle_error(struct super_block *sb)
 	/* nothing is done for continue beyond marking the superblock dirty */
 }
 
-void jfs_error(struct super_block *sb, const char * function, ...)
+void jfs_error(struct super_block *sb, const char *fmt, ...)
 {
-	static char error_buf[256];
+	struct va_format vaf;
 	va_list args;
 
-	va_start(args, function);
-	vsnprintf(error_buf, sizeof(error_buf), function, args);
-	va_end(args);
+	va_start(args, fmt);
+
+	vaf.fmt = fmt;
+	vaf.va = &args;
 
-	pr_err("ERROR: (device %s): %s\n", sb->s_id, error_buf);
+	pr_err("ERROR: (device %s): %pf: %pV\n",
+	       sb->s_id, __builtin_return_address(0), &vaf);
+
+	va_end(args);
 
 	jfs_handle_error(sb);
 }
@@ -617,7 +621,7 @@ static int jfs_freeze(struct super_block *sb)
 		txQuiesce(sb);
 		rc = lmLogShutdown(log);
 		if (rc) {
-			jfs_error(sb, "jfs_freeze: lmLogShutdown failed");
+			jfs_error(sb, "lmLogShutdown failed\n");
 
 			/* let operations fail rather than hang */
 			txResume(sb);
@@ -646,12 +650,12 @@ static int jfs_unfreeze(struct super_block *sb)
 	if (!(sb->s_flags & MS_RDONLY)) {
 		rc = updateSuper(sb, FM_MOUNT);
 		if (rc) {
-			jfs_error(sb, "jfs_unfreeze: updateSuper failed");
+			jfs_error(sb, "updateSuper failed\n");
 			goto out;
 		}
 		rc = lmLogInit(log);
 		if (rc)
-			jfs_error(sb, "jfs_unfreeze: lmLogInit failed");
+			jfs_error(sb, "lmLogInit failed\n");
 out:
 		txResume(sb);
 	}
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c
index 86ce028f2566..d3472f4cd530 100644
--- a/fs/jfs/xattr.c
+++ b/fs/jfs/xattr.c
@@ -382,7 +382,7 @@ static int ea_read(struct inode *ip, struct jfs_ea_list *ealist)
 
 	nbytes = sizeDXD(&ji->ea);
 	if (!nbytes) {
-		jfs_error(sb, "ea_read: nbytes is 0");
+		jfs_error(sb, "nbytes is 0\n");
 		return -EIO;
 	}
 
@@ -482,7 +482,7 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size)
 		current_blocks = 0;
 	} else {
 		if (!(ji->ea.flag & DXD_EXTENT)) {
-			jfs_error(sb, "ea_get: invalid ea.flag)");
+			jfs_error(sb, "invalid ea.flag\n");
 			return -EIO;
 		}
 		current_blocks = (ea_size + sb->s_blocksize - 1) >>
]

213/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31120
							output: 40
							thoughts: 117
						

Thoughts:
**Initial Thoughts on a Persistent Bug**

Okay, so `eb8630d7d2fd` is a simple reformatting of `DT_GETPAGE`. Nothing earth-shattering there. But that got me thinking, and now I'm digging into `1da177e4c3f4`. Hang on a second... isn't that... yeah, it is. The very first Git commit for the kernel! This implies this potential issue has been lurking since the *very beginning* of the Git history? Incredible! Okay, time to check my hypothesis. I need to examine the `BT_GETPAGE` macro within `fs/jfs/jfs_btree.h` to see if there's any correlation. Let's see if this macro is potentially affected.



214/2 2026/06/26 22:12 tool git-log
0m Args:
map[CodeRegexp:#define BT_GETPAGE PathPrefix:fs/jfs/jfs_btree.h]

Results:
map[Output:1da177e4c3f4 Linux-2.6.12-rc2
]

215/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 31482
							output: 38
							thoughts: 24
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience and written in the first person:

**Diving into the JFS B-tree Implementation**

Okay, so I need to understand how page retrieval is handled within the JFS filesystem. The key here is the B-tree structure, so I'm immediately heading to the `fs/jfs/jfs_btree.h` header file. Specifically, I'm zeroing in on `BT_GETPAGE`. That macro or function call is the critical point; it's the one I need to dissect. I'm assuming that this is where the core logic resides for pulling a specific page from the B-tree based on some key, likely an offset within a file or extent. I'm anticipating this is a complex dance with locking, potentially caching, and certainly the navigation logic through the B-tree nodes themselves. I expect to find some low-level detail about how the filesystem interacts with the block device or page cache at this point. Time to dig in and see how JFS handles those page faults...



216/2 2026/06/26 22:12 tool git-show
0m Args:
map[Commit:1da177e4c3f4:fs/jfs/jfs_btree.h]

Results:
map[Output:/*
 *   Copyright (C) International Business Machines Corp., 2000-2004
 *
 *   This program is free software;  you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or 
 *   (at your option) any later version.
 * 
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 *   the GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program;  if not, write to the Free Software 
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
#ifndef	_H_JFS_BTREE
#define _H_JFS_BTREE

/*
 *	jfs_btree.h: B+-tree
 *
 * JFS B+-tree (dtree and xtree) common definitions
 */

/*
 *	basic btree page - btpage
 *
struct btpage {
	s64 next;		right sibling bn
	s64 prev;		left sibling bn

	u8 flag;
	u8 rsrvd[7];		type specific
	s64 self;		self address

	u8 entry[4064];
};						*/

/* btpaget_t flag */
#define BT_TYPE		0x07	/* B+-tree index */
#define	BT_ROOT		0x01	/* root page */
#define	BT_LEAF		0x02	/* leaf page */
#define	BT_INTERNAL	0x04	/* internal page */
#define	BT_RIGHTMOST	0x10	/* rightmost page */
#define	BT_LEFTMOST	0x20	/* leftmost page */
#define	BT_SWAPPED	0x80	/* used by fsck for endian swapping */

/* btorder (in inode) */
#define	BT_RANDOM		0x0000
#define	BT_SEQUENTIAL		0x0001
#define	BT_LOOKUP		0x0010
#define	BT_INSERT		0x0020
#define	BT_DELETE		0x0040

/*
 *	btree page buffer cache access
 */
#define BT_IS_ROOT(MP) (((MP)->xflag & COMMIT_PAGE) == 0)

/* get page from buffer page */
#define BT_PAGE(IP, MP, TYPE, ROOT)\
	(BT_IS_ROOT(MP) ? (TYPE *)&JFS_IP(IP)->ROOT : (TYPE *)(MP)->data)

/* get the page buffer and the page for specified block address */
#define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\
{\
	if ((BN) == 0)\
	{\
		MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
		P = (TYPE *)&JFS_IP(IP)->ROOT;\
		RC = 0;\
	}\
	else\
	{\
		MP = read_metapage((IP), BN, SIZE, 1);\
		if (MP) {\
			RC = 0;\
			P = (MP)->data;\
		} else {\
			P = NULL;\
			jfs_err("bread failed!");\
			RC = -EIO;\
		}\
	}\
}

#define BT_MARK_DIRTY(MP, IP)\
{\
	if (BT_IS_ROOT(MP))\
		mark_inode_dirty(IP);\
	else\
		mark_metapage_dirty(MP);\
}

/* put the page buffer */
#define BT_PUTPAGE(MP)\
{\
	if (! BT_IS_ROOT(MP)) \
		release_metapage(MP); \
}


/*
 *	btree traversal stack
 *
 * record the path traversed during the search;
 * top frame record the leaf page/entry selected.
 */
struct btframe {	/* stack frame */
	s64 bn;			/* 8: */
	s16 index;		/* 2: */
	s16 lastindex;		/* 2: unused */
	struct metapage *mp;	/* 4/8: */
};				/* (16/24) */

struct btstack {
	struct btframe *top;
	int nsplit;
	struct btframe stack[MAXTREEHEIGHT];
};

#define BT_CLR(btstack)\
	(btstack)->top = (btstack)->stack

#define BT_STACK_FULL(btstack)\
	( (btstack)->top == &((btstack)->stack[MAXTREEHEIGHT-1]))

#define BT_PUSH(BTSTACK, BN, INDEX)\
{\
	assert(!BT_STACK_FULL(BTSTACK));\
	(BTSTACK)->top->bn = BN;\
	(BTSTACK)->top->index = INDEX;\
	++(BTSTACK)->top;\
}

#define BT_POP(btstack)\
	( (btstack)->top == (btstack)->stack ? NULL : --(btstack)->top )

#define BT_STACK(btstack)\
	( (btstack)->top == (btstack)->stack ? NULL : (btstack)->top )

static inline void BT_STACK_DUMP(struct btstack *btstack)
{
	int i;
	printk("btstack dump:\n");
	for (i = 0; i < MAXTREEHEIGHT; i++)
		printk(KERN_ERR "bn = %Lx, index = %d\n",
		       (long long)btstack->stack[i].bn,
		       btstack->stack[i].index);
}

/* retrieve search results */
#define BT_GETSEARCH(IP, LEAF, BN, MP, TYPE, P, INDEX, ROOT)\
{\
	BN = (LEAF)->bn;\
	MP = (LEAF)->mp;\
	if (BN)\
		P = (TYPE *)MP->data;\
	else\
		P = (TYPE *)&JFS_IP(IP)->ROOT;\
	INDEX = (LEAF)->index;\
}

/* put the page buffer of search */
#define BT_PUTSEARCH(BTSTACK)\
{\
	if (! BT_IS_ROOT((BTSTACK)->top->mp))\
		release_metapage((BTSTACK)->top->mp);\
}
#endif				/* _H_JFS_BTREE */
]

217/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33356
							output: 41
							thoughts: 136
						

Thoughts:
**Debugging a Subtle JFS Metapage Issue**

Okay, so the problem seems to stem from `BT_GETPAGE` returning a "pseudo-metapage" when `BN` is zero. I need to be careful here – that pseudo-metapage, which is `&JFS_IP(IP)->bxflag`, is causing potential trouble. If `xtTruncate`, `dtDeleteUp`, or any similar function decides to call `discard_metapage(mp)` on this, we're going to crash, no doubt. Hmmm... now, when was `discard_metapage` introduced again? Right, let me quickly double-check that change. And I need to verify its behavior. I should check the implementation of `discard_metapage` in `fs/jfs/jfs_metapage.h`. Gotta be certain about this.



218/2 2026/06/26 22:12 tool git-log
0m Args:
map[CodeRegexp:discard_metapage PathPrefix:fs/jfs/jfs_metapage.h]

Results:
map[Output:1da177e4c3f4 Linux-2.6.12-rc2
]

219/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 33757
							output: 39
							thoughts: 38
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Diving into the JFS x-tree Implementation**

Right, time to dig into this `xtTruncate` function. Let's see... the code's version is from that `1da177e4c3f4` commit, which I vaguely recall. I'll need to refresh my memory on the context of that commit, see if there are any related bug reports or discussions around it. I know JFS's x-tree structure is fairly complex but crucial for efficient file system operation and performance in this area. Specifically, looking at `fs/jfs/jfs_xtree.c` should be useful. I'll focus on how `xtTruncate` handles block deallocation and data structure updates during file truncation. I'm looking for potential race conditions, edge cases with large files or very fragmented data, and, of course, any obvious performance bottlenecks. Might also be good to quickly examine the surrounding code to understand how `xtTruncate` is called within the overall truncation sequence. Time to break out the debugger and start tracing through the logic.



220/2 2026/06/26 22:12 tool git-show
0m Args:
map[Commit:1da177e4c3f4:fs/jfs/jfs_xtree.c]

Results:
map[Output:
Full output is too long, showing 1000 out of 4485 lines.

[/*
  *   Copyright (C) International Business Machines Corp., 2000-2004
  *
  *   This program is free software;  you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
  *   the Free Software Foundation; either version 2 of the License, or 
  *   (at your option) any later version.
  * 
  *   This program is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
  *   the GNU General Public License for more details.
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program;  if not, write to the Free Software 
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 /*
  *      jfs_xtree.c: extent allocation descriptor B+-tree manager
  */
 
 #include <linux/fs.h>
 #include <linux/quotaops.h>
 #include "jfs_incore.h"
 #include "jfs_filsys.h"
 #include "jfs_metapage.h"
 #include "jfs_dmap.h"
 #include "jfs_dinode.h"
 #include "jfs_superblock.h"
 #include "jfs_debug.h"
 
 /*
  * xtree local flag
  */
 #define XT_INSERT       0x00000001
 
 /*
  *       xtree key/entry comparison: extent offset
  *
  * return:
  *      -1: k < start of extent
  *       0: start_of_extent <= k <= end_of_extent
  *       1: k > end_of_extent
  */
 #define XT_CMP(CMP, K, X, OFFSET64)\
 {\
         OFFSET64 = offsetXAD(X);\
         (CMP) = ((K) >= OFFSET64 + lengthXAD(X)) ? 1 :\
               ((K) < OFFSET64) ? -1 : 0;\
 }
 
 /* write a xad entry */
 #define XT_PUTENTRY(XAD, FLAG, OFF, LEN, ADDR)\
 {\
         (XAD)->flag = (FLAG);\
         XADoffset((XAD), (OFF));\
         XADlength((XAD), (LEN));\
         XADaddress((XAD), (ADDR));\
 }
 
 #define XT_PAGE(IP, MP) BT_PAGE(IP, MP, xtpage_t, i_xtroot)
 
 /* get page buffer for specified block address */
 /* ToDo: Replace this ugly macro with a function */
 #define XT_GETPAGE(IP, BN, MP, SIZE, P, RC)\
 {\
 	BT_GETPAGE(IP, BN, MP, xtpage_t, SIZE, P, RC, i_xtroot)\
 	if (!(RC))\
 	{\
 		if ((le16_to_cpu((P)->header.nextindex) < XTENTRYSTART) ||\
 		    (le16_to_cpu((P)->header.nextindex) > le16_to_cpu((P)->header.maxentry)) ||\
 		    (le16_to_cpu((P)->header.maxentry) > (((BN)==0)?XTROOTMAXSLOT:PSIZE>>L2XTSLOTSIZE)))\
 		{\
 			jfs_error((IP)->i_sb, "XT_GETPAGE: xtree page corrupt");\
 			BT_PUTPAGE(MP);\
 			MP = NULL;\
 			RC = -EIO;\
 		}\
         }\
 }
 
 /* for consistency */
 #define XT_PUTPAGE(MP) BT_PUTPAGE(MP)
 
 #define XT_GETSEARCH(IP, LEAF, BN, MP,  P, INDEX) \
 	BT_GETSEARCH(IP, LEAF, BN, MP, xtpage_t, P, INDEX, i_xtroot)
 /* xtree entry parameter descriptor */
 struct xtsplit {
 	struct metapage *mp;
 	s16 index;
 	u8 flag;
 	s64 off;
 	s64 addr;
 	int len;
 	struct pxdlist *pxdlist;
 };
 
 
 /*
  *      statistics
  */
 #ifdef CONFIG_JFS_STATISTICS
 static struct {
 	uint search;
 	uint fastSearch;
 	uint split;
 } xtStat;
 #endif
 
 
 /*
  * forward references
  */
 static int xtSearch(struct inode *ip,
 		    s64 xoff, int *cmpp, struct btstack * btstack, int flag);
 
 static int xtSplitUp(tid_t tid,
 		     struct inode *ip,
 		     struct xtsplit * split, struct btstack * btstack);
 
 static int xtSplitPage(tid_t tid, struct inode *ip, struct xtsplit * split,
 		       struct metapage ** rmpp, s64 * rbnp);
 
 static int xtSplitRoot(tid_t tid, struct inode *ip,
 		       struct xtsplit * split, struct metapage ** rmpp);
 
 #ifdef _STILL_TO_PORT
 static int xtDeleteUp(tid_t tid, struct inode *ip, struct metapage * fmp,
 		      xtpage_t * fp, struct btstack * btstack);
 
 static int xtSearchNode(struct inode *ip,
 			xad_t * xad,
 			int *cmpp, struct btstack * btstack, int flag);
 
 static int xtRelink(tid_t tid, struct inode *ip, xtpage_t * fp);
 #endif				/*  _STILL_TO_PORT */
 
 /* External references */
 
 /*
  *      debug control
  */
 /*      #define _JFS_DEBUG_XTREE        1 */
 
 
 /*
  *      xtLookup()
  *
  * function: map a single page into a physical extent;
  */
 int xtLookup(struct inode *ip, s64 lstart,
 	     s64 llen, int *pflag, s64 * paddr, s32 * plen, int no_check)
 {
 	int rc = 0;
 	struct btstack btstack;
 	int cmp;
 	s64 bn;
 	struct metapage *mp;
 	xtpage_t *p;
 	int index;
 	xad_t *xad;
 	s64 size, xoff, xend;
 	int xlen;
 	s64 xaddr;
 
 	*plen = 0;
 
 	if (!no_check) {
 		/* is lookup offset beyond eof ? */
 		size = ((u64) ip->i_size + (JFS_SBI(ip->i_sb)->bsize - 1)) >>
 		    JFS_SBI(ip->i_sb)->l2bsize;
 		if (lstart >= size) {
 			jfs_err("xtLookup: lstart (0x%lx) >= size (0x%lx)",
 				(ulong) lstart, (ulong) size);
 			return 0;
 		}
 	}
 
 	/*
 	 * search for the xad entry covering the logical extent
 	 */
 //search:
 	if ((rc = xtSearch(ip, lstart, &cmp, &btstack, 0))) {
 		jfs_err("xtLookup: xtSearch returned %d", rc);
 		return rc;
 	}
 
 	/*
 	 *      compute the physical extent covering logical extent
 	 *
 	 * N.B. search may have failed (e.g., hole in sparse file),
 	 * and returned the index of the next entry.
 	 */
 	/* retrieve search result */
 	XT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
 
 	/* is xad found covering start of logical extent ?
 	 * lstart is a page start address,
 	 * i.e., lstart cannot start in a hole;
 	 */
 	if (cmp)
 		goto out;
 
 	/*
 	 * lxd covered by xad
 	 */
 	xad = &p->xad[index];
 	xoff = offsetXAD(xad);
 	xlen = lengthXAD(xad);
 	xend = xoff + xlen;
 	xaddr = addressXAD(xad);
 
 	/* initialize new pxd */
 	*pflag = xad->flag;
 	*paddr = xaddr + (lstart - xoff);
 	/* a page must be fully covered by an xad */
 	*plen = min(xend - lstart, llen);
 
       out:
 	XT_PUTPAGE(mp);
 
 	return rc;
 }
 
 
 /*
  *      xtLookupList()
  *
  * function: map a single logical extent into a list of physical extent;
  *
  * parameter:
  *      struct inode    *ip,
  *      struct lxdlist  *lxdlist,       lxd list (in)
  *      struct xadlist  *xadlist,       xad list (in/out)
  *      int		flag)
  *
  * coverage of lxd by xad under assumption of
  * . lxd's are ordered and disjoint.
  * . xad's are ordered and disjoint.
  *
  * return:
  *      0:      success
  *
  * note: a page being written (even a single byte) is backed fully,
  *      except the last page which is only backed with blocks
  *      required to cover the last byte;
  *      the extent backing a page is fully contained within an xad;
  */
 int xtLookupList(struct inode *ip, struct lxdlist * lxdlist,
 		 struct xadlist * xadlist, int flag)
 {
 	int rc = 0;
 	struct btstack btstack;
 	int cmp;
 	s64 bn;
 	struct metapage *mp;
 	xtpage_t *p;
 	int index;
 	lxd_t *lxd;
 	xad_t *xad, *pxd;
 	s64 size, lstart, lend, xstart, xend, pstart;
 	s64 llen, xlen, plen;
 	s64 xaddr, paddr;
 	int nlxd, npxd, maxnpxd;
 
 	npxd = xadlist->nxad = 0;
 	maxnpxd = xadlist->maxnxad;
 	pxd = xadlist->xad;
 
 	nlxd = lxdlist->nlxd;
 	lxd = lxdlist->lxd;
 
 	lstart = offsetLXD(lxd);
 	llen = lengthLXD(lxd);
 	lend = lstart + llen;
 
 	size = (ip->i_size + (JFS_SBI(ip->i_sb)->bsize - 1)) >>
 	    JFS_SBI(ip->i_sb)->l2bsize;
 
 	/*
 	 * search for the xad entry covering the logical extent
 	 */
       search:
 	if (lstart >= size)
 		return 0;
 
 	if ((rc = xtSearch(ip, lstart, &cmp, &btstack, 0)))
 		return rc;
 
 	/*
 	 *      compute the physical extent covering logical extent
 	 *
 	 * N.B. search may have failed (e.g., hole in sparse file),
 	 * and returned the index of the next entry.
 	 */
 //map:
 	/* retrieve search result */
 	XT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
 
 	/* is xad on the next sibling page ? */
 	if (index == le16_to_cpu(p->header.nextindex)) {
 		if (p->header.flag & BT_ROOT)
 			goto mapend;
 
 		if ((bn = le64_to_cpu(p->header.next)) == 0)
 			goto mapend;
 
 		XT_PUTPAGE(mp);
 
 		/* get next sibling page */
 		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
 		if (rc)
 			return rc;
 
 		index = XTENTRYSTART;
 	}
 
 	xad = &p->xad[index];
 
 	/*
 	 * is lxd covered by xad ?
 	 */
       compare:
 	xstart = offsetXAD(xad);
 	xlen = lengthXAD(xad);
 	xend = xstart + xlen;
 	xaddr = addressXAD(xad);
 
       compare1:
 	if (xstart < lstart)
 		goto compare2;
 
 	/* (lstart <= xstart) */
 
 	/* lxd is NOT covered by xad */
 	if (lend <= xstart) {
 		/*
 		 * get next lxd
 		 */
 		if (--nlxd == 0)
 			goto mapend;
 		lxd++;
 
 		lstart = offsetLXD(lxd);
 		llen = lengthLXD(lxd);
 		lend = lstart + llen;
 		if (lstart >= size)
 			goto mapend;
 
 		/* compare with the current xad  */
 		goto compare1;
 	}
 	/* lxd is covered by xad */
 	else {			/* (xstart < lend) */
 
 		/* initialize new pxd */
 		pstart = xstart;
 		plen = min(lend - xstart, xlen);
 		paddr = xaddr;
 
 		goto cover;
 	}
 
 	/* (xstart < lstart) */
       compare2:
 	/* lxd is covered by xad */
 	if (lstart < xend) {
 		/* initialize new pxd */
 		pstart = lstart;
 		plen = min(xend - lstart, llen);
 		paddr = xaddr + (lstart - xstart);
 
 		goto cover;
 	}
 	/* lxd is NOT covered by xad */
 	else {			/* (xend <= lstart) */
 
 		/*
 		 * get next xad
 		 *
 		 * linear search next xad covering lxd on
 		 * the current xad page, and then tree search
 		 */
 		if (index == le16_to_cpu(p->header.nextindex) - 1) {
 			if (p->header.flag & BT_ROOT)
 				goto mapend;
 
 			XT_PUTPAGE(mp);
 			goto search;
 		} else {
 			index++;
 			xad++;
 
 			/* compare with new xad */
 			goto compare;
 		}
 	}
 
 	/*
 	 * lxd is covered by xad and a new pxd has been initialized
 	 * (lstart <= xstart < lend) or (xstart < lstart < xend)
 	 */
       cover:
 	/* finalize pxd corresponding to current xad */
 	XT_PUTENTRY(pxd, xad->flag, pstart, plen, paddr);
 
 	if (++npxd >= maxnpxd)
 		goto mapend;
 	pxd++;
 
 	/*
 	 * lxd is fully covered by xad
 	 */
 	if (lend <= xend) {
 		/*
 		 * get next lxd
 		 */
 		if (--nlxd == 0)
 			goto mapend;
 		lxd++;
 
 		lstart = offsetLXD(lxd);
 		llen = lengthLXD(lxd);
 		lend = lstart + llen;
 		if (lstart >= size)
 			goto mapend;
 
 		/*
 		 * test for old xad covering new lxd
 		 * (old xstart < new lstart)
 		 */
 		goto compare2;
 	}
 	/*
 	 * lxd is partially covered by xad
 	 */
 	else {			/* (xend < lend)  */
 
 		/*
 		 * get next xad
 		 *
 		 * linear search next xad covering lxd on
 		 * the current xad page, and then next xad page search
 		 */
 		if (index == le16_to_cpu(p->header.nextindex) - 1) {
 			if (p->header.flag & BT_ROOT)
 				goto mapend;
 
 			if ((bn = le64_to_cpu(p->header.next)) == 0)
 				goto mapend;
 
 			XT_PUTPAGE(mp);
 
 			/* get next sibling page */
 			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
 			if (rc)
 				return rc;
 
 			index = XTENTRYSTART;
 			xad = &p->xad[index];
 		} else {
 			index++;
 			xad++;
 		}
 
 		/*
 		 * test for new xad covering old lxd
 		 * (old lstart < new xstart)
 		 */
 		goto compare;
 	}
 
       mapend:
 	xadlist->nxad = npxd;
 
 //out:
 	XT_PUTPAGE(mp);
 
 	return rc;
 }
 
 
 /*
  *      xtSearch()
  *
  * function:    search for the xad entry covering specified offset.
  *
  * parameters:
  *      ip      - file object;
  *      xoff    - extent offset;
  *      cmpp    - comparison result:
  *      btstack - traverse stack;
  *      flag    - search process flag (XT_INSERT);
  *
  * returns:
  *      btstack contains (bn, index) of search path traversed to the entry.
  *      *cmpp is set to result of comparison with the entry returned.
  *      the page containing the entry is pinned at exit.
  */
 static int xtSearch(struct inode *ip, s64 xoff,	/* offset of extent */
 		    int *cmpp, struct btstack * btstack, int flag)
 {
 	struct jfs_inode_info *jfs_ip = JFS_IP(ip);
 	int rc = 0;
 	int cmp = 1;		/* init for empty page */
 	s64 bn;			/* block number */
 	struct metapage *mp;	/* page buffer */
 	xtpage_t *p;		/* page */
 	xad_t *xad;
 	int base, index, lim, btindex;
 	struct btframe *btsp;
 	int nsplit = 0;		/* number of pages to split */
 	s64 t64;
 
 	INCREMENT(xtStat.search);
 
 	BT_CLR(btstack);
 
 	btstack->nsplit = 0;
 
 	/*
 	 *      search down tree from root:
 	 *
 	 * between two consecutive entries of <Ki, Pi> and <Kj, Pj> of
 	 * internal page, child page Pi contains entry with k, Ki <= K < Kj.
 	 *
 	 * if entry with search key K is not found
 	 * internal page search find the entry with largest key Ki
 	 * less than K which point to the child page to search;
 	 * leaf page search find the entry with smallest key Kj
 	 * greater than K so that the returned index is the position of
 	 * the entry to be shifted right for insertion of new entry.
 	 * for empty tree, search key is greater than any key of the tree.
 	 *
 	 * by convention, root bn = 0.
 	 */
 	for (bn = 0;;) {
 		/* get/pin the page to search */
 		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
 		if (rc)
 			return rc;
 
 		/* try sequential access heuristics with the previous
 		 * access entry in target leaf page:
 		 * once search narrowed down into the target leaf,
 		 * key must either match an entry in the leaf or
 		 * key entry does not exist in the tree;
 		 */
 //fastSearch:
 		if ((jfs_ip->btorder & BT_SEQUENTIAL) &&
 		    (p->header.flag & BT_LEAF) &&
 		    (index = jfs_ip->btindex) <
 		    le16_to_cpu(p->header.nextindex)) {
 			xad = &p->xad[index];
 			t64 = offsetXAD(xad);
 			if (xoff < t64 + lengthXAD(xad)) {
 				if (xoff >= t64) {
 					*cmpp = 0;
 					goto out;
 				}
 
 				/* stop sequential access heuristics */
 				goto binarySearch;
 			} else {	/* (t64 + lengthXAD(xad)) <= xoff */
 
 				/* try next sequential entry */
 				index++;
 				if (index <
 				    le16_to_cpu(p->header.nextindex)) {
 					xad++;
 					t64 = offsetXAD(xad);
 					if (xoff < t64 + lengthXAD(xad)) {
 						if (xoff >= t64) {
 							*cmpp = 0;
 							goto out;
 						}
 
 						/* miss: key falls between
 						 * previous and this entry
 						 */
 						*cmpp = 1;
 						goto out;
 					}
 
 					/* (xoff >= t64 + lengthXAD(xad));
 					 * matching entry may be further out:
 					 * stop heuristic search
 					 */
 					/* stop sequential access heuristics */
 					goto binarySearch;
 				}
 
 				/* (index == p->header.nextindex);
 				 * miss: key entry does not exist in
 				 * the target leaf/tree
 				 */
 				*cmpp = 1;
 				goto out;
 			}
 
 			/*
 			 * if hit, return index of the entry found, and
 			 * if miss, where new entry with search key is
 			 * to be inserted;
 			 */
 		      out:
 			/* compute number of pages to split */
 			if (flag & XT_INSERT) {
 				if (p->header.nextindex ==	/* little-endian */
 				    p->header.maxentry)
 					nsplit++;
 				else
 					nsplit = 0;
 				btstack->nsplit = nsplit;
 			}
 
 			/* save search result */
 			btsp = btstack->top;
 			btsp->bn = bn;
 			btsp->index = index;
 			btsp->mp = mp;
 
 			/* update sequential access heuristics */
 			jfs_ip->btindex = index;
 
 			INCREMENT(xtStat.fastSearch);
 			return 0;
 		}
 
 		/* well, ... full search now */
 	      binarySearch:
 		lim = le16_to_cpu(p->header.nextindex) - XTENTRYSTART;
 
 		/*
 		 * binary search with search key K on the current page
 		 */
 		for (base = XTENTRYSTART; lim; lim >>= 1) {
 			index = base + (lim >> 1);
 
 			XT_CMP(cmp, xoff, &p->xad[index], t64);
 			if (cmp == 0) {
 				/*
 				 *      search hit
 				 */
 				/* search hit - leaf page:
 				 * return the entry found
 				 */
 				if (p->header.flag & BT_LEAF) {
 					*cmpp = cmp;
 
 					/* compute number of pages to split */
 					if (flag & XT_INSERT) {
 						if (p->header.nextindex ==
 						    p->header.maxentry)
 							nsplit++;
 						else
 							nsplit = 0;
 						btstack->nsplit = nsplit;
 					}
 
 					/* save search result */
 					btsp = btstack->top;
 					btsp->bn = bn;
 					btsp->index = index;
 					btsp->mp = mp;
 
 					/* init sequential access heuristics */
 					btindex = jfs_ip->btindex;
 					if (index == btindex ||
 					    index == btindex + 1)
 						jfs_ip->btorder = BT_SEQUENTIAL;
 					else
 						jfs_ip->btorder = BT_RANDOM;
 					jfs_ip->btindex = index;
 
 					return 0;
 				}
 
 				/* search hit - internal page:
 				 * descend/search its child page
 				 */
 				goto next;
 			}
 
 			if (cmp > 0) {
 				base = index + 1;
 				--lim;
 			}
 		}
 
 		/*
 		 *      search miss
 		 *
 		 * base is the smallest index with key (Kj) greater than
 		 * search key (K) and may be zero or maxentry index.
 		 */
 		/*
 		 * search miss - leaf page:
 		 *
 		 * return location of entry (base) where new entry with
 		 * search key K is to be inserted.
 		 */
 		if (p->header.flag & BT_LEAF) {
 			*cmpp = cmp;
 
 			/* compute number of pages to split */
 			if (flag & XT_INSERT) {
 				if (p->header.nextindex ==
 				    p->header.maxentry)
 					nsplit++;
 				else
 					nsplit = 0;
 				btstack->nsplit = nsplit;
 			}
 
 			/* save search result */
 			btsp = btstack->top;
 			btsp->bn = bn;
 			btsp->index = base;
 			btsp->mp = mp;
 
 			/* init sequential access heuristics */
 			btindex = jfs_ip->btindex;
 			if (base == btindex || base == btindex + 1)
 				jfs_ip->btorder = BT_SEQUENTIAL;
 			else
 				jfs_ip->btorder = BT_RANDOM;
 			jfs_ip->btindex = base;
 
 			return 0;
 		}
 
 		/*
 		 * search miss - non-leaf page:
 		 *
 		 * if base is non-zero, decrement base by one to get the parent
 		 * entry of the child page to search.
 		 */
 		index = base ? base - 1 : base;
 
 		/*
 		 * go down to child page
 		 */
 	      next:
 		/* update number of pages to split */
 		if (p->header.nextindex == p->header.maxentry)
 			nsplit++;
 		else
 			nsplit = 0;
 
 		/* push (bn, index) of the parent page/entry */
 		BT_PUSH(btstack, bn, index);
 
 		/* get the child page block number */
 		bn = addressXAD(&p->xad[index]);
 
 		/* unpin the parent page */
 		XT_PUTPAGE(mp);
 	}
 }
 
 /*
  *      xtInsert()
  *
  * function:
  *
  * parameter:
  *      tid     - transaction id;
  *      ip      - file object;
  *      xflag   - extent flag (XAD_NOTRECORDED):
  *      xoff    - extent offset;
  *      xlen    - extent length;
  *      xaddrp  - extent address pointer (in/out):
  *              if (*xaddrp)
  *                      caller allocated data extent at *xaddrp;
  *              else
  *                      allocate data extent and return its xaddr;
  *      flag    -
  *
  * return:
  */
 int xtInsert(tid_t tid,		/* transaction id */
 	     struct inode *ip, int xflag, s64 xoff, s32 xlen, s64 * xaddrp,
 	     int flag)
 {
 	int rc = 0;
 	s64 xaddr, hint;
 	struct metapage *mp;	/* meta-page buffer */
 	xtpage_t *p;		/* base B+-tree index page */
 	s64 bn;
 	int index, nextindex;
 	struct btstack btstack;	/* traverse stack */
 	struct xtsplit split;	/* split information */
 	xad_t *xad;
 	int cmp;
 	struct tlock *tlck;
 	struct xtlock *xtlck;
 
 	jfs_info("xtInsert: nxoff:0x%lx nxlen:0x%x", (ulong) xoff, xlen);
 
 	/*
 	 *      search for the entry location at which to insert:
 	 *
 	 * xtFastSearch() and xtSearch() both returns (leaf page
 	 * pinned, index at which to insert).
 	 * n.b. xtSearch() may return index of maxentry of
 	 * the full page.
 	 */
 	if ((rc = xtSearch(ip, xoff, &cmp, &btstack, XT_INSERT)))
 		return rc;
 
 	/* retrieve search result */
 	XT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
 
 	/* This test must follow XT_GETSEARCH since mp must be valid if
 	 * we branch to out: */
 	if (cmp == 0) {
 		rc = -EEXIST;
 		goto out;
 	}
 
 	/*
 	 * allocate data extent requested
 	 *
 	 * allocation hint: last xad
 	 */
 	if ((xaddr = *xaddrp) == 0) {
 		if (index > XTENTRYSTART) {
 			xad = &p->xad[index - 1];
 			hint = addressXAD(xad) + lengthXAD(xad) - 1;
 		} else
 			hint = 0;
 		if ((rc = DQUOT_ALLOC_BLOCK(ip, xlen)))
 			goto out;
 		if ((rc = dbAlloc(ip, hint, (s64) xlen, &xaddr))) {
 			DQUOT_FREE_BLOCK(ip, xlen);
 			goto out;
 		}
 	}
 
 	/*
 	 *      insert entry for new extent
 	 */
 	xflag |= XAD_NEW;
 
 	/*
 	 *      if the leaf page is full, split the page and
 	 *      propagate up the router entry for the new page from split
 	 *
 	 * The xtSplitUp() will insert the entry and unpin the leaf page.
 	 */
 	nextindex = le16_to_cpu(p->header.nextindex);
 	if (nextindex == le16_to_cpu(p->header.maxentry)) {
 		split.mp = mp;
 		split.index = index;
 		split.flag = xflag;
 		split.off = xoff;
 		split.len = xlen;
 		split.addr = xaddr;
 		split.pxdlist = NULL;
 		if ((rc = xtSplitUp(tid, ip, &split, &btstack))) {
 			/* undo data extent allocation */
 			if (*xaddrp == 0) {
 				dbFree(ip, xaddr, (s64) xlen);
 				DQUOT_FREE_BLOCK(ip, xlen);
 			}
 			return rc;
 		}
 
 		*xaddrp = xaddr;
 		return 0;
 	}
 
 	/*
 	 *      insert the new entry into the leaf page
 	 */
 	/*
 	 * acquire a transaction lock on the leaf page;
 	 *
 	 * action: xad insertion/extension;
 	 */
 	BT_MARK_DIRTY(mp, ip);
 
 	/* if insert into middle, shift right remaining entries. */
 	if (index < nextindex)
 		memmove(&p->xad[index + 1], &p->xad[index],
 			(nextindex - index) * sizeof(xad_t));
 
 	/* insert the new entry: mark the entry NEW */
 	xad = &p->xad[index];
 	XT_PUTENTRY(xad, xflag, xoff, xlen, xaddr);
 
 	/* advance next available entry index */
 	p->header.nextindex =
 	    cpu_to_le16(le16_to_cpu(p->header.nextindex) + 1);
 
 	/* Don't log it if there are no links to the file */
 	if (!test_cflag(COMMIT_Nolink, ip)) {
 		tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
 		xtlck = (struct xtlock *) & tlck->lock;
 		xtlck->lwm.offset =
 		    (xtlck->lwm.offset) ? min(index,
 					      (int)xtlck->lwm.offset) : index;
 		xtlck->lwm.length =
 		    le16_to_cpu(p->header.nextindex) - xtlck->lwm.offset;
 	}
 
 	*xaddrp = xaddr;
 
       out:
 	/* unpin the leaf page */
 	XT_PUTPAGE(mp);
 
 	return rc;
 }
 
 
 /*
  *      xtSplitUp()
  *
  * function:
  *      split full pages as propagating insertion up the tree
  *
  * parameter:
  *      tid     - transaction id;
  *      ip      - file object;
  *      split   - entry parameter descriptor;
  *      btstack - traverse stack from xtSearch()
  *
  * return:
  */
 static int
 xtSplitUp(tid_t tid,
 	  struct inode *ip, struct xtsplit * split, struct btstack * btstack)
 {
 	int rc = 0;
 	struct metapage *smp;
 	xtpage_t *sp;		/* split page */
 	struct metapage *rmp;
 	s64 rbn;		/* new right page block number */
 	struct metapage *rcmp;
 	xtpage_t *rcp;		/* right child page */
 	s64 rcbn;		/* right child page block number */
 	int skip;		/* index of entry of insertion */
 	int nextindex;		/* next available entry index of p */
 	struct btframe *parent;	/* parent page entry on traverse stack */
 	xad_t *xad;
 	s64 xaddr;
 	int xlen;
 	int nsplit;		/* number of pages split */
 	struct pxdlist pxdlist;
 	pxd_t *pxd;
 	struct tlock *tlck;
 	struct xtlock *xtlck;
 
 	smp = split->mp;
 	sp = XT_PAGE(ip, smp);
 
 	/* is inode xtree root extension/inline EA area free ? */
 	if ((sp->header.flag & BT_ROOT) && (!S_ISDIR(ip->i_mode)) &&
 	    (le16_to_cpu(sp->header.maxentry) < XTROOTMAXSLOT) &&
 	    (JFS_IP(ip)->mode2 & INLINEEA)) {
 		sp->header.maxentry = cpu_to_le16(XTROOTMAXSLOT);
 		JFS_IP(ip)->mode2 &= ~INLINEEA;
 
 		BT_MARK_DIRTY(smp, ip);
 		/*
 		 * acquire a transaction lock on the leaf page;
 		 *
 		 * action: xad insertion/extension;
 		 */
 
 		/* if insert into middle, shift right remaining entries. */
 		skip = split->index;
 		nextindex = le16_to_cpu(sp->header.nextindex);
 		if (skip < nextindex)
 			memmove(&sp->xad[skip + 1], &sp->xad[skip],
 				(nextindex - skip) * sizeof(xad_t));
 
 		/* insert the new entry: mark the entry NEW */
 		xad = &sp->xad[skip];
 		XT_PUTENTRY(xad, split->flag, split->off, split->len,
 			    split->addr);
 
 		/* advance next available entry index */
 		sp->header.nextindex =
 		    cpu_to_le16(le16_to_cpu(sp->header.nextindex) + 1);
 
 		/* Don't log it if there are no links to the file */
 		if (!test_cflag(COMMIT_Nolink, ip)) {
 			tlck = txLock(tid, ip, smp, tlckXTREE | tlckGROW);
 			xtlck = (struct xtlock *) & tlck->lock;
 			xtlck->lwm.offset = (xtlck->lwm.offset) ?
 			    min(skip, (int)xtlck->lwm.offset) : skip;
 			xtlck->lwm.length =
 			    le16_to_cpu(sp->header.nextindex) -
 			    xtlck->lwm.offset;
 		}
 
 		return 0;
]
]

221/2 2026/06/26 22:12 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 43731
							output: 37
							thoughts: 41
						

Thoughts:
Here's a summary of my thought process, as requested:

**Digging into the JFS Xtree Code**

Okay, so I need to understand how `discard_metapage` is used, and the first place I'm going to look is the JFS xtree code. I'm specifically interested in the commit `1da177e4c3f4` to see if there are any context-specific implications. This commit probably introduces the function, changes its use, or simply documents it better. I'll pull that up and start examining `fs/jfs/jfs_xtree.c` in that specific commit. I need to understand how the xtree structure works as it relates to discard operations. Let's see what's changed and what's relevant to how the filesystem handles meta data.



222/2 2026/06/26 22:13 tool grepper
0m Args:
map[Expression:discard_metapage PathPrefix:fs/jfs/jfs_xtree.c]

Results:
map[Output:fs/jfs/jfs_xtree.c=2203=s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
--
fs/jfs/jfs_xtree.c-2501-			/* invalidate empty leaf page */
fs/jfs/jfs_xtree.c:2502:			discard_metapage(mp);
fs/jfs/jfs_xtree.c-2503-		}
--
fs/jfs/jfs_xtree.c-2660-				/* invalidate parent page */
fs/jfs/jfs_xtree.c:2661:				discard_metapage(mp);
fs/jfs/jfs_xtree.c-2662-			}
]

223/2 2026/06/26 22:13 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 44197
							output: 39
							thoughts: 75
						

Thoughts:
Okay, let me break this down.

**Diving into the `xtTruncate` Mystery**

Right, `xtTruncate` calls `discard_metapage(mp)` when a page is emptied. That's the expected behavior, makes sense. But then, *wait a minute*, there's a problem... it looks like `discard_metapage` is being called on a pseudo-metapage if `BT_ROOT` is missing. That's not right. A pseudo-metapage should not be subject to normal metapage management. Okay, time to go back to the source. I need to zero in on that `xtTruncate` function, specifically around line 2502. Let's see what's happening there and why this pseudo-metapage is getting involved. I need to understand the logic flow, trace the calls, and find the point where this unwanted interaction is occurring.



224/2 2026/06/26 22:13 tool git-show
0m Args:
map[Commit:1da177e4c3f4:fs/jfs/jfs_xtree.c]

Results:
map[Output:
Full output is too long, showing 1000 out of 4485 lines.

[/*
  *   Copyright (C) International Business Machines Corp., 2000-2004
  *
  *   This program is free software;  you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
  *   the Free Software Foundation; either version 2 of the License, or 
  *   (at your option) any later version.
  * 
  *   This program is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
  *   the GNU General Public License for more details.
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program;  if not, write to the Free Software 
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 /*
  *      jfs_xtree.c: extent allocation descriptor B+-tree manager
  */
 
 #include <linux/fs.h>
 #include <linux/quotaops.h>
 #include "jfs_incore.h"
 #include "jfs_filsys.h"
 #include "jfs_metapage.h"
 #include "jfs_dmap.h"
 #include "jfs_dinode.h"
 #include "jfs_superblock.h"
 #include "jfs_debug.h"
 
 /*
  * xtree local flag
  */
 #define XT_INSERT       0x00000001
 
 /*
  *       xtree key/entry comparison: extent offset
  *
  * return:
  *      -1: k < start of extent
  *       0: start_of_extent <= k <= end_of_extent
  *       1: k > end_of_extent
  */
 #define XT_CMP(CMP, K, X, OFFSET64)\
 {\
         OFFSET64 = offsetXAD(X);\
         (CMP) = ((K) >= OFFSET64 + lengthXAD(X)) ? 1 :\
               ((K) < OFFSET64) ? -1 : 0;\
 }
 
 /* write a xad entry */
 #define XT_PUTENTRY(XAD, FLAG, OFF, LEN, ADDR)\
 {\
         (XAD)->flag = (FLAG);\
         XADoffset((XAD), (OFF));\
         XADlength((XAD), (LEN));\
         XADaddress((XAD), (ADDR));\
 }
 
 #define XT_PAGE(IP, MP) BT_PAGE(IP, MP, xtpage_t, i_xtroot)
 
 /* get page buffer for specified block address */
 /* ToDo: Replace this ugly macro with a function */
 #define XT_GETPAGE(IP, BN, MP, SIZE, P, RC)\
 {\
 	BT_GETPAGE(IP, BN, MP, xtpage_t, SIZE, P, RC, i_xtroot)\
 	if (!(RC))\
 	{\
 		if ((le16_to_cpu((P)->header.nextindex) < XTENTRYSTART) ||\
 		    (le16_to_cpu((P)->header.nextindex) > le16_to_cpu((P)->header.maxentry)) ||\
 		    (le16_to_cpu((P)->header.maxentry) > (((BN)==0)?XTROOTMAXSLOT:PSIZE>>L2XTSLOTSIZE)))\
 		{\
 			jfs_error((IP)->i_sb, "XT_GETPAGE: xtree page corrupt");\
 			BT_PUTPAGE(MP);\
 			MP = NULL;\
 			RC = -EIO;\
 		}\
         }\
 }
 
 /* for consistency */
 #define XT_PUTPAGE(MP) BT_PUTPAGE(MP)
 
 #define XT_GETSEARCH(IP, LEAF, BN, MP,  P, INDEX) \
 	BT_GETSEARCH(IP, LEAF, BN, MP, xtpage_t, P, INDEX, i_xtroot)
 /* xtree entry parameter descriptor */
 struct xtsplit {
 	struct metapage *mp;
 	s16 index;
 	u8 flag;
 	s64 off;
 	s64 addr;
 	int len;
 	struct pxdlist *pxdlist;
 };
 
 
 /*
  *      statistics
  */
 #ifdef CONFIG_JFS_STATISTICS
 static struct {
 	uint search;
 	uint fastSearch;
 	uint split;
 } xtStat;
 #endif
 
 
 /*
  * forward references
  */
 static int xtSearch(struct inode *ip,
 		    s64 xoff, int *cmpp, struct btstack * btstack, int flag);
 
 static int xtSplitUp(tid_t tid,
 		     struct inode *ip,
 		     struct xtsplit * split, struct btstack * btstack);
 
 static int xtSplitPage(tid_t tid, struct inode *ip, struct xtsplit * split,
 		       struct metapage ** rmpp, s64 * rbnp);
 
 static int xtSplitRoot(tid_t tid, struct inode *ip,
 		       struct xtsplit * split, struct metapage ** rmpp);
 
 #ifdef _STILL_TO_PORT
 static int xtDeleteUp(tid_t tid, struct inode *ip, struct metapage * fmp,
 		      xtpage_t * fp, struct btstack * btstack);
 
 static int xtSearchNode(struct inode *ip,
 			xad_t * xad,
 			int *cmpp, struct btstack * btstack, int flag);
 
 static int xtRelink(tid_t tid, struct inode *ip, xtpage_t * fp);
 #endif				/*  _STILL_TO_PORT */
 
 /* External references */
 
 /*
  *      debug control
  */
 /*      #define _JFS_DEBUG_XTREE        1 */
 
 
 /*
  *      xtLookup()
  *
  * function: map a single page into a physical extent;
  */
 int xtLookup(struct inode *ip, s64 lstart,
 	     s64 llen, int *pflag, s64 * paddr, s32 * plen, int no_check)
 {
 	int rc = 0;
 	struct btstack btstack;
 	int cmp;
 	s64 bn;
 	struct metapage *mp;
 	xtpage_t *p;
 	int index;
 	xad_t *xad;
 	s64 size, xoff, xend;
 	int xlen;
 	s64 xaddr;
 
 	*plen = 0;
 
 	if (!no_check) {
 		/* is lookup offset beyond eof ? */
 		size = ((u64) ip->i_size + (JFS_SBI(ip->i_sb)->bsize - 1)) >>
 		    JFS_SBI(ip->i_sb)->l2bsize;
 		if (lstart >= size) {
 			jfs_err("xtLookup: lstart (0x%lx) >= size (0x%lx)",
 				(ulong) lstart, (ulong) size);
 			return 0;
 		}
 	}
 
 	/*
 	 * search for the xad entry covering the logical extent
 	 */
 //search:
 	if ((rc = xtSearch(ip, lstart, &cmp, &btstack, 0))) {
 		jfs_err("xtLookup: xtSearch returned %d", rc);
 		return rc;
 	}
 
 	/*
 	 *      compute the physical extent covering logical extent
 	 *
 	 * N.B. search may have failed (e.g., hole in sparse file),
 	 * and returned the index of the next entry.
 	 */
 	/* retrieve search result */
 	XT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
 
 	/* is xad found covering start of logical extent ?
 	 * lstart is a page start address,
 	 * i.e., lstart cannot start in a hole;
 	 */
 	if (cmp)
 		goto out;
 
 	/*
 	 * lxd covered by xad
 	 */
 	xad = &p->xad[index];
 	xoff = offsetXAD(xad);
 	xlen = lengthXAD(xad);
 	xend = xoff + xlen;
 	xaddr = addressXAD(xad);
 
 	/* initialize new pxd */
 	*pflag = xad->flag;
 	*paddr = xaddr + (lstart - xoff);
 	/* a page must be fully covered by an xad */
 	*plen = min(xend - lstart, llen);
 
       out:
 	XT_PUTPAGE(mp);
 
 	return rc;
 }
 
 
 /*
  *      xtLookupList()
  *
  * function: map a single logical extent into a list of physical extent;
  *
  * parameter:
  *      struct inode    *ip,
  *      struct lxdlist  *lxdlist,       lxd list (in)
  *      struct xadlist  *xadlist,       xad list (in/out)
  *      int		flag)
  *
  * coverage of lxd by xad under assumption of
  * . lxd's are ordered and disjoint.
  * . xad's are ordered and disjoint.
  *
  * return:
  *      0:      success
  *
  * note: a page being written (even a single byte) is backed fully,
  *      except the last page which is only backed with blocks
  *      required to cover the last byte;
  *      the extent backing a page is fully contained within an xad;
  */
 int xtLookupList(struct inode *ip, struct lxdlist * lxdlist,
 		 struct xadlist * xadlist, int flag)
 {
 	int rc = 0;
 	struct btstack btstack;
 	int cmp;
 	s64 bn;
 	struct metapage *mp;
 	xtpage_t *p;
 	int index;
 	lxd_t *lxd;
 	xad_t *xad, *pxd;
 	s64 size, lstart, lend, xstart, xend, pstart;
 	s64 llen, xlen, plen;
 	s64 xaddr, paddr;
 	int nlxd, npxd, maxnpxd;
 
 	npxd = xadlist->nxad = 0;
 	maxnpxd = xadlist->maxnxad;
 	pxd = xadlist->xad;
 
 	nlxd = lxdlist->nlxd;
 	lxd = lxdlist->lxd;
 
 	lstart = offsetLXD(lxd);
 	llen = lengthLXD(lxd);
 	lend = lstart + llen;
 
 	size = (ip->i_size + (JFS_SBI(ip->i_sb)->bsize - 1)) >>
 	    JFS_SBI(ip->i_sb)->l2bsize;
 
 	/*
 	 * search for the xad entry covering the logical extent
 	 */
       search:
 	if (lstart >= size)
 		return 0;
 
 	if ((rc = xtSearch(ip, lstart, &cmp, &btstack, 0)))
 		return rc;
 
 	/*
 	 *      compute the physical extent covering logical extent
 	 *
 	 * N.B. search may have failed (e.g., hole in sparse file),
 	 * and returned the index of the next entry.
 	 */
 //map:
 	/* retrieve search result */
 	XT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
 
 	/* is xad on the next sibling page ? */
 	if (index == le16_to_cpu(p->header.nextindex)) {
 		if (p->header.flag & BT_ROOT)
 			goto mapend;
 
 		if ((bn = le64_to_cpu(p->header.next)) == 0)
 			goto mapend;
 
 		XT_PUTPAGE(mp);
 
 		/* get next sibling page */
 		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
 		if (rc)
 			return rc;
 
 		index = XTENTRYSTART;
 	}
 
 	xad = &p->xad[index];
 
 	/*
 	 * is lxd covered by xad ?
 	 */
       compare:
 	xstart = offsetXAD(xad);
 	xlen = lengthXAD(xad);
 	xend = xstart + xlen;
 	xaddr = addressXAD(xad);
 
       compare1:
 	if (xstart < lstart)
 		goto compare2;
 
 	/* (lstart <= xstart) */
 
 	/* lxd is NOT covered by xad */
 	if (lend <= xstart) {
 		/*
 		 * get next lxd
 		 */
 		if (--nlxd == 0)
 			goto mapend;
 		lxd++;
 
 		lstart = offsetLXD(lxd);
 		llen = lengthLXD(lxd);
 		lend = lstart + llen;
 		if (lstart >= size)
 			goto mapend;
 
 		/* compare with the current xad  */
 		goto compare1;
 	}
 	/* lxd is covered by xad */
 	else {			/* (xstart < lend) */
 
 		/* initialize new pxd */
 		pstart = xstart;
 		plen = min(lend - xstart, xlen);
 		paddr = xaddr;
 
 		goto cover;
 	}
 
 	/* (xstart < lstart) */
       compare2:
 	/* lxd is covered by xad */
 	if (lstart < xend) {
 		/* initialize new pxd */
 		pstart = lstart;
 		plen = min(xend - lstart, llen);
 		paddr = xaddr + (lstart - xstart);
 
 		goto cover;
 	}
 	/* lxd is NOT covered by xad */
 	else {			/* (xend <= lstart) */
 
 		/*
 		 * get next xad
 		 *
 		 * linear search next xad covering lxd on
 		 * the current xad page, and then tree search
 		 */
 		if (index == le16_to_cpu(p->header.nextindex) - 1) {
 			if (p->header.flag & BT_ROOT)
 				goto mapend;
 
 			XT_PUTPAGE(mp);
 			goto search;
 		} else {
 			index++;
 			xad++;
 
 			/* compare with new xad */
 			goto compare;
 		}
 	}
 
 	/*
 	 * lxd is covered by xad and a new pxd has been initialized
 	 * (lstart <= xstart < lend) or (xstart < lstart < xend)
 	 */
       cover:
 	/* finalize pxd corresponding to current xad */
 	XT_PUTENTRY(pxd, xad->flag, pstart, plen, paddr);
 
 	if (++npxd >= maxnpxd)
 		goto mapend;
 	pxd++;
 
 	/*
 	 * lxd is fully covered by xad
 	 */
 	if (lend <= xend) {
 		/*
 		 * get next lxd
 		 */
 		if (--nlxd == 0)
 			goto mapend;
 		lxd++;
 
 		lstart = offsetLXD(lxd);
 		llen = lengthLXD(lxd);
 		lend = lstart + llen;
 		if (lstart >= size)
 			goto mapend;
 
 		/*
 		 * test for old xad covering new lxd
 		 * (old xstart < new lstart)
 		 */
 		goto compare2;
 	}
 	/*
 	 * lxd is partially covered by xad
 	 */
 	else {			/* (xend < lend)  */
 
 		/*
 		 * get next xad
 		 *
 		 * linear search next xad covering lxd on
 		 * the current xad page, and then next xad page search
 		 */
 		if (index == le16_to_cpu(p->header.nextindex) - 1) {
 			if (p->header.flag & BT_ROOT)
 				goto mapend;
 
 			if ((bn = le64_to_cpu(p->header.next)) == 0)
 				goto mapend;
 
 			XT_PUTPAGE(mp);
 
 			/* get next sibling page */
 			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
 			if (rc)
 				return rc;
 
 			index = XTENTRYSTART;
 			xad = &p->xad[index];
 		} else {
 			index++;
 			xad++;
 		}
 
 		/*
 		 * test for new xad covering old lxd
 		 * (old lstart < new xstart)
 		 */
 		goto compare;
 	}
 
       mapend:
 	xadlist->nxad = npxd;
 
 //out:
 	XT_PUTPAGE(mp);
 
 	return rc;
 }
 
 
 /*
  *      xtSearch()
  *
  * function:    search for the xad entry covering specified offset.
  *
  * parameters:
  *      ip      - file object;
  *      xoff    - extent offset;
  *      cmpp    - comparison result:
  *      btstack - traverse stack;
  *      flag    - search process flag (XT_INSERT);
  *
  * returns:
  *      btstack contains (bn, index) of search path traversed to the entry.
  *      *cmpp is set to result of comparison with the entry returned.
  *      the page containing the entry is pinned at exit.
  */
 static int xtSearch(struct inode *ip, s64 xoff,	/* offset of extent */
 		    int *cmpp, struct btstack * btstack, int flag)
 {
 	struct jfs_inode_info *jfs_ip = JFS_IP(ip);
 	int rc = 0;
 	int cmp = 1;		/* init for empty page */
 	s64 bn;			/* block number */
 	struct metapage *mp;	/* page buffer */
 	xtpage_t *p;		/* page */
 	xad_t *xad;
 	int base, index, lim, btindex;
 	struct btframe *btsp;
 	int nsplit = 0;		/* number of pages to split */
 	s64 t64;
 
 	INCREMENT(xtStat.search);
 
 	BT_CLR(btstack);
 
 	btstack->nsplit = 0;
 
 	/*
 	 *      search down tree from root:
 	 *
 	 * between two consecutive entries of <Ki, Pi> and <Kj, Pj> of
 	 * internal page, child page Pi contains entry with k, Ki <= K < Kj.
 	 *
 	 * if entry with search key K is not found
 	 * internal page search find the entry with largest key Ki
 	 * less than K which point to the child page to search;
 	 * leaf page search find the entry with smallest key Kj
 	 * greater than K so that the returned index is the position of
 	 * the entry to be shifted right for insertion of new entry.
 	 * for empty tree, search key is greater than any key of the tree.
 	 *
 	 * by convention, root bn = 0.
 	 */
 	for (bn = 0;;) {
 		/* get/pin the page to search */
 		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
 		if (rc)
 			return rc;
 
 		/* try sequential access heuristics with the previous
 		 * access entry in target leaf page:
 		 * once search narrowed down into the target leaf,
 		 * key must either match an entry in the leaf or
 		 * key entry does not exist in the tree;
 		 */
 //fastSearch:
 		if ((jfs_ip->btorder & BT_SEQUENTIAL) &&
 		    (p->header.flag & BT_LEAF) &&
 		    (index = jfs_ip->btindex) <
 		    le16_to_cpu(p->header.nextindex)) {
 			xad = &p->xad[index];
 			t64 = offsetXAD(xad);
 			if (xoff < t64 + lengthXAD(xad)) {
 				if (xoff >= t64) {
 					*cmpp = 0;
 					goto out;
 				}
 
 				/* stop sequential access heuristics */
 				goto binarySearch;
 			} else {	/* (t64 + lengthXAD(xad)) <= xoff */
 
 				/* try next sequential entry */
 				index++;
 				if (index <
 				    le16_to_cpu(p->header.nextindex)) {
 					xad++;
 					t64 = offsetXAD(xad);
 					if (xoff < t64 + lengthXAD(xad)) {
 						if (xoff >= t64) {
 							*cmpp = 0;
 							goto out;
 						}
 
 						/* miss: key falls between
 						 * previous and this entry
 						 */
 						*cmpp = 1;
 						goto out;
 					}
 
 					/* (xoff >= t64 + lengthXAD(xad));
 					 * matching entry may be further out:
 					 * stop heuristic search
 					 */
 					/* stop sequential access heuristics */
 					goto binarySearch;
 				}
 
 				/* (index == p->header.nextindex);
 				 * miss: key entry does not exist in
 				 * the target leaf/tree
 				 */
 				*cmpp = 1;
 				goto out;
 			}
 
 			/*
 			 * if hit, return index of the entry found, and
 			 * if miss, where new entry with search key is
 			 * to be inserted;
 			 */
 		      out:
 			/* compute number of pages to split */
 			if (flag & XT_INSERT) {
 				if (p->header.nextindex ==	/* little-endian */
 				    p->header.maxentry)
 					nsplit++;
 				else
 					nsplit = 0;
 				btstack->nsplit = nsplit;
 			}
 
 			/* save search result */
 			btsp = btstack->top;
 			btsp->bn = bn;
 			btsp->index = index;
 			btsp->mp = mp;
 
 			/* update sequential access heuristics */
 			jfs_ip->btindex = index;
 
 			INCREMENT(xtStat.fastSearch);
 			return 0;
 		}
 
 		/* well, ... full search now */
 	      binarySearch:
 		lim = le16_to_cpu(p->header.nextindex) - XTENTRYSTART;
 
 		/*
 		 * binary search with search key K on the current page
 		 */
 		for (base = XTENTRYSTART; lim; lim >>= 1) {
 			index = base + (lim >> 1);
 
 			XT_CMP(cmp, xoff, &p->xad[index], t64);
 			if (cmp == 0) {
 				/*
 				 *      search hit
 				 */
 				/* search hit - leaf page:
 				 * return the entry found
 				 */
 				if (p->header.flag & BT_LEAF) {
 					*cmpp = cmp;
 
 					/* compute number of pages to split */
 					if (flag & XT_INSERT) {
 						if (p->header.nextindex ==
 						    p->header.maxentry)
 							nsplit++;
 						else
 							nsplit = 0;
 						btstack->nsplit = nsplit;
 					}
 
 					/* save search result */
 					btsp = btstack->top;
 					btsp->bn = bn;
 					btsp->index = index;
 					btsp->mp = mp;
 
 					/* init sequential access heuristics */
 					btindex = jfs_ip->btindex;
 					if (index == btindex ||
 					    index == btindex + 1)
 						jfs_ip->btorder = BT_SEQUENTIAL;
 					else
 						jfs_ip->btorder = BT_RANDOM;
 					jfs_ip->btindex = index;
 
 					return 0;
 				}
 
 				/* search hit - internal page:
 				 * descend/search its child page
 				 */
 				goto next;
 			}
 
 			if (cmp > 0) {
 				base = index + 1;
 				--lim;
 			}
 		}
 
 		/*
 		 *      search miss
 		 *
 		 * base is the smallest index with key (Kj) greater than
 		 * search key (K) and may be zero or maxentry index.
 		 */
 		/*
 		 * search miss - leaf page:
 		 *
 		 * return location of entry (base) where new entry with
 		 * search key K is to be inserted.
 		 */
 		if (p->header.flag & BT_LEAF) {
 			*cmpp = cmp;
 
 			/* compute number of pages to split */
 			if (flag & XT_INSERT) {
 				if (p->header.nextindex ==
 				    p->header.maxentry)
 					nsplit++;
 				else
 					nsplit = 0;
 				btstack->nsplit = nsplit;
 			}
 
 			/* save search result */
 			btsp = btstack->top;
 			btsp->bn = bn;
 			btsp->index = base;
 			btsp->mp = mp;
 
 			/* init sequential access heuristics */
 			btindex = jfs_ip->btindex;
 			if (base == btindex || base == btindex + 1)
 				jfs_ip->btorder = BT_SEQUENTIAL;
 			else
 				jfs_ip->btorder = BT_RANDOM;
 			jfs_ip->btindex = base;
 
 			return 0;
 		}
 
 		/*
 		 * search miss - non-leaf page:
 		 *
 		 * if base is non-zero, decrement base by one to get the parent
 		 * entry of the child page to search.
 		 */
 		index = base ? base - 1 : base;
 
 		/*
 		 * go down to child page
 		 */
 	      next:
 		/* update number of pages to split */
 		if (p->header.nextindex == p->header.maxentry)
 			nsplit++;
 		else
 			nsplit = 0;
 
 		/* push (bn, index) of the parent page/entry */
 		BT_PUSH(btstack, bn, index);
 
 		/* get the child page block number */
 		bn = addressXAD(&p->xad[index]);
 
 		/* unpin the parent page */
 		XT_PUTPAGE(mp);
 	}
 }
 
 /*
  *      xtInsert()
  *
  * function:
  *
  * parameter:
  *      tid     - transaction id;
  *      ip      - file object;
  *      xflag   - extent flag (XAD_NOTRECORDED):
  *      xoff    - extent offset;
  *      xlen    - extent length;
  *      xaddrp  - extent address pointer (in/out):
  *              if (*xaddrp)
  *                      caller allocated data extent at *xaddrp;
  *              else
  *                      allocate data extent and return its xaddr;
  *      flag    -
  *
  * return:
  */
 int xtInsert(tid_t tid,		/* transaction id */
 	     struct inode *ip, int xflag, s64 xoff, s32 xlen, s64 * xaddrp,
 	     int flag)
 {
 	int rc = 0;
 	s64 xaddr, hint;
 	struct metapage *mp;	/* meta-page buffer */
 	xtpage_t *p;		/* base B+-tree index page */
 	s64 bn;
 	int index, nextindex;
 	struct btstack btstack;	/* traverse stack */
 	struct xtsplit split;	/* split information */
 	xad_t *xad;
 	int cmp;
 	struct tlock *tlck;
 	struct xtlock *xtlck;
 
 	jfs_info("xtInsert: nxoff:0x%lx nxlen:0x%x", (ulong) xoff, xlen);
 
 	/*
 	 *      search for the entry location at which to insert:
 	 *
 	 * xtFastSearch() and xtSearch() both returns (leaf page
 	 * pinned, index at which to insert).
 	 * n.b. xtSearch() may return index of maxentry of
 	 * the full page.
 	 */
 	if ((rc = xtSearch(ip, xoff, &cmp, &btstack, XT_INSERT)))
 		return rc;
 
 	/* retrieve search result */
 	XT_GETSEARCH(ip, btstack.top, bn, mp, p, index);
 
 	/* This test must follow XT_GETSEARCH since mp must be valid if
 	 * we branch to out: */
 	if (cmp == 0) {
 		rc = -EEXIST;
 		goto out;
 	}
 
 	/*
 	 * allocate data extent requested
 	 *
 	 * allocation hint: last xad
 	 */
 	if ((xaddr = *xaddrp) == 0) {
 		if (index > XTENTRYSTART) {
 			xad = &p->xad[index - 1];
 			hint = addressXAD(xad) + lengthXAD(xad) - 1;
 		} else
 			hint = 0;
 		if ((rc = DQUOT_ALLOC_BLOCK(ip, xlen)))
 			goto out;
 		if ((rc = dbAlloc(ip, hint, (s64) xlen, &xaddr))) {
 			DQUOT_FREE_BLOCK(ip, xlen);
 			goto out;
 		}
 	}
 
 	/*
 	 *      insert entry for new extent
 	 */
 	xflag |= XAD_NEW;
 
 	/*
 	 *      if the leaf page is full, split the page and
 	 *      propagate up the router entry for the new page from split
 	 *
 	 * The xtSplitUp() will insert the entry and unpin the leaf page.
 	 */
 	nextindex = le16_to_cpu(p->header.nextindex);
 	if (nextindex == le16_to_cpu(p->header.maxentry)) {
 		split.mp = mp;
 		split.index = index;
 		split.flag = xflag;
 		split.off = xoff;
 		split.len = xlen;
 		split.addr = xaddr;
 		split.pxdlist = NULL;
 		if ((rc = xtSplitUp(tid, ip, &split, &btstack))) {
 			/* undo data extent allocation */
 			if (*xaddrp == 0) {
 				dbFree(ip, xaddr, (s64) xlen);
 				DQUOT_FREE_BLOCK(ip, xlen);
 			}
 			return rc;
 		}
 
 		*xaddrp = xaddr;
 		return 0;
 	}
 
 	/*
 	 *      insert the new entry into the leaf page
 	 */
 	/*
 	 * acquire a transaction lock on the leaf page;
 	 *
 	 * action: xad insertion/extension;
 	 */
 	BT_MARK_DIRTY(mp, ip);
 
 	/* if insert into middle, shift right remaining entries. */
 	if (index < nextindex)
 		memmove(&p->xad[index + 1], &p->xad[index],
 			(nextindex - index) * sizeof(xad_t));
 
 	/* insert the new entry: mark the entry NEW */
 	xad = &p->xad[index];
 	XT_PUTENTRY(xad, xflag, xoff, xlen, xaddr);
 
 	/* advance next available entry index */
 	p->header.nextindex =
 	    cpu_to_le16(le16_to_cpu(p->header.nextindex) + 1);
 
 	/* Don't log it if there are no links to the file */
 	if (!test_cflag(COMMIT_Nolink, ip)) {
 		tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);
 		xtlck = (struct xtlock *) & tlck->lock;
 		xtlck->lwm.offset =
 		    (xtlck->lwm.offset) ? min(index,
 					      (int)xtlck->lwm.offset) : index;
 		xtlck->lwm.length =
 		    le16_to_cpu(p->header.nextindex) - xtlck->lwm.offset;
 	}
 
 	*xaddrp = xaddr;
 
       out:
 	/* unpin the leaf page */
 	XT_PUTPAGE(mp);
 
 	return rc;
 }
 
 
 /*
  *      xtSplitUp()
  *
  * function:
  *      split full pages as propagating insertion up the tree
  *
  * parameter:
  *      tid     - transaction id;
  *      ip      - file object;
  *      split   - entry parameter descriptor;
  *      btstack - traverse stack from xtSearch()
  *
  * return:
  */
 static int
 xtSplitUp(tid_t tid,
 	  struct inode *ip, struct xtsplit * split, struct btstack * btstack)
 {
 	int rc = 0;
 	struct metapage *smp;
 	xtpage_t *sp;		/* split page */
 	struct metapage *rmp;
 	s64 rbn;		/* new right page block number */
 	struct metapage *rcmp;
 	xtpage_t *rcp;		/* right child page */
 	s64 rcbn;		/* right child page block number */
 	int skip;		/* index of entry of insertion */
 	int nextindex;		/* next available entry index of p */
 	struct btframe *parent;	/* parent page entry on traverse stack */
 	xad_t *xad;
 	s64 xaddr;
 	int xlen;
 	int nsplit;		/* number of pages split */
 	struct pxdlist pxdlist;
 	pxd_t *pxd;
 	struct tlock *tlck;
 	struct xtlock *xtlck;
 
 	smp = split->mp;
 	sp = XT_PAGE(ip, smp);
 
 	/* is inode xtree root extension/inline EA area free ? */
 	if ((sp->header.flag & BT_ROOT) && (!S_ISDIR(ip->i_mode)) &&
 	    (le16_to_cpu(sp->header.maxentry) < XTROOTMAXSLOT) &&
 	    (JFS_IP(ip)->mode2 & INLINEEA)) {
 		sp->header.maxentry = cpu_to_le16(XTROOTMAXSLOT);
 		JFS_IP(ip)->mode2 &= ~INLINEEA;
 
 		BT_MARK_DIRTY(smp, ip);
 		/*
 		 * acquire a transaction lock on the leaf page;
 		 *
 		 * action: xad insertion/extension;
 		 */
 
 		/* if insert into middle, shift right remaining entries. */
 		skip = split->index;
 		nextindex = le16_to_cpu(sp->header.nextindex);
 		if (skip < nextindex)
 			memmove(&sp->xad[skip + 1], &sp->xad[skip],
 				(nextindex - skip) * sizeof(xad_t));
 
 		/* insert the new entry: mark the entry NEW */
 		xad = &sp->xad[skip];
 		XT_PUTENTRY(xad, split->flag, split->off, split->len,
 			    split->addr);
 
 		/* advance next available entry index */
 		sp->header.nextindex =
 		    cpu_to_le16(le16_to_cpu(sp->header.nextindex) + 1);
 
 		/* Don't log it if there are no links to the file */
 		if (!test_cflag(COMMIT_Nolink, ip)) {
 			tlck = txLock(tid, ip, smp, tlckXTREE | tlckGROW);
 			xtlck = (struct xtlock *) & tlck->lock;
 			xtlck->lwm.offset = (xtlck->lwm.offset) ?
 			    min(skip, (int)xtlck->lwm.offset) : skip;
 			xtlck->lwm.length =
 			    le16_to_cpu(sp->header.nextindex) -
 			    xtlck->lwm.offset;
 		}
 
 		return 0;
]
]

225/2 2026/06/26 22:13 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 54157
							output: 41
							thoughts: 45
						

Thoughts:
Okay, here's my interpretation of what's going through my mind, as an expert familiar with filesystems and kernel code:

**Diving into the JFS Xtree Implementation**

Right, time to get my hands dirty. I need to take a look at a specific section of the JFS code, specifically in the `fs/jfs/` directory. The commit ID I'm interested in is `1da177e4c3f4`, which I'll be using for the specific code revision. I need to understand something within the JFS's xtree data structure. Let's start by focusing on lines 2480 to 2510 of `jfs_xtree.c`. That chunk of code should be just the right place to get a grasp of whatever detail I'm currently looking for, probably some aspect of xtree management or traversal. I'm expecting to find something specific. Let's see what's in there. I bet it is some details about the specific implementation for the file system.



226/2 2026/06/26 22:13 tool read-file
0m Args:
map[File:fs/jfs/jfs_xtree.c FirstLine:2480 LineCount:30]

Results:
map[Contents:2480:			    le16_to_cpu(p->header.nextindex) - XTENTRYSTART;
2481:			txFreeMap(ip, (struct maplock *) & xadlock, NULL, COMMIT_WMAP);
2482:		}
2483:	
2484:		if (p->header.flag & BT_ROOT) {
2485:			p->header.flag &= ~BT_INTERNAL;
2486:			p->header.flag |= BT_LEAF;
2487:			p->header.nextindex = cpu_to_le16(XTENTRYSTART);
2488:	
2489:			XT_PUTPAGE(mp);	/* debug */
2490:			goto out;
2491:		} else {
2492:			if (log) {	/* COMMIT_PWMAP */
2493:				/* page will be invalidated at tx completion
2494:				 */
2495:				XT_PUTPAGE(mp);
2496:			} else {	/* COMMIT_WMAP */
2497:	
2498:				if (mp->lid)
2499:					lid_to_tlock(mp->lid)->flag |= tlckFREELOCK;
2500:	
2501:				/* invalidate empty leaf page */
2502:				discard_metapage(mp);
2503:			}
2504:		}
2505:	
2506:		/*
2507:		 * the leaf page become empty: delete the parent entry
2508:		 * for the leaf page if the parent page is to be kept
2509:		 * in the new sized file.
]

227/2 2026/06/26 22:13 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 54918
							output: 40
							thoughts: 707
						

Thoughts:
**Analyzing the JFS Xtree Bug**

Okay, so I've got the code snippet from the bug report here, and it's exactly as described. Specifically, I'm looking at the `XT_GETPAGE` macro and the conditional logic related to `BT_ROOT` within the `jfs_xtree.c` file. The core issue seems to be that `XT_GETPAGE` doesn't validate if `BT_ROOT` is set when the block number (`BN`) is 0, which would signify the root page.

Looking at the code, if `BT_ROOT` *is* set, then the code within the `if` block correctly changes the page flags from `BT_INTERNAL` to `BT_LEAF` and updates `nextindex`. The `XT_PUTPAGE(mp)` call suggests this is part of a write process. Conversely, if `BT_ROOT` *isn't* set, we go into the `else` branch. There's a check for `log` and further branching: if `log` is true, another `XT_PUTPAGE` call which likely does some write operation, otherwise, we proceed to free/discard the page.

Based on the bug report, this `else` branch is the problematic one. The missing `BT_ROOT` bit in the `header.flag` of the root page causes `xtTruncate` to treat it like a leaf page. Subsequently, `discard_metapage(mp)` is called, which calls `release_metapage(mp)` directly and that's the vulnerability. The report contrasts this with `XT_PUTPAGE`, which seems to have a built-in safety check before releasing the page (at least that's how I read it).

The key here is `BT_ROOT` *not* being checked when it should be (the root page, `BN==0`). This makes sense. The code is structured to perform different actions depending on the flag, the check is missing on the `BN == 0` path.

The commit history provided - `1da177e4c3f4` - that's from the very beginning of the repository. I need to be sure though, if a later commit may have introduced this particular behavior. Given the comment and the nature of the issue, this looks like a core logic flaw. This likely means this bug has been present since the beginning of the repository's history, which is significant.

The bug report mentions the corruption happening to `header.flag`, which I would attribute to a memory corruption event, which is then made much worse due to the missing check. A corrupted root page that is treated as a leaf. That's a serious data integrity concern.



228/2 2026/06/26 22:13 tool read-file
0m Args:
map[File:fs/jfs/jfs_metapage.h FirstLine:1 LineCount:100]

Results:
map[Contents:   1:	/* SPDX-License-Identifier: GPL-2.0-or-later */
   2:	/*
   3:	 *   Copyright (C) International Business Machines Corp., 2000-2002
   4:	 *   Portions Copyright (C) Christoph Hellwig, 2001-2002
   5:	 */
   6:	#ifndef	_H_JFS_METAPAGE
   7:	#define _H_JFS_METAPAGE
   8:	
   9:	#include <linux/pagemap.h>
  10:	
  11:	struct metapage {
  12:		/* Common logsyncblk prefix (see jfs_logmgr.h) */
  13:		u16 xflag;
  14:		u16 unused;
  15:		lid_t lid;
  16:		int lsn;
  17:		struct list_head synclist;
  18:		/* End of logsyncblk prefix */
  19:	
  20:		unsigned long flag;	/* See Below */
  21:		unsigned long count;	/* Reference count */
  22:		void *data;		/* Data pointer */
  23:		sector_t index;		/* block address of page */
  24:		wait_queue_head_t wait;
  25:	
  26:		/* implementation */
  27:		struct folio *folio;
  28:		struct super_block *sb;
  29:		unsigned int logical_size;
  30:	
  31:		/* Journal management */
  32:		int clsn;
  33:		int nohomeok;
  34:		struct jfs_log *log;
  35:	};
  36:	
  37:	/* metapage flag */
  38:	#define META_locked	0
  39:	#define META_dirty	2
  40:	#define META_sync	3
  41:	#define META_discard	4
  42:	#define META_forcewrite	5
  43:	#define META_io		6
  44:	
  45:	#define mark_metapage_dirty(mp) set_bit(META_dirty, &(mp)->flag)
  46:	
  47:	/* function prototypes */
  48:	extern int metapage_init(void);
  49:	extern void metapage_exit(void);
  50:	extern struct metapage *__get_metapage(struct inode *inode,
  51:					  unsigned long lblock, unsigned int size,
  52:					  int absolute, unsigned long new);
  53:	
  54:	#define read_metapage(inode, lblock, size, absolute)\
  55:		 __get_metapage(inode, lblock, size, absolute, false)
  56:	
  57:	#define get_metapage(inode, lblock, size, absolute)\
  58:		 __get_metapage(inode, lblock, size, absolute, true)
  59:	
  60:	extern void release_metapage(struct metapage *);
  61:	extern void grab_metapage(struct metapage *);
  62:	extern void force_metapage(struct metapage *);
  63:	
  64:	/*
  65:	 * hold_metapage and put_metapage are used in conjunction.  The page lock
  66:	 * is not dropped between the two, so no other threads can get or release
  67:	 * the metapage
  68:	 */
  69:	extern void hold_metapage(struct metapage *);
  70:	extern void put_metapage(struct metapage *);
  71:	
  72:	static inline void write_metapage(struct metapage *mp)
  73:	{
  74:		set_bit(META_dirty, &mp->flag);
  75:		release_metapage(mp);
  76:	}
  77:	
  78:	static inline void flush_metapage(struct metapage *mp)
  79:	{
  80:		set_bit(META_sync, &mp->flag);
  81:		write_metapage(mp);
  82:	}
  83:	
  84:	static inline void discard_metapage(struct metapage *mp)
  85:	{
  86:		clear_bit(META_dirty, &mp->flag);
  87:		set_bit(META_discard, &mp->flag);
  88:		release_metapage(mp);
  89:	}
  90:	
  91:	static inline void metapage_nohomeok(struct metapage *mp)
  92:	{
  93:		struct folio *folio = mp->folio;
  94:		folio_lock(folio);
  95:		if (!mp->nohomeok++) {
  96:			mark_metapage_dirty(mp);
  97:			folio_get(folio);
  98:			folio_wait_writeback(folio);
  99:		}
 100:		folio_unlock(folio);
]

229/2 2026/06/26 22:13 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 57597
							output: 40
							thoughts: 90
						

Thoughts:
**Analyzing the Metapage Release Process**

Okay, so I'm tracing the flow here, specifically how a metapage is released. I know `discard_metapage` has been part of the system since day one, and it's responsible for calling `release_metapage(mp)`. Right, that's the obvious entry point. Now, `release_metapage` in turn calls `unlock_metapage(mp)`. And within `unlock_metapage`, we've got a call to `wake_up(&mp->wait)`. That's where the context switch is initiated. I need to make sure I don't miss anything.

Just to be absolutely certain I understand the logic, I need to check the exact implementation of `release_metapage`. Let me cross-reference that with the code in `fs/jfs/jfs_metapage.c` to be certain I have the right picture.



230/2 2026/06/26 22:13 tool git-show
0m Args:
map[Commit:1da177e4c3f4:fs/jfs/jfs_metapage.c]

Results:
map[Output:/*
 *   Copyright (C) International Business Machines Corp., 2000-2003
 *   Portions Copyright (C) Christoph Hellwig, 2001-2002
 *
 *   This program is free software;  you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or 
 *   (at your option) any later version.
 * 
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 *   the GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program;  if not, write to the Free Software 
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#include <linux/fs.h>
#include <linux/init.h>
#include <linux/buffer_head.h>
#include <linux/mempool.h>
#include <linux/delay.h>
#include "jfs_incore.h"
#include "jfs_superblock.h"
#include "jfs_filsys.h"
#include "jfs_metapage.h"
#include "jfs_txnmgr.h"
#include "jfs_debug.h"

static DEFINE_SPINLOCK(meta_lock);

#ifdef CONFIG_JFS_STATISTICS
static struct {
	uint	pagealloc;	/* # of page allocations */
	uint	pagefree;	/* # of page frees */
	uint	lockwait;	/* # of sleeping lock_metapage() calls */
} mpStat;
#endif


#define HASH_BITS 10		/* This makes hash_table 1 4K page */
#define HASH_SIZE (1 << HASH_BITS)
static struct metapage **hash_table = NULL;
static unsigned long hash_order;


static inline int metapage_locked(struct metapage *mp)
{
	return test_bit(META_locked, &mp->flag);
}

static inline int trylock_metapage(struct metapage *mp)
{
	return test_and_set_bit(META_locked, &mp->flag);
}

static inline void unlock_metapage(struct metapage *mp)
{
	clear_bit(META_locked, &mp->flag);
	wake_up(&mp->wait);
}

static void __lock_metapage(struct metapage *mp)
{
	DECLARE_WAITQUEUE(wait, current);

	INCREMENT(mpStat.lockwait);

	add_wait_queue_exclusive(&mp->wait, &wait);
	do {
		set_current_state(TASK_UNINTERRUPTIBLE);
		if (metapage_locked(mp)) {
			spin_unlock(&meta_lock);
			schedule();
			spin_lock(&meta_lock);
		}
	} while (trylock_metapage(mp));
	__set_current_state(TASK_RUNNING);
	remove_wait_queue(&mp->wait, &wait);
}

/* needs meta_lock */
static inline void lock_metapage(struct metapage *mp)
{
	if (trylock_metapage(mp))
		__lock_metapage(mp);
}

#define METAPOOL_MIN_PAGES 32
static kmem_cache_t *metapage_cache;
static mempool_t *metapage_mempool;

static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
{
	struct metapage *mp = (struct metapage *)foo;

	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
	    SLAB_CTOR_CONSTRUCTOR) {
		mp->lid = 0;
		mp->lsn = 0;
		mp->flag = 0;
		mp->data = NULL;
		mp->clsn = 0;
		mp->log = NULL;
		set_bit(META_free, &mp->flag);
		init_waitqueue_head(&mp->wait);
	}
}

static inline struct metapage *alloc_metapage(int gfp_mask)
{
	return mempool_alloc(metapage_mempool, gfp_mask);
}

static inline void free_metapage(struct metapage *mp)
{
	mp->flag = 0;
	set_bit(META_free, &mp->flag);

	mempool_free(mp, metapage_mempool);
}

int __init metapage_init(void)
{
	/*
	 * Allocate the metapage structures
	 */
	metapage_cache = kmem_cache_create("jfs_mp", sizeof(struct metapage),
					   0, 0, init_once, NULL);
	if (metapage_cache == NULL)
		return -ENOMEM;

	metapage_mempool = mempool_create(METAPOOL_MIN_PAGES, mempool_alloc_slab,
					  mempool_free_slab, metapage_cache);

	if (metapage_mempool == NULL) {
		kmem_cache_destroy(metapage_cache);
		return -ENOMEM;
	}
	/*
	 * Now the hash list
	 */
	for (hash_order = 0;
	     ((PAGE_SIZE << hash_order) / sizeof(void *)) < HASH_SIZE;
	     hash_order++);
	hash_table =
	    (struct metapage **) __get_free_pages(GFP_KERNEL, hash_order);
	assert(hash_table);
	memset(hash_table, 0, PAGE_SIZE << hash_order);

	return 0;
}

void metapage_exit(void)
{
	mempool_destroy(metapage_mempool);
	kmem_cache_destroy(metapage_cache);
}

/*
 * Basically same hash as in pagemap.h, but using our hash table
 */
static struct metapage **meta_hash(struct address_space *mapping,
				   unsigned long index)
{
#define i (((unsigned long)mapping)/ \
	   (sizeof(struct inode) & ~(sizeof(struct inode) -1 )))
#define s(x) ((x) + ((x) >> HASH_BITS))
	return hash_table + (s(i + index) & (HASH_SIZE - 1));
#undef i
#undef s
}

static struct metapage *search_hash(struct metapage ** hash_ptr,
				    struct address_space *mapping,
			       unsigned long index)
{
	struct metapage *ptr;

	for (ptr = *hash_ptr; ptr; ptr = ptr->hash_next) {
		if ((ptr->mapping == mapping) && (ptr->index == index))
			return ptr;
	}

	return NULL;
}

static void add_to_hash(struct metapage * mp, struct metapage ** hash_ptr)
{
	if (*hash_ptr)
		(*hash_ptr)->hash_prev = mp;

	mp->hash_prev = NULL;
	mp->hash_next = *hash_ptr;
	*hash_ptr = mp;
}

static void remove_from_hash(struct metapage * mp, struct metapage ** hash_ptr)
{
	if (mp->hash_prev)
		mp->hash_prev->hash_next = mp->hash_next;
	else {
		assert(*hash_ptr == mp);
		*hash_ptr = mp->hash_next;
	}

	if (mp->hash_next)
		mp->hash_next->hash_prev = mp->hash_prev;
}

struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
				unsigned int size, int absolute,
				unsigned long new)
{
	struct metapage **hash_ptr;
	int l2BlocksPerPage;
	int l2bsize;
	struct address_space *mapping;
	struct metapage *mp;
	unsigned long page_index;
	unsigned long page_offset;

	jfs_info("__get_metapage: inode = 0x%p, lblock = 0x%lx", inode, lblock);

	if (absolute)
		mapping = inode->i_sb->s_bdev->bd_inode->i_mapping;
	else {
		/*
		 * If an nfs client tries to read an inode that is larger
		 * than any existing inodes, we may try to read past the
		 * end of the inode map
		 */
		if ((lblock << inode->i_blkbits) >= inode->i_size)
			return NULL;
		mapping = inode->i_mapping;
	}

	hash_ptr = meta_hash(mapping, lblock);
again:
	spin_lock(&meta_lock);
	mp = search_hash(hash_ptr, mapping, lblock);
	if (mp) {
	      page_found:
		if (test_bit(META_stale, &mp->flag)) {
			spin_unlock(&meta_lock);
			msleep(1);
			goto again;
		}
		mp->count++;
		lock_metapage(mp);
		spin_unlock(&meta_lock);
		if (test_bit(META_discard, &mp->flag)) {
			if (!new) {
				jfs_error(inode->i_sb,
					  "__get_metapage: using a "
					  "discarded metapage");
				release_metapage(mp);
				return NULL;
			}
			clear_bit(META_discard, &mp->flag);
		}
		jfs_info("__get_metapage: found 0x%p, in hash", mp);
		if (mp->logical_size != size) {
			jfs_error(inode->i_sb,
				  "__get_metapage: mp->logical_size != size");
			release_metapage(mp);
			return NULL;
		}
	} else {
		l2bsize = inode->i_blkbits;
		l2BlocksPerPage = PAGE_CACHE_SHIFT - l2bsize;
		page_index = lblock >> l2BlocksPerPage;
		page_offset = (lblock - (page_index << l2BlocksPerPage)) <<
		    l2bsize;
		if ((page_offset + size) > PAGE_CACHE_SIZE) {
			spin_unlock(&meta_lock);
			jfs_err("MetaData crosses page boundary!!");
			return NULL;
		}
		
		/*
		 * Locks held on aggregate inode pages are usually
		 * not held long, and they are taken in critical code
		 * paths (committing dirty inodes, txCommit thread) 
		 * 
		 * Attempt to get metapage without blocking, tapping into
		 * reserves if necessary.
		 */
		mp = NULL;
		if (JFS_IP(inode)->fileset == AGGREGATE_I) {
			mp = alloc_metapage(GFP_ATOMIC);
			if (!mp) {
				/*
				 * mempool is supposed to protect us from
				 * failing here.  We will try a blocking
				 * call, but a deadlock is possible here
				 */
				printk(KERN_WARNING
				       "__get_metapage: atomic call to mempool_alloc failed.\n");
				printk(KERN_WARNING
				       "Will attempt blocking call\n");
			}
		}
		if (!mp) {
			struct metapage *mp2;

			spin_unlock(&meta_lock);
			mp = alloc_metapage(GFP_NOFS);
			spin_lock(&meta_lock);

			/* we dropped the meta_lock, we need to search the
			 * hash again.
			 */
			mp2 = search_hash(hash_ptr, mapping, lblock);
			if (mp2) {
				free_metapage(mp);
				mp = mp2;
				goto page_found;
			}
		}
		mp->flag = 0;
		lock_metapage(mp);
		if (absolute)
			set_bit(META_absolute, &mp->flag);
		mp->xflag = COMMIT_PAGE;
		mp->count = 1;
		atomic_set(&mp->nohomeok,0);
		mp->mapping = mapping;
		mp->index = lblock;
		mp->page = NULL;
		mp->logical_size = size;
		add_to_hash(mp, hash_ptr);
		spin_unlock(&meta_lock);

		if (new) {
			jfs_info("__get_metapage: Calling grab_cache_page");
			mp->page = grab_cache_page(mapping, page_index);
			if (!mp->page) {
				jfs_err("grab_cache_page failed!");
				goto freeit;
			} else {
				INCREMENT(mpStat.pagealloc);
				unlock_page(mp->page);
			}
		} else {
			jfs_info("__get_metapage: Calling read_cache_page");
			mp->page = read_cache_page(mapping, lblock,
				    (filler_t *)mapping->a_ops->readpage, NULL);
			if (IS_ERR(mp->page)) {
				jfs_err("read_cache_page failed!");
				goto freeit;
			} else
				INCREMENT(mpStat.pagealloc);
		}
		mp->data = kmap(mp->page) + page_offset;
	}

	if (new)
		memset(mp->data, 0, PSIZE);

	jfs_info("__get_metapage: returning = 0x%p", mp);
	return mp;

freeit:
	spin_lock(&meta_lock);
	remove_from_hash(mp, hash_ptr);
	free_metapage(mp);
	spin_unlock(&meta_lock);
	return NULL;
}

void hold_metapage(struct metapage * mp, int force)
{
	spin_lock(&meta_lock);

	mp->count++;

	if (force) {
		ASSERT (!(test_bit(META_forced, &mp->flag)));
		if (trylock_metapage(mp))
			set_bit(META_forced, &mp->flag);
	} else
		lock_metapage(mp);

	spin_unlock(&meta_lock);
}

static void __write_metapage(struct metapage * mp)
{
	int l2bsize = mp->mapping->host->i_blkbits;
	int l2BlocksPerPage = PAGE_CACHE_SHIFT - l2bsize;
	unsigned long page_index;
	unsigned long page_offset;
	int rc;

	jfs_info("__write_metapage: mp = 0x%p", mp);

	page_index = mp->page->index;
	page_offset =
	    (mp->index - (page_index << l2BlocksPerPage)) << l2bsize;

	lock_page(mp->page);
	rc = mp->mapping->a_ops->prepare_write(NULL, mp->page, page_offset,
					       page_offset +
					       mp->logical_size);
	if (rc) {
		jfs_err("prepare_write return %d!", rc);
		ClearPageUptodate(mp->page);
		unlock_page(mp->page);
		clear_bit(META_dirty, &mp->flag);
		return;
	}
	rc = mp->mapping->a_ops->commit_write(NULL, mp->page, page_offset,
					      page_offset +
					      mp->logical_size);
	if (rc) {
		jfs_err("commit_write returned %d", rc);
	}

	unlock_page(mp->page);
	clear_bit(META_dirty, &mp->flag);

	jfs_info("__write_metapage done");
}

static inline void sync_metapage(struct metapage *mp)
{
	struct page *page = mp->page;

	page_cache_get(page);
	lock_page(page);

	/* we're done with this page - no need to check for errors */
	if (page_has_buffers(page))
		write_one_page(page, 1);
	else
		unlock_page(page);
	page_cache_release(page);
}

void release_metapage(struct metapage * mp)
{
	struct jfs_log *log;

	jfs_info("release_metapage: mp = 0x%p, flag = 0x%lx", mp, mp->flag);

	spin_lock(&meta_lock);
	if (test_bit(META_forced, &mp->flag)) {
		clear_bit(META_forced, &mp->flag);
		mp->count--;
		spin_unlock(&meta_lock);
		return;
	}

	assert(mp->count);
	if (--mp->count || atomic_read(&mp->nohomeok)) {
		unlock_metapage(mp);
		spin_unlock(&meta_lock);
		return;
	}

	if (mp->page) {
		set_bit(META_stale, &mp->flag);
		spin_unlock(&meta_lock);
		kunmap(mp->page);
		mp->data = NULL;
		if (test_bit(META_dirty, &mp->flag))
			__write_metapage(mp);
		if (test_bit(META_sync, &mp->flag)) {
			sync_metapage(mp);
			clear_bit(META_sync, &mp->flag);
		}

		if (test_bit(META_discard, &mp->flag)) {
			lock_page(mp->page);
			block_invalidatepage(mp->page, 0);
			unlock_page(mp->page);
		}

		page_cache_release(mp->page);
		mp->page = NULL;
		INCREMENT(mpStat.pagefree);
		spin_lock(&meta_lock);
	}

	if (mp->lsn) {
		/*
		 * Remove metapage from logsynclist.
		 */
		log = mp->log;
		LOGSYNC_LOCK(log);
		mp->log = NULL;
		mp->lsn = 0;
		mp->clsn = 0;
		log->count--;
		list_del(&mp->synclist);
		LOGSYNC_UNLOCK(log);
	}
	remove_from_hash(mp, meta_hash(mp->mapping, mp->index));
	spin_unlock(&meta_lock);

	free_metapage(mp);
}

void __invalidate_metapages(struct inode *ip, s64 addr, int len)
{
	struct metapage **hash_ptr;
	unsigned long lblock;
	int l2BlocksPerPage = PAGE_CACHE_SHIFT - ip->i_blkbits;
	/* All callers are interested in block device's mapping */
	struct address_space *mapping = ip->i_sb->s_bdev->bd_inode->i_mapping;
	struct metapage *mp;
	struct page *page;

	/*
	 * First, mark metapages to discard.  They will eventually be
	 * released, but should not be written.
	 */
	for (lblock = addr; lblock < addr + len;
	     lblock += 1 << l2BlocksPerPage) {
		hash_ptr = meta_hash(mapping, lblock);
again:
		spin_lock(&meta_lock);
		mp = search_hash(hash_ptr, mapping, lblock);
		if (mp) {
			if (test_bit(META_stale, &mp->flag)) {
				spin_unlock(&meta_lock);
				msleep(1);
				goto again;
			}

			clear_bit(META_dirty, &mp->flag);
			set_bit(META_discard, &mp->flag);
			spin_unlock(&meta_lock);
		} else {
			spin_unlock(&meta_lock);
			page = find_lock_page(mapping, lblock>>l2BlocksPerPage);
			if (page) {
				block_invalidatepage(page, 0);
				unlock_page(page);
				page_cache_release(page);
			}
		}
	}
}

#ifdef CONFIG_JFS_STATISTICS
int jfs_mpstat_read(char *buffer, char **start, off_t offset, int length,
		    int *eof, void *data)
{
	int len = 0;
	off_t begin;

	len += sprintf(buffer,
		       "JFS Metapage statistics\n"
		       "=======================\n"
		       "page allocations = %d\n"
		       "page frees = %d\n"
		       "lock waits = %d\n",
		       mpStat.pagealloc,
		       mpStat.pagefree,
		       mpStat.lockwait);

	begin = offset;
	*start = buffer + begin;
	len -= begin;

	if (len > length)
		len = length;
	else
		*eof = 1;

	if (len < 0)
		len = 0;

	return len;
}
#endif
]

231/2 2026/06/26 22:13 llm fixes-finder
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 63156
							output: 53
							thoughts: 2092
						

Thoughts:
**Bug Analysis: JFS Corrupted Image Crash**

Okay, so the initial hypothesis seems sound. `release_metapage` calls `unlock_metapage`, which in turn calls `wake_up` on the metapage's wait queue. And yes, as the bug report states, when the block number `BN` is zero, we're dealing with a pseudo-metapage. Thus, a missing `BT_ROOT` check leading to a `discard_metapage` call on this pseudo-metapage *is* indeed going to cause an issue because that triggers a call to `release_metapage` with an invalid `mp`. This crash is definitely traceable back to the commit `1da177e4c3f41524e886b7f1b8a0c1fc7321cac2` (Linux-2.6.12-rc2).

Let me dig a little deeper, just to be absolutely certain we haven't missed anything. The bug report is helpful, specifically highlighting the failure to validate the `BT_ROOT` flag in `xt_getpage`. This corruption allows the code to treat the root page as a regular leaf page, ultimately leading to a `discard_metapage` call.

Examining the `xtTruncate` code within that initial commit `1da177e4c3f41524e886b7f1b8a0c1fc7321cac2`, the logic is spot on.  If `BT_ROOT` is set, it modifies the flags and proceeds. But *else*, which is triggered when `BT_ROOT` is missing, `discard_metapage` is called on the pseudo-metapage.  It's the exact scenario described in the bug report.  So, no doubt, the issue stems from this initial commit.

I need to confirm the history of `xt_getpage` as the fix was in that function. It was introduced with the refactoring commit `1014354cd8d40e81e9a6e9037a10ebfc0b656d27` *however* the offending macro `XT_GETPAGE` existed *before* that, and it had the same flawed logic, meaning the commit `1da177e4c3f41524e886b7f1b8a0c1fc7321cac2` is the culprit. The fix just happened to land on the function because it was a straight replacement of the macro.

To solidify this conclusion, let's verify:  Were there *any* subsequent commits that changed the logic to call `discard_metapage` within `xtTruncate`? No. Was there a commit that changed `BT_GETPAGE` to return a pseudo-metapage? No. Was there a commit that changed `release_metapage` to call `unlock_metapage`? No. That reinforces that `1da177e4c3f41524e886b7f1b8a0c1fc7321cac2` is the commit that introduced this flaw.

Just to be absolutely sure, let's consider the `DT_GETPAGE` macro and corresponding code in `fs/jfs/jfs_dtree.c`. In `1da177e4c3f4`, it also lacked the crucial `BT_ROOT` check for the root page (BN == 0). The `dtDeleteUp` function in this same commit has a similar conditional. If `BT_ROOT` is missing and the block number is 0, the code calls `discard_metapage(mp)`, leading to the same crash. This solidifies that the bug affected both the `xtree` and the `dtree` code paths.

Therefore, the confirmed bug-introducing commit is definitely `1da177e4c3f41524e886b7f1b8a0c1fc7321cac2`.



232/2 2026/06/26 22:13 tool set-results
0m Args:
map[FixesHash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2]

Results:
map[FixesHash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2]

233/1 2026/06/26 22:13 action format-fixes
0m Results:
map[Fixes:map[Hash:1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Title:Linux-2.6.12-rc2]]

234/1 2026/06/26 22:13 action get-maintainers
0m Results:
map[Recipients:[map[Email:arnd@arndb.de Name:Arnd Bergmann To:false] map[Email:jfs-discussion@lists.sourceforge.net Name: To:true] map[Email:linux-kernel@vger.kernel.org Name: To:false] map[Email:shaggy@kernel.org Name:Dave Kleikamp To:true] map[Email:suchitkarunakaran@gmail.com Name:Suchit Karunakaran To:false] map[Email:yun.zhou@windriver.com Name:Yun Zhou To:false] map[Email:zheng.yu@northwestern.edu Name:Zheng Yu To:false]]]

235/1 2026/06/26 22:13 action get-recent-commits
0m Results:
map[RecentCommits:jfs: avoid -Wtautological-constant-out-of-range-compare warning again
jfs: add dtpage integrity check to prevent index/pointer overflows
jfs: add dtroot integrity check to prevent index out-of-bounds
jfs: avoid -Wtautological-constant-out-of-range-compare warning
jfs: replace hardcoded magic number with DTPAGEMAXSLOT constant
jfs: jfs_xtree: replace XT_GETPAGE macro with xt_getpage()
jfs: fix array-index-out-of-bounds read in add_missing_indices
jfs: add index corruption check to DT_GETPAGE()
jfs: fix array-index-out-of-bounds in jfs_readdir
jfs: array-index-out-of-bounds fix in dtReadFirst
jfs: fix null ptr deref in dtInsertEntry
jfs: fix slab-out-of-bounds Read in dtSearch
UBSAN: array-index-out-of-bounds in dtSplitRoot
jfs: define xtree root and page independently
fs/jfs: Remove dead code
jfs: delete duplicated words + other fixes
jfs: Replace zero-length array with flexible-array member
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
treewide: kmalloc() -> kmalloc_array()
jfs: simplify procfs code
]

236/1 2026/06/26 22:13 agent description-generator
0m Model:
gemini-3.1-pro-preview

Instruction:
You are an experienced Linux kernel developer tasked with writing a commit description for
a kernel bug fixing commit. The description should start with a one-line summary,
and then include description of the bug being fixed, and how it's fixed by the provided patch.
The one-line summary should describe the change being made, rather than mention the tool that
detected the bug.

The description must not contain lines starting with '#' because they will dropped by git as comments.
The description must not contain lines starting with '--' or '---' (including inline code diffs)
because they may confuse git/patch utilities.

Your final reply should contain only the text of the commit description.


The one-line summary must be not longer than 72 characters.

IMPORTANT: Do not wrap lines manually (e.g., at 80 characters); we will reformat the text
automatically, so keep paragraphs as single lines without newlines.

Generally try to phrase the description without mentioning syzkaller
(avoid phrases like "the bug was triggered by syzkaller" or "the bug was triggered by fuzzer", etc).
How the bug was triggered is generally an irrelevant detail.
Any bug triggered by a fuzzer can also be triggered by a malicious user, or a buggy program.

If the crash is reported by a sanitizer (e.g., KASAN, KMSAN, lockdep), include the relevant
parts of the sanitizer output to illustrate the problem. Exclude less relevant sections,
as the stack trace can be very long. Describe the execution path that leads to the manifestation
of the kernel bug.



Prefer calling several tools at the same time to save round-trips.

Prompt:
The crash that corresponds to the bug is:

BUG: spinlock bad magic on CPU#0, syz-executor/6066
 lock: 0xffff888120999b48, .magic: ffffffff, .owner: �������� �������/-1902340672, .owner_cpu: 768
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in /app/workdir/cache/src/1583fc50e73bc268b47064ec35fa43904fad8ca1/kernel/locking/qspinlock.h:68:9
index 8945 is out of range for type 'unsigned long[8]'
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 ubsan_epilogue+0xa/0x30 lib/ubsan.c:233
 __ubsan_handle_out_of_bounds+0xe8/0xf0 lib/ubsan.c:455
 decode_tail kernel/locking/qspinlock.h:68 [inline]
 __pv_queued_spin_lock_slowpath+0xaf3/0xbc0 kernel/locking/qspinlock.c:285
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:35 [inline]
 queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:66 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x26c/0x2f0 kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8c5199e097
Code: a2 c7 05 5c 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc15a08f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8c51a322ca RCX: 00007f8c5199e097
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc15a09010
RBP: 00007ffc15a09010 R08: 00007ffc15a0a010 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc15a0a0a0
R13: 00007f8c51a322ca R14: 00000000000153ab R15: 00007ffc15a0a0e0
 </TASK>
---[ end trace ]---




The explanation of the root cause of the bug is:

An excellent catch! The crash is caused by a corrupted JFS image that tricks the kernel into calling `release_metapage()` on a pseudo-metapage embedded within the inode, leading to an out-of-bounds memory access and a spinlock crash.

Here is the detailed root cause analysis and the proposed fix.

### Root Cause Analysis

1. **The Pseudo-Metapage:**
   When operating on the root page of an xtree or dtree (which is stored inline within the inode), JFS doesn't use a real `struct metapage`. Instead, `BT_GETPAGE` (called via `xt_getpage` for `bn == 0`) sets the metapage pointer `mp` to the address of `JFS_IP(ip)->bxflag`:
   ```c
   // fs/jfs/jfs_btree.h
   #define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\
   {\
       if ((BN) == 0)\
       {\
           MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
           P = (TYPE *)&JFS_IP(IP)->ROOT;\
           RC = 0;\
       }\
       // ...
   ```
   Because this is a pseudo-metapage, it does not have a valid `wait_queue_head_t wait` field. Accessing `mp->wait` (which is at offset 64 in `struct metapage`) actually reads out-of-bounds memory in `struct jfs_inode_info` (overlapping with `rdwrlock` or `anon_inode_list`).

2. **The Missing Validation:**
   In `xt_getpage()`, the code validates `nextindex` and `maxentry`, but it **fails to verify that the `BT_ROOT` flag is set** in `p->header.flag` for the root page (`bn == 0`). In the corrupted syzkaller image, the inline xtree root page (`i_xtroot`) has a corrupted `header.flag` where `BT_ROOT` is missing.

3. **The Vulnerable Path in `xtTruncate`:**
   When `xtTruncate()` processes this corrupted root page and it becomes empty, it checks if it is the root page by looking at the `BT_ROOT` flag:
   ```c
   // fs/jfs/jfs_xtree.c : xtTruncate()
           if (p->header.flag & BT_ROOT) {
               // ...
               XT_PUTPAGE(mp);
               goto out;
           } else {
               if (log) {
                   XT_PUTPAGE(mp);
               } else {
                   if (mp->lid)
                       lid_to_tlock(mp->lid)->flag |= tlckFREELOCK;

                   /* invalidate empty leaf page */
                   discard_metapage(mp);
               }
           }
   ```
   Because `BT_ROOT` is missing due to corruption, `xtTruncate` takes the `else` branch, mistakenly treating the root page as a regular leaf page, and calls `discard_metapage(mp)`.

4. **The Crash:**
   Unlike `XT_PUTPAGE` (which wraps `BT_PUTPAGE` and safely checks `!BT_IS_ROOT(mp)` before releasing), `discard_metapage()` calls `release_metapage(mp)` directly:
   ```c
   // fs/jfs/jfs_metapage.h
   static inline void discard_metapage(struct metapage *mp)
   {
       clear_bit(META_dirty, &mp->flag);
       set_bit(META_discard, &mp->flag);
       release_metapage(mp);
   }
   ```
   `release_metapage()` assumes `mp` is a real metapage and calls `unlock_metapage(mp)`, which executes `wake_up(&mp->wait)`. Since `mp` points to `&JFS_IP(ip)->bxflag`, this accesses garbage memory, resulting in the `spinlock bad magic` BUG or the UBSAN out-of-bounds array access.

### Proposed Fix

To fix this, we must enforce the invariant that the `BT_ROOT` flag is set **if and only if** `bn == 0`. 

**1. Fix in `xt_getpage` (`fs/jfs/jfs_xtree.c`):**
Add a check to ensure `BT_ROOT` consistency:
```c
static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **mp)
{
	xtpage_t *p;
	int rc;

	BT_GETPAGE(ip, bn, *mp, xtpage_t, PSIZE, p, rc, i_xtroot);

	if (rc)
		return ERR_PTR(rc);
	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
	    (le16_to_cpu(p->header.nextindex) > le16_to_cpu(p->header.maxentry)) ||
	    (le16_to_cpu(p->header.maxentry) > ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {      // <--- ADD THIS CHECK
		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
		BT_PUTPAGE(*mp);
		*mp = NULL;
		return ERR_PTR(-EIO);
	}
	return p;
}
```

**2. Fix in `DT_GETPAGE` (`fs/jfs/jfs_dtree.c`):**
The exact same vulnerability exists for dtree pages (e.g., `dtDeleteUp` can crash the same way if `i_dtroot` is corrupted). The `DT_GETPAGE` macro should be updated to enforce the same `BT_ROOT` invariant:
```c
#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
do {									\
	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
	if (!(RC)) {							\
		if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {	\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree root page corrupt\n"); \
			MP = NULL;					\
			RC = -EIO;					\
		} else if ((BN) && !check_dtpage(P)) {			\
			BT_PUTPAGE(MP);					\
			jfs_error((IP)->i_sb,				\
				  "DT_GETPAGE: dtree page corrupt\n");	\
			MP = NULL;					\
			RC = -EIO;					\
		}							\
	}								\
} while (0)
```

The diff of the bug fix is:

diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index ac0f79faf..bbb157daf 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -111,19 +111,26 @@ struct dtsplit {
 #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
 
 /* get page buffer for specified block address */
-#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)				\
-do {									\
-	BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);	\
-	if (!(RC)) {							\
-		if ((BN) && !check_dtpage(P)) {				\
-			BT_PUTPAGE(MP);					\
-			jfs_error((IP)->i_sb,				\
-				  "DT_GETPAGE: dtree page corrupt\n");	\
-			MP = NULL;					\
-			RC = -EIO;					\
-		}							\
-	}								\
-} while (0)
+#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)                                       \
+	do {                                                                      \
+		BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot);          \
+		if (!(RC)) {                                                      \
+			if (((BN) == 0) != !!((P)->header.flag & BT_ROOT)) {      \
+				BT_PUTPAGE(MP);                                   \
+				jfs_error(                                        \
+					(IP)->i_sb,                               \
+					"DT_GETPAGE: dtree root page corrupt\n"); \
+				MP = NULL;                                        \
+				RC = -EIO;                                        \
+			} else if ((BN) && !check_dtpage(P)) {                    \
+				BT_PUTPAGE(MP);                                   \
+				jfs_error((IP)->i_sb,                             \
+					  "DT_GETPAGE: dtree page corrupt\n");    \
+				MP = NULL;                                        \
+				RC = -EIO;                                        \
+			}                                                         \
+		}                                                                 \
+	} while (0)
 
 /* for consistency */
 #define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 28c3cf960..6d960dd96 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -118,10 +118,11 @@ static inline xtpage_t *xt_getpage(struct inode *ip, s64 bn, struct metapage **m
 	if (rc)
 		return ERR_PTR(rc);
 	if ((le16_to_cpu(p->header.nextindex) < XTENTRYSTART) ||
-		(le16_to_cpu(p->header.nextindex) >
-			le16_to_cpu(p->header.maxentry)) ||
-		(le16_to_cpu(p->header.maxentry) >
-			((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) {
+	    (le16_to_cpu(p->header.nextindex) >
+	     le16_to_cpu(p->header.maxentry)) ||
+	    (le16_to_cpu(p->header.maxentry) >
+	     ((bn == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE)) ||
+	    ((bn == 0) != !!(p->header.flag & BT_ROOT))) {
 		jfs_error(ip->i_sb, "xt_getpage: xtree page corrupt\n");
 		BT_PUTPAGE(*mp);
 		*mp = NULL;


Additional description of the patch:

I have applied the fix to address the spinlock crash caused by out-of-bounds memory access on the pseudo-metapage.

### What I did in the patch
1. **Updated `xt_getpage()` in `fs/jfs/jfs_xtree.c`**: Added a validation check `((bn == 0) != !!(p->header.flag & BT_ROOT))` to ensure that the `BT_ROOT` flag is set if and only if the block number is 0 (the root page). If this invariant is violated, it logs an error, releases the metapage, and returns `-EIO`.
2. **Updated `DT_GETPAGE` macro in `fs/jfs/jfs_dtree.c`**: Added the exact same invariant check for dtree pages. If the check fails, it follows the standard JFS error handling pattern (logging, releasing the metapage, and returning `-EIO`).

### Why I did it this way
- **Centralized Early Validation**: By adding the checks directly in `xt_getpage()` and `DT_GETPAGE`, we catch the corruption immediately when the page is loaded from disk or memory. This prevents any downstream functions (like `xtTruncate()` or `dtDeleteUp()`) from misinterpreting the pseudo-metapage and taking incorrect code paths (such as calling `discard_metapage()` on it).
- **Consistency with JFS Patterns**: The fix strictly follows the established error-handling sequence in JFS (log error, `BT_PUTPAGE`, set pointer to `NULL`, return `-EIO`).
- **Updating the Macro vs. Refactoring**: While refactoring `DT_GETPAGE` into an inline function (similar to what was recently done for `xt_getpage`) is a good modernization step, it would require modifying all 18 call sites of `DT_GETPAGE` across `fs/jfs/jfs_dtree.c`. To keep the fix focused, minimal, and less error-prone for backporting, I chose to update the macro directly. This perfectly matches the current codebase and safely resolves the vulnerability.

Here are summaries of recent commits that touched the same files.
Format the summary line consistently with these, look how prefixes
are specified, letter capitalization, style, etc. 

jfs: avoid -Wtautological-constant-out-of-range-compare warning again
jfs: add dtpage integrity check to prevent index/pointer overflows
jfs: add dtroot integrity check to prevent index out-of-bounds
jfs: avoid -Wtautological-constant-out-of-range-compare warning
jfs: replace hardcoded magic number with DTPAGEMAXSLOT constant
jfs: jfs_xtree: replace XT_GETPAGE macro with xt_getpage()
jfs: fix array-index-out-of-bounds read in add_missing_indices
jfs: add index corruption check to DT_GETPAGE()
jfs: fix array-index-out-of-bounds in jfs_readdir
jfs: array-index-out-of-bounds fix in dtReadFirst
jfs: fix null ptr deref in dtInsertEntry
jfs: fix slab-out-of-bounds Read in dtSearch
UBSAN: array-index-out-of-bounds in dtSplitRoot
jfs: define xtree root and page independently
fs/jfs: Remove dead code
jfs: delete duplicated words + other fixes
jfs: Replace zero-length array with flexible-array member
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
treewide: kmalloc() -> kmalloc_array()
jfs: simplify procfs code


Reply:
jfs: validate BT_ROOT flag in xt_getpage and DT_GETPAGE

A corrupted JFS image can trick the kernel into calling release_metapage()
on a pseudo-metapage embedded within the inode, leading to an out-of-bounds
memory access and a spinlock crash.

When operating on the root page of an xtree or dtree (which is stored
inline within the inode), JFS doesn't use a real struct metapage. Instead,
BT_GETPAGE() sets the metapage pointer to the address of
JFS_IP(ip)->bxflag. Because this is a pseudo-metapage, it does not have a
valid wait_queue_head_t wait field. Accessing mp->wait reads out-of-bounds
memory in struct jfs_inode_info.

In xt_getpage(), the code validates nextindex and maxentry, but it fails to
verify that the BT_ROOT flag is set in p->header.flag for the root page (bn
== 0). If the inline xtree root page has a corrupted header.flag where
BT_ROOT is missing, xtTruncate() will mistakenly treat the root page as a
regular leaf page and call discard_metapage(mp).

Unlike XT_PUTPAGE() which safely checks !BT_IS_ROOT(mp) before releasing,
discard_metapage() calls release_metapage(mp) directly. This assumes mp is
a real metapage and calls unlock_metapage(mp), which executes
wake_up(&mp->wait), accessing garbage memory and resulting in a spinlock
bad magic BUG or UBSAN out-of-bounds array access.

Fix this by enforcing the invariant that the BT_ROOT flag is set if and
only if bn == 0 in both xt_getpage() and DT_GETPAGE().

BUG: spinlock bad magic on CPU#0, syz-executor/6066
 lock: 0xffff888120999b48, .magic: ffffffff, .owner: <...>/-1902340672,
 .owner_cpu: 768
CPU: 0 UID: 0 PID: 6066 Comm: syz-executor Not tainted syzkaller #1
PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1e5/0x2f0 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock_irqsave+0x4c/0x60 kernel/locking/spinlock.c:166
 __wake_up_common_lock+0x30/0x1f0 kernel/sched/wait.c:124
 unlock_metapage fs/jfs/jfs_metapage.c:40 [inline]
 release_metapage+0x131/0xa60 fs/jfs/jfs_metapage.c:872
 xtTruncate+0xeaa/0x2eb0 fs/jfs/jfs_xtree.c:-1
 jfs_free_zero_link+0x35b/0x4c0 fs/jfs/namei.c:760
 jfs_evict_inode+0x356/0x430 fs/jfs/inode.c:159
 evict+0x624/0xb50 fs/inode.c:841
 __dentry_kill+0x206/0x700 fs/dcache.c:718
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1195
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1222
 shrink_dcache_tree+0xe9/0x5d0 fs/dcache.c:-1
 do_one_tree+0x28/0xe0 fs/dcache.c:1721
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1738
 generic_shutdown_super+0x6f/0x2d0 fs/super.c:624
 kill_block_super+0x44/0x90 fs/super.c:1725
 deactivate_locked_super+0xbc/0x130 fs/super.c:476
 cleanup_mnt+0x3d3/0x460 fs/namespace.c:1312
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xf3/0x4f0 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230
 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x33e/0x560 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 </TASK>

237/2 2026/06/26 22:13 llm description-generator
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 10874
							output: 1457
							thoughts: 5058
						

Thoughts:
**JFS BT_ROOT Flag Validation for Out-of-Bounds Access Prevention**

I've been wrestling with a nasty bug in the JFS code, a crash triggered by corrupted images. It boils down to a spinlock bad magic or out-of-bounds array access, specifically related to the handling of the filesystem's root page within the xtree or dtree structures. The problem is that a corrupted JFS image can have the `BT_ROOT` flag missing for the root page (`bn == 0`).  This is a critical oversight.  When this happens, `xtTruncate` mistakenly treats the root page, which is actually a "pseudo-metapage" embedded within the inode, as a regular leaf page. This misinterpretation leads to a call to `discard_metapage(mp)`, which in turn calls `release_metapage(mp)`.  Here's the rub: This pseudo-metapage doesn't have the standard `wait_queue_head_t wait` field that a real metapage has. Thus, calling `release_metapage(mp)` ends up accessing memory out-of-bounds when it tries to access `mp->wait` as part of `unlock_metapage(mp)`, leading to a spinlock crash.

The core of the issue lies in the code's failure to enforce an essential invariant. Specifically, neither `xt_getpage` nor `DT_GETPAGE` checks that the `BT_ROOT` flag is set when and only when `bn == 0`. The fix is, therefore, to add a check in `xt_getpage` and `DT_GETPAGE` to ensure that `BT_ROOT` is set if and only if `bn == 0`.  This will prevent the misinterpretation of the root page as a regular leaf page, and ultimately, prevent the out-of-bounds access.

Here's a simplified version of the execution path, where the corrupted image is triggering the issue: A missing `BT_ROOT` flag on the root page leads to `xtTruncate` treating it as a regular leaf page, calling `discard_metapage(mp)`, which calls `release_metapage(mp)` on a non-metapage object.

The provided information included the following crash report:

```
BUG: spinlock bad magic on CPU#0
 lock: 0xffff888120999b48, .magic: ffffffff, .owner: <...>/-1902340672, .owner_cpu: 768
CPU: 0 UID: 0 PID: 6066 Comm: ... Not tainted ...
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150
 spin_bug
 debug_spin_lock_before
 do_raw_spin_lock+0x1e5/0x2f0
 __raw_spin_lock_irqsave
 __wake_up_common_lock+0x30/0x1f0
 release_metapage+0x131/0xa60
 xtTruncate+0xeaa/0x2eb0
 jfs_free_zero_link+0x35b/0x4c0
 jfs_evict_inode+0x356/0x430
 evict+0x624/0xb50
 __dentry_kill+0x206/0x700
 shrink_kill+0xa9/0x2c0
 shrink_dentry_list+0x2e0/0x5e0
 shrink_dcache_tree+0xe9/0x5d0
 do_one_tree+0x28/0xe0
 shrink_dcache_for_umount+0xa0/0x170
 generic_shutdown_super+0x6f/0x2d0
 kill_block_super+0x44/0x90
 deactivate_locked_super+0xbc/0x130
 cleanup_mnt+0x3d3/0x460
 task_work_run+0x1d9/0x270
 exit_to_user_mode_loop+0xf3/0x4f0
 do_syscall_64+0x33e/0x560
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 ```
By adding this validation, we're ensuring that the code correctly identifies and handles the root page, which is essential for


LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)