ID Workflow Result Correct Bug Created Started Finished Revision
37a38e8d patching πŸ’₯ WARNING in iomap_read_inline_data (2) 2026/09/17 10:03 2026/09/17 10:04 2026/09/17 11:54 95928915
Agent: prod-syz-agent-2
External Bug ID: ---

Inputs:
BaseBranch master
BaseCommit RC
BaseRepository git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
BugTitle WARNING in iomap_read_inline_data
CrashLogID 4795605752217600
CrashReportID 5294612232536064
KernelCommit 9b87fdc9af2fbfcdb5c24a64139685ef80f6573f
KernelConfig
Show (282200 bytes)
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 syzkaller Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Debian 14.2.0-19) 14.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=140200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24400
CONFIG_LD_IS_BFD=y
CONFIG_LD_VERSION=24400
CONFIG_LLD_VERSION=0
CONFIG_RUSTC_VERSION=109600
CONFIG_RUST_IS_AVAILABLE=y
CONFIG_RUSTC_LLVM_VERSION=220102
CONFIG_RUSTC_LLVM_MAJOR_VERSION=22
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_ASSUME=y
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY=y
CONFIG_RUSTC_HAS_SPAN_FILE=y
CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=y
CONFIG_RUSTC_HAS_FILE_WITH_NUL=y
CONFIG_RUSTC_HAS_FILE_AS_C_STR=y
CONFIG_PAHOLE_VERSION=130
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_ARCH_WANTS_CLOCKSOURCE_READ_INLINE=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST_IDLE=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CLOCKEVENTS_COUPLED=y
CONFIG_GENERIC_CLOCKEVENTS_COUPLED_INLINE=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_HRTIMER_REARM_DEFERRED=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_POSIX_AUX_CLOCKS=y
# 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 is not set
CONFIG_BPF_JIT_DEFAULT_ON=y
# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set
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=y
# CONFIG_PREEMPT_LAZY is not set
# CONFIG_PREEMPT_RT is not set
CONFIG_PREEMPT_COUNT=y
CONFIG_HAS_SEPARATE_PREEMPT_RESCHED_BITS=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
# CONFIG_SCHED_PROXY_EXEC is not set
# end of Scheduler features

CONFIG_ARCH_HAS_PTE_PROTNONE=y
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=5"
CONFIG_CC_MS_EXTENSIONS="-fms-extensions"
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_CC_NO_ARRAY_BOUNDS=y
CONFIG_GCC_NO_STRINGOP_OVERFLOW=y
CONFIG_CC_NO_STRINGOP_OVERFLOW=y
CONFIG_ARCH_SUPPORTS_INT128=y
CONFIG_NUMA_BALANCING=y
CONFIG_SCHED_CACHE=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_GROUP_SCHED_BANDWIDTH=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_TIME_NS_VDSO=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_ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG=y
CONFIG_CMDLINE_LOG_WRAP_IDEAL_LEN=1021
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_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_PRIVATE_HASH=y
CONFIG_FUTEX_MPOL=y
CONFIG_HAVE_FUTEX_ROBUST_UNLOCK=y
CONFIG_FUTEX_ROBUST_UNLOCK=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_IO_URING_MOCK_FILE=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KCMP=y
CONFIG_RSEQ=y
CONFIG_RSEQ_SLICE_EXTENSION=y
# CONFIG_RSEQ_STATS is not set
# CONFIG_RSEQ_DEBUG_DEFAULT_ENABLE is not set
CONFIG_CACHESTAT_SYSCALL=y
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
CONFIG_PERF_GUEST_MEDIATED_PMU=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_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_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y
CONFIG_CRASH_MAX_MEMORY_RANGES=8192
# end of Kexec and crash features

#
# Live Update and Kexec HandOver
#
# CONFIG_KEXEC_HANDOVER is not set
# end of Live Update and Kexec HandOver
# 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_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=y
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_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_BHYVE_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_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_BROADCAST_TLB_FLUSH=y
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_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_MICROCODE_DBG 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_INTEL_TDX_HOST is not set
# 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_HAVE_KLP_BUILD=y
CONFIG_X86_BUS_LOCK_DETECT=y
# end of Processor type and features

CONFIG_CC_HAS_NAMED_AS=y
CONFIG_CC_HAS_NAMED_AS_FIXED_SANITIZERS=y
CONFIG_USE_X86_SEG_SUPPORT=y
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_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_MITIGATION_VMSCAPE is not set
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_QOS_CPU_SYSTEM_WAKEUP 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=y
# 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_X86_X32_ABI=y
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_VIRT_XFER_TO_GUEST_WORK=y
CONFIG_HAVE_KVM_PM_NOTIFIER=y
CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y
CONFIG_KVM_ELIDE_TLB_FLUSH_IF_YOUNG=y
CONFIG_KVM_MMU_LOCKLESS_AGING=y
CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES=y
CONFIG_KVM_GUEST_MEMFD=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_IOAPIC=y
CONFIG_KVM_SMM=y
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_SEV_SNP=y
CONFIG_AS_WRUSS=y
CONFIG_ARCH_CONFIGURES_CPU_MITIGATIONS=y

#
# General architecture-dependent options
#
CONFIG_HOTPLUG_SMT=y
CONFIG_ARCH_SUPPORTS_SCHED_SMT=y
CONFIG_ARCH_SUPPORTS_SCHED_CLUSTER=y
CONFIG_ARCH_SUPPORTS_SCHED_MC=y
CONFIG_SCHED_SMT=y
CONFIG_SCHED_CLUSTER=y
CONFIG_SCHED_MC=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_IRQ_ENTRY=y
CONFIG_GENERIC_SYSCALL=y
CONFIG_GENERIC_ENTRY=y
CONFIG_ARCH_SUPPORTS_SYSCALL_USER_DISPATCH=y
CONFIG_SYSCALL_USER_DISPATCH=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_DELAY_TIMER=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_ARCH_MEMORY_ORDER_TSO=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_UNWIND_USER=y
CONFIG_HAVE_UNWIND_USER_FP=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_KSTACK_ERASE=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_LTO_NONE=y
CONFIG_ARCH_SUPPORTS_CFI=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_PV_STEAL_CLOCK_GEN=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
CONFIG_HAVE_GENERIC_TIF_BITS=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_MIN_FUNCTION_ALIGNMENT=y
CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT=y
CONFIG_ARCH_HAS_CPU_ATTACK_VECTORS=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_SHA256=y
# 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="sha256"
# 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
# CONFIG_BLK_ERROR_INJECTION is not set

#
# 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_QUEUED_SPINLOCKS_TRACE_CONTENDED_RELEASE is not set
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_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_ZSMALLOC=y

#
# Zsmalloc allocator options
#

#
# Zsmalloc is a common backend allocator for zswap & zram
#
# CONFIG_ZSMALLOC_STAT is not set
CONFIG_ZSMALLOC_CHAIN_SIZE=8
# end of Zsmalloc allocator options

#
# 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_KMALLOC_PARTITION_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_ARCH_ENABLE_MEMORY_HOTPLUG=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_BALLOON=y
# CONFIG_BALLOON_MIGRATION is not set
CONFIG_COMPACTION=y
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
CONFIG_PAGE_REPORTING=y
CONFIG_NUMA_MIGRATION=y
CONFIG_MIGRATION=y
CONFIG_DEVICE_MIGRATION=y
CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y
CONFIG_ARCH_HAS_PMD_SOFTLEAVES=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_PERSISTENT_HUGE_ZERO_FOLIO is not set
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_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ALWAYS is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_WITHIN_SIZE is not set
CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ADVISE=y
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_NEVER is not set
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ALWAYS is not set
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_WITHIN_SIZE is not set
CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ADVISE=y
CONFIG_THP_SWAP=y
# CONFIG_NO_PAGE_MAPCOUNT is not set
CONFIG_PAGE_MAPCOUNT=y
CONFIG_PGTABLE_HAS_HUGE_LEAVES=y
CONFIG_HAVE_GIGANTIC_FOLIOS=y
CONFIG_ASYNC_KERNEL_PGTABLE_FREE=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_MAX_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_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_RWP=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_PT_RECLAIM=y

#
# Data Access Monitoring
#
CONFIG_DAMON=y
# CONFIG_DAMON_DEBUG_SANITY is not set
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
# CONFIG_DAMON_STAT 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_INET_PSP=y
CONFIG_UNIX=y
CONFIG_AF_UNIX_OOB=y
CONFIG_UNIX_DIAG=y
CONFIG_TLS=y
CONFIG_TLS_DEVICE=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=y
CONFIG_XFRM_ESPINTCP=y
CONFIG_SMC=y
CONFIG_SMC_DIAG=y
# CONFIG_SMC_HS_CTRL_BPF is not set
CONFIG_DIBS=y
CONFIG_DIBS_LO=y
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_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_GRE=y
CONFIG_NF_CT_PROTO_SCTP=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_EXTHDR_DCCP=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
CONFIG_NETFILTER_XTABLES_LEGACY=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_SHA256=y
# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set
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_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_LEGACY_FCS 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_MT7628 is not set
CONFIG_NET_DSA_TAG_MTK=y
# CONFIG_NET_DSA_TAG_MXL_862XX is not set
# CONFIG_NET_DSA_TAG_MXL_GSW1XX is not set
# CONFIG_NET_DSA_TAG_KSZ is not set
# CONFIG_NET_DSA_TAG_NETC 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_NET_DSA_TAG_YT921X is not set
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_LLC=y
CONFIG_LLC2=y
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_DUALPI2 is not set
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_MCAST=y
# CONFIG_BATMAN_ADV_DEBUG is not set
# CONFIG_BATMAN_ADV_TRACING is not set
CONFIG_OPENVSWITCH=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_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_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_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_TSM is not set
# 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_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_ENDPOINT_MSI_DOORBELL 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_GENERIC is not set
# CONFIG_PCI_PWRCTRL_TC9563 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_PCCARD_NONSTATIC=y
# CONFIG_RAPIDIO is not set
# CONFIG_PC104 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_DRIVER_DEFERRED_PROBE_TIMEOUT=10
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_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

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
#
# CONFIG_QCOM_PAS is not set
# CONFIG_QCOM_PAS_TEE is not set
# CONFIG_QCOM_SCM is not set
# 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
# CONFIG_MTD_INTEL_DG is not set

#
# 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_ATA_OVER_ETH=y
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_RBD is not set
CONFIG_BLK_DEV_UBLK=y
CONFIG_BLKDEV_UBLK_LEGACY_OPCODES=y
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_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_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_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_MAX6875 is not set
CONFIG_EEPROM_93CX6=y
# CONFIG_EEPROM_IDT_89HPESX 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_CSC 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_MISC_RP1 is not set
# CONFIG_INTEL_SSEI 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_LEAPRAID 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_BITMAP=y
# CONFIG_MD_LLBITMAP is not set
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_INLINECRYPT is not set
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_DM_PCACHE 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_SOLOS is not set

#
# 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_MXL_GSW1XX 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_MXL862 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_KS8995 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
# CONFIG_NET_DSA_YT921X 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_ALIBABA=y
# CONFIG_ALIBABA_EEA 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_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_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_IXD 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_MUCSE=y
# CONFIG_MGBE is not set
# 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_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_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_TXGBEVF is not set
# CONFIG_NGBEVF 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_NET_VENDOR_ZTE=y
# CONFIG_DINGHAI is not set
CONFIG_FDDI=y
# CONFIG_DEFXX is not set
# CONFIG_SKFP is not set
CONFIG_PHYLINK=y
CONFIG_PHYLIB=y
CONFIG_SWPHY=y
CONFIG_PHY_PACKAGE=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_AN8801_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_ADIN1140_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_DAP8211R_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_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_DUMMY 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_VIRTIO_CAN is not set
# 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_USBLIB is not set
# CONFIG_MCTP_TRANSPORT_USB is not set
# end of MCTP Device Drivers

#
# MDIO controller drivers
#
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
# end of MDIO Multiplexers
# end of MDIO controller drivers

#
# 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_PPPOX=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_MORSEMICRO=y
# CONFIG_MM81X_USB is not set
# CONFIG_MM81X_SDIO is not set
CONFIG_WLAN_VENDOR_NXP=y
# CONFIG_NXPWIFI_SDIO 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

#
# 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_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_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX is not set
# CONFIG_KEYBOARD_CHARLIEPLEX 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_HIMAX_HX852X is not set
# CONFIG_TOUCHSCREEN_HYCON_HY46XX is not set
# CONFIG_TOUCHSCREEN_HYNITRON_CSTXXX is not set
# CONFIG_TOUCHSCREEN_HYNITRON_CST816X 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_WACOM_W9000 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_AW86927 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_ISA1200_HAPTIC is not set
# CONFIG_INPUT_CMA3000 is not set
# CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set
# CONFIG_INPUT_AMD_SFH_TABLETMODE 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_F1A is not set
# CONFIG_RMI4_F21 is not set
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_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_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_MOXA_PCIE=y
# 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_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_8250_MANY_PORTS=y
# CONFIG_SERIAL_8250_PCI1XXXX is not set
# 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
CONFIG_SERIAL_8250_DWLIB=y

#
# 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_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_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_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_I3C_OR_I2C=y
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_QSPI is not set
# CONFIG_SPI_MICROCHIP_CORE_SPI 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_VIRTIO 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
# CONFIG_PTP_NETC_V4_TIMER is not set
# end of PTP clock support

#
# DPLL device support
#
# CONFIG_ZL3073X_I2C is not set
# CONFIG_ZL3073X_SPI is not set
# end of DPLL device support

# CONFIG_PINCTRL is not set
CONFIG_GPIOLIB_LEGACY=y
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_BY_PINCTRL 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_WAVESHARE_DSI_TOUCH 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_NOVALAKE 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_LJCA=y
# CONFIG_GPIO_TWL4030 is not set
# CONFIG_GPIO_WHISKEY_COVE is not set
# end of MFD GPIO expanders

#
# Auxiliary Bus GPIO drivers
#
# end of Auxiliary Bus GPIO drivers

#
# 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_LINE_MUX 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_S2MU005 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_BQ25630 is not set
# CONFIG_CHARGER_BQ256XX is not set
# CONFIG_CHARGER_SGM41542 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_CHARGER_RT9756 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_BATTERY_CHARGER_SURFACE_RT 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_KB9002 is not set
# CONFIG_SENSORS_FAM15H_POWER is not set
# CONFIG_SENSORS_APPLESMC is not set
# CONFIG_SENSORS_ARCTIC_FAN_CONTROLLER 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_GPD 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_PROM21_XHCI is not set
# CONFIG_SENSORS_LATTEPANDA_SIGMA_EC 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_LTC4283 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_MCP9982 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_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_EMC1812 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_TSC1641 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
# CONFIG_SENSORS_YOGAFAN 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_LENOVO_SE30G2_SE60_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_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_CS40L50_I2C is not set
# CONFIG_MFD_CS40L50_SPI is not set
# CONFIG_MFD_CS42L43_I2C is not set
# CONFIG_MFD_CS42L43_SDW is not set
# CONFIG_MFD_LOCHNAGAR is not set
# CONFIG_MFD_MADERA 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_PF1550 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_MAX5970 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_NCT6694 is not set
# CONFIG_MFD_OCELOT 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_BQ257XX 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_LM3533 is not set
# CONFIG_MFD_TC3589X is not set
# CONFIG_MFD_TQMX86 is not set
# CONFIG_MFD_VX855 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_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
# CONFIG_MFD_MAX7360 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_FP9931 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_MAX77675 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_MAX77838 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_PF0900 is not set
# CONFIG_REGULATOR_PF530X 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_RT4801 is not set
# CONFIG_REGULATOR_RT4803 is not set
# CONFIG_REGULATOR_RT5133 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_RT8092 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_SGM3804 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_TPS65185 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_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

# CONFIG_VIDEO_CAMERA_LENS is not set

#
# 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_INTEL_CVS is not set
# 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_GPU_BUDDY=y
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_RAS 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
# CONFIG_DRM_AMDGPU is not set

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

# CONFIG_DRM_AST is not set
CONFIG_DRM_BRIDGE=y
CONFIG_DRM_PANEL_BRIDGE=y
CONFIG_DRM_AUX_BRIDGE=y
CONFIG_DRM_AUX_HPD_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_LONTIUM_LT8713SX 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_SOLOMON_SSD2825 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_WAVESHARE_BRIDGE 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_GMA500 is not set
CONFIG_DRM_GUD=y
# CONFIG_DRM_HISI_HIBMC 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_LOGICVC is not set
# CONFIG_DRM_MGAG200 is not set
# CONFIG_DRM_NOUVEAU is not set
CONFIG_DRM_PANEL=y

#
# Display Panels
#
# CONFIG_DRM_PANEL_ABT_Y030XX067A is not set
# CONFIG_DRM_PANEL_ANBERNIC_TD4310 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_CHIPONE_ICNA35XX is not set
# CONFIG_DRM_PANEL_CHIPWEALTH_CH13726A 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_FOCALTECH_OTA7290B 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_HX83112B is not set
# CONFIG_DRM_PANEL_HIMAX_HX83121A is not set
# CONFIG_DRM_PANEL_HIMAX_HX8394 is not set
# CONFIG_DRM_PANEL_HYDIS_HV101HD1 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI7807S is not set
# CONFIG_DRM_PANEL_ILITEK_IL9322 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9341 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9488 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9805 is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9806E_DSI is not set
# CONFIG_DRM_PANEL_ILITEK_ILI9806E_SPI 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_LD070WX3 is not set
# CONFIG_DRM_PANEL_LG_LG4573 is not set
# CONFIG_DRM_PANEL_LG_SW43408 is not set
# CONFIG_DRM_PANEL_LXD_M9189A is not set
# CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966 is not set
# CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set
# CONFIG_DRM_PANEL_MOTOROLA_MOT 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_NT35532 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_NT36536 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36672A is not set
# CONFIG_DRM_PANEL_NOVATEK_NT36672E is not set
# CONFIG_DRM_PANEL_NOVATEK_NT37700F 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_RENESAS_R61307 is not set
# CONFIG_DRM_PANEL_RENESAS_R63419 is not set
# CONFIG_DRM_PANEL_RENESAS_R69328 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_LTL106HL02 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_S6E3FC2X01 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_S6E8AA5X01_AMS561RA01 is not set
# CONFIG_DRM_PANEL_SAMSUNG_S6E8FC0 is not set
# CONFIG_DRM_PANEL_SAMSUNG_SOFEF00 is not set
# CONFIG_DRM_PANEL_SEIKO_43WVF1G is not set
# CONFIG_DRM_PANEL_SHARP_LQ079L1SX01 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_SYNAPTICS_TDDI 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_QXL is not set
# CONFIG_DRM_RADEON is not set
# CONFIG_DRM_ST7571 is not set
# CONFIG_DRM_ST7586 is not set
# CONFIG_DRM_ST7735R is not set
# CONFIG_DRM_ST7920 is not set
# CONFIG_DRM_SSD130X is not set

#
# 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

# 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_DRM_PIXPAPER 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_UDL=y
# CONFIG_DRM_VBOXVIDEO is not set
CONFIG_DRM_VGEM=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_DRM_VIRTIO_GPU_KMS=y
# CONFIG_DRM_VKMS is not set
CONFIG_DRM_VMWGFX=y
# CONFIG_DRM_VMWGFX_MKSSTATS is not set
# CONFIG_DRM_XE 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_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_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_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_AW99706 is not set
# CONFIG_BACKLIGHT_KTD253 is not set
# CONFIG_BACKLIGHT_KTD2801 is not set
# CONFIG_BACKLIGHT_KTZ8866 is not set
# CONFIG_BACKLIGHT_SY7758 is not set
# CONFIG_BACKLIGHT_MAX25014 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
# CONFIG_FIRMWARE_EDID is not set

#
# 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_MONO_FILE="drivers/video/logo/logo_linux_mono.pbm"
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_VGA16_FILE="drivers/video/logo/logo_linux_vga16.ppm"
# CONFIG_LOGO_LINUX_CLUT224 is not set
# CONFIG_TRACE_GPU_MEM 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_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 is not set
# CONFIG_SND_SUPPORT_OLD_API is not set
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_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_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDA_CTL_DEV_ID is not set
CONFIG_SND_HDA_PREALLOC_SIZE=0
CONFIG_SND_HDA_INTEL=y
# CONFIG_SND_HDA_ACPI is not set
CONFIG_SND_HDA_GENERIC_LEDS=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
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_CM9825 is not set
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_CODEC_REALTEK=y
# CONFIG_SND_HDA_CODEC_ALC260 is not set
# CONFIG_SND_HDA_CODEC_ALC262 is not set
# CONFIG_SND_HDA_CODEC_ALC268 is not set
# CONFIG_SND_HDA_CODEC_ALC269 is not set
# CONFIG_SND_HDA_CODEC_ALC662 is not set
# CONFIG_SND_HDA_CODEC_ALC680 is not set
# CONFIG_SND_HDA_CODEC_ALC861 is not set
# CONFIG_SND_HDA_CODEC_ALC861VD is not set
# CONFIG_SND_HDA_CODEC_ALC880 is not set
# CONFIG_SND_HDA_CODEC_ALC882 is not set
CONFIG_SND_HDA_CODEC_CIRRUS=y
# CONFIG_SND_HDA_CODEC_CS420X is not set
# CONFIG_SND_HDA_CODEC_CS421X is not set
# CONFIG_SND_HDA_CODEC_CS8409 is not set
CONFIG_SND_HDA_CODEC_HDMI=y
# CONFIG_SND_HDA_CODEC_HDMI_GENERIC is not set
# CONFIG_SND_HDA_CODEC_HDMI_SIMPLE is not set
# CONFIG_SND_HDA_CODEC_HDMI_INTEL is not set
# CONFIG_SND_HDA_CODEC_HDMI_ATI is not set
# CONFIG_SND_HDA_CODEC_HDMI_NVIDIA is not set
# CONFIG_SND_HDA_CODEC_HDMI_NVIDIA_MCP is not set
# CONFIG_SND_HDA_CODEC_HDMI_TEGRA is not set
# CONFIG_SND_HDA_SCODEC_AW88399_I2C is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_I2C is not set
# CONFIG_SND_HDA_SCODEC_CS35L56_SPI is not set
CONFIG_SND_HDA_CORE=y
CONFIG_SND_HDA_COMPONENT=y
CONFIG_SND_HDA_I915=y
CONFIG_SND_INTEL_NHLT=y
CONFIG_SND_INTEL_DSP_CONFIG=y
CONFIG_SND_INTEL_SOUNDWIRE_ACPI=y
# end of HD-Audio

# 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_US144MKII is not set
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

#
# Analog Devices
#
# CONFIG_SND_SOC_ADI_AXI_I2S is not set
# CONFIG_SND_SOC_ADI_AXI_SPDIF is not set
# end of Analog Devices

#
# AMD
#
# 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
# end of AMD

#
# Apple
#
# end of Apple

#
# Atmel
#
# CONFIG_SND_SOC_MIKROE_PROTO is not set
# end of Atmel

#
# Au1x
#
# end of Au1x

#
# Broadcom
#
# CONFIG_SND_BCM63XX_I2S_WHISTLER is not set
# end of Broadcom

#
# Cirrus Logic
#
# end of Cirrus Logic

#
# DesignWare
#
# CONFIG_SND_DESIGNWARE_I2S is not set
# end of DesignWare

#
# Freescale
#

#
# 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 Freescale

#
# Google
#
# CONFIG_SND_SOC_CHV3_I2S is not set
# end of Google

#
# Hisilicon
#
# CONFIG_SND_I2S_HI6210_I2S is not set
# end of Hisilicon

#
# JZ4740
#
# end of JZ4740

#
# Kirkwood
#
# end of Kirkwood

#
# Loongson
#
# end of Loongson

#
# Intel
#
# CONFIG_SND_SOC_INTEL_SST_TOPLEVEL is not set
# CONFIG_SND_SOC_INTEL_AVS is not set
# end of Intel

#
# Mediatek
#
# CONFIG_SND_SOC_MTK_BTCVSD is not set
# end of Mediatek

#
# PXA
#
# end of PXA

#
# SoundWire (SDCA)
#
# CONFIG_SND_SOC_SDCA is not set
CONFIG_SND_SOC_SDCA_OPTIONAL=y
# end of SoundWire (SDCA)

#
# ST SPEAr
#
# end of ST SPEAr

#
# Spreadtrum
#
# end of Spreadtrum

#
# STMicroelectronics STM32
#
# end of STMicroelectronics STM32

#
# Tegra
#
# end of Tegra

#
# Xilinx
#
# 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
# end of Xilinx

#
# Xtensa
#
# CONFIG_SND_SOC_XTFPGA_I2S is not set
# end of Xtensa

# CONFIG_SND_SOC_SOF_TOPLEVEL 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_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_CS530X_SPI 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_FS210X 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_PCM1754 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_PM4125_SDW 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_RT5575 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_RT5645 is not set
# CONFIG_SND_SOC_RT5659 is not set
# CONFIG_SND_SOC_RT5677 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_RTQ9124 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_TAS675X 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_UDA1380 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_WSA885X 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_NAU8325 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

#
# Generic 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
# end of Generic drivers

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
CONFIG_HID_HAPTIC=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_HYPERX is not set
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_MSI is not set
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_LENOVO_GO is not set
# CONFIG_HID_LENOVO_GO_S is not set
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_RAKK is not set
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_OXP is not set
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_RAPOO is not set
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
CONFIG_HID_HUAWEI=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_CDNS3=y
CONFIG_USB_CDNS3_HOST=y
CONFIG_USB_CDNS3_GADGET=y

#
# Platform glue driver support
#
CONFIG_USB_CDNS3_PCI_WRAP=y
CONFIG_USB_CDNSP_PCI=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_DWC3_GENERIC_PLAT=y
# CONFIG_USB_DWC3_GOOGLE is not set
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_USBIO is not set
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_OSRAM_AMS_AS3668 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_LTC3220 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_LP5812 is not set
# CONFIG_LEDS_LP5860_CORE is not set
# CONFIG_LEDS_LP5860_SPI 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_ACCESS_CORE=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_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_SUPPORT=y
CONFIG_EDAC=y
# 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_IMH 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_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_PCF85063 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
# CONFIG_RTC_DRV_GOLDFISH is not set

#
# HID Sensor RTC drivers
#
CONFIG_RTC_DRV_HID_SENSOR_TIME=y
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_SWITCHTEC_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_DEBUG is not set
CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_HEAPS_SYSTEM=y
# CONFIG_DMABUF_HEAPS_SYSTEM_CC_SHARED is not set
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_NOIOMMU 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_VDPA_USER is not set
# 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
CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=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_PCI7250 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_GPIB 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_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_WMI_BMOF=y
# CONFIG_HUAWEI_WMI is not set
# CONFIG_X86_PLATFORM_DRIVERS_UNIWILL is not set
# CONFIG_MXM_WMI is not set
# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set
# CONFIG_XIAOMI_WMI is not set
# CONFIG_REDMI_WMI is not set
# CONFIG_GIGABYTE_WMI is not set
# CONFIG_BITLAND_MIFS_WMI 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_HFI is not set
# CONFIG_AMD_3D_VCACHE is not set
# CONFIG_AMD_WBRF is not set
# CONFIG_AMD_HALO_LED 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_ARMOURY is not set
CONFIG_ASUS_WMI=y
# CONFIG_ASUS_WMI_DEPRECATED_ATTRS is not set
# CONFIG_ASUS_NB_WMI is not set
CONFIG_ASUS_TF103C_DOCK=y
# CONFIG_AYANEO_EC is not set
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_SENSORS_HDAPS 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_EHL_PSE_IO 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_IDEAPAD_LAPTOP is not set
# CONFIG_LENOVO_WMI_HOTKEY_UTILITIES is not set
# CONFIG_LENOVO_WMI_CAMERA is not set
# CONFIG_LENOVO_YB9_KBDOCK is not set
# CONFIG_THINKPAD_ACPI is not set
# CONFIG_THINKPAD_LMI is not set
# CONFIG_YOGABOOK is not set
# CONFIG_YT2_1380 is not set
# CONFIG_LENOVO_WMI_GAMEZONE is not set
# CONFIG_LENOVO_WMI_TUNING 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_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_ACPI_WMI=y
# CONFIG_ACPI_WMI_LEGACY_DEVICE_NAMES is not set
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

#
# Cixtech Audio Subsystem Clock Driver
#
# end of Cixtech Audio Subsystem Clock Driver

# 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=y
# CONFIG_AMD_IOMMU_IOMMUFD 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_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
CONFIG_GENERIC_PT=y
CONFIG_DEBUG_GENERIC_PT=y
CONFIG_IOMMU_PT=y
CONFIG_IOMMU_PT_AMDV1=y
CONFIG_IOMMU_PT_VTDSS=y
# CONFIG_IOMMU_PT_RISCV64 is not set
CONFIG_IOMMU_PT_X86_64=y

#
# 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
CONFIG_QCOM_QMI_HELPERS=y
# 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_MAX14526 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_AD4080 is not set
# CONFIG_AD4130 is not set
# CONFIG_AD4134 is not set
# CONFIG_AD4170_4 is not set
# CONFIG_AD4691 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_ADE9000 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_MAX14001 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_BD79112 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_ADS1018 is not set
# CONFIG_TI_ADS1100 is not set
# CONFIG_TI_ADS1119 is not set
# CONFIG_TI_ADS112C14 is not set
# CONFIG_TI_ADS124S08 is not set
# CONFIG_TI_ADS1298 is not set
# CONFIG_TI_ADS131E08 is not set
# CONFIG_TI_ADS131M02 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_VERSAL_SYSMON_I2C 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_ADL8113 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_SPI is not set
# CONFIG_AD5446_I2C 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_AD5706R 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_MAX22007 is not set
# CONFIG_MAX5522 is not set
# CONFIG_MAX5821 is not set
# CONFIG_MCP4725 is not set
# CONFIG_MCP4728 is not set
# CONFIG_MCP47A1 is not set
# CONFIG_MCP47FEB02 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

#
# Flow sensors
#
# CONFIG_SENSIRION_SLF3S is not set
# end of Flow sensors

#
# Frequency Synthesizers DDS/PLL
#

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

#
# Phase-Locked Loop (PLL) frequency synthesizers
#
# CONFIG_ADF41513 is not set
# 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_ICM42607_I2C is not set
# CONFIG_INV_ICM42607_SPI is not set
# CONFIG_INV_ICM45600_I2C is not set
# CONFIG_INV_ICM45600_SPI is not set
# CONFIG_INV_MPU6050_I2C is not set
# CONFIG_INV_MPU6050_SPI is not set
# CONFIG_SMI240 is not set
# CONFIG_SMI330_I2C is not set
# CONFIG_SMI330_SPI 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_APDS9999 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_VEML3328 is not set
# CONFIG_VEML6030 is not set
# CONFIG_VEML6040 is not set
# CONFIG_VEML6046X00 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_MMC5633 is not set
# CONFIG_MMC5983 is not set
# CONFIG_IIO_ST_MAGN_3AXIS is not set
# CONFIG_INFINEON_TLV493D is not set
# CONFIG_QMC5883L is not set
# CONFIG_QMC6308 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_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_ABP2030PA_I2C is not set
# CONFIG_ABP2030PA_SPI 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_I2C is not set
# CONFIG_MPRLS0025PA_SPI 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
# CONFIG_ADP810 is not set
# end of Pressure sensors

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

#
# Proximity and distance sensors
#
# CONFIG_D3323AA is not set
# 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_VL53L1X_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_IRQ_MSI_LIB=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_PHY_CAN_TRANSCEIVER is not set
CONFIG_PHY_GOOGLE_USB=y
CONFIG_USB_LGM_PHY=y
# CONFIG_PHY_NXP_PTN3222 is not set
# CONFIG_PHY_NXP_TJA1145 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_INTEL_LGM_COMBO is not set
# CONFIG_PHY_INTEL_LGM_EMMC 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_TI_DS125DF111 is not set
CONFIG_PHY_TUSB1210=y
# 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_CONFIGFS=y
# CONFIG_USB4_DEBUGFS_WRITE is not set
# CONFIG_USB4_DMA_TEST is not set
# CONFIG_USB4_STREAM is not set

#
# Android
#
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
CONFIG_ANDROID_BINDER_DEVICES="binder0,binder1"
# 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_RAMDAX is not set
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_FSDEV=y
# 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_EEPROM_AT24 is not set
# CONFIG_EEPROM_AT25 is not set
# CONFIG_EEPROM_93XX46 is not set
# CONFIG_EEPROM_EE1004 is not set
# CONFIG_EEPROM_M24LR is not set
# 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_TEE_DMABUF_HEAPS=y
CONFIG_OPTEE_STATIC_PROTMEM_POOL=y
# CONFIG_MUX_CORE is not set
# 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_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_DRAIN_INTENTS=y
CONFIG_XFS_LIVE_HOOKS=y
CONFIG_XFS_MEMORY_BUFS=y
CONFIG_XFS_BTREE_IN_MEM=y
CONFIG_XFS_ONLINE_SCRUB=y
# CONFIG_XFS_ONLINE_SCRUB_STATS is not set
CONFIG_XFS_ONLINE_REPAIR=y
# 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_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_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=y
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=y
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
# 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_NTFS_FS is not set
CONFIG_NTFS3_FS=y
# CONFIG_NTFS3_64BIT_CLUSTER is not set
CONFIG_NTFS3_LZX_XPRESS=y
CONFIG_NTFS3_FS_POSIX_ACL=y
# 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_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_ARCH_SUPPORTS_HUGETLBFS=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_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_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_PCPU_KTHREAD is not set
# CONFIG_EROFS_FS_PAGE_CACHE_SHARE 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_0=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_POSIX_ACLS 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_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_SMBDIRECT=y
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 is not set
CONFIG_PROC_MEM_FORCE_PTRACE=y
# 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_LSM_MMAP_MIN_ADDR=65536
# CONFIG_STATIC_USERMODEHELPER is not set
CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS=9
CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE=256
CONFIG_SECURITY_SELINUX_AVC_HASH_BITS=9
# CONFIG_SECURITY_SELINUX_DEBUG 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 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_LANDLOCK_LOG=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_IMA_STAGING is not set
# CONFIG_IMA_INIT_LATE_SYNC 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_SELINUX=y
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_LSM="landlock,lockdown,yama,safesetid,integrity,tomoyo,selinux,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_RANDSTRUCT_NONE=y
# end of Kernel hardening options
# end of Security options

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_AKCIPHER2=y
CONFIG_CRYPTO_AKCIPHER=y
CONFIG_CRYPTO_KPP2=y
CONFIG_CRYPTO_KPP=y
CONFIG_CRYPTO_ACOMP2=y
CONFIG_CRYPTO_ACOMP=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_USER=y
# CONFIG_CRYPTO_SELFTESTS is not set
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_PCRYPT=y
# CONFIG_CRYPTO_CRYPTD is not set
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 is not set
CONFIG_CRYPTO_ECRDSA=y
CONFIG_CRYPTO_MLDSA=y
# end of Public-key cryptography

#
# Block ciphers
#
CONFIG_CRYPTO_AES=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_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_XCTR=y
CONFIG_CRYPTO_XTS=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 is not set
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
CONFIG_CRYPTO_RMD160=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_SHA3=y
# CONFIG_CRYPTO_SM3 is not set
CONFIG_CRYPTO_STREEBOG=y
CONFIG_CRYPTO_WP512=y
CONFIG_CRYPTO_XCBC=y
# CONFIG_CRYPTO_XXHASH is not set
# end of Hashes, digests, and MACs

#
# CRCs (cyclic redundancy checks)
#
# CONFIG_CRYPTO_CRC32C is not set
# 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_DRBG is not set
# CONFIG_CRYPTO_JITTERENTROPY is not set
CONFIG_CRYPTO_KDF800108_CTR=y
# end of Random number generation

#
# Userspace interface (deprecated)
#
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_AEAD=y
CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y
# end of Userspace interface (deprecated)

#
# Accelerated Cryptographic Algorithms for CPU (x86)
#
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_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
# 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_SP_PSP 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_WAIVE_AUTHATTRS_REJECTION_FOR_MLDSA is not set
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_MLDSA_44=y
# CONFIG_MODULE_SIG_KEY_TYPE_MLDSA_65 is not set
# CONFIG_MODULE_SIG_KEY_TYPE_MLDSA_87 is not set
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
CONFIG_OPENSSL_SUPPORTS_ML_DSA=y
# end of Certificates for signature checking

CONFIG_CRYPTO_KRB5=y
# CONFIG_CRYPTO_KRB5_SELFTESTS is not set
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_LINEAR_RANGES=y
# CONFIG_PACKING is not set
CONFIG_BITREVERSE=y
CONFIG_GENERIC_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
CONFIG_CRC8=y
CONFIG_CRC16=y
CONFIG_CRC_CCITT=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC_T10DIF_ARCH=y
CONFIG_CRC32=y
CONFIG_CRC32_ARCH=y
CONFIG_CRC64=y
CONFIG_CRC64_ARCH=y
CONFIG_CRC_OPTIMIZATIONS=y
CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_LIB_UTILS=y
CONFIG_CRYPTO_LIB_AES=y
CONFIG_CRYPTO_LIB_AES_ARCH=y
CONFIG_CRYPTO_LIB_AES_CBC=y
CONFIG_CRYPTO_LIB_AES_CBC_MACS=y
CONFIG_CRYPTO_LIB_AES_CCM=y
CONFIG_CRYPTO_LIB_AES_CTR=y
CONFIG_CRYPTO_LIB_AES_ECB=y
CONFIG_CRYPTO_LIB_AES_GCM=y
CONFIG_CRYPTO_LIB_AES_XTS=y
CONFIG_CRYPTO_LIB_ARC4=y
CONFIG_CRYPTO_LIB_GF128MUL=y
CONFIG_CRYPTO_LIB_BLAKE2B=y
CONFIG_CRYPTO_LIB_BLAKE2S_ARCH=y
CONFIG_CRYPTO_LIB_CHACHA=y
CONFIG_CRYPTO_LIB_CHACHA_ARCH=y
CONFIG_CRYPTO_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_CURVE25519_ARCH=y
CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=y
CONFIG_CRYPTO_LIB_DES=y
CONFIG_CRYPTO_LIB_GF128HASH=y
CONFIG_CRYPTO_LIB_GF128HASH_ARCH=y
CONFIG_CRYPTO_LIB_MD5=y
CONFIG_CRYPTO_LIB_MLDSA=y
CONFIG_CRYPTO_LIB_NH=y
CONFIG_CRYPTO_LIB_NH_ARCH=y
CONFIG_CRYPTO_LIB_POLY1305=y
CONFIG_CRYPTO_LIB_POLY1305_ARCH=y
CONFIG_CRYPTO_LIB_POLY1305_GENERIC=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
CONFIG_CRYPTO_LIB_SHA1=y
CONFIG_CRYPTO_LIB_SHA1_ARCH=y
CONFIG_CRYPTO_LIB_SHA256=y
CONFIG_CRYPTO_LIB_SHA256_ARCH=y
CONFIG_CRYPTO_LIB_SHA512=y
CONFIG_CRYPTO_LIB_SHA512_ARCH=y
CONFIG_CRYPTO_LIB_SHA3=y
CONFIG_XOR_BLOCKS=y
CONFIG_XOR_BLOCKS_ARCH=y
CONFIG_RAID6_PQ=y
CONFIG_RAID6_PQ_ARCH=y
# CONFIG_RAID6_PQ_BENCHMARK is not set
CONFIG_XXHASH=y
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_DEFAULT_SIZE_MB=64
# 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_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_VDSO_DATASTORE=y
CONFIG_GENERIC_GETTIMEOFDAY=y
CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT=y
CONFIG_VDSO_GETRANDOM=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

#
# 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
CONFIG_DEBUG_BUGVERBOSE_DETAILED=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_LANG_EXCLUDE=y
# CONFIG_GDB_SCRIPTS is not set
CONFIG_FRAME_WARN=2048
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_HEADERS_INSTALL is not set
# CONFIG_DEBUG_SECTION_MISMATCH 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
# 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_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_BOUNDS_STRICT=y
CONFIG_UBSAN_BOUNDS=y
CONFIG_UBSAN_BOUNDS_STRICT=y
CONFIG_UBSAN_SHIFT=y
# CONFIG_UBSAN_DIV_ZERO is not set
# 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_MEM_ALLOC_PROFILING 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_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
# end of Memory Debugging

# CONFIG_DEBUG_SHIRQ is not set

#
# Debug Oops, Lockups and Hangs
#
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=86400
CONFIG_LOCKUP_DETECTOR=y
CONFIG_SOFTLOCKUP_DETECTOR=y
# CONFIG_SOFTLOCKUP_DETECTOR_INTR_STORM is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=1
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=1
# CONFIG_DETECT_HUNG_TASK_BLOCKER is not set
CONFIG_WQ_WATCHDOG=y
CONFIG_BOOTPARAM_WQ_STALL_PANIC=0
# 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
# CONFIG_DEBUG_ATOMIC is not set

#
# 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_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_DYNAMIC_FTRACE_WITH_JMP=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_TRACEFS_AUTOMOUNT_DEPRECATED=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_PROBE_EVENTS_DUMP_FETCHARG is not set
CONFIG_UPROBE_EVENTS=y
CONFIG_EPROBE_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_RING_BUFFER_PERSISTENT_INJECT is not set
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set
# CONFIG_RV is not set
# CONFIG_TRACE_REMOTE_TEST 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_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_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_WORKQUEUE is not set
# CONFIG_TEST_BPF is not set
# CONFIG_FIND_BIT_BENCHMARK is not set
# CONFIG_REGION_ALLOC_BENCHMARK is not set
# CONFIG_TEST_FIRMWARE is not set
# CONFIG_TEST_SYSCTL is not set
# CONFIG_CONTEXT_ANALYSIS_TEST 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
CONFIG_IO_URING_BPF=y
KernelRepo git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
ReproCID 5921505659060224
ReproOpts
ReproSyzID 0
SyzkallerCommit 1fe56c0af80df10ab9f07819d9fa709dc9971ae1
TargetArch amd64
TargetOS linux
TargetVMArch amd64

Error:
log-in to see details

Outputs:

Crash report:
------------[ cut here ]------------
size > iomap->length
WARNING: fs/iomap/buffered-io.c:431 at iomap_read_inline_data+0x901/0xc10 fs/iomap/buffered-io.c:431, CPU#1: syz-executor183/6038
Modules linked in:
CPU: 1 UID: 0 PID: 6038 Comm: syz-executor183 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:iomap_read_inline_data+0x901/0xc10 fs/iomap/buffered-io.c:431
Code: ff ff ff e8 31 37 51 ff 48 c7 c6 20 6b 0a 8c 48 89 ef e8 52 d9 a4 ff 90 0f 0b e8 4a 7a c4 ff e9 46 f7 ff ff e8 10 37 51 ff 90 <0f> 0b 90 48 b8 00 00 00 00 00 fc ff df 4c 89 fa 48 c1 ea 03 80 3c
RSP: 0000:ffffc90003357538 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffffc90003357790 RCX: 0000000000000000
RDX: ffff888029fa4b00 RSI: ffffffff82bae840 RDI: ffff888029fa4b00
RBP: ffffea0001030f80 R08: 0000000000000006 R09: 0000000000000005
R10: 0000000000000014 R11: 0000000000000000 R12: 0000000000000014
R13: ffffc900033577b8 R14: ffffc900033577e8 R15: ffffc900033577c0
FS:  00007f4d0baf66c0(0000) GS:ffff8880d5c59000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4d0a2f1000 CR3: 0000000059e5c000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 iomap_read_folio_iter+0xc35/0xfd0 fs/iomap/buffered-io.c:571
 iomap_read_folio+0x392/0x980 fs/iomap/buffered-io.c:676
 ntfs_read_folio+0x298/0x4b0 fs/ntfs3/inode.c:856
 filemap_read_folio+0xfc/0x3b0 mm/filemap.c:2520
 filemap_fault+0x24b8/0x3130 mm/filemap.c:3689
 __do_fault+0x10b/0x440 mm/memory.c:5565
 do_read_fault mm/memory.c:6000 [inline]
 do_fault+0xb3f/0x1830 mm/memory.c:6134
 do_pte_missing mm/memory.c:4700 [inline]
 handle_pte_fault mm/memory.c:6558 [inline]
 __handle_mm_fault+0x150b/0x2f60 mm/memory.c:6707
 handle_mm_fault+0x363/0xa20 mm/memory.c:6876
 do_user_addr_fault+0x59c/0x12f0 arch/x86/mm/fault.c:1343
 handle_page_fault arch/x86/mm/fault.c:1483 [inline]
 exc_page_fault+0x6f/0xd0 arch/x86/mm/fault.c:1536
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595
RIP: 0033:0x7f4d0cb0af39
Code: 00 ba 04 00 00 00 be 00 10 00 00 48 89 df e8 7e 3e 02 00 8b 3d e0 4b 0c 00 b9 04 00 00 00 31 f6 ba 00 10 00 00 e8 87 34 02 00 <0f> b6 03 88 44 24 0f 8b 05 be 4b 0c 00 85 c0 74 c6 be 00 10 00 00
RSP: 002b:00007f4d0baf6200 EFLAGS: 00010207
RAX: 0000000000000000 RBX: 00007f4d0a2f1000 RCX: 00007f4d0cb2e3ca
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000021 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000000004 R11: 0000000000000246 R12: ffffffffffffffd0
R13: 0000000000000002 R14: 00007ffe1da2f580 R15: 00007ffe1da2f668
 </TASK>

Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/09/17 10:04 flow patching
1h50m Error:
log-in to see details

1/1 2026/09/17 10:04 action base-commit-picker
0m Results:
map[KernelBranch:master KernelCommit:fd73f4a6659897191fa0d40695fe370925dd3780 KernelRepo:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git]

2/1 2026/09/17 10:04 action syz-repro-to-c-repro
0m Results:
map[SimplifiedCRepro:#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <pthread.h>
#include <sys/ioctl.h>
#include <linux/loop.h>
#include <errno.h>

#pragma pack(push, 1)

struct NTFS_BOOT {
    uint8_t  jump[3];
    char     system_id[8];
    uint16_t bytes_per_sector;
    uint8_t  sectors_per_clst;
    uint16_t reserved_sectors;
    uint8_t  zero1[3];
    uint16_t unused1;
    uint8_t  media_descriptor;
    uint16_t unused2;
    uint16_t sectors_per_track;
    uint16_t number_of_heads;
    uint32_t hidden_sectors;
    uint32_t unused3;
    uint8_t  bios_drive_num;
    uint8_t  extended_flags;
    uint8_t  extended_signature;
    uint8_t  unused4;
    uint64_t sectors_per_volume;
    uint64_t mft_clst;
    uint64_t mft2_clst;
    int8_t   record_size;
    uint8_t  unused5[3];
    int8_t   index_size;
    uint8_t  unused6[3];
    uint64_t serial_number;
    uint32_t checksum;
    uint8_t  boot_code[426];
    uint16_t boot_magic;
};

struct MFT_RECORD_HDR {
    uint32_t magic;
    uint16_t fix_off;
    uint16_t fix_num;
    uint64_t lsn;
    uint16_t seq;
    uint16_t hard_links;
    uint16_t attr_off;
    uint16_t flags;
    uint32_t used_bytes;
    uint32_t total_bytes;
    uint64_t base_ref;
    uint16_t next_attr_id;
    uint16_t dummy;
    uint32_t mft_rec_num;
};

struct ATTR_RESIDENT {
    uint32_t type;
    uint32_t size;
    uint8_t  non_res;
    uint8_t  name_len;
    uint16_t name_off;
    uint16_t flags;
    uint16_t id;
    uint32_t data_size;
    uint16_t data_off;
    uint8_t  res_flags;
    uint8_t  pad;
};

struct ATTR_NON_RESIDENT {
    uint32_t type;
    uint32_t size;
    uint8_t  non_res;
    uint8_t  name_len;
    uint16_t name_off;
    uint16_t flags;
    uint16_t id;
    uint64_t svcn;
    uint64_t evcn;
    uint16_t run_off;
    uint16_t comp_unit;
    uint32_t pad;
    uint64_t alloc_size;
    uint64_t data_size;
    uint64_t valid_size;
};

struct ATTR_STD_INFO {
    uint64_t crtime;
    uint64_t mtime;
    uint64_t ctime;
    uint64_t atime;
    uint32_t file_flags;
    uint32_t max_ver;
    uint32_t ver_num;
    uint32_t class_id;
    uint32_t owner_id;
    uint32_t security_id;
    uint64_t quota_charge;
    uint64_t usn;
};

struct ATTR_FILE_NAME {
    uint64_t parent_ref;
    uint64_t crtime;
    uint64_t mtime;
    uint64_t ctime;
    uint64_t atime;
    uint64_t alloc_size;
    uint64_t data_size;
    uint32_t flags;
    uint32_t reparse_tag;
    uint8_t  name_len;
    uint8_t  name_type;
    uint16_t name[];
};

struct ATTR_VOL_INFO_DATA {
    uint64_t reserved;
    uint8_t  major_ver;
    uint8_t  minor_ver;
    uint16_t flags;
};

struct INDEX_HDR {
    uint32_t first_entry_off;
    uint32_t total_size;
    uint32_t alloc_size;
    uint8_t  flags;
    uint8_t  pad2[3];
};

struct INDEX_ROOT {
    uint32_t type;
    uint32_t collation_rule;
    uint32_t index_block_size;
    uint8_t  clusters_per_block;
    uint8_t  pad[3];
    struct INDEX_HDR hdr;
};

struct INDEX_ENTRY {
    uint64_t ref;
    uint16_t entry_len;
    uint16_t key_len;
    uint16_t entry_flags;
    uint16_t pad;
};

struct ATTR_DEF_ENTRY {
    uint16_t name[64];
    uint32_t type;
    uint32_t display_rule;
    uint32_t collation_rule;
    uint32_t flags;
    uint64_t min_size;
    uint64_t max_size;
};

#pragma pack(pop)

static void apply_mft_fixups(uint8_t *rec) {
    uint16_t usn = 1;
    uint16_t *fix_array = (uint16_t *)(rec + 0x30);
    uint16_t *sec0_end  = (uint16_t *)(rec + 512 - 2);
    uint16_t *sec1_end  = (uint16_t *)(rec + 1024 - 2);
    fix_array[0] = usn;
    fix_array[1] = *sec0_end;
    fix_array[2] = *sec1_end;
    *sec0_end = usn;
    *sec1_end = usn;
}

static int add_attr_std(uint8_t *buf, uint16_t id) {
    struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)buf;
    int asize = sizeof(struct ATTR_RESIDENT) + sizeof(struct ATTR_STD_INFO);
    asize = (asize + 7) & ~7;
    memset(buf, 0, asize);
    a->type = 0x10;
    a->size = asize;
    a->id = id;
    a->data_off = sizeof(struct ATTR_RESIDENT);
    a->data_size = sizeof(struct ATTR_STD_INFO);
    
    struct ATTR_STD_INFO *std = (struct ATTR_STD_INFO *)(buf + sizeof(struct ATTR_RESIDENT));
    std->file_flags = 0x20;
    return asize;
}

static int add_attr_name(uint8_t *buf, uint16_t id, uint64_t pref, const char *name, uint64_t size) {
    int nlen = strlen(name);
    int datalen = 66 + nlen * 2;
    int asize = sizeof(struct ATTR_RESIDENT) + datalen;
    asize = (asize + 7) & ~7;
    memset(buf, 0, asize);
    struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)buf;
    a->type = 0x30;
    a->size = asize;
    a->id = id;
    a->data_off = sizeof(struct ATTR_RESIDENT);
    a->data_size = datalen;
    struct ATTR_FILE_NAME *fn = (struct ATTR_FILE_NAME *)(buf + sizeof(struct ATTR_RESIDENT));
    fn->parent_ref = pref;
    fn->alloc_size = size;
    fn->data_size = size;
    fn->flags = 0x20;
    fn->name_len = nlen;
    fn->name_type = 3;
    for (int i = 0; i < nlen; i++) fn->name[i] = (uint8_t)name[i];
    return asize;
}

static int add_attr_data_res(uint8_t *buf, uint16_t id, const void *data, uint32_t size) {
    struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)buf;
    int asize = sizeof(struct ATTR_RESIDENT) + size;
    asize = (asize + 7) & ~7;
    memset(buf, 0, asize);
    a->type = 0x80;
    a->size = asize;
    a->id = id;
    a->data_off = sizeof(struct ATTR_RESIDENT);
    a->data_size = size;
    if (size > 0 && data) {
        memcpy(buf + sizeof(struct ATTR_RESIDENT), data, size);
    }
    return asize;
}

static int encode_run(uint8_t *buf, uint64_t clst_count, int64_t lcn) {
    buf[0] = 0x22;
    buf[1] = clst_count & 0xFF;
    buf[2] = (clst_count >> 8) & 0xFF;
    buf[3] = lcn & 0xFF;
    buf[4] = (lcn >> 8) & 0xFF;
    buf[5] = 0x00;
    return 6;
}

static void init_record(uint8_t *buf, uint32_t rec_num, uint16_t seq, uint16_t flags) {
    memset(buf, 0, 1024);
    struct MFT_RECORD_HDR *hdr = (struct MFT_RECORD_HDR *)buf;
    hdr->magic = 0x454C4946;
    hdr->fix_off = 0x30;
    hdr->fix_num = 3;
    hdr->seq = seq;
    hdr->hard_links = 1;
    hdr->attr_off = 0x38;
    hdr->flags = flags;
    hdr->total_bytes = 1024;
    hdr->mft_rec_num = rec_num;
}

int create_ntfs_image(const char *filename) {
    FILE *f = fopen(filename, "wb+");
    if (!f) return -1;

    const uint64_t total_sectors = 204800; // 100MB
    const uint32_t clst_size = 4096;
    const uint64_t mft_lcn = 4;
    const uint64_t mftmirr_lcn = 20;
    const uint64_t logfile_lcn = 24;
    const uint64_t bitmap_lcn = 74;
    const uint64_t upcase_lcn = 75;
    const uint64_t mft_bitmap_lcn = 107;

    struct NTFS_BOOT boot;
    memset(&boot, 0, sizeof(boot));
    boot.jump[0] = 0xEB; boot.jump[1] = 0x52; boot.jump[2] = 0x90;
    memcpy(boot.system_id, "NTFS    ", 8);
    boot.bytes_per_sector = 512;
    boot.sectors_per_clst = 8;
    boot.media_descriptor = 0xF8;
    boot.sectors_per_track = 63;
    boot.number_of_heads = 255;
    boot.bios_drive_num = 0x80;
    boot.extended_signature = 0x80;
    boot.sectors_per_volume = total_sectors - 1;
    boot.mft_clst = mft_lcn;
    boot.mft2_clst = mftmirr_lcn;
    boot.record_size = -10;
    boot.index_size = -12;
    boot.serial_number = 0x1234567887654321ULL;
    boot.boot_magic = 0xAA55;

    fseek(f, 0, SEEK_SET);
    fwrite(&boot, sizeof(boot), 1, f);

    uint8_t mft_table[32 * 1024];
    memset(mft_table, 0, sizeof(mft_table));

    /* Record 0: $MFT */
    {
        uint8_t *rec = mft_table + 0 * 1024;
        init_record(rec, 0, 1, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$MFT", 16 * clst_size);

        struct ATTR_NON_RESIDENT *a = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen = encode_run(rec + off + sizeof(*a), 16, mft_lcn);
        int asize = (sizeof(*a) + rlen + 7) & ~7;
        a->type = 0x80; a->size = asize; a->non_res = 1; a->id = 3;
        a->evcn = 15; a->run_off = sizeof(*a);
        a->alloc_size = a->data_size = a->valid_size = 16 * clst_size;
        off += asize;

        struct ATTR_NON_RESIDENT *b = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen2 = encode_run(rec + off + sizeof(*b), 1, mft_bitmap_lcn);
        int bsize = (sizeof(*b) + rlen2 + 7) & ~7;
        b->type = 0xB0; b->size = bsize; b->non_res = 1; b->id = 4;
        b->evcn = 0; b->run_off = sizeof(*b);
        b->alloc_size = clst_size; b->data_size = b->valid_size = 8;
        off += bsize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 1: $MFTMirr */
    {
        uint8_t *rec = mft_table + 1 * 1024;
        init_record(rec, 1, 1, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$MFTMirr", 4096);

        struct ATTR_NON_RESIDENT *a = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen = encode_run(rec + off + sizeof(*a), 1, mftmirr_lcn);
        int asize = (sizeof(*a) + rlen + 7) & ~7;
        a->type = 0x80; a->size = asize; a->non_res = 1; a->id = 3;
        a->evcn = 0; a->run_off = sizeof(*a);
        a->alloc_size = a->data_size = a->valid_size = 4 * 1024;
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 2: $LogFile */
    {
        uint8_t *rec = mft_table + 2 * 1024;
        init_record(rec, 2, 2, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$LogFile", 50 * clst_size);

        struct ATTR_NON_RESIDENT *a = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen = encode_run(rec + off + sizeof(*a), 50, logfile_lcn);
        int asize = (sizeof(*a) + rlen + 7) & ~7;
        a->type = 0x80; a->size = asize; a->non_res = 1; a->id = 3;
        a->evcn = 49; a->run_off = sizeof(*a);
        a->alloc_size = a->data_size = a->valid_size = 50 * clst_size;
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 3: $Volume */
    {
        uint8_t *rec = mft_table + 3 * 1024;
        init_record(rec, 3, 3, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$Volume", 0);

        struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)(rec + off);
        int asize = (sizeof(*a) + sizeof(struct ATTR_VOL_INFO_DATA) + 7) & ~7;
        a->type = 0x70; a->size = asize; a->id = 3;
        a->data_off = sizeof(*a); a->data_size = sizeof(struct ATTR_VOL_INFO_DATA);
        struct ATTR_VOL_INFO_DATA *vi = (struct ATTR_VOL_INFO_DATA *)(rec + off + sizeof(*a));
        vi->major_ver = 1; vi->minor_ver = 2; // NTFS 1.2 to skip $Secure
        off += asize;

        off += add_attr_data_res(rec + off, 4, NULL, 0);

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 4: $AttrDef */
    {
        uint8_t *rec = mft_table + 4 * 1024;
        init_record(rec, 4, 4, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$AttrDef", sizeof(struct ATTR_DEF_ENTRY));

        struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)(rec + off);
        int dsize = sizeof(struct ATTR_DEF_ENTRY);
        int asize = (sizeof(*a) + dsize + 7) & ~7;
        a->type = 0x80; a->size = asize; a->id = 3;
        a->data_off = sizeof(*a); a->data_size = dsize;
        struct ATTR_DEF_ENTRY *ade = (struct ATTR_DEF_ENTRY *)(rec + off + sizeof(*a));
        memset(ade, 0, sizeof(*ade));
        ade->type = 0x10;
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 5: Root Directory '.' */
    {
        uint8_t *rec = mft_table + 5 * 1024;
        init_record(rec, 5, 5, 0x03);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), ".", 0);

        struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)(rec + off);
        int nlen = 4;
        int fn_datalen = 66 + nlen * 2;
        int entry1_len = (sizeof(struct INDEX_ENTRY) + fn_datalen + 7) & ~7;
        int entry2_len = sizeof(struct INDEX_ENTRY);
        int dsize = sizeof(struct INDEX_ROOT) + entry1_len + entry2_len;
        int asize = (sizeof(*a) + 8 + dsize + 7) & ~7;
        
        a->type = 0x90; a->size = asize; a->id = 3;
        a->name_len = 4; a->name_off = sizeof(*a);
        uint16_t *aname = (uint16_t *)(rec + off + sizeof(*a));
        aname[0] = '$'; aname[1] = 'I'; aname[2] = '3'; aname[3] = '0';
        a->data_off = sizeof(*a) + 8; a->data_size = dsize;

        struct INDEX_ROOT *ir = (struct INDEX_ROOT *)(rec + off + sizeof(*a) + 8);
        ir->type = 0x30;
        ir->collation_rule = 0x01;
        ir->index_block_size = 4096;
        ir->clusters_per_block = 1;
        ir->hdr.first_entry_off = 0x10;
        ir->hdr.total_size = 0x10 + entry1_len + entry2_len;
        ir->hdr.alloc_size = ir->hdr.total_size;
        ir->hdr.flags = 0;
        
        struct INDEX_ENTRY *ie1 = (struct INDEX_ENTRY *)((uint8_t *)ir + sizeof(struct INDEX_ROOT));
        memset(ie1, 0, entry1_len);
        ie1->ref = 16 | (1ULL << 48);
        ie1->entry_len = entry1_len;
        ie1->key_len = fn_datalen;
        ie1->entry_flags = 0;
        
        struct ATTR_FILE_NAME *fn = (struct ATTR_FILE_NAME *)((uint8_t *)ie1 + sizeof(struct INDEX_ENTRY));
        memset(fn, 0, fn_datalen);
        fn->parent_ref = 5 | (5ULL << 48);
        fn->alloc_size = 5;
        fn->data_size = 5;
        fn->flags = 0x20;
        fn->name_len = nlen;
        fn->name_type = 3;
        fn->name[0] = 't'; fn->name[1] = 'e'; fn->name[2] = 's'; fn->name[3] = 't';
        
        struct INDEX_ENTRY *ie2 = (struct INDEX_ENTRY *)((uint8_t *)ie1 + entry1_len);
        memset(ie2, 0, entry2_len);
        ie2->ref = 0;
        ie2->entry_len = entry2_len;
        ie2->key_len = 0;
        ie2->entry_flags = 0x02;
        
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 6: $Bitmap */
    {
        uint8_t *rec = mft_table + 6 * 1024;
        init_record(rec, 6, 6, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$Bitmap", 3200);

        struct ATTR_NON_RESIDENT *a = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen = encode_run(rec + off + sizeof(*a), 1, bitmap_lcn);
        int asize = (sizeof(*a) + rlen + 7) & ~7;
        a->type = 0x80; a->size = asize; a->non_res = 1; a->id = 3;
        a->evcn = 0; a->run_off = sizeof(*a);
        a->alloc_size = clst_size; a->data_size = a->valid_size = 3200;
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 8: $BadClus */
    {
        uint8_t *rec = mft_table + 8 * 1024;
        init_record(rec, 8, 8, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$BadClus", 0);

        unsigned char dummy_attr[] = {
            0x80, 0x00, 0x00, 0x00, // type = ATTR_DATA
            0x48, 0x00, 0x00, 0x00, // size = 72
            0x01,                   // non_res = 1
            0x00,                   // name_len = 0
            0x40, 0x00,             // name_off = 64
            0x00, 0x00,             // flags = 0
            0x03, 0x00,             // id = 3
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // svcn = 0
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // evcn = 0
            0x40, 0x00,             // run_off = 64
            0x00, 0x00,             // comp_unit = 0
            0x00, 0x00, 0x00, 0x00, // res2 = 0
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // alloc_size = 0
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // data_size = 0
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // valid_size = 0
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // runlist (empty)
        };
        memcpy(rec + off, dummy_attr, sizeof(dummy_attr));
        off += sizeof(dummy_attr);

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 10: $UpCase */
    {
        uint8_t *rec = mft_table + 10 * 1024;
        init_record(rec, 10, 10, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$UpCase", 131072);

        struct ATTR_NON_RESIDENT *a = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen = encode_run(rec + off + sizeof(*a), 32, upcase_lcn);
        int asize = (sizeof(*a) + rlen + 7) & ~7;
        a->type = 0x80; a->size = asize; a->non_res = 1; a->id = 3;
        a->evcn = 31; a->run_off = sizeof(*a);
        a->alloc_size = a->data_size = a->valid_size = 131072;
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 16: "test" */
    {
        uint8_t *rec = mft_table + 16 * 1024;
        init_record(rec, 16, 1, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "test", 5);

        off += add_attr_data_res(rec + off, 3, "hello", 5);

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    fseek(f, mft_lcn * clst_size, SEEK_SET);
    fwrite(mft_table, 32 * 1024, 1, f);

    fseek(f, mftmirr_lcn * clst_size, SEEK_SET);
    fwrite(mft_table, 4 * 1024, 1, f);

    fseek(f, logfile_lcn * clst_size, SEEK_SET);
    uint8_t ff_buf[4096];
    memset(ff_buf, 0xFF, sizeof(ff_buf));
    for (int i = 0; i < 50; i++) {
        fwrite(ff_buf, sizeof(ff_buf), 1, f);
    }

    fseek(f, bitmap_lcn * clst_size, SEEK_SET);
    uint8_t bmp[4096];
    memset(bmp, 0, sizeof(bmp));
    for (int i = 0; i <= 107; i++) {
        bmp[i / 8] |= (1 << (i % 8));
    }
    fwrite(bmp, sizeof(bmp), 1, f);

    fseek(f, upcase_lcn * clst_size, SEEK_SET);
    uint16_t upcase_tbl[65536];
    for (int i = 0; i < 65536; i++) {
        if (i >= 'a' && i <= 'z')
            upcase_tbl[i] = i - ('a' - 'A');
        else
            upcase_tbl[i] = i;
    }
    fwrite(upcase_tbl, sizeof(upcase_tbl), 1, f);

    fseek(f, mft_bitmap_lcn * clst_size, SEEK_SET);
    uint8_t mft_bmp[4096];
    memset(mft_bmp, 0, sizeof(mft_bmp));
    mft_bmp[0] = 0x7F; mft_bmp[1] = 0x05; mft_bmp[2] = 0x01;
    fwrite(mft_bmp, sizeof(mft_bmp), 1, f);

    fflush(f);
    if (ftruncate(fileno(f), total_sectors * 512) < 0) {
        fclose(f);
        return -1;
    }
    fclose(f);
    return 0;
}

int fd;
volatile int stop = 0;

void *truncate_thread(void *arg) {
    while (!stop) {
        if (ftruncate(fd, 20) < 0) {}
        if (ftruncate(fd, 5) < 0) {}
    }
    return NULL;
}

void *read_thread(void *arg) {
    char *ptr = mmap(NULL, 4096, PROT_READ, MAP_SHARED, fd, 0);
    if (ptr == MAP_FAILED) {
        perror("mmap");
        return NULL;
    }
    
    volatile char val;
    while (!stop) {
        madvise(ptr, 4096, MADV_DONTNEED);
        posix_fadvise(fd, 0, 4096, POSIX_FADV_DONTNEED);
        val = ptr[0];
    }
    
    munmap(ptr, 4096);
    return NULL;
}

int main(void) {
    umount2("/tmp/mnt", MNT_FORCE | MNT_DETACH);
    unlink("/tmp/img.ntfs");

    printf("[*] Creating NTFS image...\n");
    if (create_ntfs_image("/tmp/img.ntfs") != 0) {
        printf("[-] Failed to create NTFS image\n");
        exit(1);
    }
    printf("[+] NTFS image created\n");

    int loop_c_fd = open("/dev/loop-control", O_RDWR);
    if (loop_c_fd < 0) {
        printf("[-] Failed to open /dev/loop-control: %s\n", strerror(errno));
        exit(1);
    }
    int loop_num = ioctl(loop_c_fd, LOOP_CTL_GET_FREE);
    if (loop_num < 0) {
        printf("[-] Failed to get free loop device: %s\n", strerror(errno));
        exit(1);
    }
    close(loop_c_fd);
    
    char loop_name[64];
    sprintf(loop_name, "/dev/loop%d", loop_num);
    int loop_fd = open(loop_name, O_RDWR);
    if (loop_fd < 0) {
        printf("[-] Failed to open %s: %s\n", loop_name, strerror(errno));
        exit(1);
    }
    
    int file_fd = open("/tmp/img.ntfs", O_RDWR);
    if (file_fd < 0) {
        printf("[-] Failed to open /tmp/img.ntfs: %s\n", strerror(errno));
        exit(1);
    }
    if (ioctl(loop_fd, LOOP_SET_FD, file_fd) < 0) {
        printf("[-] Failed to LOOP_SET_FD: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Loop device %s setup\n", loop_name);

    close(loop_fd);
    close(file_fd);

    mkdir("/tmp/mnt", 0777);
    
    usleep(250000); 
    
    int retries = 100;
    int mount_ret = -1;
    while (retries--) {
        mount_ret = mount(loop_name, "/tmp/mnt", "ntfs3", 0, "");
        if (mount_ret == 0) {
            break;
        }
        if (errno != EBUSY) {
            printf("[-] mount failed with unexpected error: %s\n", strerror(errno));
            break;
        }
        usleep(50000);
    }

    if (mount_ret != 0) {
        printf("[-] mount failed after retries\n");
        exit(1);
    }
    printf("[+] Mounted NTFS image\n");

    fd = open("/tmp/mnt/test", O_RDWR);
    if (fd < 0) {
        printf("[-] Failed to open /tmp/mnt/test: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Opened /tmp/mnt/test\n");

    pthread_t t1;
    pthread_t t2[4];
    pthread_create(&t1, NULL, truncate_thread, NULL);
    for (int i = 0; i < 4; i++) {
        pthread_create(&t2[i], NULL, read_thread, NULL);
    }

    sleep(5);
    stop = 1;
    
    pthread_join(t1, NULL);
    for (int i = 0; i < 4; i++) {
        pthread_join(t2[i], NULL);
    }

    close(fd);
    umount2("/tmp/mnt", MNT_FORCE | MNT_DETACH);
    
    loop_c_fd = open("/dev/loop-control", O_RDWR);
    if (loop_c_fd >= 0) {
        ioctl(loop_c_fd, LOOP_CTL_REMOVE, loop_num);
        close(loop_c_fd);
    }

    printf("[+] Done\n");

    return 0;
}
]

3/1 2026/09/17 10:04 action kernel-checkouter
1m Results:
map[KernelSrc:/app/workdir/cache/src/67d11fc48f675838c09d79899c80d8f2ebfe5ae5]

4/1 2026/09/17 10:05 action kernel-builder
17m Results:
map[KernelObj:/app/workdir/cache/build/8f886b6cb7d65c3b4ac23f860191087fb82edbf2]

5/1 2026/09/17 10:23 action crash-reproducer
1m Results:
map[OtherCrashReports:<nil> ReproducedBugTitle:WARNING in iomap_read_inline_data ReproducedCrashReport:------------[ cut here ]------------
size > iomap->length
WARNING: fs/iomap/buffered-io.c:431 at iomap_read_inline_data+0xa7b/0xc40 fs/iomap/buffered-io.c:431, CPU#0: syz-executor344/5848
Modules linked in:
CPU: 0 UID: 0 PID: 5848 Comm: syz-executor344 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
RIP: 0010:iomap_read_inline_data+0xa7b/0xc40 fs/iomap/buffered-io.c:431
Code: 48 83 c4 58 5b 41 5c 41 5d 41 5e 41 5f 5d e9 4c 11 5d 09 cc e8 16 17 59 ff 90 0f 0b 90 bd fb ff ff ff eb da e8 06 17 59 ff 90 <0f> 0b 90 48 bb 00 00 00 00 00 fc ff df 48 8b 44 24 10 80 3c 18 00
RSP: 0000:ffffc9000350f478 EFLAGS: 00010293
RAX: ffffffff826cf42a RBX: ffffc9000350f6d8 RCX: ffff88818e028000
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000014
RBP: 0000000000001000 R08: ffffea00045c8547 R09: 1ffffd40008b90a8
R10: dffffc0000000000 R11: fffff940008b90a9 R12: ffffc9000350f680
R13: ffffea00045c8540 R14: 0000000000000005 R15: 1ffff920006a1edb
FS:  00007fad77cec6c0(0000) GS:ffff8881a4c69000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fad764e9000 CR3: 0000000114d7f000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 iomap_read_folio_iter+0x30d/0xe80 fs/iomap/buffered-io.c:571
 iomap_read_folio+0x58b/0x970 fs/iomap/buffered-io.c:676
 ntfs_read_folio+0x3f1/0x4b0 fs/ntfs3/inode.c:856
 filemap_read_folio+0x12c/0x3a0 mm/filemap.c:2520
 filemap_fault+0xd06/0x13b0 mm/filemap.c:3689
 __do_fault+0x138/0x2a0 mm/memory.c:5565
 do_read_fault mm/memory.c:6000 [inline]
 do_fault mm/memory.c:6134 [inline]
 do_pte_missing+0x2313/0x3260 mm/memory.c:4700
 handle_pte_fault mm/memory.c:6558 [inline]
 __handle_mm_fault mm/memory.c:6707 [inline]
 handle_mm_fault+0x1a2c/0x3770 mm/memory.c:6876
 do_user_addr_fault+0xa4f/0x1340 arch/x86/mm/fault.c:1343
 handle_page_fault arch/x86/mm/fault.c:1483 [inline]
 exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1536
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595
RIP: 0033:0x7fad78d01f39
Code: 00 ba 04 00 00 00 be 00 10 00 00 48 89 df e8 7e 3e 02 00 8b 3d e0 4b 0c 00 b9 04 00 00 00 31 f6 ba 00 10 00 00 e8 87 34 02 00 <0f> b6 03 88 44 24 0f 8b 05 be 4b 0c 00 85 c0 74 c6 be 00 10 00 00
RSP: 002b:00007fad77cec200 EFLAGS: 00010207
RAX: 0000000000000000 RBX: 00007fad764e9000 RCX: 00007fad78d253ca
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000021 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000000004 R11: 0000000000000246 R12: ffffffffffffffd0
R13: 0000000000000002 R14: 00007ffccf51a930 R15: 00007ffccf51aa18
 </TASK>
 ReproducedFaultInjection:]

6/1 2026/09/17 10:24 action codesearch-prepare
11m Results:
map[Index:codesearch-index]

7/1 2026/09/17 10:36 agent debugger
1h18m Model:
deep-reasoning

Error:
log-in to see details

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:

------------[ cut here ]------------
size > iomap->length
WARNING: fs/iomap/buffered-io.c:431 at iomap_read_inline_data+0xa7b/0xc40 fs/iomap/buffered-io.c:431, CPU#0: syz-executor344/5848
Modules linked in:
CPU: 0 UID: 0 PID: 5848 Comm: syz-executor344 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
RIP: 0010:iomap_read_inline_data+0xa7b/0xc40 fs/iomap/buffered-io.c:431
Code: 48 83 c4 58 5b 41 5c 41 5d 41 5e 41 5f 5d e9 4c 11 5d 09 cc e8 16 17 59 ff 90 0f 0b 90 bd fb ff ff ff eb da e8 06 17 59 ff 90 <0f> 0b 90 48 bb 00 00 00 00 00 fc ff df 48 8b 44 24 10 80 3c 18 00
RSP: 0000:ffffc9000350f478 EFLAGS: 00010293
RAX: ffffffff826cf42a RBX: ffffc9000350f6d8 RCX: ffff88818e028000
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000014
RBP: 0000000000001000 R08: ffffea00045c8547 R09: 1ffffd40008b90a8
R10: dffffc0000000000 R11: fffff940008b90a9 R12: ffffc9000350f680
R13: ffffea00045c8540 R14: 0000000000000005 R15: 1ffff920006a1edb
FS:  00007fad77cec6c0(0000) GS:ffff8881a4c69000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fad764e9000 CR3: 0000000114d7f000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 iomap_read_folio_iter+0x30d/0xe80 fs/iomap/buffered-io.c:571
 iomap_read_folio+0x58b/0x970 fs/iomap/buffered-io.c:676
 ntfs_read_folio+0x3f1/0x4b0 fs/ntfs3/inode.c:856
 filemap_read_folio+0x12c/0x3a0 mm/filemap.c:2520
 filemap_fault+0xd06/0x13b0 mm/filemap.c:3689
 __do_fault+0x138/0x2a0 mm/memory.c:5565
 do_read_fault mm/memory.c:6000 [inline]
 do_fault mm/memory.c:6134 [inline]
 do_pte_missing+0x2313/0x3260 mm/memory.c:4700
 handle_pte_fault mm/memory.c:6558 [inline]
 __handle_mm_fault mm/memory.c:6707 [inline]
 handle_mm_fault+0x1a2c/0x3770 mm/memory.c:6876
 do_user_addr_fault+0xa4f/0x1340 arch/x86/mm/fault.c:1343
 handle_page_fault arch/x86/mm/fault.c:1483 [inline]
 exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1536
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595
RIP: 0033:0x7fad78d01f39
Code: 00 ba 04 00 00 00 be 00 10 00 00 48 89 df e8 7e 3e 02 00 8b 3d e0 4b 0c 00 b9 04 00 00 00 31 f6 ba 00 10 00 00 e8 87 34 02 00 <0f> b6 03 88 44 24 0f 8b 05 be 4b 0c 00 85 c0 74 c6 be 00 10 00 00
RSP: 002b:00007fad77cec200 EFLAGS: 00010207
RAX: 0000000000000000 RBX: 00007fad764e9000 RCX: 00007fad78d253ca
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000021 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000000004 R11: 0000000000000246 R12: ffffffffffffffd0
R13: 0000000000000002 R14: 00007ffccf51a930 R15: 00007ffccf51aa18
 </TASK>


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:

#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <pthread.h>
#include <sys/ioctl.h>
#include <linux/loop.h>
#include <errno.h>

#pragma pack(push, 1)

struct NTFS_BOOT {
    uint8_t  jump[3];
    char     system_id[8];
    uint16_t bytes_per_sector;
    uint8_t  sectors_per_clst;
    uint16_t reserved_sectors;
    uint8_t  zero1[3];
    uint16_t unused1;
    uint8_t  media_descriptor;
    uint16_t unused2;
    uint16_t sectors_per_track;
    uint16_t number_of_heads;
    uint32_t hidden_sectors;
    uint32_t unused3;
    uint8_t  bios_drive_num;
    uint8_t  extended_flags;
    uint8_t  extended_signature;
    uint8_t  unused4;
    uint64_t sectors_per_volume;
    uint64_t mft_clst;
    uint64_t mft2_clst;
    int8_t   record_size;
    uint8_t  unused5[3];
    int8_t   index_size;
    uint8_t  unused6[3];
    uint64_t serial_number;
    uint32_t checksum;
    uint8_t  boot_code[426];
    uint16_t boot_magic;
};

struct MFT_RECORD_HDR {
    uint32_t magic;
    uint16_t fix_off;
    uint16_t fix_num;
    uint64_t lsn;
    uint16_t seq;
    uint16_t hard_links;
    uint16_t attr_off;
    uint16_t flags;
    uint32_t used_bytes;
    uint32_t total_bytes;
    uint64_t base_ref;
    uint16_t next_attr_id;
    uint16_t dummy;
    uint32_t mft_rec_num;
};

struct ATTR_RESIDENT {
    uint32_t type;
    uint32_t size;
    uint8_t  non_res;
    uint8_t  name_len;
    uint16_t name_off;
    uint16_t flags;
    uint16_t id;
    uint32_t data_size;
    uint16_t data_off;
    uint8_t  res_flags;
    uint8_t  pad;
};

struct ATTR_NON_RESIDENT {
    uint32_t type;
    uint32_t size;
    uint8_t  non_res;
    uint8_t  name_len;
    uint16_t name_off;
    uint16_t flags;
    uint16_t id;
    uint64_t svcn;
    uint64_t evcn;
    uint16_t run_off;
    uint16_t comp_unit;
    uint32_t pad;
    uint64_t alloc_size;
    uint64_t data_size;
    uint64_t valid_size;
};

struct ATTR_STD_INFO {
    uint64_t crtime;
    uint64_t mtime;
    uint64_t ctime;
    uint64_t atime;
    uint32_t file_flags;
    uint32_t max_ver;
    uint32_t ver_num;
    uint32_t class_id;
    uint32_t owner_id;
    uint32_t security_id;
    uint64_t quota_charge;
    uint64_t usn;
};

struct ATTR_FILE_NAME {
    uint64_t parent_ref;
    uint64_t crtime;
    uint64_t mtime;
    uint64_t ctime;
    uint64_t atime;
    uint64_t alloc_size;
    uint64_t data_size;
    uint32_t flags;
    uint32_t reparse_tag;
    uint8_t  name_len;
    uint8_t  name_type;
    uint16_t name[];
};

struct ATTR_VOL_INFO_DATA {
    uint64_t reserved;
    uint8_t  major_ver;
    uint8_t  minor_ver;
    uint16_t flags;
};

struct INDEX_HDR {
    uint32_t first_entry_off;
    uint32_t total_size;
    uint32_t alloc_size;
    uint8_t  flags;
    uint8_t  pad2[3];
};

struct INDEX_ROOT {
    uint32_t type;
    uint32_t collation_rule;
    uint32_t index_block_size;
    uint8_t  clusters_per_block;
    uint8_t  pad[3];
    struct INDEX_HDR hdr;
};

struct INDEX_ENTRY {
    uint64_t ref;
    uint16_t entry_len;
    uint16_t key_len;
    uint16_t entry_flags;
    uint16_t pad;
};

struct ATTR_DEF_ENTRY {
    uint16_t name[64];
    uint32_t type;
    uint32_t display_rule;
    uint32_t collation_rule;
    uint32_t flags;
    uint64_t min_size;
    uint64_t max_size;
};

#pragma pack(pop)

static void apply_mft_fixups(uint8_t *rec) {
    uint16_t usn = 1;
    uint16_t *fix_array = (uint16_t *)(rec + 0x30);
    uint16_t *sec0_end  = (uint16_t *)(rec + 512 - 2);
    uint16_t *sec1_end  = (uint16_t *)(rec + 1024 - 2);
    fix_array[0] = usn;
    fix_array[1] = *sec0_end;
    fix_array[2] = *sec1_end;
    *sec0_end = usn;
    *sec1_end = usn;
}

static int add_attr_std(uint8_t *buf, uint16_t id) {
    struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)buf;
    int asize = sizeof(struct ATTR_RESIDENT) + sizeof(struct ATTR_STD_INFO);
    asize = (asize + 7) & ~7;
    memset(buf, 0, asize);
    a->type = 0x10;
    a->size = asize;
    a->id = id;
    a->data_off = sizeof(struct ATTR_RESIDENT);
    a->data_size = sizeof(struct ATTR_STD_INFO);
    
    struct ATTR_STD_INFO *std = (struct ATTR_STD_INFO *)(buf + sizeof(struct ATTR_RESIDENT));
    std->file_flags = 0x20;
    return asize;
}

static int add_attr_name(uint8_t *buf, uint16_t id, uint64_t pref, const char *name, uint64_t size) {
    int nlen = strlen(name);
    int datalen = 66 + nlen * 2;
    int asize = sizeof(struct ATTR_RESIDENT) + datalen;
    asize = (asize + 7) & ~7;
    memset(buf, 0, asize);
    struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)buf;
    a->type = 0x30;
    a->size = asize;
    a->id = id;
    a->data_off = sizeof(struct ATTR_RESIDENT);
    a->data_size = datalen;
    struct ATTR_FILE_NAME *fn = (struct ATTR_FILE_NAME *)(buf + sizeof(struct ATTR_RESIDENT));
    fn->parent_ref = pref;
    fn->alloc_size = size;
    fn->data_size = size;
    fn->flags = 0x20;
    fn->name_len = nlen;
    fn->name_type = 3;
    for (int i = 0; i < nlen; i++) fn->name[i] = (uint8_t)name[i];
    return asize;
}

static int add_attr_data_res(uint8_t *buf, uint16_t id, const void *data, uint32_t size) {
    struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)buf;
    int asize = sizeof(struct ATTR_RESIDENT) + size;
    asize = (asize + 7) & ~7;
    memset(buf, 0, asize);
    a->type = 0x80;
    a->size = asize;
    a->id = id;
    a->data_off = sizeof(struct ATTR_RESIDENT);
    a->data_size = size;
    if (size > 0 && data) {
        memcpy(buf + sizeof(struct ATTR_RESIDENT), data, size);
    }
    return asize;
}

static int encode_run(uint8_t *buf, uint64_t clst_count, int64_t lcn) {
    buf[0] = 0x22;
    buf[1] = clst_count & 0xFF;
    buf[2] = (clst_count >> 8) & 0xFF;
    buf[3] = lcn & 0xFF;
    buf[4] = (lcn >> 8) & 0xFF;
    buf[5] = 0x00;
    return 6;
}

static void init_record(uint8_t *buf, uint32_t rec_num, uint16_t seq, uint16_t flags) {
    memset(buf, 0, 1024);
    struct MFT_RECORD_HDR *hdr = (struct MFT_RECORD_HDR *)buf;
    hdr->magic = 0x454C4946;
    hdr->fix_off = 0x30;
    hdr->fix_num = 3;
    hdr->seq = seq;
    hdr->hard_links = 1;
    hdr->attr_off = 0x38;
    hdr->flags = flags;
    hdr->total_bytes = 1024;
    hdr->mft_rec_num = rec_num;
}

int create_ntfs_image(const char *filename) {
    FILE *f = fopen(filename, "wb+");
    if (!f) return -1;

    const uint64_t total_sectors = 204800; // 100MB
    const uint32_t clst_size = 4096;
    const uint64_t mft_lcn = 4;
    const uint64_t mftmirr_lcn = 20;
    const uint64_t logfile_lcn = 24;
    const uint64_t bitmap_lcn = 74;
    const uint64_t upcase_lcn = 75;
    const uint64_t mft_bitmap_lcn = 107;

    struct NTFS_BOOT boot;
    memset(&boot, 0, sizeof(boot));
    boot.jump[0] = 0xEB; boot.jump[1] = 0x52; boot.jump[2] = 0x90;
    memcpy(boot.system_id, "NTFS    ", 8);
    boot.bytes_per_sector = 512;
    boot.sectors_per_clst = 8;
    boot.media_descriptor = 0xF8;
    boot.sectors_per_track = 63;
    boot.number_of_heads = 255;
    boot.bios_drive_num = 0x80;
    boot.extended_signature = 0x80;
    boot.sectors_per_volume = total_sectors - 1;
    boot.mft_clst = mft_lcn;
    boot.mft2_clst = mftmirr_lcn;
    boot.record_size = -10;
    boot.index_size = -12;
    boot.serial_number = 0x1234567887654321ULL;
    boot.boot_magic = 0xAA55;

    fseek(f, 0, SEEK_SET);
    fwrite(&boot, sizeof(boot), 1, f);

    uint8_t mft_table[32 * 1024];
    memset(mft_table, 0, sizeof(mft_table));

    /* Record 0: $MFT */
    {
        uint8_t *rec = mft_table + 0 * 1024;
        init_record(rec, 0, 1, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$MFT", 16 * clst_size);

        struct ATTR_NON_RESIDENT *a = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen = encode_run(rec + off + sizeof(*a), 16, mft_lcn);
        int asize = (sizeof(*a) + rlen + 7) & ~7;
        a->type = 0x80; a->size = asize; a->non_res = 1; a->id = 3;
        a->evcn = 15; a->run_off = sizeof(*a);
        a->alloc_size = a->data_size = a->valid_size = 16 * clst_size;
        off += asize;

        struct ATTR_NON_RESIDENT *b = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen2 = encode_run(rec + off + sizeof(*b), 1, mft_bitmap_lcn);
        int bsize = (sizeof(*b) + rlen2 + 7) & ~7;
        b->type = 0xB0; b->size = bsize; b->non_res = 1; b->id = 4;
        b->evcn = 0; b->run_off = sizeof(*b);
        b->alloc_size = clst_size; b->data_size = b->valid_size = 8;
        off += bsize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 1: $MFTMirr */
    {
        uint8_t *rec = mft_table + 1 * 1024;
        init_record(rec, 1, 1, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$MFTMirr", 4096);

        struct ATTR_NON_RESIDENT *a = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen = encode_run(rec + off + sizeof(*a), 1, mftmirr_lcn);
        int asize = (sizeof(*a) + rlen + 7) & ~7;
        a->type = 0x80; a->size = asize; a->non_res = 1; a->id = 3;
        a->evcn = 0; a->run_off = sizeof(*a);
        a->alloc_size = a->data_size = a->valid_size = 4 * 1024;
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 2: $LogFile */
    {
        uint8_t *rec = mft_table + 2 * 1024;
        init_record(rec, 2, 2, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$LogFile", 50 * clst_size);

        struct ATTR_NON_RESIDENT *a = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen = encode_run(rec + off + sizeof(*a), 50, logfile_lcn);
        int asize = (sizeof(*a) + rlen + 7) & ~7;
        a->type = 0x80; a->size = asize; a->non_res = 1; a->id = 3;
        a->evcn = 49; a->run_off = sizeof(*a);
        a->alloc_size = a->data_size = a->valid_size = 50 * clst_size;
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 3: $Volume */
    {
        uint8_t *rec = mft_table + 3 * 1024;
        init_record(rec, 3, 3, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$Volume", 0);

        struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)(rec + off);
        int asize = (sizeof(*a) + sizeof(struct ATTR_VOL_INFO_DATA) + 7) & ~7;
        a->type = 0x70; a->size = asize; a->id = 3;
        a->data_off = sizeof(*a); a->data_size = sizeof(struct ATTR_VOL_INFO_DATA);
        struct ATTR_VOL_INFO_DATA *vi = (struct ATTR_VOL_INFO_DATA *)(rec + off + sizeof(*a));
        vi->major_ver = 1; vi->minor_ver = 2; // NTFS 1.2 to skip $Secure
        off += asize;

        off += add_attr_data_res(rec + off, 4, NULL, 0);

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 4: $AttrDef */
    {
        uint8_t *rec = mft_table + 4 * 1024;
        init_record(rec, 4, 4, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$AttrDef", sizeof(struct ATTR_DEF_ENTRY));

        struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)(rec + off);
        int dsize = sizeof(struct ATTR_DEF_ENTRY);
        int asize = (sizeof(*a) + dsize + 7) & ~7;
        a->type = 0x80; a->size = asize; a->id = 3;
        a->data_off = sizeof(*a); a->data_size = dsize;
        struct ATTR_DEF_ENTRY *ade = (struct ATTR_DEF_ENTRY *)(rec + off + sizeof(*a));
        memset(ade, 0, sizeof(*ade));
        ade->type = 0x10;
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 5: Root Directory '.' */
    {
        uint8_t *rec = mft_table + 5 * 1024;
        init_record(rec, 5, 5, 0x03);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), ".", 0);

        struct ATTR_RESIDENT *a = (struct ATTR_RESIDENT *)(rec + off);
        int nlen = 4;
        int fn_datalen = 66 + nlen * 2;
        int entry1_len = (sizeof(struct INDEX_ENTRY) + fn_datalen + 7) & ~7;
        int entry2_len = sizeof(struct INDEX_ENTRY);
        int dsize = sizeof(struct INDEX_ROOT) + entry1_len + entry2_len;
        int asize = (sizeof(*a) + 8 + dsize + 7) & ~7;
        
        a->type = 0x90; a->size = asize; a->id = 3;
        a->name_len = 4; a->name_off = sizeof(*a);
        uint16_t *aname = (uint16_t *)(rec + off + sizeof(*a));
        aname[0] = '$'; aname[1] = 'I'; aname[2] = '3'; aname[3] = '0';
        a->data_off = sizeof(*a) + 8; a->data_size = dsize;

        struct INDEX_ROOT *ir = (struct INDEX_ROOT *)(rec + off + sizeof(*a) + 8);
        ir->type = 0x30;
        ir->collation_rule = 0x01;
        ir->index_block_size = 4096;
        ir->clusters_per_block = 1;
        ir->hdr.first_entry_off = 0x10;
        ir->hdr.total_size = 0x10 + entry1_len + entry2_len;
        ir->hdr.alloc_size = ir->hdr.total_size;
        ir->hdr.flags = 0;
        
        struct INDEX_ENTRY *ie1 = (struct INDEX_ENTRY *)((uint8_t *)ir + sizeof(struct INDEX_ROOT));
        memset(ie1, 0, entry1_len);
        ie1->ref = 16 | (1ULL << 48);
        ie1->entry_len = entry1_len;
        ie1->key_len = fn_datalen;
        ie1->entry_flags = 0;
        
        struct ATTR_FILE_NAME *fn = (struct ATTR_FILE_NAME *)((uint8_t *)ie1 + sizeof(struct INDEX_ENTRY));
        memset(fn, 0, fn_datalen);
        fn->parent_ref = 5 | (5ULL << 48);
        fn->alloc_size = 5;
        fn->data_size = 5;
        fn->flags = 0x20;
        fn->name_len = nlen;
        fn->name_type = 3;
        fn->name[0] = 't'; fn->name[1] = 'e'; fn->name[2] = 's'; fn->name[3] = 't';
        
        struct INDEX_ENTRY *ie2 = (struct INDEX_ENTRY *)((uint8_t *)ie1 + entry1_len);
        memset(ie2, 0, entry2_len);
        ie2->ref = 0;
        ie2->entry_len = entry2_len;
        ie2->key_len = 0;
        ie2->entry_flags = 0x02;
        
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 6: $Bitmap */
    {
        uint8_t *rec = mft_table + 6 * 1024;
        init_record(rec, 6, 6, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$Bitmap", 3200);

        struct ATTR_NON_RESIDENT *a = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen = encode_run(rec + off + sizeof(*a), 1, bitmap_lcn);
        int asize = (sizeof(*a) + rlen + 7) & ~7;
        a->type = 0x80; a->size = asize; a->non_res = 1; a->id = 3;
        a->evcn = 0; a->run_off = sizeof(*a);
        a->alloc_size = clst_size; a->data_size = a->valid_size = 3200;
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 8: $BadClus */
    {
        uint8_t *rec = mft_table + 8 * 1024;
        init_record(rec, 8, 8, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$BadClus", 0);

        unsigned char dummy_attr[] = {
            0x80, 0x00, 0x00, 0x00, // type = ATTR_DATA
            0x48, 0x00, 0x00, 0x00, // size = 72
            0x01,                   // non_res = 1
            0x00,                   // name_len = 0
            0x40, 0x00,             // name_off = 64
            0x00, 0x00,             // flags = 0
            0x03, 0x00,             // id = 3
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // svcn = 0
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // evcn = 0
            0x40, 0x00,             // run_off = 64
            0x00, 0x00,             // comp_unit = 0
            0x00, 0x00, 0x00, 0x00, // res2 = 0
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // alloc_size = 0
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // data_size = 0
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // valid_size = 0
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // runlist (empty)
        };
        memcpy(rec + off, dummy_attr, sizeof(dummy_attr));
        off += sizeof(dummy_attr);

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 10: $UpCase */
    {
        uint8_t *rec = mft_table + 10 * 1024;
        init_record(rec, 10, 10, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "$UpCase", 131072);

        struct ATTR_NON_RESIDENT *a = (struct ATTR_NON_RESIDENT *)(rec + off);
        int rlen = encode_run(rec + off + sizeof(*a), 32, upcase_lcn);
        int asize = (sizeof(*a) + rlen + 7) & ~7;
        a->type = 0x80; a->size = asize; a->non_res = 1; a->id = 3;
        a->evcn = 31; a->run_off = sizeof(*a);
        a->alloc_size = a->data_size = a->valid_size = 131072;
        off += asize;

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    /* Record 16: "test" */
    {
        uint8_t *rec = mft_table + 16 * 1024;
        init_record(rec, 16, 1, 0x01);
        int off = 0x38;
        off += add_attr_std(rec + off, 1);
        off += add_attr_name(rec + off, 2, 5 | (5ULL << 48), "test", 5);

        off += add_attr_data_res(rec + off, 3, "hello", 5);

        *(uint32_t *)(rec + off) = 0xFFFFFFFF;
        ((struct MFT_RECORD_HDR *)rec)->used_bytes = off + 8;
        apply_mft_fixups(rec);
    }

    fseek(f, mft_lcn * clst_size, SEEK_SET);
    fwrite(mft_table, 32 * 1024, 1, f);

    fseek(f, mftmirr_lcn * clst_size, SEEK_SET);
    fwrite(mft_table, 4 * 1024, 1, f);

    fseek(f, logfile_lcn * clst_size, SEEK_SET);
    uint8_t ff_buf[4096];
    memset(ff_buf, 0xFF, sizeof(ff_buf));
    for (int i = 0; i < 50; i++) {
        fwrite(ff_buf, sizeof(ff_buf), 1, f);
    }

    fseek(f, bitmap_lcn * clst_size, SEEK_SET);
    uint8_t bmp[4096];
    memset(bmp, 0, sizeof(bmp));
    for (int i = 0; i <= 107; i++) {
        bmp[i / 8] |= (1 << (i % 8));
    }
    fwrite(bmp, sizeof(bmp), 1, f);

    fseek(f, upcase_lcn * clst_size, SEEK_SET);
    uint16_t upcase_tbl[65536];
    for (int i = 0; i < 65536; i++) {
        if (i >= 'a' && i <= 'z')
            upcase_tbl[i] = i - ('a' - 'A');
        else
            upcase_tbl[i] = i;
    }
    fwrite(upcase_tbl, sizeof(upcase_tbl), 1, f);

    fseek(f, mft_bitmap_lcn * clst_size, SEEK_SET);
    uint8_t mft_bmp[4096];
    memset(mft_bmp, 0, sizeof(mft_bmp));
    mft_bmp[0] = 0x7F; mft_bmp[1] = 0x05; mft_bmp[2] = 0x01;
    fwrite(mft_bmp, sizeof(mft_bmp), 1, f);

    fflush(f);
    if (ftruncate(fileno(f), total_sectors * 512) < 0) {
        fclose(f);
        return -1;
    }
    fclose(f);
    return 0;
}

int fd;
volatile int stop = 0;

void *truncate_thread(void *arg) {
    while (!stop) {
        if (ftruncate(fd, 20) < 0) {}
        if (ftruncate(fd, 5) < 0) {}
    }
    return NULL;
}

void *read_thread(void *arg) {
    char *ptr = mmap(NULL, 4096, PROT_READ, MAP_SHARED, fd, 0);
    if (ptr == MAP_FAILED) {
        perror("mmap");
        return NULL;
    }
    
    volatile char val;
    while (!stop) {
        madvise(ptr, 4096, MADV_DONTNEED);
        posix_fadvise(fd, 0, 4096, POSIX_FADV_DONTNEED);
        val = ptr[0];
    }
    
    munmap(ptr, 4096);
    return NULL;
}

int main(void) {
    umount2("/tmp/mnt", MNT_FORCE | MNT_DETACH);
    unlink("/tmp/img.ntfs");

    printf("[*] Creating NTFS image...\n");
    if (create_ntfs_image("/tmp/img.ntfs") != 0) {
        printf("[-] Failed to create NTFS image\n");
        exit(1);
    }
    printf("[+] NTFS image created\n");

    int loop_c_fd = open("/dev/loop-control", O_RDWR);
    if (loop_c_fd < 0) {
        printf("[-] Failed to open /dev/loop-control: %s\n", strerror(errno));
        exit(1);
    }
    int loop_num = ioctl(loop_c_fd, LOOP_CTL_GET_FREE);
    if (loop_num < 0) {
        printf("[-] Failed to get free loop device: %s\n", strerror(errno));
        exit(1);
    }
    close(loop_c_fd);
    
    char loop_name[64];
    sprintf(loop_name, "/dev/loop%d", loop_num);
    int loop_fd = open(loop_name, O_RDWR);
    if (loop_fd < 0) {
        printf("[-] Failed to open %s: %s\n", loop_name, strerror(errno));
        exit(1);
    }
    
    int file_fd = open("/tmp/img.ntfs", O_RDWR);
    if (file_fd < 0) {
        printf("[-] Failed to open /tmp/img.ntfs: %s\n", strerror(errno));
        exit(1);
    }
    if (ioctl(loop_fd, LOOP_SET_FD, file_fd) < 0) {
        printf("[-] Failed to LOOP_SET_FD: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Loop device %s setup\n", loop_name);

    close(loop_fd);
    close(file_fd);

    mkdir("/tmp/mnt", 0777);
    
    usleep(250000); 
    
    int retries = 100;
    int mount_ret = -1;
    while (retries--) {
        mount_ret = mount(loop_name, "/tmp/mnt", "ntfs3", 0, "");
        if (mount_ret == 0) {
            break;
        }
        if (errno != EBUSY) {
            printf("[-] mount failed with unexpected error: %s\n", strerror(errno));
            break;
        }
        usleep(50000);
    }

    if (mount_ret != 0) {
        printf("[-] mount failed after retries\n");
        exit(1);
    }
    printf("[+] Mounted NTFS image\n");

    fd = open("/tmp/mnt/test", O_RDWR);
    if (fd < 0) {
        printf("[-] Failed to open /tmp/mnt/test: %s\n", strerror(errno));
        exit(1);
    }
    printf("[+] Opened /tmp/mnt/test\n");

    pthread_t t1;
    pthread_t t2[4];
    pthread_create(&t1, NULL, truncate_thread, NULL);
    for (int i = 0; i < 4; i++) {
        pthread_create(&t2[i], NULL, read_thread, NULL);
    }

    sleep(5);
    stop = 1;
    
    pthread_join(t1, NULL);
    for (int i = 0; i < 4; i++) {
        pthread_join(t2[i], NULL);
    }

    close(fd);
    umount2("/tmp/mnt", MNT_FORCE | MNT_DETACH);
    
    loop_c_fd = open("/dev/loop-control", O_RDWR);
    if (loop_c_fd >= 0) {
        ioctl(loop_c_fd, LOOP_CTL_REMOVE, loop_num);
        close(loop_c_fd);
    }

    printf("[+] Done\n");

    return 0;
}





8/2 2026/09/17 10:36 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 15688
							output: 38
							thoughts: 310
						

Thoughts:
**Debugging a File System Crash**

Okay, so I've got a crash, and it's happening deep within `iomap_read_inline_data`, specifically in `fs/iomap/buffered-io.c` at line 431. The warning message is pretty clear, `size > iomap->length`. That's not good. I'm reading past the allocated space. Let's see how we got here.

The call trace gives me some clues. It looks like `iomap_read_folio_iter` calls `iomap_read_folio`, which in turn calls `ntfs_read_folio`. The crash originates in `ntfs_read_folio`. Okay, so it seems like there might be an issue with how the NTFS driver is interacting with the I/O mapping layer, which then interacts with the page cache. And `ntfs_read_folio` is using `filemap_read_folio`, so let's check there too.

Now, the reproducer setup is interesting. We're dealing with an NTFS image, a file is opened, and we have two threads doing some pretty aggressive things. The `truncate_thread` is repeatedly calling `ftruncate` – bouncing the file size between 20 and 5 bytes. That's a classic race condition setup. The `read_thread` is then triggering memory pressure with `madvise(DONTNEED)` and `posix_fadvise(DONTNEED)` followed by mmap reads. This indicates the issue has to do with reading from the mmaped file. I need to understand what's happening when the file is truncated and then read from.

I'm going to jump into `fs/iomap/buffered-io.c` around line 431. I need to understand how the I/O map is constructed and whether the size is calculated correctly when the file gets truncated, especially with the NTFS file system. My initial instinct is that the truncation may not be handled properly, creating a race condition between the truncation and the read calls.



9/2 2026/09/17 10:36 tool grepper
0m Args:
map[Expression:size > iomap->length PathPrefix:fs/iomap/buffered-io.c]

Results:
map[Output:fs/iomap/buffered-io.c=418=static int iomap_read_inline_data(const struct iomap_iter *iter,
--
fs/iomap/buffered-io.c-430-
fs/iomap/buffered-io.c:431:	if (WARN_ON_ONCE(size > iomap->length)) {
fs/iomap/buffered-io.c-432-		fserror_report_io(iter->inode, FSERR_BUFFERED_READ,
]

10/2 2026/09/17 10:36 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 16627
							output: 39
							thoughts: 29
						

Thoughts:
Here's my summary, as though I'm reading and thinking about the code:

**Diving into `iomap_read_inline_data`**

Okay, time to dig into `fs/iomap/buffered-io.c` and take a look at `iomap_read_inline_data`. This function, from the looks of it, is crucial for handling inline data during reads, right? It's the point where we determine how to access the data that might be embedded directly within the inode itself, rather than needing a separate disk block. I need to be sure I've got a good grasp on how this interacts with the rest of the buffered I/O system, particularly when dealing with the possibility of partially filled inline extents or how it is that the data is extracted.

I immediately want to understand how it deals with the various edge cases – what if the requested read crosses the boundary of the inline data? Does it intelligently handle partial reads from the inline portion and then seamlessly transition to disk? Does it check for corrupt data or errors? I'm assuming there's some kind of sanity check on the length of the inline data before it gets processed. 

I'm expecting to see a lot of pointer arithmetic and bit manipulation in this function. This is, after all, where we're efficiently pulling data directly from memory. I'm going to pay close attention to the use of any locking mechanisms. Are there any potential race conditions here with concurrent reads or writes to the same inode? Let's hope the locking strategy is well designed. I'll need to remember how the iomap system works with page cache.

I'm curious about the specific error handling and recovery. Where are the `goto` statements leading, and what are the implications of different error scenarios? Is there a clear path for returning an error back to the caller in a clean and controlled way, without leaking resources? I'm assuming that it is robust.

Finally, I'm interested in how it interacts with the underlying block device layer, if at all. Are there specific calls to block device functions within this function, or does it abstract that away? Alright, let's see how they've done it... let's dive in.



11/2 2026/09/17 10:37 tool read-file
0m Args:
map[File:fs/iomap/buffered-io.c FirstLine:418 LineCount:50]

Results:
map[Contents: 418:	static int iomap_read_inline_data(const struct iomap_iter *iter,
 419:			struct folio *folio)
 420:	{
 421:		const struct iomap *iomap = iomap_iter_srcmap(iter);
 422:		size_t size = i_size_read(iter->inode) - iomap->offset;
 423:		size_t offset = offset_in_folio(folio, iomap->offset);
 424:	
 425:		if (WARN_ON_ONCE(!iomap->inline_data))
 426:			return -EIO;
 427:	
 428:		if (folio_test_uptodate(folio))
 429:			return 0;
 430:	
 431:		if (WARN_ON_ONCE(size > iomap->length)) {
 432:			fserror_report_io(iter->inode, FSERR_BUFFERED_READ,
 433:					  iomap->offset, size, -EIO, GFP_NOFS);
 434:			return -EIO;
 435:		}
 436:		if (offset > 0)
 437:			ifs_alloc(iter->inode, folio, iter->flags);
 438:	
 439:		folio_fill_tail(folio, offset, iomap->inline_data, size);
 440:		iomap_set_range_uptodate(folio, offset, folio_size(folio) - offset);
 441:		return 0;
 442:	}
 443:	
 444:	void iomap_finish_folio_read(struct folio *folio, size_t off, size_t len,
 445:			int error)
 446:	{
 447:		struct iomap_folio_state *ifs = folio->private;
 448:		bool uptodate = !error;
 449:		bool finished = true;
 450:	
 451:		if (error)
 452:			fserror_report_io(folio->mapping->host, FSERR_BUFFERED_READ,
 453:					  folio_pos(folio) + off, len, error,
 454:					  GFP_ATOMIC);
 455:	
 456:		if (ifs) {
 457:			unsigned long flags;
 458:	
 459:			spin_lock_irqsave(&ifs->state_lock, flags);
 460:			if (!error)
 461:				uptodate = ifs_set_range_uptodate(folio, ifs, off, len);
 462:			ifs->read_bytes_pending -= len;
 463:			finished = !ifs->read_bytes_pending;
 464:			spin_unlock_irqrestore(&ifs->state_lock, flags);
 465:		}
 466:	
 467:		if (finished)
]

12/2 2026/09/17 10:37 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 17989
							output: 37
							thoughts: 143
						

Thoughts:
**Analyzing a Potential Read Size Inconsistency**

Okay, so I'm looking at this warning that's popping up, and it seems to be flagged when the calculated `size` exceeds `iomap->length`. Digging deeper, it looks like `size` is essentially the difference between the current file size, obtained through `i_size_read(iter->inode)`, and the `iomap->offset`. On the other hand, `iomap->length` represents the length of the inline data.

Aha! Now I see the possible race condition. If the file size is being concurrently modified, say through an `ftruncate` call, the value returned by `i_size_read(iter->inode)` could easily be larger than it was when `iomap->length` was initially set. This explains how the comparison breaks down. `ftruncate` can definitely influence `i_size`.

My next step is to trace how `iomap->length` is actually populated within `ntfs_read_folio`. That's where I need to focus my attention to understand the complete picture and find a potential solution or protection mechanism.



13/2 2026/09/17 10:37 tool read-file
0m Args:
map[File:fs/ntfs3/inode.c FirstLine:840 LineCount:50]

Results:
map[Contents: 840:			return -EIO;
 841:		}
 842:	
 843:		if (ni->i_valid <= vbo) {
 844:			folio_zero_range(folio, 0, folio_size(folio));
 845:			folio_mark_uptodate(folio);
 846:			folio_unlock(folio);
 847:			return 0;
 848:		}
 849:	
 850:		if (is_compressed(ni)) {
 851:			/* ni_lock is taken inside ni_read_folio_cmpr after page locks */
 852:			err = ni_read_folio_cmpr(ni, folio);
 853:			return err;
 854:		}
 855:	
 856:		iomap_read_folio(&ntfs_iomap_ops, &ctx, NULL);
 857:		return 0;
 858:	}
 859:	
 860:	static void ntfs_readahead(struct readahead_control *rac)
 861:	{
 862:		struct address_space *mapping = rac->mapping;
 863:		struct inode *inode = mapping->host;
 864:		struct ntfs_inode *ni = ntfs_i(inode);
 865:		struct iomap_read_folio_ctx ctx = {
 866:			.ops = &ntfs_iomap_bio_read_ops,
 867:			.rac = rac,
 868:		};
 869:	
 870:		if (is_resident(ni)) {
 871:			/* No readahead for resident. */
 872:			return;
 873:		}
 874:	
 875:		if (is_compressed(ni)) {
 876:			/* No readahead for compressed. */
 877:			return;
 878:		}
 879:	
 880:		iomap_readahead(&ntfs_iomap_ops, &ctx, NULL);
 881:	}
 882:	
 883:	int ntfs_set_size(struct inode *inode, u64 new_size)
 884:	{
 885:		struct super_block *sb = inode->i_sb;
 886:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 887:		struct ntfs_inode *ni = ntfs_i(inode);
 888:		int err;
 889:	
]

14/2 2026/09/17 10:37 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 19134
							output: 26
							thoughts: 14
						

Thoughts:
Okay, let's dive into this. Here's my take on those `ntfs_iomap_ops`:

**Diving into ntfs_iomap_ops**

Alright, so we're looking at `ntfs_iomap_ops`. I'm immediately thinking, "Okay, this is how the NTFS file system interacts with the kernel's I/O mapping infrastructure." We're talking about the low-level details of how NTFS handles data access, probably focusing on direct I/O, extent mapping, and addressing within the file system. I need to refresh my memory on the specifics, but I'm guessing this structure defines the methods for mapping logical blocks within an NTFS file to physical blocks on the underlying storage. It'll probably include functions for things like reading, writing, and potentially, managing sparse files or other optimization strategies specific to NTFS. I expect it covers both regular file I/O and perhaps some handling of metadata access, too. Time to delve in and see what's what!



15/2 2026/09/17 10:38 tool codesearch-find-references
0m Args:
map[Name:ntfs_iomap_ops]

Results:
map[References:<nil> TruncatedOutput:false]

16/2 2026/09/17 10:38 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 19408
							output: 34
							thoughts: 26
						

Thoughts:
Here's my thought process, summarized as you requested:

**Navigating the NTFS Landscape**

Okay, hold on a second. Before I get too deep into this, I need to get my bearings. I'm focusing on the NTFS3 filesystem implementation, and there's a specific data structure or set of operations I need to find the definition of. My initial thought is to zero in on `ntfs_iomap_ops`. That's the key. Now, where would that be located within the kernel sources? My best guess, based on standard kernel organization, is that it'll reside within the `fs/ntfs3/` directory. That's the logical place to start digging. Time to run that search and see what I can unearth.



17/2 2026/09/17 10:38 tool grepper
0m Args:
map[Expression:ntfs_iomap_ops PathPrefix:fs/ntfs3/]

Results:
map[Output:fs/ntfs3/file.c=301=static int ntfs_extend_initialized_size(struct file *file,
--
fs/ntfs3/file.c-317-	err = iomap_zero_range(inode, valid, new_valid - valid, NULL,
fs/ntfs3/file.c:318:			       &ntfs_iomap_ops, &ntfs_iomap_folio_ops, NULL);
fs/ntfs3/file.c-319-	if (err) {
--
fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-556-			err = iomap_zero_range(inode, from, tmp - from, NULL,
fs/ntfs3/file.c:557:					       &ntfs_iomap_ops,
fs/ntfs3/file.c-558-					       &ntfs_iomap_folio_ops, NULL);
--
fs/ntfs3/file.c-574-			err = iomap_zero_range(inode, end_a, end - end_a, NULL,
fs/ntfs3/file.c:575:					       &ntfs_iomap_ops,
fs/ntfs3/file.c-576-					       &ntfs_iomap_folio_ops, NULL);
--
fs/ntfs3/file.c=817=static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
--
fs/ntfs3/file.c-892-
fs/ntfs3/file.c:893:		ret = iomap_dio_rw(iocb, iter, &ntfs_iomap_ops, NULL, dio_flags,
fs/ntfs3/file.c-894-				   NULL, 0);
--
fs/ntfs3/file.c=1239=static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/ntfs3/file.c-1307-
fs/ntfs3/file.c:1308:		ret = iomap_file_buffered_write(iocb, from, &ntfs_iomap_ops,
fs/ntfs3/file.c-1309-						&ntfs_iomap_folio_ops, NULL);
--
fs/ntfs3/file.c-1324-
fs/ntfs3/file.c:1325:	ret = iomap_dio_rw(iocb, from, &ntfs_iomap_ops, NULL,
fs/ntfs3/file.c-1326-			   IOMAP_DIO_FORCE_WAIT, NULL, 0);
--
fs/ntfs3/file.c-1337-		iocb->ki_flags &= ~IOCB_DIRECT;
fs/ntfs3/file.c:1338:		err = iomap_file_buffered_write(iocb, from, &ntfs_iomap_ops,
fs/ntfs3/file.c-1339-						&ntfs_iomap_folio_ops, NULL);
--
fs/ntfs3/file.c=1457=int ntfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
--
fs/ntfs3/file.c-1487-
fs/ntfs3/file.c:1488:	err = iomap_fiemap(inode, fieinfo, start, len, &ntfs_iomap_ops);
fs/ntfs3/file.c-1489-
--
fs/ntfs3/inode.c=763=static sector_t ntfs_bmap(struct address_space *mapping, sector_t block)
--
fs/ntfs3/inode.c-783-
fs/ntfs3/inode.c:784:	return iomap_bmap(mapping, block, &ntfs_iomap_ops);
fs/ntfs3/inode.c-785-}
--
fs/ntfs3/inode.c=826=static int ntfs_read_folio(struct file *file, struct folio *folio)
--
fs/ntfs3/inode.c-855-
fs/ntfs3/inode.c:856:	iomap_read_folio(&ntfs_iomap_ops, &ctx, NULL);
fs/ntfs3/inode.c-857-	return 0;
--
fs/ntfs3/inode.c=860=static void ntfs_readahead(struct readahead_control *rac)
--
fs/ntfs3/inode.c-879-
fs/ntfs3/inode.c:880:	iomap_readahead(&ntfs_iomap_ops, &ctx, NULL);
fs/ntfs3/inode.c-881-}
--
fs/ntfs3/inode.c=2319=static DEFINE_IOMAP_ITER_NEXT_END(ntfs_iomap_next, ntfs_iomap_begin,
--
fs/ntfs3/inode.c-2321-
fs/ntfs3/inode.c:2322:const struct iomap_ops ntfs_iomap_ops = {
fs/ntfs3/inode.c-2323-	.iomap_next	= ntfs_iomap_next,
--
fs/ntfs3/ntfs_fs.h=812=void ntfs_evict_inode(struct inode *inode);
fs/ntfs3/ntfs_fs.h:813:extern const struct iomap_ops ntfs_iomap_ops;
fs/ntfs3/ntfs_fs.h-814-extern const struct iomap_write_ops ntfs_iomap_folio_ops;
]

18/2 2026/09/17 10:38 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 21179
							output: 39
							thoughts: 26
						

Thoughts:
Here's my take on those thoughts, tailored for an expert audience:

**Diving into `ntfs_iomap_begin` in `fs/ntfs3/inode.c`**

Okay, time to dig into the `ntfs_iomap_begin` function. Specifically, I need to revisit the implementation within the `ntfs3` filesystem code, focusing on its role with the inodes. Given the context, I'm expecting this function is where the core logic for mapping logical block addresses (LBAs) to physical disk blocks resides. It's the critical entry point for handling read and write operations, and I need to re-familiarize myself with its intricacies. I want to quickly evaluate how it interacts with the NTFS metadata structures. Specifically, I want to refresh my memory on the handling of attribute lists, extents, and the fragment allocation within the NTFS file system. I anticipate that this function is where the details of sparse files, compression, and encryption (if implemented) will be handled. I also need to make sure I understand how it interacts with the journaling mechanisms if any. Essentially, I'm aiming to quickly map the function's responsibility to the broader IO path within the `ntfs3` driver, making sure I understand the complexities.



19/2 2026/09/17 10:38 tool read-file
0m Args:
map[File:fs/ntfs3/inode.c FirstLine:2200 LineCount:100]

Results:
map[Contents:2200:		case IO_REPARSE_TAG_CLOUD_4:
2201:		case IO_REPARSE_TAG_CLOUD_5:
2202:		case IO_REPARSE_TAG_CLOUD_6:
2203:		case IO_REPARSE_TAG_CLOUD_7:
2204:		case IO_REPARSE_TAG_CLOUD_8:
2205:		case IO_REPARSE_TAG_CLOUD_9:
2206:		case IO_REPARSE_TAG_CLOUD_A:
2207:		case IO_REPARSE_TAG_CLOUD_B:
2208:		case IO_REPARSE_TAG_CLOUD_C:
2209:		case IO_REPARSE_TAG_CLOUD_D:
2210:		case IO_REPARSE_TAG_CLOUD_E:
2211:		case IO_REPARSE_TAG_CLOUD_F:
2212:			err = sizeof("OneDrive") - 1;
2213:			if (err > buflen)
2214:				err = buflen;
2215:			memcpy(buffer, "OneDrive", err);
2216:			goto out;
2217:	
2218:		default:
2219:			if (IsReparseTagMicrosoft(rp->ReparseTag)) {
2220:				/* Unknown Microsoft Tag. */
2221:				goto out;
2222:			}
2223:			if (!IsReparseTagNameSurrogate(rp->ReparseTag) ||
2224:			    size <= sizeof(struct REPARSE_POINT)) {
2225:				goto out;
2226:			}
2227:	
2228:			/* Users tag. */
2229:			uname = Add2Ptr(rp, sizeof(struct REPARSE_POINT));
2230:			ulen = le16_to_cpu(rp->ReparseDataLength) -
2231:			       sizeof(struct REPARSE_POINT);
2232:		}
2233:	
2234:		/* Convert nlen from bytes to UNICODE chars. */
2235:		ulen >>= 1;
2236:	
2237:		/* Check that name is available. */
2238:		if (!ulen || uname + ulen > (__le16 *)Add2Ptr(rp, size))
2239:			goto out;
2240:	
2241:		/* If name is already zero terminated then truncate it now. */
2242:		if (!uname[ulen - 1])
2243:			ulen -= 1;
2244:	
2245:		err = ntfs_utf16_to_nls(sbi, uname, ulen, buffer, buflen);
2246:	
2247:		if (err < 0)
2248:			goto out;
2249:	
2250:		/* Translate Windows '\' into Linux '/'. */
2251:		for (i = 0; i < err; i++) {
2252:			if (buffer[i] == '\\')
2253:				buffer[i] = '/';
2254:		}
2255:	
2256:		/* Always set last zero. */
2257:		buffer[err] = 0;
2258:	
2259:		/* If this is a junction, translate the link target. */
2260:		if (rp->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT)
2261:			err = ntfs_translate_junction(sb, link_de, buffer, err, buflen);
2262:	
2263:	out:
2264:		kfree(to_free);
2265:		return err;
2266:	}
2267:	
2268:	static const char *ntfs_get_link(struct dentry *de, struct inode *inode,
2269:					 struct delayed_call *done)
2270:	{
2271:		int err;
2272:		char *ret;
2273:	
2274:		if (!de)
2275:			return ERR_PTR(-ECHILD);
2276:	
2277:		ret = kmalloc(PAGE_SIZE, GFP_NOFS);
2278:		if (!ret)
2279:			return ERR_PTR(-ENOMEM);
2280:	
2281:		err = ntfs_readlink_hlp(de, inode, ret, PAGE_SIZE);
2282:		if (err < 0) {
2283:			kfree(ret);
2284:			return ERR_PTR(err);
2285:		}
2286:	
2287:		set_delayed_call(done, kfree_link, ret);
2288:	
2289:		return ret;
2290:	}
2291:	
2292:	// clang-format off
2293:	const struct inode_operations ntfs_link_inode_operations = {
2294:		.get_link	= ntfs_get_link,
2295:		.setattr	= ntfs_setattr,
2296:		.listxattr	= ntfs_listxattr,
2297:		.fileattr_get	= ntfs_fileattr_get,
2298:		.fileattr_set	= ntfs_fileattr_set,
2299:	};
]

20/2 2026/09/17 10:38 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 22978
							output: 39
							thoughts: 17
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience and written in the first person:

**Navigating the NTFS I/O Landscape**

Okay, so I'm looking at this code, and my initial instinct is that the crucial bit I need – the `ntfs_iomap_begin` function call – isn't right here. It feels like it's a layer down. I'll need to scroll through the file further. I bet the relevant section is nestled deeper, probably within some more granular I/O handling or error-checking sequence. Time to dive deeper and see where that function is actually invoked or defined. This usually indicates how the lower-level functionality is initialized or accessed within the module.



21/2 2026/09/17 10:38 tool read-file
0m Args:
map[File:fs/ntfs3/inode.c FirstLine:2300 LineCount:100]

Results:
map[Contents:2300:	
2301:	const struct address_space_operations ntfs_aops = {
2302:		.read_folio	= ntfs_read_folio,
2303:		.readahead	= ntfs_readahead,
2304:		.writepages	= ntfs_writepages,
2305:		.bmap		= ntfs_bmap,
2306:		.dirty_folio	= iomap_dirty_folio,
2307:		.migrate_folio	= filemap_migrate_folio,
2308:		.release_folio	= iomap_release_folio,
2309:		.invalidate_folio = iomap_invalidate_folio,
2310:	};
2311:	
2312:	const struct address_space_operations ntfs_aops_cmpr = {
2313:		.read_folio	= ntfs_read_folio,
2314:		.dirty_folio	= iomap_dirty_folio,
2315:		.release_folio	= iomap_release_folio,
2316:		.invalidate_folio = iomap_invalidate_folio,
2317:	};
2318:	
2319:	static DEFINE_IOMAP_ITER_NEXT_END(ntfs_iomap_next, ntfs_iomap_begin,
2320:					  ntfs_iomap_end);
2321:	
2322:	const struct iomap_ops ntfs_iomap_ops = {
2323:		.iomap_next	= ntfs_iomap_next,
2324:	};
2325:	
2326:	const struct iomap_write_ops ntfs_iomap_folio_ops = {
2327:		.put_folio = ntfs_iomap_put_folio,
2328:	};
2329:	// clang-format on
]

22/2 2026/09/17 10:38 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 23720
							output: 26
							thoughts: 14
						

Thoughts:
Here's my thought process, as requested:

**Tracing the Source: ntfs_iomap_begin**

Okay, so I'm trying to get a handle on `ntfs_iomap_begin`. My immediate question is, where is this function actually defined? Knowing the definition is fundamental. It's the starting point for understanding its purpose, its parameters, and how it interacts with the rest of the NTFS driver code. I'll need to locate the header file or source file where the declaration lives. From there I can explore the implementation. I'm already anticipating things like the function's return type and any arguments it takes. Once I see the definition, I can begin to reason about its role within the iomap framework. Is it responsible for preparing an iomap operation, setting up data structures, or something else entirely? The definition will give me the first crucial clue.



23/2 2026/09/17 10:39 tool codesearch-find-references
0m Args:
map[Name:ntfs_iomap_begin]

Results:
map[References:[map[ReferenceKind:takes-address-of ReferencingEntityKind:function ReferencingEntityName:ntfs_iomap_next SourceFile:fs/ntfs3/inode.c SourceLine:2319] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ntfs_writeback_range SourceFile:fs/ntfs3/inode.c SourceLine:1181]] TruncatedOutput:false]

24/2 2026/09/17 10:39 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 24083
							output: 26
							thoughts: 26
						

Thoughts:
Here's my take on those thoughts:

**Analyzing `ntfs_iomap_begin` in `fs/ntfs3/inode.c`**

Okay, time to dig into the `ntfs_iomap_begin` function within the NTFS3 filesystem driver. Specifically, it's located in `fs/ntfs3/inode.c`. I'm guessing this function is central to how the NTFS driver handles I/O mapping – figuring out where data physically resides on the disk for a given inode. I need to understand its role in the overall I/O path. I'm hoping this gives me insights into performance bottlenecks or potential areas for optimization within this layer. Let's see how the NTFS driver manages the block mapping. It’s likely involved in figuring out the on-disk location given the logical offset and size of a file, especially within the context of NTFS’s complex metadata structures and its use of extent-based allocation. It would be a key player for both reads and writes. I'm expecting this function will deal with things like attribute lists, resident data, and the MFT. I'll need to pay close attention to how it handles extent handling, including any potential optimization logic for contiguous extents.



25/2 2026/09/17 10:39 tool codesearch-definition-source
0m Args:
map[Name:ntfs_iomap_begin]

Results:
map[SourceCode: 921:	/*
 922:	 * Function to get mapping vbo -> lbo.
 923:	 * used with:
 924:	 * - iomap_zero_range
 925:	 * - iomap_truncate_page
 926:	 * - iomap_dio_rw
 927:	 * - iomap_file_buffered_write
 928:	 * - iomap_bmap
 929:	 * - iomap_fiemap
 930:	 * - iomap_bio_read_folio
 931:	 * - iomap_bio_readahead
 932:	 */
 933:	static int ntfs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
 934:				    unsigned int flags, struct iomap *iomap,
 935:				    struct iomap *srcmap)
 936:	{
 937:		struct ntfs_inode *ni = ntfs_i(inode);
 938:		struct ntfs_sb_info *sbi = ni->mi.sbi;
 939:		u8 cluster_bits = sbi->cluster_bits;
 940:		CLST vcn = offset >> cluster_bits;
 941:		u32 off = offset & sbi->cluster_mask;
 942:		bool rw = flags & IOMAP_WRITE;
 943:		loff_t endbyte = offset + length;
 944:		void *res = NULL;
 945:		int err;
 946:		CLST lcn, clen, clen_max = 1;
 947:		bool new_clst = false;
 948:		bool no_da;
 949:		bool zero = false;
 950:		if (unlikely(ntfs3_forced_shutdown(sbi->sb)))
 951:			return -EIO;
 952:	
 953:		if (flags & IOMAP_REPORT) {
 954:			if (offset > ntfs_get_maxbytes(ni)) {
 955:				/* called from fiemap/bmap. */
 956:				return -EINVAL;
 957:			}
 958:	
 959:			if (offset >= inode->i_size) {
 960:				/* special code for report. */
 961:				return -ENOENT;
 962:			}
 963:		}
 964:	
 965:		if (IOMAP_ZERO == flags && (endbyte & sbi->cluster_mask)) {
 966:			rw = true;
 967:		} else if (rw) {
 968:			clen_max = bytes_to_cluster(sbi, endbyte) - vcn;
 969:		}
 970:	
 971:		/*
 972:		 * Force to allocate clusters if directIO(write) or writeback_range.
 973:		 * NOTE: attr_data_get_block allocates clusters only for sparse file.
 974:		 * Normal file allocates clusters in attr_set_size.
 975:		*/
 976:		no_da = flags == (IOMAP_DIRECT | IOMAP_WRITE) || srcmap == WB_NO_DA;
 977:	
 978:		err = attr_data_get_block(ni, vcn, clen_max, &lcn, &clen,
 979:					  rw ? &new_clst : NULL, zero, &res, no_da);
 980:	
 981:		if (err) {
 982:			return err;
 983:		}
 984:	
 985:		if (lcn == EOF_LCN) {
 986:			/* request out of file. */
 987:			if (flags & IOMAP_REPORT) {
 988:				/* special code for report. */
 989:				return -ENOENT;
 990:			}
 991:	
 992:			if (rw) {
 993:				/* should never be here. */
 994:				return -EINVAL;
 995:			}
 996:			lcn = SPARSE_LCN;
 997:		}
 998:	
 999:		iomap->flags = new_clst ? IOMAP_F_NEW : 0;
1000:	
1001:		if (lcn == RESIDENT_LCN) {
1002:			if (offset >= clen) {
1003:				if (res)
1004:					__free_page(virt_to_page(res));
1005:				if (flags & IOMAP_REPORT) {
1006:					/* special code for report. */
1007:					return -ENOENT;
1008:				}
1009:				return -EFAULT;
1010:			}
1011:	
1012:			iomap->private = iomap->inline_data = res;
1013:			iomap->type = IOMAP_INLINE;
1014:			iomap->offset = 0;
1015:			iomap->length = clen; /* resident size in bytes. */
1016:			return 0;
1017:		}
1018:	
1019:		if (!clen) {
1020:			/* broken file? */
1021:			return -EINVAL;
1022:		}
1023:	
1024:		iomap->bdev = inode->i_sb->s_bdev;
1025:		iomap->offset = offset;
1026:		iomap->length = ((loff_t)clen << cluster_bits) - off;
1027:	
1028:		if (lcn == COMPRESSED_LCN) {
1029:			/* should never be here. */
1030:			return -EOPNOTSUPP;
1031:		}
1032:	
1033:		if (lcn == DELALLOC_LCN) {
1034:			iomap->type = IOMAP_DELALLOC;
1035:			iomap->addr = IOMAP_NULL_ADDR;
1036:		} else {
1037:			/* Translate clusters into bytes. */
1038:			iomap->addr = ((loff_t)lcn << cluster_bits) + off;
1039:			if (length && iomap->length > length)
1040:				iomap->length = length;
1041:			else
1042:				endbyte = offset + iomap->length;
1043:	
1044:			if (lcn == SPARSE_LCN) {
1045:				iomap->addr = IOMAP_NULL_ADDR;
1046:				iomap->type = IOMAP_HOLE;
1047:				//			if (IOMAP_ZERO == flags && !off) {
1048:				//				iomap->length = (endbyte - offset) &
1049:				//						sbi->cluster_mask_inv;
1050:				//			}
1051:			} else if (endbyte <= ni->i_valid) {
1052:				iomap->type = IOMAP_MAPPED;
1053:			} else if (offset < ni->i_valid) {
1054:				iomap->type = IOMAP_MAPPED;
1055:				if (flags & IOMAP_REPORT)
1056:					iomap->length = ni->i_valid - offset;
1057:			} else if (rw || (flags & IOMAP_ZERO)) {
1058:				iomap->type = IOMAP_MAPPED;
1059:			} else {
1060:				iomap->type = IOMAP_UNWRITTEN;
1061:			}
1062:		}
1063:	
1064:		if ((flags & IOMAP_ZERO) &&
1065:		    (iomap->type == IOMAP_MAPPED || iomap->type == IOMAP_DELALLOC)) {
1066:			/* Avoid too large requests. */
1067:			u32 tail;
1068:			u32 off_a = offset & (PAGE_SIZE - 1);
1069:			if (off_a)
1070:				tail = PAGE_SIZE - off_a;
1071:			else
1072:				tail = PAGE_SIZE;
1073:	
1074:			if (iomap->length > tail)
1075:				iomap->length = tail;
1076:		}
1077:	
1078:		return 0;
1079:	}
 SourceFile:fs/ntfs3/inode.c]

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

Tokens:
							input: 26834
							output: 25
							thoughts: 204
						

Thoughts:
**Analyzing the NTFS I/O Mapping Process**

Okay, so I'm diving into this `ntfs_iomap_begin` function and trying to grasp its logic. The crucial part, it seems, hinges on the `lcn` value. If `lcn` is `RESIDENT_LCN`, that suggests we're dealing with inline data – data stored directly within the attribute itself.

I'm checking the offset and comparing it to `clen`, which, as I recall from previous work with NTFS, is set by the `attr_data_get_block` function. Makes sense; `clen` likely represents the length of the resident data.

If the offset exceeds `clen`, then we have a problem. The code checks if `res` exists, and frees it if it does. If this is a report, then it should report ENOENT. Otherwise, return EFAULT.

However, if offset is within `clen`, we're in a happy path for inline data. `iomap->private` and `iomap->inline_data` are both set to the resident data pointed to by `res`. The `iomap` structure is then configured to indicate an `IOMAP_INLINE` type, with the offset set to zero and the length set to `clen`. Finally, the function returns success. So the basic idea here is efficient inline data handling, which is a key optimization in NTFS, making sure that it can quickly serve requests for attributes that are small enough to be stored in the MFT entry itself.



27/2 2026/09/17 10:39 tool codesearch-definition-source
0m Args:
map[Name:attr_data_get_block]

Results:
map[SourceCode: 942:	/*
 943:	 * attr_data_get_block - Returns 'lcn' and 'len' for given 'vcn'.
 944:	 *
 945:	 * @new == NULL means just to get current mapping for 'vcn'
 946:	 * @new != NULL means allocate real cluster if 'vcn' maps to hole
 947:	 * @zero - zeroout new allocated clusters
 948:	 *
 949:	 *  NOTE:
 950:	 *  - @new != NULL is called only for sparsed or compressed attributes.
 951:	 *  - new allocated clusters are zeroed via blkdev_issue_zeroout.
 952:	 */
 953:	int attr_data_get_block(struct ntfs_inode *ni, CLST vcn, CLST clen, CLST *lcn,
 954:				CLST *len, bool *new, bool zero, void **res, bool no_da)
 955:	{
 956:		int err;
 957:	
 958:		if (new)
 959:			*new = false;
 960:		if (res)
 961:			*res = NULL;
 962:	
 963:		/* Try to find in cache. */
 964:		down_read(&ni->file.run_lock);
 965:		if (run_lookup_entry_da(&ni->file.run, !no_da ? &ni->file.run_da : NULL,
 966:					vcn, lcn, len)) {
 967:		} else {
 968:			*len = 0;
 969:		}
 970:		up_read(&ni->file.run_lock);
 971:	
 972:		if (*len && (*lcn != SPARSE_LCN || !new))
 973:			return 0; /* Fast normal way without allocation. */
 974:	
 975:		/* No cluster in cache or we need to allocate cluster in hole. */
 976:		ni_lock(ni);
 977:		down_write(&ni->file.run_lock);
 978:	
 979:		err = attr_data_get_block_locked(ni, vcn, clen, lcn, len, new, zero,
 980:						 res, no_da);
 981:	
 982:		up_write(&ni->file.run_lock);
 983:		ni_unlock(ni);
 984:	
 985:		return err;
 986:	}
 SourceFile:fs/ntfs3/attrib.c]

28/2 2026/09/17 10:39 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 28121
							output: 27
							thoughts: 15
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm deep in the weeds of some low-level system code.

**Diving into `attr_data_get_block_locked`**

Alright, so the focus is now on `attr_data_get_block_locked`. That function name alone tells me a lot. We're talking about *attribute data*, which means metadata, descriptors, something tied to a specific object or file system entity. The "get" implies we're retrieving this data. The "block" suggests we're probably dealing with data organized in some kind of block structure, likely on-disk or in a memory-mapped region. And the "locked" part is critical. This means we're in a multithreaded environment, and we're dealing with synchronization primitives. We're likely holding some kind of mutex or spinlock to safely access this critical section. I need to understand this function's exact purpose within the larger data access scheme. I'm going to have to consider potential race conditions, deadlocks, and whether it's optimized for the target hardware. My next step will be to look at the function's definition, the surrounding context, and what it's trying to achieve – is it atomic, transactional, or something more complex? I need to analyze how this function interacts with the underlying storage and other concurrent processes.



29/2 2026/09/17 10:40 tool codesearch-definition-source
0m Args:
map[Name:attr_data_get_block_locked]

Results:
map[SourceCode: 988:	/*
 989:	 * attr_data_get_block_locked - Helper for attr_data_get_block.
 990:	 */
 991:	int attr_data_get_block_locked(struct ntfs_inode *ni, CLST vcn, CLST clen,
 992:				       CLST *lcn, CLST *len, bool *new, bool zero,
 993:				       void **res, bool no_da)
 994:	{
 995:		int err = 0;
 996:		struct ntfs_sb_info *sbi = ni->mi.sbi;
 997:		struct runs_tree *run = &ni->file.run;
 998:		struct runs_tree *run_da = &ni->file.run_da;
 999:		bool da = sbi->options->delalloc && !no_da;
1000:		u8 cluster_bits;
1001:		struct ATTRIB *attr, *attr_b;
1002:		struct ATTR_LIST_ENTRY *le, *le_b;
1003:		struct mft_inode *mi, *mi_b;
1004:		CLST hint, svcn, to_alloc, evcn1, next_svcn, asize, end, vcn0;
1005:		CLST alloc, evcn;
1006:		unsigned fr;
1007:		u64 total_size, total_size0;
1008:		int step;
1009:	
1010:	again:
1011:		if (run_lookup_entry_da(run, da ? &ni->file.run_da : NULL, vcn, lcn,
1012:					len)) {
1013:		} else {
1014:			*len = 0;
1015:		}
1016:	
1017:		if (*len) {
1018:			if (*lcn != SPARSE_LCN || !new)
1019:				goto out; /* normal way without allocation. */
1020:			if (clen > *len)
1021:				clen = *len;
1022:		}
1023:	
1024:		cluster_bits = sbi->cluster_bits;
1025:		step = 0;
1026:	
1027:		le_b = NULL;
1028:		attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA, ni->file.ads.name,
1029:				      ni->file.ads.len, NULL, &mi_b);
1030:		if (!attr_b) {
1031:			err = -ENOENT;
1032:			goto out;
1033:		}
1034:	
1035:		if (!attr_b->non_res) {
1036:			u32 data_size = le32_to_cpu(attr_b->res.data_size);
1037:			*lcn = RESIDENT_LCN;
1038:			*len = data_size;
1039:			if (res) {
1040:				*res = NULL;
1041:				if (data_size) {
1042:					struct page *page = alloc_page(GFP_KERNEL);
1043:					if (!page) {
1044:						err = -ENOMEM;
1045:						goto out;
1046:					}
1047:	
1048:					*res = page_address(page);
1049:					memcpy(*res, resident_data(attr_b), data_size);
1050:				}
1051:			}
1052:			goto out;
1053:		}
1054:	
1055:		asize = le64_to_cpu(attr_b->nres.alloc_size) >> cluster_bits;
1056:		if (vcn >= asize) {
1057:			if (new) {
1058:				err = -EINVAL;
1059:			} else {
1060:				*len = 1;
1061:				*lcn = EOF_LCN;
1062:			}
1063:			goto out;
1064:		}
1065:	
1066:		svcn = le64_to_cpu(attr_b->nres.svcn);
1067:		evcn1 = le64_to_cpu(attr_b->nres.evcn) + 1;
1068:	
1069:		attr = attr_b;
1070:		le = le_b;
1071:		mi = mi_b;
1072:	
1073:		if (le_b && (vcn < svcn || evcn1 <= vcn)) {
1074:			attr = ni_find_attr(ni, attr_b, &le, ATTR_DATA,
1075:					    ni->file.ads.name, ni->file.ads.len, &vcn,
1076:					    &mi);
1077:			if (!attr) {
1078:				err = -EINVAL;
1079:				goto out;
1080:			}
1081:			svcn = le64_to_cpu(attr->nres.svcn);
1082:			evcn1 = le64_to_cpu(attr->nres.evcn) + 1;
1083:		}
1084:	
1085:		/* Load in cache actual information. */
1086:		err = attr_load_runs(attr, ni, run, NULL);
1087:		if (err)
1088:			goto out;
1089:	
1090:		/* Check for compressed frame. */
1091:		err = attr_is_frame_compressed(ni, attr_b, vcn >> NTFS_LZNT_CUNIT,
1092:					       &hint, run);
1093:		if (err)
1094:			goto out;
1095:	
1096:		if (hint) {
1097:			/* if frame is compressed - don't touch it. */
1098:			*lcn = COMPRESSED_LCN;
1099:			/* length to the end of frame. */
1100:			*len = NTFS_LZNT_CLUSTERS - (vcn & (NTFS_LZNT_CLUSTERS - 1));
1101:			err = 0;
1102:			goto out;
1103:		}
1104:	
1105:		if (!*len) {
1106:			if (run_lookup_entry_da(run, da ? run_da : NULL, vcn, lcn,
1107:						len)) {
1108:				if (*lcn != SPARSE_LCN || !new)
1109:					goto ok; /* Slow normal way without allocation. */
1110:	
1111:				if (clen > *len)
1112:					clen = *len;
1113:			} else if (!new) {
1114:				/* Here we may return -ENOENT.
1115:				 * In any case caller gets zero length. */
1116:				goto ok;
1117:			}
1118:		}
1119:	
1120:		if (!is_attr_ext(attr_b)) {
1121:			/* The code below only for sparsed or compressed attributes. */
1122:			err = -EINVAL;
1123:			goto out;
1124:		}
1125:	
1126:		vcn0 = vcn;
1127:		to_alloc = clen;
1128:		fr = (sbi->record_size - le32_to_cpu(mi->mrec->used) + 8) / 3 + 1;
1129:		/* Allocate frame aligned clusters.
1130:		 * ntfs.sys usually uses 16 clusters per frame for sparsed or compressed.
1131:		 * ntfs3 uses 1 cluster per frame for new created sparsed files. */
1132:		if (attr_b->nres.c_unit) {
1133:			CLST clst_per_frame = 1u << attr_b->nres.c_unit;
1134:			CLST cmask = ~(clst_per_frame - 1);
1135:	
1136:			/* Get frame aligned vcn and to_alloc. */
1137:			vcn = vcn0 & cmask;
1138:			to_alloc = ((vcn0 + clen + clst_per_frame - 1) & cmask) - vcn;
1139:			if (fr < clst_per_frame)
1140:				fr = clst_per_frame;
1141:			if (vcn != vcn0)
1142:				zero = true;
1143:	
1144:			/* Check if 'vcn' and 'vcn0' in different attribute segments. */
1145:			if (vcn < svcn || evcn1 <= vcn) {
1146:				struct ATTRIB *attr2;
1147:				/* Load runs for truncated vcn. */
1148:				attr2 = ni_find_attr(ni, attr_b, &le_b, ATTR_DATA,
1149:						     ni->file.ads.name,
1150:						     ni->file.ads.len, &vcn, &mi);
1151:				if (!attr2) {
1152:					err = -EINVAL;
1153:					goto out;
1154:				}
1155:				evcn1 = le64_to_cpu(attr2->nres.evcn) + 1;
1156:				err = attr_load_runs(attr2, ni, run, NULL);
1157:				if (err)
1158:					goto out;
1159:			}
1160:	
1161:			if (vcn0 < svcn || evcn1 <= vcn0) {
1162:				struct ATTRIB *attr2;
1163:	
1164:				attr2 = ni_find_attr(ni, attr_b, &le_b, ATTR_DATA,
1165:						     ni->file.ads.name,
1166:						     ni->file.ads.len, &vcn0, &mi);
1167:				if (!attr2) {
1168:					err = -EINVAL;
1169:					goto out;
1170:				}
1171:				err = attr_load_runs(attr2, ni, run, NULL);
1172:				if (err)
1173:					goto out;
1174:			}
1175:	
1176:			da = false; /* no delalloc for compressed file. */
1177:		}
1178:	
1179:		if (vcn + to_alloc > asize)
1180:			to_alloc = asize - vcn;
1181:	
1182:		if (da) {
1183:			CLST rlen1, rlen2;
1184:			if (!ntfs_check_free_space(sbi, to_alloc, 0, true)) {
1185:				err = ni_allocate_da_blocks_locked(ni);
1186:				if (err)
1187:					goto out;
1188:				/* Layout of records may be changed. Start again without 'da'. */
1189:				da = false;
1190:				goto again;
1191:			}
1192:	
1193:			/* run_add_entry consolidates existed ranges. */
1194:			rlen1 = run_len(run_da);
1195:			if (!run_add_entry(run_da, vcn, SPARSE_LCN, to_alloc, false)) {
1196:				err = -ENOMEM;
1197:				goto out;
1198:			}
1199:			rlen2 = run_len(run_da);
1200:	
1201:			/* new added delay clusters = rlen2 - rlen1. */
1202:			ntfs_add_da(sbi, rlen2 - rlen1);
1203:			*len = to_alloc;
1204:			*lcn = DELALLOC_LCN;
1205:			goto ok;
1206:		}
1207:	
1208:		/* Get the last LCN to allocate from. */
1209:		hint = 0;
1210:	
1211:		if (vcn > evcn1) {
1212:			if (!run_add_entry(run, evcn1, SPARSE_LCN, vcn - evcn1,
1213:					   false)) {
1214:				err = -ENOMEM;
1215:				goto out;
1216:			}
1217:		} else if (vcn && !run_lookup_entry(run, vcn - 1, &hint, NULL, NULL)) {
1218:			hint = -1;
1219:		}
1220:	
1221:		/* Allocate and zeroout new clusters. */
1222:		err = attr_allocate_clusters(sbi, run, run_da, vcn, hint + 1, to_alloc,
1223:					     NULL,
1224:					     zero ? ALLOCATE_ZERO : ALLOCATE_ONE_FR,
1225:					     len, fr, lcn, len);
1226:		if (err)
1227:			goto out;
1228:		*new = true;
1229:		step = 1;
1230:	
1231:		end = vcn + *len;
1232:		/* Save 'total_size0' to restore if error. */
1233:		total_size0 = le64_to_cpu(attr_b->nres.total_size);
1234:		total_size = total_size0 + ((u64)*len << cluster_bits);
1235:	
1236:		if (vcn != vcn0) {
1237:			if (!run_lookup_entry(run, vcn0, lcn, len, NULL)) {
1238:				err = -EINVAL;
1239:				goto out;
1240:			}
1241:			if (*lcn == SPARSE_LCN) {
1242:				/* Internal error. Should not happened. */
1243:				WARN_ON(1);
1244:				err = -EINVAL;
1245:				goto out;
1246:			}
1247:			/* Check case when vcn0 + len overlaps new allocated clusters. */
1248:			if (vcn0 + *len > end)
1249:				*len = end - vcn0;
1250:		}
1251:	
1252:	repack:
1253:		err = mi_pack_runs(mi, attr, run, max(end, evcn1) - svcn);
1254:		if (err)
1255:			goto out;
1256:	
1257:		attr_b->nres.total_size = cpu_to_le64(total_size);
1258:		inode_set_bytes(&ni->vfs_inode, total_size);
1259:		ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
1260:	
1261:		mi_b->dirty = true;
1262:		mark_inode_dirty(&ni->vfs_inode);
1263:	
1264:		/* Stored [vcn : next_svcn) from [vcn : end). */
1265:		next_svcn = le64_to_cpu(attr->nres.evcn) + 1;
1266:	
1267:		if (end <= evcn1) {
1268:			if (next_svcn == evcn1) {
1269:				/* Normal way. Update attribute and exit. */
1270:				goto ok;
1271:			}
1272:			/* Add new segment [next_svcn : evcn1 - next_svcn). */
1273:			if (!ni->attr_list.size) {
1274:				err = ni_create_attr_list(ni);
1275:				if (err)
1276:					goto undo1;
1277:				/* Layout of records is changed. */
1278:				le_b = NULL;
1279:				attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA,
1280:						      ni->file.ads.name,
1281:						      ni->file.ads.len, NULL, &mi_b);
1282:				if (!attr_b) {
1283:					err = -ENOENT;
1284:					goto out;
1285:				}
1286:	
1287:				attr = attr_b;
1288:				le = le_b;
1289:				mi = mi_b;
1290:				goto repack;
1291:			}
1292:		}
1293:	
1294:		/*
1295:		 * The code below may require additional cluster (to extend attribute list)
1296:		 * and / or one MFT record
1297:		 * It is too complex to undo operations if -ENOSPC occurs deep inside
1298:		 * in 'ni_insert_nonresident'.
1299:		 * Return in advance -ENOSPC here if there are no free cluster and no free MFT.
1300:		 */
1301:		if (!ntfs_check_free_space(sbi, 1, 1, false)) {
1302:			/* Undo step 1. */
1303:			err = -ENOSPC;
1304:			goto undo1;
1305:		}
1306:	
1307:		step = 2;
1308:		svcn = evcn1;
1309:	
1310:		/* Estimate next attribute. */
1311:		attr = ni_find_attr(ni, attr, &le, ATTR_DATA, ni->file.ads.name,
1312:				    ni->file.ads.len, &svcn, &mi);
1313:	
1314:		if (!attr) {
1315:			/* Insert new attribute segment. */
1316:			goto ins_ext;
1317:		}
1318:	
1319:		/* Try to update existed attribute segment. */
1320:		alloc = bytes_to_cluster(sbi, le64_to_cpu(attr_b->nres.alloc_size));
1321:		evcn = le64_to_cpu(attr->nres.evcn);
1322:	
1323:		if (end < next_svcn)
1324:			end = next_svcn;
1325:		while (end > evcn) {
1326:			/* Remove segment [svcn : evcn). */
1327:			mi_remove_attr(NULL, mi, attr);
1328:	
1329:			if (!al_remove_le(ni, le)) {
1330:				err = -EINVAL;
1331:				goto out;
1332:			}
1333:	
1334:			if (evcn + 1 >= alloc) {
1335:				/* Last attribute segment. */
1336:				evcn1 = evcn + 1;
1337:				goto ins_ext;
1338:			}
1339:	
1340:			if (ni_load_mi(ni, le, &mi)) {
1341:				attr = NULL;
1342:				goto out;
1343:			}
1344:	
1345:			attr = mi_find_attr(ni, mi, NULL, ATTR_DATA, ni->file.ads.name,
1346:					    ni->file.ads.len, &le->id);
1347:			if (!attr) {
1348:				err = -EINVAL;
1349:				goto out;
1350:			}
1351:			svcn = le64_to_cpu(attr->nres.svcn);
1352:			evcn = le64_to_cpu(attr->nres.evcn);
1353:		}
1354:	
1355:		if (end < svcn)
1356:			end = svcn;
1357:	
1358:		err = attr_load_runs(attr, ni, run, &end);
1359:		if (err)
1360:			goto out;
1361:	
1362:		evcn1 = evcn + 1;
1363:		attr->nres.svcn = cpu_to_le64(next_svcn);
1364:		err = mi_pack_runs(mi, attr, run, evcn1 - next_svcn);
1365:		if (err)
1366:			goto out;
1367:	
1368:		le->vcn = cpu_to_le64(next_svcn);
1369:		ni->attr_list.dirty = true;
1370:		mi->dirty = true;
1371:		next_svcn = le64_to_cpu(attr->nres.evcn) + 1;
1372:	
1373:	ins_ext:
1374:		if (evcn1 > next_svcn) {
1375:			err = ni_insert_nonresident(ni, ATTR_DATA, ni->file.ads.name,
1376:						    ni->file.ads.len, run, next_svcn,
1377:						    evcn1 - next_svcn, attr_b->flags,
1378:						    &attr, &mi, NULL);
1379:			if (err)
1380:				goto out;
1381:		}
1382:	ok:
1383:		run_truncate_around(run, vcn);
1384:	out:
1385:		if (err && step > 1) {
1386:			/* Too complex to restore. */
1387:			_ntfs_bad_inode(&ni->vfs_inode);
1388:		}
1389:	
1390:		return err;
1391:	
1392:	undo1:
1393:		/* Undo step1. */
1394:		attr_b->nres.total_size = cpu_to_le64(total_size0);
1395:		inode_set_bytes(&ni->vfs_inode, total_size0);
1396:	
1397:		if (run_deallocate_ex(sbi, run, vcn, *len, NULL, false, run_da) ||
1398:		    !run_add_entry(run, vcn, SPARSE_LCN, *len, false) ||
1399:		    mi_pack_runs(mi, attr, run, max(end, evcn1) - svcn)) {
1400:			_ntfs_bad_inode(&ni->vfs_inode);
1401:		}
1402:		goto out;
1403:	}
 SourceFile:fs/ntfs3/attrib.c]

30/2 2026/09/17 10:40 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 34883
							output: 24
							thoughts: 888
						

Thoughts:
**Analyzing a Potential Race Condition in NTFS Resident Attribute Handling**

Okay, let's break this down. My initial thought process is centered around a discrepancy I'm seeing with resident attributes in the NTFS file system. Specifically, in the `iomap_read_inline_data` function, a warning is triggered if the size of the data being read (`i_size_read(iter->inode)`) exceeds the expected resident data size (`iomap->length`). The flow goes like this: `attr_data_get_block_locked` determines if an attribute is resident and, if so, sets `iomap->length` (ultimately derived from `data_size`) in `ntfs_iomap_begin`. Then, `iomap_read_inline_data` is called.

The problem is, the reproducer triggers this warning via `ftruncate(fd, 20)` followed by `ftruncate(fd, 5)`. The file's resident, meaning its data is stored directly within the attribute itself. The `ftruncate` calls are key here. I initially thought it was a concurrency issue where `i_size` was altered under the read call, as `ftruncate` takes `inode_lock`. But `read` doesn't take the `inode_lock`. It takes the `folio_lock` and uses `i_size_read`, so there *is* a race. The `inode_lock` protects the `i_size`, but `i_size` is read without the lock by `read` or functions in its stack!

So, the critical question is: how can `i_size_read(iter->inode)` grow to be *larger* than the resident `data_size`? And the answer is the concurrency. The read occurs while `ftruncate` is running, changing the value of `i_size` because it's not protected by the `inode_lock`! 

The next step is to examine `ntfs_set_size` or `ntfs_truncate` to better understand the ordering of operations. Specifically, how is `data_size` updated in the resident attribute, and is it updated before or after `i_size` is changed? That will tell me if the `ftruncate` function can alter the `i_size` during a read.



31/2 2026/09/17 10:40 tool codesearch-definition-source
0m Args:
map[Name:ntfs_set_size]

Results:
map[SourceCode: 883:	int ntfs_set_size(struct inode *inode, u64 new_size)
 884:	{
 885:		struct super_block *sb = inode->i_sb;
 886:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 887:		struct ntfs_inode *ni = ntfs_i(inode);
 888:		int err;
 889:	
 890:		/* Check for maximum file size. */
 891:		if (is_sparsed(ni) || is_compressed(ni)) {
 892:			if (new_size > sbi->maxbytes_sparse) {
 893:				return -EFBIG;
 894:			}
 895:		} else if (new_size > sbi->maxbytes) {
 896:			return -EFBIG;
 897:		}
 898:	
 899:		/* Mark rw ntfs as dirty. It will be cleared at umount. */
 900:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 901:	
 902:		ni_lock(ni);
 903:		down_write(&ni->file.run_lock);
 904:		if (new_size < ni->i_valid)
 905:			ni->i_valid = new_size;
 906:	
 907:		/* last 'true' means keep preallocated. */
 908:		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
 909:				    &ni->file.run, new_size, &ni->i_valid, true);
 910:	
 911:		up_write(&ni->file.run_lock);
 912:		ni_unlock(ni);
 913:	
 914:		return err;
 915:	}
 SourceFile:fs/ntfs3/inode.c]

32/2 2026/09/17 10:40 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 36867
							output: 23
							thoughts: 11
						

Thoughts:
Okay, here's my interpretation of "Let's see `attr_set_size`", summarized as though it's my own thought process, assuming I'm an expert:

**Investigating `attr_set_size`**

Alright, the code's pointing me at `attr_set_size`. Immediately, my brain kicks into gear. My initial thought is probably, "Okay, `attr_set_size`... that's dealing with the size, the *capacity*, of a set of attributes, right?" I'm mentally picturing the underlying data structure – likely a bitset or a more complex hash table internally, depending on the implementation – and its associated storage requirements.

My next step depends on the *context*. Am I looking at an allocation issue? A performance bottleneck? Or perhaps debugging a memory leak? If it's allocation, I'm thinking, "Is this the *initial* size, or is it the *current* used size, or something else entirely?" If it's performance, I'm asking myself, "Is the size optimal for the expected usage pattern? Are we wasting memory, or are we experiencing frequent re-allocations?"

I need more context. I'm going to quickly reference the documentation, if I have it, to see what this function *actually* does. Specifically, I'll need to know:
*   Does this reflect allocated memory (as opposed to used/occupied)?
*   Is this exposed to the user, or an internal measure for the library?
*   How is this value used elsewhere in the system?
*   What is its *type*? Integers? Some bespoke attribute size?

Then, the true thinking begins. It is likely I will be doing some of the following:
*   I will have to cross-reference with the other attribute functions.
*   I will be looking at this with a critical eye, questioning any assumptions made in the code.
*   I will have to check all the possible ways this is called in the code.
*   I will consider if there are any race conditions for a multithreaded environment.

Ultimately, my goal is to understand how `attr_set_size` fits into the broader picture and whether it's behaving as expected or, more importantly, *why* it's not. It's a key piece of information, and I need to extract its meaning within this system.



33/2 2026/09/17 10:40 tool codesearch-definition-source
0m Args:
map[Name:attr_set_size]

Results:
map[SourceCode: 473:	static inline int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
 474:					const __le16 *name, u8 name_len,
 475:					struct runs_tree *run, u64 new_size,
 476:					const u64 *new_valid, bool keep_prealloc)
 477:	{
 478:		return attr_set_size_ex(ni, type, name, name_len, run, new_size,
 479:					new_valid, keep_prealloc, NULL, false);
 480:	}
 SourceFile:fs/ntfs3/ntfs_fs.h]

34/2 2026/09/17 10:40 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 37613
							output: 25
							thoughts: 13
						

Thoughts:
Okay, let's break this down. Here's my perspective on this specific point, tailored for someone who knows their stuff:

**Diving into `attr_set_size_ex`**

Alright, so the focus is on `attr_set_size_ex`. I immediately start thinking about its purpose. From the name itself, I can infer this is probably related to determining the size or capacity of a specific attribute set, and the "ex" suffix probably suggests it's an extended or more detailed version compared to a standard size check. My mind races to the potential implications: Is this a critical piece of memory management? Perhaps it helps optimize storage allocation within a complex data structure? Is there a subtle difference in the information this provides compared to a more basic function that could impact performance if used carelessly? I'm already formulating questions in my head: What specific attributes does this size function consider? Are there any corner cases or potential gotchas that I should immediately consider? And is this particular function going to require careful handling of alignment or data padding to ensure optimal performance? Time to dig into the actual implementation.



35/2 2026/09/17 10:41 tool codesearch-definition-source
0m Args:
map[Name:attr_set_size_ex]

Results:
map[SourceCode: 421:	/*
 422:	 * attr_set_size_ex - Change the size of attribute.
 423:	 *
 424:	 * Extend:
 425:	 *   - Sparse/compressed: No allocated clusters.
 426:	 *   - Normal: Append allocated and preallocated new clusters.
 427:	 * Shrink:
 428:	 *   - No deallocate if @keep_prealloc is set.
 429:	 */
 430:	int attr_set_size_ex(struct ntfs_inode *ni, enum ATTR_TYPE type,
 431:			     const __le16 *name, u8 name_len, struct runs_tree *run,
 432:			     u64 new_size, const u64 *new_valid, bool keep_prealloc,
 433:			     struct ATTRIB **ret, bool no_da)
 434:	{
 435:		int err = 0;
 436:		struct ntfs_inode *nb = ni->base;
 437:		struct ntfs_sb_info *sbi = ni->mi.sbi;
 438:		u8 cluster_bits = sbi->cluster_bits;
 439:		bool is_mft = ni->mi.rno == MFT_REC_MFT && type == ATTR_DATA &&
 440:			      !name_len;
 441:		u64 old_valid, old_size, old_alloc, new_alloc_tmp;
 442:		u64 new_alloc = 0;
 443:		struct ATTRIB *attr = NULL, *attr_b;
 444:		struct ATTR_LIST_ENTRY *le, *le_b;
 445:		struct mft_inode *mi, *mi_b;
 446:		CLST alen, vcn, lcn, new_alen, old_alen, svcn, evcn;
 447:		CLST next_svcn, pre_alloc = -1, done = 0;
 448:		bool is_ext = false, is_bad = false;
 449:		bool dirty = false;
 450:		struct runs_tree *run_da = run == &ni->file.run ? &ni->file.run_da :
 451:								  NULL;
 452:		bool da = !is_mft && sbi->options->delalloc && run_da && !no_da;
 453:		u32 align;
 454:		struct MFT_REC *rec;
 455:	
 456:	again:
 457:		alen = 0;
 458:		le_b = NULL;
 459:		attr_b = ni_find_attr(ni, NULL, &le_b, type, name, name_len, NULL,
 460:				      &mi_b);
 461:		if (!attr_b) {
 462:			err = -ENOENT;
 463:			goto bad_inode;
 464:		}
 465:	
 466:		if (!attr_b->non_res) {
 467:			err = attr_set_size_res(ni, attr_b, le_b, mi_b, new_size, run,
 468:						&attr_b);
 469:			if (err)
 470:				return err;
 471:	
 472:			/* Return if file is still resident. */
 473:			if (!attr_b->non_res) {
 474:				dirty = true;
 475:				goto ok1;
 476:			}
 477:	
 478:			/* Layout of records may be changed, so do a full search. */
 479:			goto again;
 480:		}
 481:	
 482:		is_ext = is_attr_ext(attr_b);
 483:		align = sbi->cluster_size;
 484:		if (is_ext) {
 485:			align <<= attr_b->nres.c_unit;
 486:			keep_prealloc = false;
 487:			da = false;
 488:		}
 489:	
 490:		old_valid = le64_to_cpu(attr_b->nres.valid_size);
 491:		old_size = le64_to_cpu(attr_b->nres.data_size);
 492:		old_alloc = le64_to_cpu(attr_b->nres.alloc_size);
 493:	
 494:	again_1:
 495:		old_alen = old_alloc >> cluster_bits;
 496:	
 497:		new_alloc = (new_size + align - 1) & ~(u64)(align - 1);
 498:		new_alen = new_alloc >> cluster_bits;
 499:	
 500:		if (keep_prealloc && new_size < old_size) {
 501:			attr_b->nres.data_size = cpu_to_le64(new_size);
 502:			mi_b->dirty = dirty = true;
 503:			goto ok;
 504:		}
 505:	
 506:		if (da &&
 507:		    (vcn = old_alen + run_len(&ni->file.run_da), new_alen > vcn)) {
 508:			/* Resize up normal file. Delay new clusters allocation. */
 509:			alen = new_alen - vcn;
 510:	
 511:			if (ntfs_check_free_space(sbi, alen, 0, true)) {
 512:				if (!run_add_entry(&ni->file.run_da, vcn, SPARSE_LCN,
 513:						   alen, false)) {
 514:					err = -ENOMEM;
 515:					goto out;
 516:				}
 517:	
 518:				ntfs_add_da(sbi, alen);
 519:				goto ok1;
 520:			}
 521:		}
 522:	
 523:		if (!keep_prealloc && run_da && run_da->count &&
 524:		    (vcn = run_get_max_vcn(run_da), new_alen < vcn)) {
 525:			/* Shrink delayed clusters. */
 526:	
 527:			/* Try to remove fragment from delay allocated run. */
 528:			if (!run_remove_range(run_da, new_alen, vcn - new_alen,
 529:					      &alen)) {
 530:				err = -ENOMEM;
 531:				goto out;
 532:			}
 533:	
 534:			ntfs_sub_da(sbi, alen);
 535:		}
 536:	
 537:		vcn = old_alen - 1;
 538:	
 539:		svcn = le64_to_cpu(attr_b->nres.svcn);
 540:		evcn = le64_to_cpu(attr_b->nres.evcn);
 541:	
 542:		if (svcn <= vcn && vcn <= evcn) {
 543:			attr = attr_b;
 544:			le = le_b;
 545:			mi = mi_b;
 546:		} else if (!le_b) {
 547:			err = -EINVAL;
 548:			goto bad_inode;
 549:		} else {
 550:			le = le_b;
 551:			attr = ni_find_attr(ni, attr_b, &le, type, name, name_len, &vcn,
 552:					    &mi);
 553:			if (!attr) {
 554:				err = -EINVAL;
 555:				goto bad_inode;
 556:			}
 557:	
 558:	next_le_1:
 559:			svcn = le64_to_cpu(attr->nres.svcn);
 560:			evcn = le64_to_cpu(attr->nres.evcn);
 561:		}
 562:		/*
 563:		 * Here we have:
 564:		 * attr,mi,le - last attribute segment (containing 'vcn').
 565:		 * attr_b,mi_b,le_b - base (primary) attribute segment.
 566:		 */
 567:	next_le:
 568:		rec = mi->mrec;
 569:		err = attr_load_runs(attr, ni, run, NULL);
 570:		if (err)
 571:			goto out;
 572:	
 573:		if (new_size > old_size) {
 574:			CLST to_allocate;
 575:			size_t free;
 576:	
 577:			if (new_alloc <= old_alloc) {
 578:				attr_b->nres.data_size = cpu_to_le64(new_size);
 579:				mi_b->dirty = dirty = true;
 580:				goto ok;
 581:			}
 582:	
 583:			/*
 584:			 * Add clusters. In simple case we have to:
 585:			 *  - allocate space (vcn, lcn, len)
 586:			 *  - update packed run in 'mi'
 587:			 *  - update attr->nres.evcn
 588:			 *  - update attr_b->nres.data_size/attr_b->nres.alloc_size
 589:			 */
 590:			to_allocate = new_alen - old_alen;
 591:	add_alloc_in_same_attr_seg:
 592:			lcn = 0;
 593:			if (is_mft) {
 594:				/* MFT allocates clusters from MFT zone. */
 595:				pre_alloc = 0;
 596:			} else if (is_ext) {
 597:				/* No preallocate for sparse/compress. */
 598:				pre_alloc = 0;
 599:			} else if (pre_alloc == -1) {
 600:				pre_alloc = 0;
 601:				if (type == ATTR_DATA && !name_len &&
 602:				    sbi->options->prealloc) {
 603:					pre_alloc = bytes_to_cluster(
 604:							    sbi, get_pre_allocated(
 605:									 new_size)) -
 606:						    new_alen;
 607:				}
 608:	
 609:				/* Get the last LCN to allocate from. */
 610:				if (old_alen &&
 611:				    !run_lookup_entry(run, vcn, &lcn, NULL, NULL)) {
 612:					lcn = SPARSE_LCN;
 613:				}
 614:	
 615:				if (lcn == SPARSE_LCN)
 616:					lcn = 0;
 617:				else if (lcn)
 618:					lcn += 1;
 619:	
 620:				free = wnd_zeroes(&sbi->used.bitmap);
 621:				if (to_allocate > free) {
 622:					err = -ENOSPC;
 623:					goto out;
 624:				}
 625:	
 626:				if (pre_alloc && to_allocate + pre_alloc > free)
 627:					pre_alloc = 0;
 628:			}
 629:	
 630:			vcn = old_alen;
 631:	
 632:			if (is_ext) {
 633:				if (!run_add_entry(run, vcn, SPARSE_LCN, to_allocate,
 634:						   false)) {
 635:					err = -ENOMEM;
 636:					goto out;
 637:				}
 638:				alen = to_allocate;
 639:			} else {
 640:				/* ~3 bytes per fragment. */
 641:				err = attr_allocate_clusters(
 642:					sbi, run, run_da, vcn, lcn, to_allocate,
 643:					&pre_alloc,
 644:					is_mft ? ALLOCATE_MFT : ALLOCATE_DEF, &alen,
 645:					is_mft ? 0 :
 646:						 (sbi->record_size -
 647:						  le32_to_cpu(rec->used) + 8) /
 648:								 3 +
 649:							 1,
 650:					NULL, NULL);
 651:				if (err)
 652:					goto out;
 653:			}
 654:	
 655:			done += alen;
 656:			vcn += alen;
 657:			if (to_allocate > alen)
 658:				to_allocate -= alen;
 659:			else
 660:				to_allocate = 0;
 661:	
 662:	pack_runs:
 663:			err = mi_pack_runs(mi, attr, run, vcn - svcn);
 664:			if (err)
 665:				goto undo_1;
 666:	
 667:			next_svcn = le64_to_cpu(attr->nres.evcn) + 1;
 668:			new_alloc_tmp = (u64)next_svcn << cluster_bits;
 669:			attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp);
 670:			mi_b->dirty = dirty = true;
 671:	
 672:			if (next_svcn >= vcn && !to_allocate) {
 673:				/* Normal way. Update attribute and exit. */
 674:				attr_b->nres.data_size = cpu_to_le64(new_size);
 675:				goto ok;
 676:			}
 677:	
 678:			/* At least two MFT to avoid recursive loop. */
 679:			if (is_mft && next_svcn == vcn &&
 680:			    ((u64)done << sbi->cluster_bits) >= 2 * sbi->record_size) {
 681:				new_size = new_alloc_tmp;
 682:				attr_b->nres.data_size = attr_b->nres.alloc_size;
 683:				goto ok;
 684:			}
 685:	
 686:			if (le32_to_cpu(rec->used) < sbi->record_size) {
 687:				old_alen = next_svcn;
 688:				evcn = old_alen - 1;
 689:				goto add_alloc_in_same_attr_seg;
 690:			}
 691:	
 692:			attr_b->nres.data_size = attr_b->nres.alloc_size;
 693:			if (new_alloc_tmp < old_valid)
 694:				attr_b->nres.valid_size = attr_b->nres.data_size;
 695:	
 696:			if (type == ATTR_LIST) {
 697:				err = ni_expand_list(ni);
 698:				if (err)
 699:					goto undo_2;
 700:				if (next_svcn < vcn)
 701:					goto pack_runs;
 702:	
 703:				/* Layout of records is changed. */
 704:				goto again;
 705:			}
 706:	
 707:			if (!nb->attr_list.size) {
 708:				err = ni_create_attr_list(nb);
 709:				/* In case of error layout of records is not changed. */
 710:				if (err)
 711:					goto undo_2;
 712:				/* Layout of records is changed. */
 713:			}
 714:	
 715:			if (next_svcn >= vcn) {
 716:				/* This is MFT data, repeat. */
 717:				goto again;
 718:			}
 719:	
 720:			/* Insert new attribute segment. */
 721:			err = ni_insert_nonresident(ni, type, name, name_len, run,
 722:						    next_svcn, vcn - next_svcn,
 723:						    attr_b->flags, &attr, &mi, NULL);
 724:	
 725:			/*
 726:			 * Layout of records maybe changed.
 727:			 * Find base attribute to update.
 728:			 */
 729:			le_b = NULL;
 730:			attr_b = ni_find_attr(ni, NULL, &le_b, type, name, name_len,
 731:					      NULL, &mi_b);
 732:			if (!attr_b) {
 733:				err = -EINVAL;
 734:				goto bad_inode;
 735:			}
 736:	
 737:			if (err) {
 738:				/* ni_insert_nonresident failed. */
 739:				attr = NULL;
 740:				goto undo_2;
 741:			}
 742:	
 743:			/* keep runs for $MFT::$ATTR_DATA and $MFT::$ATTR_BITMAP. */
 744:			if (ni->mi.rno != MFT_REC_MFT)
 745:				run_truncate_head(run, evcn + 1);
 746:	
 747:			svcn = le64_to_cpu(attr->nres.svcn);
 748:			evcn = le64_to_cpu(attr->nres.evcn);
 749:	
 750:			/*
 751:			 * Attribute is in consistency state.
 752:			 * Save this point to restore to if next steps fail.
 753:			 */
 754:			old_valid = old_size = old_alloc = (u64)vcn << cluster_bits;
 755:			attr_b->nres.valid_size = attr_b->nres.data_size =
 756:				attr_b->nres.alloc_size = cpu_to_le64(old_size);
 757:			mi_b->dirty = dirty = true;
 758:			goto again_1;
 759:		}
 760:	
 761:		if (new_size != old_size ||
 762:		    (new_alloc != old_alloc && !keep_prealloc)) {
 763:			/*
 764:			 * Truncate clusters. In simple case we have to:
 765:			 *  - update packed run in 'mi'
 766:			 *  - update attr->nres.evcn
 767:			 *  - update attr_b->nres.data_size/attr_b->nres.alloc_size
 768:			 *  - mark and trim clusters as free (vcn, lcn, len)
 769:			 */
 770:			CLST dlen = 0;
 771:	
 772:			vcn = max(svcn, new_alen);
 773:			new_alloc_tmp = (u64)vcn << cluster_bits;
 774:	
 775:			if (vcn > svcn) {
 776:				err = mi_pack_runs(mi, attr, run, vcn - svcn);
 777:				if (err)
 778:					goto out;
 779:			} else if (le && le->vcn) {
 780:				u16 le_sz = le16_to_cpu(le->size);
 781:	
 782:				/*
 783:				 * NOTE: List entries for one attribute are always
 784:				 * the same size. We deal with last entry (vcn==0)
 785:				 * and it is not first in entries array
 786:				 * (list entry for std attribute always first).
 787:				 * So it is safe to step back.
 788:				 */
 789:				mi_remove_attr(NULL, mi, attr);
 790:	
 791:				if (!al_remove_le(ni, le)) {
 792:					err = -EINVAL;
 793:					goto bad_inode;
 794:				}
 795:	
 796:				le = (struct ATTR_LIST_ENTRY *)((u8 *)le - le_sz);
 797:			} else {
 798:				attr->nres.evcn = cpu_to_le64((u64)vcn - 1);
 799:				mi->dirty = true;
 800:			}
 801:	
 802:			attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp);
 803:	
 804:			if (vcn == new_alen) {
 805:				attr_b->nres.data_size = cpu_to_le64(new_size);
 806:				if (new_size < old_valid)
 807:					attr_b->nres.valid_size =
 808:						attr_b->nres.data_size;
 809:			} else {
 810:				if (new_alloc_tmp <=
 811:				    le64_to_cpu(attr_b->nres.data_size))
 812:					attr_b->nres.data_size =
 813:						attr_b->nres.alloc_size;
 814:				if (new_alloc_tmp <
 815:				    le64_to_cpu(attr_b->nres.valid_size))
 816:					attr_b->nres.valid_size =
 817:						attr_b->nres.alloc_size;
 818:			}
 819:			mi_b->dirty = dirty = true;
 820:	
 821:			err = run_deallocate_ex(sbi, run, vcn, evcn - vcn + 1, &dlen,
 822:						true, run_da);
 823:			if (err)
 824:				goto out;
 825:	
 826:			if (is_ext) {
 827:				/* dlen - really deallocated clusters. */
 828:				le64_sub_cpu(&attr_b->nres.total_size,
 829:					     (u64)dlen << cluster_bits);
 830:			}
 831:	
 832:			run_truncate(run, vcn);
 833:	
 834:			if (new_alloc_tmp <= new_alloc)
 835:				goto ok;
 836:	
 837:			old_size = new_alloc_tmp;
 838:			vcn = svcn - 1;
 839:	
 840:			if (le == le_b) {
 841:				attr = attr_b;
 842:				mi = mi_b;
 843:				evcn = svcn - 1;
 844:				svcn = 0;
 845:				goto next_le;
 846:			}
 847:	
 848:			if (le->type != type || le->name_len != name_len ||
 849:			    memcmp(le_name(le), name, name_len * sizeof(short))) {
 850:				err = -EINVAL;
 851:				goto bad_inode;
 852:			}
 853:	
 854:			err = ni_load_mi(ni, le, &mi);
 855:			if (err)
 856:				goto out;
 857:	
 858:			attr = mi_find_attr(ni, mi, NULL, type, name, name_len,
 859:					    &le->id);
 860:			if (!attr) {
 861:				err = -EINVAL;
 862:				goto bad_inode;
 863:			}
 864:			goto next_le_1;
 865:		}
 866:	
 867:	ok:
 868:		if (new_valid) {
 869:			__le64 valid = cpu_to_le64(min(*new_valid, new_size));
 870:	
 871:			if (attr_b->nres.valid_size != valid) {
 872:				attr_b->nres.valid_size = valid;
 873:				mi_b->dirty = true;
 874:			}
 875:		}
 876:	
 877:	ok1:
 878:		if (ret)
 879:			*ret = attr_b;
 880:	
 881:		if ((type == ATTR_DATA || (type == ATTR_ALLOC && name == I30_NAME))) {
 882:			/* Update inode_set_bytes. */
 883:			if (attr_b->non_res &&
 884:			    inode_get_bytes(&ni->vfs_inode) != new_alloc) {
 885:				inode_set_bytes(&ni->vfs_inode, new_alloc);
 886:				dirty = true;
 887:			}
 888:	
 889:			i_size_write(&ni->vfs_inode, new_size);
 890:	
 891:			/* Don't forget to update duplicate information in parent. */
 892:			if (dirty) {
 893:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 894:				mark_inode_dirty(&ni->vfs_inode);
 895:			}
 896:		}
 897:	
 898:		return 0;
 899:	
 900:	undo_2:
 901:		vcn -= alen;
 902:		attr_b->nres.data_size = cpu_to_le64(old_size);
 903:		attr_b->nres.valid_size = cpu_to_le64(old_valid);
 904:		attr_b->nres.alloc_size = cpu_to_le64(old_alloc);
 905:	
 906:		/* Restore 'attr' and 'mi'. */
 907:		if (attr)
 908:			goto restore_run;
 909:	
 910:		if (le64_to_cpu(attr_b->nres.svcn) <= svcn &&
 911:		    svcn <= le64_to_cpu(attr_b->nres.evcn)) {
 912:			attr = attr_b;
 913:			le = le_b;
 914:			mi = mi_b;
 915:		} else if (!le_b) {
 916:			err = -EINVAL;
 917:			goto bad_inode;
 918:		} else {
 919:			le = le_b;
 920:			attr = ni_find_attr(ni, attr_b, &le, type, name, name_len,
 921:					    &svcn, &mi);
 922:			if (!attr)
 923:				goto bad_inode;
 924:		}
 925:	
 926:	restore_run:
 927:		if (mi_pack_runs(mi, attr, run, evcn - svcn + 1))
 928:			is_bad = true;
 929:	
 930:	undo_1:
 931:		run_deallocate_ex(sbi, run, vcn, alen, NULL, false, run_da);
 932:	
 933:		run_truncate(run, vcn);
 934:	out:
 935:		if (is_bad) {
 936:	bad_inode:
 937:			_ntfs_bad_inode(&ni->vfs_inode);
 938:		}
 939:		return err;
 940:	}
 SourceFile:fs/ntfs3/attrib.c]

36/2 2026/09/17 10:41 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 45841
							output: 25
							thoughts: 803
						

Thoughts:
**Analyzing Potential Race Conditions in Attribute Size Updates**

Okay, so I'm looking at this `attr_set_size_ex` function, specifically how it handles attribute size changes, particularly for resident attributes. My initial thought is the call to `attr_set_size_res` to update the resident attribute's size, followed by `i_size_write` updating the inode's size. It seems straightforward, but I need to make sure there are no race conditions.

If the size is *increased*, the attribute size will be increased by `attr_set_size_res` first, then `i_size_write` will increase `i_size`. A `read` call by another thread can't possibly have `i_size` smaller than the attribute size.

However, if the size is *decreased*, `attr_set_size_res` will decrease the attribute size *before* `i_size_write` decreases `i_size`. That's where things get interesting. If another thread calls `read` between those two calls, it'll see the *old* (larger) `i_size` but the *new* (smaller) attribute size (`iomap->length`).

This is where the vulnerability lies! The `read` call uses `i_size_read` to calculate a read size. Then there is a check: `size > iomap->length`. If the size is decreased between calls, the old `i_size` used in `read` will result in a larger size, based on the old size, compared to the smaller attribute size. Therefore, this leads to the scenario I want to investigate, where `size > iomap->length` is triggered.

It looks like the discrepancy between the updated attribute size and the `i_size` during a decrease can lead to a race condition. Now I need to dive deeper into `attr_set_size_res` to see exactly how it works, and then investigate the consequences of this discovered race.



37/2 2026/09/17 10:41 tool codesearch-definition-source
0m Args:
map[Name:attr_set_size_res]

Results:
map[SourceCode: 379:	/*
 380:	 * attr_set_size_res - Helper for attr_set_size().
 381:	 */
 382:	static int attr_set_size_res(struct ntfs_inode *ni, struct ATTRIB *attr,
 383:				     struct ATTR_LIST_ENTRY *le, struct mft_inode *mi,
 384:				     u64 new_size, struct runs_tree *run,
 385:				     struct ATTRIB **ins_attr)
 386:	{
 387:		struct ntfs_sb_info *sbi = mi->sbi;
 388:		struct MFT_REC *rec = mi->mrec;
 389:		u32 used = le32_to_cpu(rec->used);
 390:		u32 asize = le32_to_cpu(attr->size);
 391:		u32 aoff = PtrOffset(rec, attr);
 392:		u32 rsize = le32_to_cpu(attr->res.data_size);
 393:		u32 tail = used - aoff - asize;
 394:		char *next = Add2Ptr(attr, asize);
 395:		s64 dsize = ALIGN(new_size, 8) - ALIGN(rsize, 8);
 396:	
 397:		if (dsize < 0) {
 398:			memmove(next + dsize, next, tail);
 399:		} else if (dsize > 0) {
 400:			if (used + dsize > sbi->max_bytes_per_attr)
 401:				return attr_make_nonresident(ni, attr, le, mi, new_size,
 402:							     run, ins_attr, NULL);
 403:	
 404:			memmove(next + dsize, next, tail);
 405:			memset(next, 0, dsize);
 406:		}
 407:	
 408:		if (new_size > rsize)
 409:			memset(Add2Ptr(resident_data(attr), rsize), 0,
 410:			       new_size - rsize);
 411:	
 412:		rec->used = cpu_to_le32(used + dsize);
 413:		attr->size = cpu_to_le32(asize + dsize);
 414:		attr->res.data_size = cpu_to_le32(new_size);
 415:		mi->dirty = true;
 416:		*ins_attr = attr;
 417:	
 418:		return 0;
 419:	}
 SourceFile:fs/ntfs3/attrib.c]

38/2 2026/09/17 10:41 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 47866
							output: 24
							thoughts: 844
						

Thoughts:
**Analyzing a Potential Race Condition in NTFS File Size Updates**

Okay, so I'm digging into a possible concurrency issue within the NTFS file system code, specifically around file size modifications during truncation. Let's see... I've confirmed that `attr_set_size_res` directly updates `attr->res.data_size`, which is a key piece of information. This function is called within the `attr_set_size` chain, originating from `ntfs_set_size`.

Aha! `i_size_write` is called *after* `attr_set_size_res` within `attr_set_size_ex` at the `ok1:` label. This is important. If a concurrent read happens while these operations are interleaved, then there is an issue.

Now, a concurrent read would be handled through `ntfs_read_folio`, which branches off into `iomap_read_folio`, and eventually `ntfs_iomap_begin`. Inside `ntfs_iomap_begin`, the code reads `attr_b->res.data_size` by way of a call to `attr_data_get_block` and `attr_data_get_block_locked`. This `data_size` becomes the value assigned to `iomap->length`. However, `ntfs_iomap_begin` also reads `i_size_read` later in the function within `iomap_read_inline_data`.

Here's the crux: if a read thread is running between the execution of `attr_set_size_res` and `i_size_write`, it would see the *new* (smaller) `data_size`, but the *old* (larger) `i_size`. Therefore, the calculation `size = i_size - offset` will yield a value larger than `iomap->length`. Bingo! This discrepancy is what triggers the `WARN_ON_ONCE(size > iomap->length)` call.

The question then is, is there any locking to mitigate this race? The `ftruncate` system call calls `ntfs_set_size`. It seems like `ntfs_set_size` holds the `inode_lock`, which is good. Does `ntfs_read_folio` hold the `inode_lock`? No, it looks like `read` (via `filemap_read_folio` -> `ntfs_read_folio`) only holds the folio lock, but not `inode_lock`. Yes, inside `ntfs_set_size`, I see `ni_lock(ni)` which locks `ni->ni_lock`, a mutex. Does `ntfs_read_folio` take `ni_lock`? I need to check `ntfs_read_folio`.



39/2 2026/09/17 10:41 tool codesearch-definition-source
0m Args:
map[Name:ntfs_read_folio]

Results:
map[SourceCode: 826:	static int ntfs_read_folio(struct file *file, struct folio *folio)
 827:	{
 828:		int err;
 829:		struct address_space *mapping = folio->mapping;
 830:		struct inode *inode = mapping->host;
 831:		struct ntfs_inode *ni = ntfs_i(inode);
 832:		loff_t vbo = folio_pos(folio);
 833:		struct iomap_read_folio_ctx ctx = {
 834:			.cur_folio = folio,
 835:			.ops = &ntfs_iomap_bio_read_ops,
 836:		};
 837:	
 838:		if (unlikely(is_bad_ni(ni))) {
 839:			folio_unlock(folio);
 840:			return -EIO;
 841:		}
 842:	
 843:		if (ni->i_valid <= vbo) {
 844:			folio_zero_range(folio, 0, folio_size(folio));
 845:			folio_mark_uptodate(folio);
 846:			folio_unlock(folio);
 847:			return 0;
 848:		}
 849:	
 850:		if (is_compressed(ni)) {
 851:			/* ni_lock is taken inside ni_read_folio_cmpr after page locks */
 852:			err = ni_read_folio_cmpr(ni, folio);
 853:			return err;
 854:		}
 855:	
 856:		iomap_read_folio(&ntfs_iomap_ops, &ctx, NULL);
 857:		return 0;
 858:	}
 SourceFile:fs/ntfs3/inode.c]

40/2 2026/09/17 10:41 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 49859
							output: 23
							thoughts: 1050
						

Thoughts:
**Analyzing Potential Concurrency Issues in NTFS File Size Updates**

Okay, let's break this down. My initial thought was that `ntfs_read_folio` might have a race condition, but it doesn't take `ni_lock` directly. Then I saw that `ntfs_iomap_begin` calls `attr_data_get_block`, which *conditionally* takes `ni_lock`. Specifically, the code does a `run_lookup_entry_da` lookup. If it's a resident attribute (which is key here), that lookup *will* fail, because there are no runs. Therefore, the length will be zero, and *then* `ni_lock` is taken.

The issue arises because `ntfs_set_size`, which is called during file truncation, *also* holds `ni_lock`. So, `attr_data_get_block_locked` and `attr_set_size` are mutually exclusive due to the `ni_lock`. Good, that's reassuring.

Okay, let's step through a hypothetical sequence: if `attr_data_get_block_locked` is called, it *has* `ni_lock`. It reads `attr_b->res.data_size` while holding that lock, then it returns. After `attr_data_get_block` drops `ni_lock`, `ntfs_iomap_begin` returns and then `iomap_read_folio` calls `iomap_read_inline_data`. Importantly, `iomap_read_inline_data` reads `i_size_read`.

Now, if a truncate is occurring, it follows this sequence:

1.  Thread 1 (truncate) takes `inode_lock`.
2.  It calls `ntfs_setattr` which calls `ntfs_truncate` which in turn calls `ntfs_set_size`.
3.  It then takes `ni_lock`.
4.  Then `attr_set_size_ex` is called. It updates `attr_b->res.data_size`.
5.  It calls `i_size_write(inode, new_size)`.
6.  Finally, `ni_lock` is dropped.

Here's the problem I was worried about: If `i_size_write` is called *before* `ni_lock` is dropped, then a concurrent call to `attr_data_get_block_locked` (that needs `ni_lock`) might observe a partially updated state. It would see the new `data_size` but potentially a stale `i_size`. However, the order is crucial here. `attr_set_size_ex` calls `i_size_write` *before* `ntfs_set_size` drops `ni_lock`! That's it!

So, the critical insight: `attr_data_get_block_locked` *cannot* run concurrently *between* when `attr_set_size` updates the resources and when `i_size_write` updates the inode size and then when `ntfs_set_size` drops `ni_lock`. This is because `ni_lock` is held throughout.

Okay, but what if Thread 1 increases the size? If Thread 1 increases the size then `i_size` is increased. Ah, `ftruncate` can *increase* the size - which calls `truncate_setsize` which is called by `ntfs_setattr`. Everything should still be fine.



41/2 2026/09/17 10:42 tool codesearch-definition-source
0m Args:
map[Name:ntfs_setattr]

Results:
map[SourceCode: 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
 770:		if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE))
 771:			ntfs_save_wsl_perm(inode, NULL);
 772:		mark_inode_dirty(inode);
 773:	out:
 774:		return err;
 775:	}
 SourceFile:fs/ntfs3/file.c]

42/2 2026/09/17 10:42 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 52791
							output: 22
							thoughts: 57
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own:

**Analyzing `truncate_setsize` and Its Timing**

Right, so I'm seeing this sequence: `truncate_setsize(inode, newsize)` *before* `ntfs_set_size(inode, newsize)`. That's interesting, and important to remember. The key here is that `truncate_setsize` appears to be responsible for modifying `i_size`. That's significant. It means it's handling the core size adjustment, *before* we potentially get into the lower-level NTFS-specific size modifications. Given this ordering, I need to understand *exactly* what `truncate_setsize` is doing to `i_size`, as this could have substantial implications for our overall file size handling strategy in the NTFS context. Time to dive into that function and trace its logic.



43/2 2026/09/17 10:42 tool codesearch-definition-source
0m Args:
map[Name:truncate_setsize]

Results:
map[SourceCode: 803:	/**
 804:	 * truncate_setsize - update inode and pagecache for a new file size
 805:	 * @inode: inode
 806:	 * @newsize: new file size
 807:	 *
 808:	 * truncate_setsize updates i_size and performs pagecache truncation (if
 809:	 * necessary) to @newsize. It will be typically be called from the filesystem's
 810:	 * setattr function when ATTR_SIZE is passed in.
 811:	 *
 812:	 * Must be called with a lock serializing truncates and writes (generally
 813:	 * i_rwsem but e.g. xfs uses a different lock) and before all filesystem
 814:	 * specific block truncation has been performed.
 815:	 */
 816:	void truncate_setsize(struct inode *inode, loff_t newsize)
 817:	{
 818:		loff_t oldsize = inode->i_size;
 819:	
 820:		i_size_write(inode, newsize);
 821:		if (newsize > oldsize)
 822:			pagecache_isize_extended(inode, oldsize, newsize);
 823:		truncate_pagecache(inode, newsize);
 824:	}
 SourceFile:mm/truncate.c]

44/2 2026/09/17 10:42 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 53442
							output: 23
							thoughts: 1470
						

Thoughts:
**The Race Condition in NTFS Inline Data Truncate**

Okay, I've got it. The `truncate_setsize` function is the key. It calls `i_size_write(inode, newsize)`, which means that the in-memory `i_size` is updated *before* `ntfs_set_size` is called. If I'm increasing the file size, say from 5 to 20, `i_size` immediately becomes 20. Then `ntfs_set_size` gets called, takes `ni_lock`, and updates `attr_b->res.data_size` (the on-disk size) to 20.

The race is this: if a concurrent `read` happens after `truncate_setsize` but before `ntfs_set_size` grabs `ni_lock`...

1.  `read` goes through `ntfs_read_folio`.
2.  Which goes through `iomap_read_folio`.
3.  Then `ntfs_iomap_begin`.
4.  `ntfs_iomap_begin` takes `ni_lock`, which is free because `ntfs_set_size` hasn't taken it yet.
5.  `ntfs_iomap_begin` reads `attr_b->res.data_size`, which is still the *old* size, 5!
6.  `ntfs_iomap_begin` sets `iomap->length = 5`.
7.  `ntfs_iomap_begin` drops `ni_lock`.
8.  `iomap_read_folio` goes to `iomap_read_inline_data`.
9.  `iomap_read_inline_data` reads `i_size_read(iter->inode)`, which is now 20!
10. `size = 20 - 0 = 20`.
11.  Now, the check `size > iomap->length` (20 > 5) triggers the `WARN_ON_ONCE`! That's the bug.

So, in essence, I have Thread 1: truncate to 20, and Thread 2: a concurrent read.

I had initially thought that `pagecache_isize_extended` and `truncate_pagecache` would prevent the race, but `pagecache_isize_extended` just zeroes the tail, and `truncate_pagecache` removes pages beyond the new size. But a read *can* allocate a new folio with a call to `filemap_read_folio`, and then `a_ops->read_folio`.

Let me look at `ntfs_setattr`.

I see that `truncate_setsize` updates `i_size` *before* `ntfs_set_size` updates the on-disk metadata. Is this the right order? I'd usually expect that for extending a truncate, `i_size` should be updated *after* blocks are allocated and zeroed, to prevent seeing uninitialized data.

The `truncate_setsize` documentation confirms this, it says "Must be called with a lock serializing truncates and writes (generally i_rwsem... and *before* all filesystem specific block truncation". But, for extending a truncate, `truncate_setsize` *immediately* updates `i_size`.

This means that a concurrent read *without* the `i_rwsem` lock can read the new `i_size` value and attempt to read it before on-disk blocks are allocated and data is available.

`iomap_read_inline_data` is where the error occurs:
```c
	size_t size = i_size_read(iter->inode) - iomap->offset;
    // ...
	if (WARN_ON_ONCE(size > iomap->length)) {
```

If `i_size` is updated before the inline data is expanded, then `size` is larger than `iomap->length`, triggering the warning. Now I need to check how other filesystems, such as ext4, handle extending a truncate with inline data.



45/2 2026/09/17 10:42 tool codesearch-definition-source
0m Args:
map[Name:ext4_setattr]

Results:
map[SourceCode:5985:	/*
5986:	 * ext4_setattr()
5987:	 *
5988:	 * Called from notify_change.
5989:	 *
5990:	 * We want to trap VFS attempts to truncate the file as soon as
5991:	 * possible.  In particular, we want to make sure that when the VFS
5992:	 * shrinks i_size, we put the inode on the orphan list and modify
5993:	 * i_disksize immediately, so that during the subsequent flushing of
5994:	 * dirty pages and freeing of disk blocks, we can guarantee that any
5995:	 * commit will leave the blocks being flushed in an unused state on
5996:	 * disk.  (On recovery, the inode will get truncated and the blocks will
5997:	 * be freed, so we have a strong guarantee that no future commit will
5998:	 * leave these blocks visible to the user.)
5999:	 *
6000:	 * Another thing we have to assure is that if we are in ordered mode
6001:	 * and inode is still attached to the committing transaction, we must
6002:	 * we start writeout of all the dirty pages which are being truncated.
6003:	 * This way we are sure that all the data written in the previous
6004:	 * transaction are already on disk (truncate waits for pages under
6005:	 * writeback).
6006:	 *
6007:	 * Called with inode->i_rwsem down.
6008:	 */
6009:	int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
6010:			 struct iattr *attr)
6011:	{
6012:		struct inode *inode = d_inode(dentry);
6013:		int error, rc = 0;
6014:		int orphan = 0;
6015:		const unsigned int ia_valid = attr->ia_valid;
6016:		bool inc_ivers = true;
6017:	
6018:		error = ext4_emergency_state(inode->i_sb);
6019:		if (unlikely(error))
6020:			return error;
6021:	
6022:		if (unlikely(IS_IMMUTABLE(inode)))
6023:			return -EPERM;
6024:	
6025:		if (unlikely(IS_APPEND(inode) &&
6026:			     (ia_valid & (ATTR_MODE | ATTR_UID |
6027:					  ATTR_GID | ATTR_TIMES_SET))))
6028:			return -EPERM;
6029:	
6030:		error = setattr_prepare(idmap, dentry, attr);
6031:		if (error)
6032:			return error;
6033:	
6034:		error = fscrypt_prepare_setattr(dentry, attr);
6035:		if (error)
6036:			return error;
6037:	
6038:		if (is_quota_modification(idmap, inode, attr)) {
6039:			error = dquot_initialize(inode);
6040:			if (error)
6041:				return error;
6042:		}
6043:	
6044:		if (i_uid_needs_update(idmap, attr, inode) ||
6045:		    i_gid_needs_update(idmap, attr, inode)) {
6046:			handle_t *handle;
6047:	
6048:			/* (user+group)*(old+new) structure, inode write (sb,
6049:			 * inode block, ? - but truncate inode update has it) */
6050:			handle = ext4_journal_start(inode, EXT4_HT_QUOTA,
6051:				(EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb) +
6052:				 EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb)) + 3);
6053:			if (IS_ERR(handle)) {
6054:				error = PTR_ERR(handle);
6055:				goto err_out;
6056:			}
6057:	
6058:			/* dquot_transfer() calls back ext4_get_inode_usage() which
6059:			 * counts xattr inode references.
6060:			 */
6061:			down_read(&EXT4_I(inode)->xattr_sem);
6062:			error = dquot_transfer(idmap, inode, attr);
6063:			up_read(&EXT4_I(inode)->xattr_sem);
6064:	
6065:			if (error) {
6066:				ext4_journal_stop(handle);
6067:				return error;
6068:			}
6069:			/* Update corresponding info in inode so that everything is in
6070:			 * one transaction */
6071:			i_uid_update(idmap, attr, inode);
6072:			i_gid_update(idmap, attr, inode);
6073:			error = ext4_mark_inode_dirty(handle, inode);
6074:			ext4_journal_stop(handle);
6075:			if (unlikely(error)) {
6076:				return error;
6077:			}
6078:		}
6079:	
6080:		if (attr->ia_valid & ATTR_SIZE) {
6081:			handle_t *handle;
6082:			loff_t oldsize = inode->i_size;
6083:			loff_t old_disksize;
6084:			int shrink = (attr->ia_size < inode->i_size);
6085:	
6086:			if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
6087:				struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
6088:	
6089:				if (attr->ia_size > sbi->s_bitmap_maxbytes) {
6090:					return -EFBIG;
6091:				}
6092:			}
6093:			if (!S_ISREG(inode->i_mode)) {
6094:				return -EINVAL;
6095:			}
6096:	
6097:			if (attr->ia_size == inode->i_size)
6098:				inc_ivers = false;
6099:	
6100:			/*
6101:			 * If file has inline data but new size exceeds inline capacity,
6102:			 * convert to extent-based storage first to prevent inconsistent
6103:			 * state (inline flag set but size exceeds inline capacity).
6104:			 */
6105:			if (ext4_has_inline_data(inode) &&
6106:			    attr->ia_size > EXT4_I(inode)->i_inline_size) {
6107:				error = ext4_convert_inline_data(inode);
6108:				if (error)
6109:					goto err_out;
6110:			}
6111:	
6112:			if (shrink) {
6113:				if (ext4_should_order_data(inode)) {
6114:					error = ext4_begin_ordered_truncate(inode,
6115:								    attr->ia_size);
6116:					if (error)
6117:						goto err_out;
6118:				}
6119:				/*
6120:				 * Blocks are going to be removed from the inode. Wait
6121:				 * for dio in flight.
6122:				 */
6123:				inode_dio_wait(inode);
6124:			}
6125:	
6126:			filemap_invalidate_lock(inode->i_mapping);
6127:	
6128:			rc = ext4_break_layouts(inode);
6129:			if (rc) {
6130:				filemap_invalidate_unlock(inode->i_mapping);
6131:				goto err_out;
6132:			}
6133:	
6134:			if (attr->ia_size != inode->i_size) {
6135:				/* attach jbd2 jinode for EOF folio tail zeroing */
6136:				if (attr->ia_size & (inode->i_sb->s_blocksize - 1) ||
6137:				    oldsize & (inode->i_sb->s_blocksize - 1)) {
6138:					error = ext4_inode_attach_jinode(inode);
6139:					if (error)
6140:						goto out_mmap_sem;
6141:				}
6142:	
6143:				/*
6144:				 * Update c/mtime and tail zero the EOF folio on
6145:				 * truncate up. ext4_truncate() handles the shrink case
6146:				 * below.
6147:				 */
6148:				if (!shrink) {
6149:					inode_set_mtime_to_ts(inode,
6150:							      inode_set_ctime_current(inode));
6151:					if (oldsize & (inode->i_sb->s_blocksize - 1)) {
6152:						error = ext4_block_zero_eof(inode,
6153:								oldsize, LLONG_MAX);
6154:						if (error)
6155:							goto out_mmap_sem;
6156:					}
6157:				}
6158:	
6159:				handle = ext4_journal_start(inode, EXT4_HT_INODE, 3);
6160:				if (IS_ERR(handle)) {
6161:					error = PTR_ERR(handle);
6162:					goto out_mmap_sem;
6163:				}
6164:				if (ext4_handle_valid(handle) && shrink) {
6165:					error = ext4_orphan_add(handle, inode);
6166:					orphan = 1;
6167:				}
6168:	
6169:				if (shrink)
6170:					ext4_fc_track_range(handle, inode,
6171:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6172:						inode->i_sb->s_blocksize_bits,
6173:						EXT_MAX_BLOCKS - 1);
6174:				else
6175:					ext4_fc_track_range(
6176:						handle, inode,
6177:						(oldsize > 0 ? oldsize - 1 : oldsize) >>
6178:						inode->i_sb->s_blocksize_bits,
6179:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6180:						inode->i_sb->s_blocksize_bits);
6181:	
6182:				down_write(&EXT4_I(inode)->i_data_sem);
6183:				old_disksize = EXT4_I(inode)->i_disksize;
6184:				EXT4_I(inode)->i_disksize = attr->ia_size;
6185:	
6186:				/*
6187:				 * We have to update i_size under i_data_sem together
6188:				 * with i_disksize to avoid races with writeback code
6189:				 * running ext4_wb_update_i_disksize().
6190:				 */
6191:				if (!error)
6192:					i_size_write(inode, attr->ia_size);
6193:				else
6194:					EXT4_I(inode)->i_disksize = old_disksize;
6195:				up_write(&EXT4_I(inode)->i_data_sem);
6196:				rc = ext4_mark_inode_dirty(handle, inode);
6197:				if (!error)
6198:					error = rc;
6199:				ext4_journal_stop(handle);
6200:				if (error)
6201:					goto out_mmap_sem;
6202:				if (!shrink) {
6203:					pagecache_isize_extended(inode, oldsize,
6204:								 inode->i_size);
6205:				} else if (ext4_should_journal_data(inode)) {
6206:					ext4_wait_for_tail_page_commit(inode);
6207:				}
6208:			}
6209:	
6210:			/*
6211:			 * Truncate pagecache after we've waited for commit
6212:			 * in data=journal mode to make pages freeable.
6213:			 */
6214:			truncate_pagecache(inode, inode->i_size);
6215:			/*
6216:			 * Call ext4_truncate() even if i_size didn't change to
6217:			 * truncate possible preallocated blocks.
6218:			 */
6219:			if (attr->ia_size <= oldsize) {
6220:				rc = ext4_truncate(inode);
6221:				if (rc)
6222:					error = rc;
6223:			}
6224:	out_mmap_sem:
6225:			filemap_invalidate_unlock(inode->i_mapping);
6226:		}
6227:	
6228:		if (!error) {
6229:			if (inc_ivers)
6230:				inode_inc_iversion(inode);
6231:			setattr_copy(idmap, inode, attr);
6232:			mark_inode_dirty(inode);
6233:		}
6234:	
6235:		/*
6236:		 * If the call to ext4_truncate failed to get a transaction handle at
6237:		 * all, we need to clean up the in-core orphan list manually.
6238:		 */
6239:		if (orphan && inode->i_nlink)
6240:			ext4_orphan_del(NULL, inode);
6241:	
6242:		if (!error && (ia_valid & ATTR_MODE))
6243:			rc = posix_acl_chmod(idmap, dentry, inode->i_mode);
6244:	
6245:	err_out:
6246:		if  (error)
6247:			ext4_std_error(inode->i_sb, error);
6248:		if (!error)
6249:			error = rc;
6250:		return error;
6251:	}
 SourceFile:fs/ext4/inode.c]

46/2 2026/09/17 10:43 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 59922
							output: 24
							thoughts: 164
						

Thoughts:
**Ext4 File Size Updates: A Deep Dive**

Okay, so I'm thinking through how ext4 handles file size updates, specifically when the data is inline. My understanding is, if the file has inline data and the new size *exceeds* the inline capacity, the system cleverly converts to extent-based storage *before* it updates `i_size`. That's a good optimization, I see. But if it doesn't exceed the capacity, it goes a different route. It updates `i_size` under the protection of `i_data_sem` and *then* calls `pagecache_isize_extended`.

Wait a minute... I was just remembering something – ext4 doesn't actually use `truncate_setsize`, that's an important detail. It *directly* updates the `i_size` using `i_size_write(inode, attr->ia_size)`. After that, it calls both `pagecache_isize_extended` and `truncate_pagecache`. Got it. That's a key distinction I should have recalled.

And when dealing with inline data specifically, `ext4_read_folio` does *not* utilize `iomap_read_inline_data`. That's interesting, I need to understand that logic better. Let me refresh my memory and check what `ext4_read_folio` is doing in this scenario.



47/2 2026/09/17 10:43 tool codesearch-definition-source
0m Args:
map[Name:ext4_read_folio]

Results:
map[SourceCode: 321:	int ext4_read_folio(struct file *file, struct folio *folio)
 322:	{
 323:		struct inode *inode = folio->mapping->host;
 324:		struct fsverity_info *vi = NULL;
 325:		int ret;
 326:	
 327:		trace_ext4_read_folio(inode, folio);
 328:	
 329:		if (ext4_has_inline_data(inode)) {
 330:			ret = ext4_readpage_inline(inode, folio);
 331:			if (ret != -EAGAIN)
 332:				return ret;
 333:		}
 334:	
 335:		if (folio->index < DIV_ROUND_UP(inode->i_size, PAGE_SIZE))
 336:			vi = fsverity_get_info(inode);
 337:		if (vi)
 338:			fsverity_readahead(vi, folio->index, folio_nr_pages(folio));
 339:		return ext4_mpage_readpages(inode, vi, NULL, folio);
 340:	}
 SourceFile:fs/ext4/readpage.c]

48/2 2026/09/17 10:43 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 60757
							output: 25
							thoughts: 26
						

Thoughts:
Here's my take on those thoughts:

**Analyzing `ext4_readpage_inline` in the ext4 Filesystem**

Okay, so I'm thinking about how `ext4` handles reading data, and the first thing that jumps out is that it appears to leverage the `ext4_readpage_inline` function. I know this function is related to inline data, which is where the file data can be stored directly within the inode itself, particularly for smaller files. It's an optimization, obviously. My next step here, as usual, will be to dive into the implementation of `ext4_readpage_inline` to understand exactly how it works. I need to know how it's implemented, its behavior under different conditions (like fragmented inline data), how it interacts with the buffer cache, and how it handles potential errors. I'll need to dissect its interactions with the ext4 journal if journaling is enabled. I need to be sure the function is efficient and handles all corner cases correctly.



49/2 2026/09/17 10:43 tool codesearch-definition-source
0m Args:
map[Name:ext4_readpage_inline]

Results:
map[SourceCode: 544:	int ext4_readpage_inline(struct inode *inode, struct folio *folio)
 545:	{
 546:		int ret = 0;
 547:	
 548:		down_read(&EXT4_I(inode)->xattr_sem);
 549:		if (!ext4_has_inline_data(inode)) {
 550:			up_read(&EXT4_I(inode)->xattr_sem);
 551:			return -EAGAIN;
 552:		}
 553:	
 554:		/*
 555:		 * Current inline data can only exist in the 1st page,
 556:		 * So for all the other pages, just set them uptodate.
 557:		 */
 558:		if (!folio->index)
 559:			ret = ext4_read_inline_folio(inode, folio);
 560:		else if (!folio_test_uptodate(folio)) {
 561:			folio_zero_segment(folio, 0, folio_size(folio));
 562:			folio_mark_uptodate(folio);
 563:		}
 564:	
 565:		up_read(&EXT4_I(inode)->xattr_sem);
 566:	
 567:		folio_unlock(folio);
 568:		return ret >= 0 ? 0 : ret;
 569:	}
 SourceFile:fs/ext4/inline.c]

50/2 2026/09/17 10:43 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 61440
							output: 25
							thoughts: 827
						

Thoughts:
**Race Condition in NTFS3 Inode Size Update**

Okay, so I've been digging into this potential race condition I've found in the NTFS3 driver, and it's quite a doozy. It started with looking at how `ext4_readpage_inline` synchronizes with truncate using `xattr_sem`. That made me think about `ntfs_read_folio`, and how it interacts with the `iomap` layer. Specifically, `ntfs_read_folio` calls `ntfs_iomap_begin`, and the key here is the acquisition of `ni_lock`.

Initially, `ntfs_iomap_begin` takes `ni_lock` only if `run_lookup_entry_da` fails. But then it hit me: for resident attributes, `run_lookup_entry_da` *always* fails! That means, it *always* takes `ni_lock`. That has serious implications! If it always takes the lock, then it can't run concurrently with `ntfs_set_size`, which sounds safe.

But then I had to verify my assumption. Let's look at the `ntfs_setattr` function. Here's what's happening. If the new size is different from the old, `truncate_setsize` gets called, which updates `i_size`. *Then* `ntfs_set_size` is called, which also takes `ni_lock`.

The problem? What happens if a `read` operation happens *after* `truncate_setsize` updates `i_size` but *before* `ntfs_set_size` grabs `ni_lock`?

The `read` calls `ntfs_read_folio`, which calls `iomap_read_folio` and then `ntfs_iomap_begin`. `ntfs_iomap_begin` takes `ni_lock`, but *only after* `truncate_setsize` updates `i_size`. Now, `ntfs_iomap_begin` reads `attr_b->res.data_size` and sets `iomap->length`. Importantly, `attr_b->res.data_size` is still the *old* size!

`ntfs_iomap_begin` drops `ni_lock`, and `iomap_read_folio` proceeds to call `iomap_read_inline_data`. Here's where the inconsistency really bites. `iomap_read_inline_data` reads `i_size_read(inode)`, which is now the *new* size, thanks to `truncate_setsize`. Let's say, just for illustration, the new size is 20 and the old size is 5.

So, the read is going to read `size = 20 - 0 = 20`. This calculation is done using a new size, but `iomap->length` is still the old size, 5. So `size > iomap->length`, which is bad, and triggers `WARN_ON_ONCE`. Bang!

So, the race is precisely about `truncate_setsize` updating `i_size` *before* the on-disk metadata (`attr_b->res.data_size`) is updated, even when it is done, under the lock, `ni_lock`. Since the `read` uses `i_size_read(inode)` for the copy, but uses `attr_b->res.data_size` in the calculation to read the correct number of bytes, they're inconsistent, and kaboom.

The fix seems to be that, in `ntfs_setattr`, we probably need to update `i_size` *after* updating the on-disk metadata, or, at a minimum, update it under `ni_lock`. But then, there's the whole issue of `truncate_setsize` having to be called *before* filesystem-specific block truncation for *shrinking* truncates to avoid exposing stale data. For *extending*, updating `i_size` *after* allocating blocks, or even atomically, sounds better. So, wait, what about *extending* truncate?

Let me see how XFS handles this... I should look at `xfs_setattr_size` as a reference.



51/2 2026/09/17 10:44 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[Name:xfs_setattr_size]

Results:
map[SourceCode: SourceFile:]

52/2 2026/09/17 10:44 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 63247
							output: 28
							thoughts: 18
						

Thoughts:
Here's my thought process, as it went down:

**XFS Investigation: Grepping for `truncate_setsize`**

Okay, so I need to understand how XFS handles setting the file size during truncation. My instinct is to zero in on the relevant code, so let's start with a `grep` for `truncate_setsize` within the `fs/xfs` directory. That's usually the first step for this kind of investigation – quickly locating the key function name or variable and seeing where it's used. Hopefully, this `grep` will turn up the function definition itself, and maybe a few places where it’s called. From there, I can start tracing through the execution flow, looking at how the size is actually modified, any potential locking issues that might arise, and how the underlying blocks are managed. Given the performance-critical nature of XFS, I’m also going to be keeping an eye out for any optimizations or potential bottlenecks related to this operation. This grep should give me a good initial handle on the code.



53/2 2026/09/17 10:44 tool grepper
0m Args:
map[Expression:truncate_setsize PathPrefix:fs/xfs]

Results:
map[Output:fs/xfs/xfs_iops.c=905=xfs_vn_setattr_size(
--
fs/xfs/xfs_iops.c-1008-	 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
fs/xfs/xfs_iops.c:1009:	 * complete. The truncate_setsize() call also cleans partial EOF page
fs/xfs/xfs_iops.c-1010-	 * PTEs on extending truncates and hence ensures sub-page block size
--
fs/xfs/xfs_iops.c-1025-	 */
fs/xfs/xfs_iops.c:1026:	truncate_setsize(inode, newsize);
fs/xfs/xfs_iops.c-1027-
]

54/2 2026/09/17 10:44 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 63736
							output: 27
							thoughts: 15
						

Thoughts:
Okay, let's dive into this. Here's my take on `xfs_vn_setattr_size`:

**Examining `xfs_vn_setattr_size`**

Alright, so I'm looking at `xfs_vn_setattr_size`. My initial thought is, this is a core XFS function – likely a low-level, critical piece. The name tells me we're dealing with setting the size attribute, specifically within the virtual namespace (vn) layer of XFS. My expert intuition tells me this touches file metadata, probably involving i-nodes. I'm assuming it interacts directly with the on-disk structures and the in-memory representation. I need to understand the implications on data allocation, extent management, and potential fragmentation. I'm already anticipating considerations around journaling and concurrency, particularly if we're dealing with a size change that necessitates a write to the metadata. I'll need to look closely at error handling – what happens if the operation fails mid-way? What are the consistency guarantees provided? And, of course, I'll pay attention to any locking mechanisms utilized to protect against race conditions. I need to consider all the ways it interacts with other functions and system components in the file system.



55/2 2026/09/17 10:44 tool codesearch-definition-source
0m Args:
map[Name:xfs_vn_setattr_size]

Results:
map[SourceCode: 901:	/*
 902:	 * Truncate file.  Must have write permission and not be a directory.
 903:	 */
 904:	int
 905:	xfs_vn_setattr_size(
 906:		struct mnt_idmap	*idmap,
 907:		struct dentry		*dentry,
 908:		struct iattr		*iattr)
 909:	{
 910:		struct inode		*inode = d_inode(dentry);
 911:		struct xfs_inode	*ip = XFS_I(inode);
 912:		struct xfs_mount	*mp = ip->i_mount;
 913:		xfs_off_t		oldsize = inode->i_size;
 914:		xfs_off_t		newsize = iattr->ia_size;
 915:		struct xfs_trans	*tp;
 916:		int			error;
 917:		uint			lock_flags = 0;
 918:		uint			resblks = 0;
 919:		bool			did_zeroing = false;
 920:		struct xfs_zone_alloc_ctx ac = { };
 921:	
 922:		xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
 923:		ASSERT(S_ISREG(inode->i_mode));
 924:		ASSERT((iattr->ia_valid & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET|
 925:			ATTR_MTIME_SET|ATTR_TIMES_SET)) == 0);
 926:	
 927:		trace_xfs_setattr(ip);
 928:	
 929:		error = xfs_vn_change_ok(idmap, dentry, iattr);
 930:		if (error)
 931:			return error;
 932:	
 933:		/*
 934:		 * Short circuit the truncate case for zero length files.
 935:		 */
 936:		if (newsize == 0 && oldsize == 0 && ip->i_df.if_nextents == 0) {
 937:			if (!(iattr->ia_valid & (ATTR_CTIME|ATTR_MTIME)))
 938:				return 0;
 939:	
 940:			/*
 941:			 * Use the regular setattr path to update the timestamps.
 942:			 */
 943:			iattr->ia_valid &= ~ATTR_SIZE;
 944:			return xfs_setattr_nonsize(idmap, dentry, ip, iattr);
 945:		}
 946:	
 947:		/*
 948:		 * Make sure that the dquots are attached to the inode.
 949:		 */
 950:		error = xfs_qm_dqattach(ip);
 951:		if (error)
 952:			return error;
 953:	
 954:		/*
 955:		 * Wait for all direct I/O to complete.
 956:		 */
 957:		inode_dio_wait(inode);
 958:	
 959:		/*
 960:		 * Normally xfs_zoned_space_reserve is supposed to be called outside the
 961:		 * IOLOCK.  For truncate we can't do that since ->setattr is called with
 962:		 * it already held by the VFS.  So for now chicken out and try to
 963:		 * allocate space under it.
 964:		 *
 965:		 * To avoid deadlocks this means we can't block waiting for space, which
 966:		 * can lead to spurious -ENOSPC if there are no directly available
 967:		 * blocks.  We mitigate this a bit by allowing zeroing to dip into the
 968:		 * reserved pool, but eventually the VFS calling convention needs to
 969:		 * change.
 970:		 */
 971:		if (xfs_is_zoned_inode(ip)) {
 972:			error = xfs_zoned_space_reserve(mp, 1,
 973:					XFS_ZR_NOWAIT | XFS_ZR_RESERVED, &ac);
 974:			if (error) {
 975:				if (error == -EAGAIN)
 976:					return -ENOSPC;
 977:				return error;
 978:			}
 979:		}
 980:	
 981:		/*
 982:		 * File data changes must be complete before we start the transaction to
 983:		 * modify the inode.  This needs to be done before joining the inode to
 984:		 * the transaction because the inode cannot be unlocked once it is a
 985:		 * part of the transaction.
 986:		 *
 987:		 * Start with zeroing any data beyond EOF that we may expose on file
 988:		 * extension, or zeroing out the rest of the block on a downward
 989:		 * truncate.
 990:		 */
 991:		if (newsize > oldsize) {
 992:			trace_xfs_zero_eof(ip, oldsize, newsize - oldsize);
 993:			error = xfs_zero_range(ip, oldsize, newsize - oldsize,
 994:					&ac, &did_zeroing);
 995:		} else {
 996:			error = xfs_truncate_page(ip, newsize, &ac, &did_zeroing);
 997:		}
 998:	
 999:		if (xfs_is_zoned_inode(ip))
1000:			xfs_zoned_space_unreserve(mp, &ac);
1001:	
1002:		if (error)
1003:			return error;
1004:	
1005:		/*
1006:		 * We've already locked out new page faults, so now we can safely remove
1007:		 * pages from the page cache knowing they won't get refaulted until we
1008:		 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
1009:		 * complete. The truncate_setsize() call also cleans partial EOF page
1010:		 * PTEs on extending truncates and hence ensures sub-page block size
1011:		 * filesystems are correctly handled, too.
1012:		 *
1013:		 * We have to do all the page cache truncate work outside the
1014:		 * transaction context as the "lock" order is page lock->log space
1015:		 * reservation as defined by extent allocation in the writeback path.
1016:		 * Hence a truncate can fail with ENOMEM from xfs_trans_alloc(), but
1017:		 * having already truncated the in-memory version of the file (i.e. made
1018:		 * user visible changes). There's not much we can do about this, except
1019:		 * to hope that the caller sees ENOMEM and retries the truncate
1020:		 * operation.
1021:		 *
1022:		 * And we update in-core i_size and truncate page cache beyond newsize
1023:		 * before writeback the [i_disk_size, newsize] range, so we're
1024:		 * guaranteed not to write stale data past the new EOF on truncate down.
1025:		 */
1026:		truncate_setsize(inode, newsize);
1027:	
1028:		/*
1029:		 * We are going to log the inode size change in this transaction so
1030:		 * any previous writes that are beyond the on disk EOF and the new
1031:		 * EOF that have not been written out need to be written here.  If we
1032:		 * do not write the data out, we expose ourselves to the null files
1033:		 * problem. Note that this includes any block zeroing we did above;
1034:		 * otherwise those blocks may not be zeroed after a crash.
1035:		 */
1036:		if (did_zeroing ||
1037:		    (newsize > ip->i_disk_size && oldsize != ip->i_disk_size)) {
1038:			error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping,
1039:							ip->i_disk_size, newsize - 1);
1040:			if (error)
1041:				return error;
1042:		}
1043:	
1044:		/*
1045:		 * For realtime inode with more than one block rtextsize, we need the
1046:		 * block reservation for bmap btree block allocations/splits that can
1047:		 * happen since it could split the tail written extent and convert the
1048:		 * right beyond EOF one to unwritten.
1049:		 */
1050:		if (xfs_inode_has_bigrtalloc(ip))
1051:			resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);
1052:	
1053:		error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, resblks,
1054:					0, 0, &tp);
1055:		if (error)
1056:			return error;
1057:	
1058:		lock_flags |= XFS_ILOCK_EXCL;
1059:		xfs_ilock(ip, XFS_ILOCK_EXCL);
1060:		xfs_trans_ijoin(tp, ip, 0);
1061:	
1062:		/*
1063:		 * Only change the c/mtime if we are changing the size or we are
1064:		 * explicitly asked to change it.  This handles the semantic difference
1065:		 * between truncate() and ftruncate() as implemented in the VFS.
1066:		 *
1067:		 * The regular truncate() case without ATTR_CTIME and ATTR_MTIME is a
1068:		 * special case where we need to update the times despite not having
1069:		 * these flags set.  For all other operations the VFS set these flags
1070:		 * explicitly if it wants a timestamp update.
1071:		 */
1072:		if (newsize != oldsize &&
1073:		    !(iattr->ia_valid & (ATTR_CTIME | ATTR_MTIME))) {
1074:			iattr->ia_ctime = iattr->ia_mtime =
1075:				current_time(inode);
1076:			iattr->ia_valid |= ATTR_CTIME | ATTR_MTIME;
1077:		}
1078:	
1079:		/*
1080:		 * The first thing we do is set the size to new_size permanently on
1081:		 * disk.  This way we don't have to worry about anyone ever being able
1082:		 * to look at the data being freed even in the face of a crash.
1083:		 * What we're getting around here is the case where we free a block, it
1084:		 * is allocated to another file, it is written to, and then we crash.
1085:		 * If the new data gets written to the file but the log buffers
1086:		 * containing the free and reallocation don't, then we'd end up with
1087:		 * garbage in the blocks being freed.  As long as we make the new size
1088:		 * permanent before actually freeing any blocks it doesn't matter if
1089:		 * they get written to.
1090:		 */
1091:		ip->i_disk_size = newsize;
1092:		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
1093:	
1094:		if (newsize <= oldsize) {
1095:			error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, newsize);
1096:			if (error)
1097:				goto out_trans_cancel;
1098:	
1099:			/*
1100:			 * Truncated "down", so we're removing references to old data
1101:			 * here - if we delay flushing for a long time, we expose
1102:			 * ourselves unduly to the notorious NULL files problem.  So,
1103:			 * we mark this inode and flush it when the file is closed,
1104:			 * and do not wait the usual (long) time for writeout.
1105:			 */
1106:			xfs_iflags_set(ip, XFS_ITRUNCATED);
1107:	
1108:			/* A truncate down always removes post-EOF blocks. */
1109:			xfs_inode_clear_eofblocks_tag(ip);
1110:		}
1111:	
1112:		setattr_copy(idmap, inode, iattr);
1113:		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
1114:	
1115:		XFS_STATS_INC(mp, xs_ig_attrchg);
1116:	
1117:		if (xfs_has_wsync(mp))
1118:			xfs_trans_set_sync(tp);
1119:	
1120:		error = xfs_trans_commit(tp);
1121:	out_unlock:
1122:		if (lock_flags)
1123:			xfs_iunlock(ip, lock_flags);
1124:		return error;
1125:	
1126:	out_trans_cancel:
1127:		xfs_trans_cancel(tp);
1128:		goto out_unlock;
1129:	}
 SourceFile:fs/xfs/xfs_iops.c]

56/2 2026/09/17 10:44 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 67848
							output: 26
							thoughts: 202
						

Thoughts:
**Analyzing File System Concurrency: XFS vs. NTFS3**

Okay, so I'm digging into how different filesystems handle concurrent access during operations like truncation and reading. With XFS, my initial observation is that `truncate_setsize` is getting called *before* `xfs_trans_alloc` and `xfs_ilock`. That's interesting, but I need to understand the complete picture. Wait a minute... XFS has that `xfs_vn_setattr_size` function, and it's holding `XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL` while it's running. Then, I remember that `xfs_file_read_iter` only takes `XFS_IOLOCK_SHARED`. Bingo! It's clear that in XFS, `read` and `truncate` operations are mutually exclusive.

Now, I'm curious about how `ntfs3` does it. Let's see if their implementation has something similar. Does it also hold some lock that excludes reads during truncation? I remember `ntfs_setattr` and its involvement with VFS `notify_change`. Oh yes, it calls `inode_lock(inode)` – which maps to `i_rwsem`, if I remember correctly. So, there's the exclusive lock. The critical question now is whether that inode lock is held by `ntfs_file_read_iter` during reads. I'm going to quickly check `ntfs_file_read_iter`. Need to confirm if it grabs that same `i_rwsem` to see if the two are mutually exclusive.



57/2 2026/09/17 10:45 tool codesearch-definition-source
0m Args:
map[Name:ntfs_file_read_iter]

Results:
map[SourceCode: 814:	/*
 815:	 * ntfs_file_read_iter - file_operations::read_iter
 816:	 */
 817:	static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
 818:	{
 819:		struct file *file = iocb->ki_filp;
 820:		struct inode *inode = file_inode(file);
 821:		struct ntfs_inode *ni = ntfs_i(inode);
 822:		size_t bytes = iov_iter_count(iter);
 823:		loff_t valid, i_size, vbo, end;
 824:		unsigned int dio_flags;
 825:		ssize_t ret;
 826:	
 827:		ret = check_read_restriction(inode);
 828:		if (ret)
 829:			return ret;
 830:	
 831:		if (!bytes)
 832:			return 0; /* skip atime */
 833:	
 834:		if (ni->file.ads.len == ARRAY_SIZE(QUERY_STREAMS) &&
 835:		    !memcmp(ni->file.ads.name, QUERY_STREAMS, sizeof(QUERY_STREAMS))) {
 836:			/* Query ADS. */
 837:			if (unlikely(iocb->ki_flags & IOCB_DIRECT)) {
 838:				ntfs_inode_warn(
 839:					inode,
 840:					"direct I/O for streams is not supported");
 841:				return -EOPNOTSUPP;
 842:			}
 843:	
 844:			inode_lock_shared(inode);
 845:			ret = ni_query_ads(ni, &iocb->ki_pos, iter);
 846:			inode_unlock_shared(inode);
 847:			return ret;
 848:		}
 849:	
 850:		if (is_compressed(ni)) {
 851:			if (iocb->ki_flags & IOCB_DIRECT) {
 852:				ntfs_inode_warn(
 853:					inode, "direct i/o + compressed not supported");
 854:				return -EOPNOTSUPP;
 855:			}
 856:			/* Turn off readahead for compressed files. */
 857:			file->f_ra.ra_pages = 0;
 858:		}
 859:	
 860:		/* Fallback to buffered I/O if the inode does not support direct I/O. */
 861:		if (!(iocb->ki_flags & IOCB_DIRECT) ||
 862:		    !ntfs_should_use_dio(iocb, iter)) {
 863:			iocb->ki_flags &= ~IOCB_DIRECT;
 864:			return generic_file_read_iter(iocb, iter);
 865:		}
 866:	
 867:		if (iocb->ki_flags & IOCB_NOWAIT) {
 868:			if (!inode_trylock_shared(inode))
 869:				return -EAGAIN;
 870:		} else {
 871:			inode_lock_shared(inode);
 872:		}
 873:	
 874:		vbo = iocb->ki_pos;
 875:		end = vbo + bytes;
 876:		dio_flags = 0;
 877:		valid = ni->i_valid;
 878:		i_size = inode->i_size;
 879:	
 880:		if (vbo < valid) {
 881:			if (valid < end) {
 882:				/* read cross 'valid' size. */
 883:				dio_flags |= IOMAP_DIO_FORCE_WAIT;
 884:			}
 885:	
 886:			if (ni->file.run_da.count) {
 887:				/* Direct I/O is not compatible with delalloc. */
 888:				ret = ni_allocate_da_blocks(ni);
 889:				if (ret)
 890:					goto out;
 891:			}
 892:	
 893:			ret = iomap_dio_rw(iocb, iter, &ntfs_iomap_ops, NULL, dio_flags,
 894:					   NULL, 0);
 895:	
 896:			if (ret <= 0)
 897:				goto out;
 898:			end = vbo + ret;
 899:			if (valid < end) {
 900:				size_t to_zero = end - valid;
 901:				/* Fix iter. */
 902:				iov_iter_revert(iter, to_zero);
 903:				iov_iter_zero(to_zero, iter);
 904:			}
 905:		} else if (vbo < i_size) {
 906:			if (end > i_size)
 907:				bytes = i_size - vbo;
 908:			iov_iter_zero(bytes, iter);
 909:			iocb->ki_pos += bytes;
 910:			ret = bytes;
 911:		}
 912:	
 913:	out:
 914:		inode_unlock_shared(inode);
 915:		file_accessed(file);
 916:		return ret;
 917:	}
 SourceFile:fs/ntfs3/file.c]

58/2 2026/09/17 10:45 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 69996
							output: 22
							thoughts: 1227
						

Thoughts:
**Analyzing a Concurrency Bug in NTFS3 Truncate and Read Operations**

Okay, so I'm digging into this NTFS3 bug and trying to understand the race condition between file truncation and buffered reads. It seems `ntfs_file_read_iter` kicks things off with `generic_file_read_iter`, which is where the concurrency concern arises. Notably, `generic_file_read_iter` *doesn't* take an `inode_lock_shared(inode)` or the `i_rwsem`, which is standard Linux VFS behavior. Instead, it leans on folio locks. This means buffered reads can happily run concurrently with a `truncate` operation, which is where the problem lies.

Now, `truncate_setsize` uses folio locks only on the folios it's actually truncating (or, for extension, perhaps the last one if partially instantiated). The current `ntfs3` implementation updates `i_size` via `truncate_setsize` *before* the resident attribute size is updated in `attr_set_size_res`. This is where the race happens. A concurrent read, seeing the *new* `i_size` but the *old* resident attribute size, triggers `iomap_read_inline_data` to complain that the size read is larger than `iomap->length`. Bingo!

The fix seems straightforward, update the resident attribute size *before* the `i_size`. But the question is how. I'm looking at how `ext4` manages this, it sets the `i_size` after allocation. The pattern there looks like this:

```c
	if (!error)
		i_size_write(inode, attr->ia_size);
	...
	if (!shrink) {
		pagecache_isize_extended(inode, oldsize, inode->i_size);
	}
```

And `ext4` calls `truncate_pagecache` at the end. Can I do something similar? Let's check `ntfs_setattr`.

In `ntfs_setattr`:

```c
			if (newsize != oldsize) {
				truncate_setsize(inode, newsize);

				err = ntfs_set_size(inode, newsize);
				if (err) {
					i_size_write(inode, oldsize);
					goto out;
				}
```

If I change this to update `ntfs_set_size` first:

```c
			if (newsize != oldsize) {
				inode_dio_wait(inode);
				oldsize = i_size_read(inode);
				newsize = attr->ia_size;

				err = ntfs_set_size(inode, newsize);
				if (err)
					goto out;

				truncate_setsize(inode, newsize);
```

Wait a second, `ntfs_set_size` *already* calls `i_size_write(inode, newsize)` internally! I need to trace into `attr_set_size_ex` to confirm this.

```c
	if ((type == ATTR_DATA || (type == ATTR_ALLOC && name == I30_NAME))) {
		/* Update inode_set_bytes. */
		if (attr_b->non_res &&
		    inode_get_bytes(&ni->vfs_inode) != new_alloc) {
			inode_set_bytes(&ni->vfs_inode, new_alloc);
			dirty = true;
		}

		i_size_write(&ni->vfs_inode, new_size);
```

Yup, there it is. So, why does `ntfs_setattr` call `truncate_setsize` *before* `ntfs_set_size` in the first place? Because `truncate_setsize` also updates `i_size` via `i_size_write` and also calls `truncate_pagecache`. I'd be updating the size twice!

Okay, so I'm thinking if I just move `truncate_setsize` *after* `ntfs_set_size`. But, for shrinking truncates, I have to call `truncate_setsize` (or at least `truncate_pagecache`) *before* freeing the blocks on disk, right? I'm remembering the VFS documentation: `"Must be called with a lock serializing truncates and writes (generally i_rwsem but e.g. xfs uses a different lock) and before all filesystem specific block truncation has been performed."` Because a concurrent read could read into page cache from freed blocks.

Wait, but buffered reads *don't* take


59/2 2026/09/17 10:45 tool codesearch-definition-source
0m Args:
map[Name:fat_setattr]

Results:
map[SourceCode: 517:	int fat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 518:			struct iattr *attr)
 519:	{
 520:		struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb);
 521:		struct inode *inode = d_inode(dentry);
 522:		unsigned int ia_valid;
 523:		int error;
 524:	
 525:		/* Check for setting the inode time. */
 526:		ia_valid = attr->ia_valid;
 527:		if (ia_valid & TIMES_SET_FLAGS) {
 528:			if (fat_allow_set_time(idmap, sbi, inode))
 529:				attr->ia_valid &= ~TIMES_SET_FLAGS;
 530:		}
 531:	
 532:		error = setattr_prepare(idmap, dentry, attr);
 533:		attr->ia_valid = ia_valid;
 534:		if (error) {
 535:			if (sbi->options.quiet)
 536:				error = 0;
 537:			goto out;
 538:		}
 539:	
 540:		/*
 541:		 * Expand the file. Since inode_setattr() updates ->i_size
 542:		 * before calling the ->truncate(), but FAT needs to fill the
 543:		 * hole before it. XXX: this is no longer true with new truncate
 544:		 * sequence.
 545:		 */
 546:		if (attr->ia_valid & ATTR_SIZE) {
 547:			inode_dio_wait(inode);
 548:	
 549:			if (attr->ia_size > inode->i_size) {
 550:				error = fat_cont_expand(inode, attr->ia_size);
 551:				if (error || attr->ia_valid == ATTR_SIZE)
 552:					goto out;
 553:				attr->ia_valid &= ~ATTR_SIZE;
 554:			}
 555:		}
 556:	
 557:		if (((attr->ia_valid & ATTR_UID) &&
 558:		     (!uid_eq(from_vfsuid(idmap, i_user_ns(inode), attr->ia_vfsuid),
 559:			      sbi->options.fs_uid))) ||
 560:		    ((attr->ia_valid & ATTR_GID) &&
 561:		     (!gid_eq(from_vfsgid(idmap, i_user_ns(inode), attr->ia_vfsgid),
 562:			      sbi->options.fs_gid))) ||
 563:		    ((attr->ia_valid & ATTR_MODE) &&
 564:		     (attr->ia_mode & ~FAT_VALID_MODE)))
 565:			error = -EPERM;
 566:	
 567:		if (error) {
 568:			if (sbi->options.quiet)
 569:				error = 0;
 570:			goto out;
 571:		}
 572:	
 573:		/*
 574:		 * We don't return -EPERM here. Yes, strange, but this is too
 575:		 * old behavior.
 576:		 */
 577:		if (attr->ia_valid & ATTR_MODE) {
 578:			if (fat_sanitize_mode(sbi, inode, &attr->ia_mode) < 0)
 579:				attr->ia_valid &= ~ATTR_MODE;
 580:		}
 581:	
 582:		if (attr->ia_valid & ATTR_SIZE) {
 583:			error = fat_block_truncate_page(inode, attr->ia_size);
 584:			if (error)
 585:				goto out;
 586:			down_write(&MSDOS_I(inode)->truncate_lock);
 587:			truncate_setsize(inode, attr->ia_size);
 588:			fat_truncate_blocks(inode, attr->ia_size);
 589:			up_write(&MSDOS_I(inode)->truncate_lock);
 590:		}
 591:	
 592:		/*
 593:		 * setattr_copy can't truncate these appropriately, so we'll copy them
 594:		 * ourselves.  See fat_truncate_time for the c/mtime logic on fat.
 595:		 */
 596:		if (attr->ia_valid & ATTR_ATIME)
 597:			fat_truncate_time(inode, &attr->ia_atime, FAT_UPDATE_ATIME);
 598:		if (attr->ia_valid & ATTR_MTIME)
 599:			fat_truncate_time(inode, &attr->ia_mtime, FAT_UPDATE_CMTIME);
 600:		attr->ia_valid &= ~(ATTR_ATIME|ATTR_CTIME|ATTR_MTIME);
 601:	
 602:		setattr_copy(idmap, inode, attr);
 603:		mark_inode_dirty(inode);
 604:	out:
 605:		return error;
 606:	}
 SourceFile:fs/fat/file.c]

60/2 2026/09/17 10:45 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 73754
							output: 24
							thoughts: 2547
						

Thoughts:
**Analyzing File Size Updates in NTFS**

Alright, let's break this down. I'm looking at how file sizes are changed in the NTFS filesystem, specifically the implications of extending versus shrinking. I'm focusing on ensuring consistency between the in-memory inode size (`i_size`) and the on-disk metadata (`attr_b->res.data_size`).

First, I examined the FAT filesystem as a point of reference. I observed how `fat_cont_expand` is used for extension and how different functions, `truncate_setsize` and then `fat_truncate_blocks` are used for shrinking.

Then, I jumped into `ntfs_setattr`. The core of my analysis revolves around a potential race condition when extending a file. In the initial implementation, `truncate_setsize` modifies `i_size` immediately, but the disk allocation happens later in `ntfs_set_size`. The crucial point is that `ntfs_set_size` indirectly calls `attr_set_size_ex`, which then updates `i_size` as well. The question is, which order of operations is correct.

I realized that if we are extending the file ( `newsize > oldsize`), `truncate_setsize` only calls `pagecache_isize_extended`. This should update the page cache to reflect the new size. `ntfs_set_size`, will call `attr_set_size_ex`, where the `i_size` is updated. However, the update happens *before* the on-disk allocation updates (which are also part of `attr_set_size_ex`). This is where the race condition lies – a concurrent reader could observe the new `i_size` before the disk metadata reflects this change, leading to inconsistencies.

If shrinking, then `truncate_setsize` updates `i_size` and truncates the page cache. `ntfs_set_size` will call `attr_set_size_ex` and the disk blocks will be deallocated.

My proposed change involves handling the shrinking and extending separately:

*   **Shrinking:** I'd handle the shrinking and extending differently. For shrinking, it's safe to call `truncate_setsize` first, because that adjusts `i_size` and truncates the page cache. Then, I let `ntfs_set_size` deallocate disk blocks. The key is in handling errors and ensuring atomicity – if `ntfs_set_size` fails during the shrink, I must revert `i_size` back to its original value, so `i_size` never misrepresents the actual on-disk state.

*   **Extending:** For extension, my modification defers the explicit `i_size` update via `pagecache_isize_extended` until *after* `ntfs_set_size` completes successfully, which handles the on-disk allocation update. This seems safer, but I need to make sure `ntfs_set_size` itself doesn't depend on a pre-existing `i_size` for its internal calculations. After reviewing the code, it looks like it uses `new_size` directly and that `ntfs_set_size` is safe.

Now, if `ntfs_set_size` fails, `attr_set_size_ex` returns an error, *without* the `i_size` being updated, which is good.

I need to make sure that the `ntfs_set_size` function doesn't rely on `i_size` being up-to-date, and it uses `new_size` directly. It calls `attr_set_size` which, if it succeeds, calls `i_size_write` internally.

To be sure that my approach is safe, I reviewed the behavior of ext4. Ext4 implements file size changes differently and this is useful for comparisons. For shrinking, ext4 updates the `i_size` and `truncate_pagecache` *before* the disk truncation. For extending, it updates `i_size` and does an `ext4_truncate` (which reallocates blocks on disk). Then I also need to verify that what `ntfs3` does matches `ext4`.

In summary: I'm confident my modification addresses the potential race condition by ensuring that the on-disk metadata is updated *before* the new `i_size` is visible to concurrent readers when extending a file. The proposed approach is consistent with the behavior of ext4 when shrinking a file.



61/2 2026/09/17 10:46 tool codesearch-find-references
0m Args:
map[Name:ntfs_set_size]

Results:
map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ntfs_fallocate SourceFile:fs/ntfs3/file.c SourceLine:655] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ntfs_fallocate SourceFile:fs/ntfs3/file.c SourceLine:679] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ntfs_file_write_iter SourceFile:fs/ntfs3/file.c SourceLine:1287] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ntfs_setattr SourceFile:fs/ntfs3/file.c SourceLine:741]] TruncatedOutput:false]

62/2 2026/09/17 10:46 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 77516
							output: 23
							thoughts: 212
						

Thoughts:
**Analyzing NTFS Fallocate Implementation**

Okay, so I'm looking at the `ntfs_fallocate` function, and something's bugging me. Specifically, this section:

```c
	if (new_size > i_size) {
		err = ntfs_set_size(inode, new_size);
		if (err)
			goto out;
	}
```

My initial thought is that it's straightforward; if the requested size (`new_size`) is larger than the current inode size (`i_size`), it calls `ntfs_set_size` to extend the file. Fine, that makes sense. Seems like a typical approach. But then I realized, it *doesn't* appear to use `truncate_setsize` here. That's unusual.

Wait a second... if `ntfs_fallocate` extends the file, it *directly* calls `ntfs_set_size`. And `ntfs_set_size` is the one responsible for updating `i_size`. That's not the normal pattern. `ntfs_fallocate` has a direct impact on the inode size without going through the usual `pagecache_isize_extended` routine. Is that correct?

Thinking back, fallocate with `KEEP_SIZE` shouldn't change the size, but if it's not set, we *do* expect `i_size` to be updated. It feels off. I need to dig deeper into the implementation of `ntfs_fallocate` to confirm my suspicion that the lack of `pagecache_isize_extended` call might be a subtle bug. I'll check it closely.



63/2 2026/09/17 10:46 tool codesearch-definition-source
0m Args:
map[Name:ntfs_fallocate]

Results:
map[SourceCode: 457:	/*
 458:	 * ntfs_fallocate - file_operations::ntfs_fallocate
 459:	 *
 460:	 * Preallocate space for a file. This implements ntfs's fallocate file
 461:	 * operation, which gets called from sys_fallocate system call. User
 462:	 * space requests 'len' bytes at 'vbo'. If FALLOC_FL_KEEP_SIZE is set
 463:	 * we just allocate clusters without zeroing them out. Otherwise we
 464:	 * allocate and zero out clusters via an expanding truncate.
 465:	 */
 466:	static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
 467:	{
 468:		struct inode *inode = file_inode(file);
 469:		struct address_space *mapping = inode->i_mapping;
 470:		struct super_block *sb = inode->i_sb;
 471:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 472:		struct ntfs_inode *ni = ntfs_i(inode);
 473:		loff_t end = vbo + len;
 474:		loff_t vbo_down = round_down(vbo, max_t(unsigned long,
 475:							sbi->cluster_size, PAGE_SIZE));
 476:		bool is_supported_holes = is_sparsed(ni) || is_compressed(ni);
 477:		loff_t i_size, new_size;
 478:		bool map_locked;
 479:		int err;
 480:	
 481:		/* No support for dir. */
 482:		if (!S_ISREG(inode->i_mode))
 483:			return -EOPNOTSUPP;
 484:	
 485:		/*
 486:		 * vfs_fallocate checks all possible combinations of mode.
 487:		 * Do additional checks here before ntfs_set_state(dirty).
 488:		 */
 489:		if (mode & FALLOC_FL_PUNCH_HOLE) {
 490:			if (!is_supported_holes)
 491:				return -EOPNOTSUPP;
 492:		} else if (mode & FALLOC_FL_COLLAPSE_RANGE) {
 493:		} else if (mode & FALLOC_FL_INSERT_RANGE) {
 494:			if (!is_supported_holes)
 495:				return -EOPNOTSUPP;
 496:		} else if (mode &
 497:			   ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
 498:			     FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_INSERT_RANGE)) {
 499:			ntfs_inode_warn(inode, "fallocate(0x%x) is not supported",
 500:					mode);
 501:			return -EOPNOTSUPP;
 502:		}
 503:	
 504:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 505:	
 506:		inode_lock(inode);
 507:		i_size = inode->i_size;
 508:		new_size = max(end, i_size);
 509:		map_locked = false;
 510:	
 511:		if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 512:			/* Should never be here, see ntfs_file_open. */
 513:			err = -EOPNOTSUPP;
 514:			goto out;
 515:		}
 516:	
 517:		if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
 518:			    FALLOC_FL_INSERT_RANGE)) {
 519:			inode_dio_wait(inode);
 520:			filemap_invalidate_lock(mapping);
 521:			map_locked = true;
 522:		}
 523:	
 524:		if (mode & FALLOC_FL_PUNCH_HOLE) {
 525:			u32 frame_size;
 526:			loff_t mask, vbo_a, end_a, tmp, from;
 527:	
 528:			err = filemap_write_and_wait_range(mapping, vbo_down,
 529:							   LLONG_MAX);
 530:			if (err)
 531:				goto out;
 532:	
 533:			truncate_pagecache(inode, vbo_down);
 534:	
 535:			ni_lock(ni);
 536:			err = attr_punch_hole(ni, vbo, len, &frame_size);
 537:			ni_unlock(ni);
 538:			if (!err)
 539:				goto ok;
 540:	
 541:			if (err != E_NTFS_NOTALIGNED)
 542:				goto out;
 543:	
 544:			/* Process not aligned punch. */
 545:			err = 0;
 546:			if (end > i_size)
 547:				end = i_size;
 548:			mask = frame_size - 1;
 549:			vbo_a = (vbo + mask) & ~mask;
 550:			end_a = end & ~mask;
 551:	
 552:			tmp = min(vbo_a, end);
 553:			from = min_t(loff_t, ni->i_valid, vbo);
 554:			/* Zero head of punch. */
 555:			if (tmp > from) {
 556:				err = iomap_zero_range(inode, from, tmp - from, NULL,
 557:						       &ntfs_iomap_ops,
 558:						       &ntfs_iomap_folio_ops, NULL);
 559:				if (err)
 560:					goto out;
 561:			}
 562:	
 563:			/* Aligned punch_hole. Deallocate clusters. */
 564:			if (end_a > vbo_a) {
 565:				ni_lock(ni);
 566:				err = attr_punch_hole(ni, vbo_a, end_a - vbo_a, NULL);
 567:				ni_unlock(ni);
 568:				if (err)
 569:					goto out;
 570:			}
 571:	
 572:			/* Zero tail of punch. */
 573:			if (vbo < end_a && end_a < end) {
 574:				err = iomap_zero_range(inode, end_a, end - end_a, NULL,
 575:						       &ntfs_iomap_ops,
 576:						       &ntfs_iomap_folio_ops, NULL);
 577:				if (err)
 578:					goto out;
 579:			}
 580:		} else if (mode & FALLOC_FL_COLLAPSE_RANGE) {
 581:			/*
 582:			 * Write tail of the last page before removed range since
 583:			 * it will get removed from the page cache below.
 584:			 */
 585:			err = filemap_write_and_wait_range(mapping, vbo_down, vbo);
 586:			if (err)
 587:				goto out;
 588:	
 589:			/*
 590:			 * Write data that will be shifted to preserve them
 591:			 * when discarding page cache below.
 592:			 */
 593:			err = filemap_write_and_wait_range(mapping, end, LLONG_MAX);
 594:			if (err)
 595:				goto out;
 596:	
 597:			truncate_pagecache(inode, vbo_down);
 598:	
 599:			ni_lock(ni);
 600:			err = attr_collapse_range(ni, vbo, len);
 601:			ni_unlock(ni);
 602:			if (err)
 603:				goto out;
 604:		} else if (mode & FALLOC_FL_INSERT_RANGE) {
 605:			/* Check new size. */
 606:			err = inode_newsize_ok(inode, new_size);
 607:			if (err)
 608:				goto out;
 609:	
 610:			/* Write out all dirty pages. */
 611:			err = filemap_write_and_wait_range(mapping, vbo_down,
 612:							   LLONG_MAX);
 613:			if (err)
 614:				goto out;
 615:			truncate_pagecache(inode, vbo_down);
 616:	
 617:			ni_lock(ni);
 618:			err = attr_insert_range(ni, vbo, len);
 619:			ni_unlock(ni);
 620:			if (err)
 621:				goto out;
 622:		} else {
 623:			/* Check new size. */
 624:			u8 cluster_bits = sbi->cluster_bits;
 625:	
 626:			/* Be sure file is non resident. */
 627:			if (is_resident(ni)) {
 628:				ni_lock(ni);
 629:				err = attr_force_nonresident(ni);
 630:				ni_unlock(ni);
 631:				if (err)
 632:					goto out;
 633:			}
 634:	
 635:			/* generic/213: expected -ENOSPC instead of -EFBIG. */
 636:			if (!is_supported_holes) {
 637:				loff_t to_alloc = new_size - inode_get_bytes(inode);
 638:	
 639:				if (to_alloc > 0 &&
 640:				    (to_alloc >> cluster_bits) >
 641:					    wnd_zeroes(&sbi->used.bitmap)) {
 642:					err = -ENOSPC;
 643:					goto out;
 644:				}
 645:			}
 646:	
 647:			err = inode_newsize_ok(inode, new_size);
 648:			if (err)
 649:				goto out;
 650:	
 651:			if (new_size > i_size) {
 652:				/*
 653:				 * Allocate clusters, do not change 'valid' size.
 654:				 */
 655:				err = ntfs_set_size(inode, new_size);
 656:				if (err)
 657:					goto out;
 658:			}
 659:	
 660:			if (is_supported_holes) {
 661:				CLST vcn = vbo >> cluster_bits;
 662:				CLST cend = bytes_to_cluster(sbi, end);
 663:				CLST lcn, clen;
 664:				bool new;
 665:	
 666:				/*
 667:				 * Allocate and zero new clusters.
 668:				 */
 669:				for (; vcn < cend; vcn += clen) {
 670:					err = attr_data_get_block(ni, vcn, cend - vcn,
 671:								  &lcn, &clen, &new,
 672:								  true, NULL, false);
 673:					if (err)
 674:						goto out;
 675:				}
 676:			}
 677:	
 678:			if (mode & FALLOC_FL_KEEP_SIZE) {
 679:				err = ntfs_set_size(inode, i_size);
 680:				if (err)
 681:					goto out;
 682:			}
 683:		}
 684:	
 685:	ok:
 686:		err = file_modified(file);
 687:		if (err)
 688:			goto out;
 689:	
 690:	out:
 691:		if (map_locked)
 692:			filemap_invalidate_unlock(mapping);
 693:	
 694:		if (!err) {
 695:			inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
 696:			mark_inode_dirty(inode);
 697:		}
 698:	
 699:		inode_unlock(inode);
 700:		return err;
 701:	}
 SourceFile:fs/ntfs3/file.c]

64/2 2026/09/17 10:46 llm debugger-compressor
0m Model:
gemini-3.8-flash

Reply:
### Investigation Summary

#### 1. Crash Overview & Call Stack
* **Kernel Warning**: `WARNING: fs/iomap/buffered-io.c:431 at iomap_read_inline_data+0xa7b/0xc40 fs/iomap/buffered-io.c:431`
* **Warning Condition**: `WARN_ON_ONCE(size > iomap->length)`
* **Stack Trace**:
  ```text
  iomap_read_inline_data fs/iomap/buffered-io.c:431
  iomap_read_folio_iter fs/iomap/buffered-io.c:571
  iomap_read_folio fs/iomap/buffered-io.c:676
  ntfs_read_folio fs/ntfs3/inode.c:856
  filemap_read_folio mm/filemap.c:2520
  filemap_fault mm/filemap.c:3689
  __do_fault mm/memory.c:5565
  ...
  handle_mm_fault / exc_page_fault
  ```
* **Repro mechanism**: Multithreaded test case bouncing file truncation (`ftruncate(fd, 20)` and `ftruncate(fd, 5)`) on an NTFS file with resident (inline) data, while concurrent threads trigger page faults via mmap reads (`val = ptr[0]` after `madvise(DONTNEED)` and `posix_fadvise(DONTNEED)`).

---

#### 2. Key Code Snippets & File Paths

* **`fs/iomap/buffered-io.c:418-435`** (`iomap_read_inline_data`):
  ```c
  static int iomap_read_inline_data(const struct iomap_iter *iter,
  		struct folio *folio)
  {
  	const struct iomap *iomap = iomap_iter_srcmap(iter);
  	size_t size = i_size_read(iter->inode) - iomap->offset;
  	size_t offset = offset_in_folio(folio, iomap->offset);

  	if (WARN_ON_ONCE(!iomap->inline_data))
  		return -EIO;

  	if (folio_test_uptodate(folio))
  		return 0;

  	if (WARN_ON_ONCE(size > iomap->length)) {
  		fserror_report_io(iter->inode, FSERR_BUFFERED_READ,
  				  iomap->offset, size, -EIO, GFP_NOFS);
  		return -EIO;
  	}
  ...
  ```
  Note: `iomap->offset` for inline data in ntfs3 is 0 (`iomap->offset = 0`), so `size = i_size_read(iter->inode)`. `iomap->length` is set to the resident attribute size `clen` (i.e. `attr_b->res.data_size`).

* **`fs/ntfs3/file.c:706-753`** (`ntfs_setattr`):
  ```c
  int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
  		 struct iattr *attr)
  {
  	struct inode *inode = d_inode(dentry);
  	struct ntfs_inode *ni = ntfs_i(inode);
  	u32 ia_valid = attr->ia_valid;
  ...
  	if (ia_valid & ATTR_SIZE) {
  		loff_t newsize, oldsize;
  ...
  		inode_dio_wait(inode);
  		oldsize = i_size_read(inode);
  		newsize = attr->ia_size;

  		if (newsize != oldsize) {
  			truncate_setsize(inode, newsize);

  			err = ntfs_set_size(inode, newsize);
  			if (err) {
  				i_size_write(inode, oldsize);
  				goto out;
  			}
  ...
  ```

* **`mm/truncate.c:816-824`** (`truncate_setsize`):
  ```c
  void truncate_setsize(struct inode *inode, loff_t newsize)
  {
  	loff_t oldsize = inode->i_size;

  	i_size_write(inode, newsize);
  	if (newsize > oldsize)
  		pagecache_isize_extended(inode, oldsize, newsize);
  	truncate_pagecache(inode, newsize);
  }
  ```

* **`fs/ntfs3/inode.c:883-915`** (`ntfs_set_size`):
  ```c
  int ntfs_set_size(struct inode *inode, u64 new_size)
  {
  ...
  	ni_lock(ni);
  	down_write(&ni->file.run_lock);
  	if (new_size < ni->i_valid)
  		ni->i_valid = new_size;

  	/* last 'true' means keep preallocated. */
  	err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
  			    &ni->file.run, new_size, &ni->i_valid, true);

  	up_write(&ni->file.run_lock);
  	ni_unlock(ni);

  	return err;
  }
  ```

* **`fs/ntfs3/attrib.c:430-897`** (`attr_set_size_ex`):
  ```c
  	if (!attr_b->non_res) {
  		err = attr_set_size_res(ni, attr_b, le_b, mi_b, new_size, run,
  					&attr_b);
  		if (err)
  			return err;

  		/* Return if file is still resident. */
  		if (!attr_b->non_res) {
  			dirty = true;
  			goto ok1;
  		}
  ...
  ok1:
  ...
  	if ((type == ATTR_DATA || (type == ATTR_ALLOC && name == I30_NAME))) {
  		...
  		i_size_write(&ni->vfs_inode, new_size);
  		...
  	}
  ```

* **`fs/ntfs3/inode.c:933-1017`** (`ntfs_iomap_begin`):
  ```c
  	err = attr_data_get_block(ni, vcn, clen_max, &lcn, &clen,
  				  rw ? &new_clst : NULL, zero, &res, no_da);
  	if (err)
  		return err;
  ...
  	if (lcn == RESIDENT_LCN) {
  		if (offset >= clen) {
  			if (res)
  				__free_page(virt_to_page(res));
  			if (flags & IOMAP_REPORT) {
  				return -ENOENT;
  			}
  			return -EFAULT;
  		}

  		iomap->private = iomap->inline_data = res;
  		iomap->type = IOMAP_INLINE;
  		iomap->offset = 0;
  		iomap->length = clen; /* resident size in bytes. */
  		return 0;
  	}
  ```

* **`fs/ntfs3/attrib.c:953-985`** (`attr_data_get_block`):
  For resident data, lookup in `run` fails, acquires `ni_lock(ni)`, calls `attr_data_get_block_locked()`, and releases `ni_lock(ni)`.
  In `attr_data_get_block_locked()`, `attr_b->res.data_size` is copied into `*len` (which becomes `clen` and `iomap->length`) and a page is allocated and populated with `resident_data(attr_b)` into `*res` (`iomap->inline_data`).

---

#### 3. Root Cause Analysis

1. **Locking Disparity Between Read Faults and Setattr**:
   * Page fault / read path: `filemap_fault()` / `filemap_read_folio()` holds the folio lock, but does **not** hold `inode->i_rwsem`.
   * Truncate path: `ntfs_setattr()` runs with `inode->i_rwsem` locked.
   * `ntfs_iomap_begin()` synchronizes internally via `ni_lock(ni)` when fetching block/resident attributes in `attr_data_get_block()`, but drops `ni_lock(ni)` before returning to `iomap_read_folio()`.

2. **The Race Condition Sequence**:
   * **State**: File has size 5 (resident attribute `data_size = 5`, `inode->i_size = 5`).
   * **Thread 1 (`ftruncate(fd, 20)`)**:
     1. In `ntfs_setattr()`: Calls `truncate_setsize(inode, 20)`.
     2. `truncate_setsize()` immediately updates VFS `inode->i_size` to 20 via `i_size_write(inode, 20)`.
     3. *Context switch before `ntfs_set_size(inode, 20)` acquires `ni_lock(ni)` or updates `attr_b->res.data_size`.*
   * **Thread 2 (page fault read on `ptr[0]`)**:
     1. Calls `filemap_fault()` -> `filemap_read_folio()` -> `ntfs_read_folio()` -> `iomap_read_folio()` -> `ntfs_iomap_begin()`.
     2. `ntfs_iomap_begin()` acquires `ni_lock(ni)` (since Thread 1 hasn't entered `ntfs_set_size` yet).
     3. Calls `attr_data_get_block_locked()`. Resident attribute on disk / in MFT record still has `data_size = 5`.
     4. Sets `iomap->offset = 0`, `iomap->length = clen = 5`, `iomap->type = IOMAP_INLINE`, and populates `iomap->inline_data` with 5 bytes.
     5. Drops `ni_lock(ni)` and returns to `iomap_read_folio()`.
     6. `iomap_read_folio_iter()` calls `iomap_read_inline_data()`.
     7. `iomap_read_inline_data()` computes:
        `size = i_size_read(iter->inode) - iomap->offset;`
        Since `inode->i_size` was already updated to 20 by `truncate_setsize()`, `size = 20 - 0 = 20`.
     8. `iomap_read_inline_data()` checks:
        `if (WARN_ON_ONCE(size > iomap->length))` -> `20 > 5` evaluates to true!
     9. Kernel triggers `WARN_ON_ONCE` and returns `-EIO`.

3. **Secondary / Reverse Race Window**:
   Even within `ntfs_set_size()` / `attr_set_size_ex()`, when shrinking or expanding, `i_size_write(&ni->vfs_inode, new_size)` is also duplicated in `attr_set_size_ex` line 889, but `truncate_setsize()` in `ntfs_setattr()` already prematurely changed `inode->i_size` before underlying metadata allocation/extension occurred in `ntfs_set_size()`. Also, between `ntfs_iomap_begin()` releasing `ni_lock(ni)` and `iomap_read_inline_data()` reading `i_size_read()`, `i_size` can change concurrently if read isn't serialized with size modifications.

---

#### 4. Approaches Tried and Dead Ends
* **Examined `iomap_read_inline_data`**: Verified the exact check and warning triggered on line 431.
* **Traced `ntfs_read_folio` -> `ntfs_iomap_begin`**: Confirmed how `iomap->length` is initialized for `RESIDENT_LCN` via `attr_data_get_block()`.
* **Traced `attr_data_get_block` and `attr_data_get_block_locked`**: Verified locking (`ni_lock`) and how `data_size` is read from `attr_b->res.data_size`.
* **Traced `ntfs_set_size` and `attr_set_size_ex`**: Verified how resident attributes are resized and noticed `attr_set_size_ex` updates `i_size_write()`, which led to checking `ntfs_setattr`.
* **Investigated `ntfs_setattr`**: Discovered `truncate_setsize(inode, newsize)` is called before `ntfs_set_size(inode, newsize)`.
* **Compared with `ext4_setattr`**: Ext4 takes special care around inline data conversion (`ext4_convert_inline_data`) and updates `i_size` under `i_data_sem` together with disksize, rather than blindly calling `truncate_setsize` before filesystem block/extent changes.

---

#### 5. Lines of Investigation / Fix Considerations
* For truncate extension (`newsize > oldsize`) in `ntfs_setattr`: Calling `truncate_setsize()` before `ntfs_set_size()` exposes an unbacked, extended `i_size` to un-serialized readers. Typically, file systems do not extend `i_size` before metadata is updated, or pagecache/iomap readers must not observe `size > iomap->length`.
* Specifically in `ntfs_setattr`: If shrinking (`newsize < oldsize`), `truncate_setsize` reduces page cache. If expanding (`newsize > oldsize`), `i_size` should only be updated after `ntfs_set_size` successfully allocates/updates the resident data or nonresident extents (or `truncate_setsize` should only be called if shrinking, while for expanding, `i_size_write` + `pagecache_isize_extended` should be done after `ntfs_set_size`).
* Or check how `iomap_read_inline_data` handles concurrent truncation/expansion, or whether ntfs3 needs to serialize `iomap_begin` and folio reads or clamp `iomap->length` / `size`.

Tokens:
							input: 60236
							output: 3533
							thoughts: 0
						

65/2 2026/09/17 10:46 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 35818
							output: 23
							thoughts: 0
						

66/2 2026/09/17 10:46 tool codesearch-definition-source
0m Args:
map[Name:ntfs_setattr]

Results:
map[SourceCode: 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
 770:		if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE))
 771:			ntfs_save_wsl_perm(inode, NULL);
 772:		mark_inode_dirty(inode);
 773:	out:
 774:		return err;
 775:	}
 SourceFile:fs/ntfs3/file.c]

67/2 2026/09/17 10:46 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 36933
							output: 24
							thoughts: 0
						

68/2 2026/09/17 10:47 tool codesearch-definition-source
0m Args:
map[Name:ntfs_set_size]

Results:
map[SourceCode: 883:	int ntfs_set_size(struct inode *inode, u64 new_size)
 884:	{
 885:		struct super_block *sb = inode->i_sb;
 886:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 887:		struct ntfs_inode *ni = ntfs_i(inode);
 888:		int err;
 889:	
 890:		/* Check for maximum file size. */
 891:		if (is_sparsed(ni) || is_compressed(ni)) {
 892:			if (new_size > sbi->maxbytes_sparse) {
 893:				return -EFBIG;
 894:			}
 895:		} else if (new_size > sbi->maxbytes) {
 896:			return -EFBIG;
 897:		}
 898:	
 899:		/* Mark rw ntfs as dirty. It will be cleared at umount. */
 900:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 901:	
 902:		ni_lock(ni);
 903:		down_write(&ni->file.run_lock);
 904:		if (new_size < ni->i_valid)
 905:			ni->i_valid = new_size;
 906:	
 907:		/* last 'true' means keep preallocated. */
 908:		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
 909:				    &ni->file.run, new_size, &ni->i_valid, true);
 910:	
 911:		up_write(&ni->file.run_lock);
 912:		ni_unlock(ni);
 913:	
 914:		return err;
 915:	}
 SourceFile:fs/ntfs3/inode.c]

69/2 2026/09/17 10:47 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 37518
							output: 23
							thoughts: 0
						

70/2 2026/09/17 10:47 tool codesearch-definition-source
0m Args:
map[Name:attr_set_size]

Results:
map[SourceCode: 473:	static inline int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
 474:					const __le16 *name, u8 name_len,
 475:					struct runs_tree *run, u64 new_size,
 476:					const u64 *new_valid, bool keep_prealloc)
 477:	{
 478:		return attr_set_size_ex(ni, type, name, name_len, run, new_size,
 479:					new_valid, keep_prealloc, NULL, false);
 480:	}
 SourceFile:fs/ntfs3/ntfs_fs.h]

71/2 2026/09/17 10:47 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 37739
							output: 25
							thoughts: 0
						

72/2 2026/09/17 10:47 tool codesearch-definition-source
0m Args:
map[Name:attr_set_size_ex]

Results:
map[SourceCode: 421:	/*
 422:	 * attr_set_size_ex - Change the size of attribute.
 423:	 *
 424:	 * Extend:
 425:	 *   - Sparse/compressed: No allocated clusters.
 426:	 *   - Normal: Append allocated and preallocated new clusters.
 427:	 * Shrink:
 428:	 *   - No deallocate if @keep_prealloc is set.
 429:	 */
 430:	int attr_set_size_ex(struct ntfs_inode *ni, enum ATTR_TYPE type,
 431:			     const __le16 *name, u8 name_len, struct runs_tree *run,
 432:			     u64 new_size, const u64 *new_valid, bool keep_prealloc,
 433:			     struct ATTRIB **ret, bool no_da)
 434:	{
 435:		int err = 0;
 436:		struct ntfs_inode *nb = ni->base;
 437:		struct ntfs_sb_info *sbi = ni->mi.sbi;
 438:		u8 cluster_bits = sbi->cluster_bits;
 439:		bool is_mft = ni->mi.rno == MFT_REC_MFT && type == ATTR_DATA &&
 440:			      !name_len;
 441:		u64 old_valid, old_size, old_alloc, new_alloc_tmp;
 442:		u64 new_alloc = 0;
 443:		struct ATTRIB *attr = NULL, *attr_b;
 444:		struct ATTR_LIST_ENTRY *le, *le_b;
 445:		struct mft_inode *mi, *mi_b;
 446:		CLST alen, vcn, lcn, new_alen, old_alen, svcn, evcn;
 447:		CLST next_svcn, pre_alloc = -1, done = 0;
 448:		bool is_ext = false, is_bad = false;
 449:		bool dirty = false;
 450:		struct runs_tree *run_da = run == &ni->file.run ? &ni->file.run_da :
 451:								  NULL;
 452:		bool da = !is_mft && sbi->options->delalloc && run_da && !no_da;
 453:		u32 align;
 454:		struct MFT_REC *rec;
 455:	
 456:	again:
 457:		alen = 0;
 458:		le_b = NULL;
 459:		attr_b = ni_find_attr(ni, NULL, &le_b, type, name, name_len, NULL,
 460:				      &mi_b);
 461:		if (!attr_b) {
 462:			err = -ENOENT;
 463:			goto bad_inode;
 464:		}
 465:	
 466:		if (!attr_b->non_res) {
 467:			err = attr_set_size_res(ni, attr_b, le_b, mi_b, new_size, run,
 468:						&attr_b);
 469:			if (err)
 470:				return err;
 471:	
 472:			/* Return if file is still resident. */
 473:			if (!attr_b->non_res) {
 474:				dirty = true;
 475:				goto ok1;
 476:			}
 477:	
 478:			/* Layout of records may be changed, so do a full search. */
 479:			goto again;
 480:		}
 481:	
 482:		is_ext = is_attr_ext(attr_b);
 483:		align = sbi->cluster_size;
 484:		if (is_ext) {
 485:			align <<= attr_b->nres.c_unit;
 486:			keep_prealloc = false;
 487:			da = false;
 488:		}
 489:	
 490:		old_valid = le64_to_cpu(attr_b->nres.valid_size);
 491:		old_size = le64_to_cpu(attr_b->nres.data_size);
 492:		old_alloc = le64_to_cpu(attr_b->nres.alloc_size);
 493:	
 494:	again_1:
 495:		old_alen = old_alloc >> cluster_bits;
 496:	
 497:		new_alloc = (new_size + align - 1) & ~(u64)(align - 1);
 498:		new_alen = new_alloc >> cluster_bits;
 499:	
 500:		if (keep_prealloc && new_size < old_size) {
 501:			attr_b->nres.data_size = cpu_to_le64(new_size);
 502:			mi_b->dirty = dirty = true;
 503:			goto ok;
 504:		}
 505:	
 506:		if (da &&
 507:		    (vcn = old_alen + run_len(&ni->file.run_da), new_alen > vcn)) {
 508:			/* Resize up normal file. Delay new clusters allocation. */
 509:			alen = new_alen - vcn;
 510:	
 511:			if (ntfs_check_free_space(sbi, alen, 0, true)) {
 512:				if (!run_add_entry(&ni->file.run_da, vcn, SPARSE_LCN,
 513:						   alen, false)) {
 514:					err = -ENOMEM;
 515:					goto out;
 516:				}
 517:	
 518:				ntfs_add_da(sbi, alen);
 519:				goto ok1;
 520:			}
 521:		}
 522:	
 523:		if (!keep_prealloc && run_da && run_da->count &&
 524:		    (vcn = run_get_max_vcn(run_da), new_alen < vcn)) {
 525:			/* Shrink delayed clusters. */
 526:	
 527:			/* Try to remove fragment from delay allocated run. */
 528:			if (!run_remove_range(run_da, new_alen, vcn - new_alen,
 529:					      &alen)) {
 530:				err = -ENOMEM;
 531:				goto out;
 532:			}
 533:	
 534:			ntfs_sub_da(sbi, alen);
 535:		}
 536:	
 537:		vcn = old_alen - 1;
 538:	
 539:		svcn = le64_to_cpu(attr_b->nres.svcn);
 540:		evcn = le64_to_cpu(attr_b->nres.evcn);
 541:	
 542:		if (svcn <= vcn && vcn <= evcn) {
 543:			attr = attr_b;
 544:			le = le_b;
 545:			mi = mi_b;
 546:		} else if (!le_b) {
 547:			err = -EINVAL;
 548:			goto bad_inode;
 549:		} else {
 550:			le = le_b;
 551:			attr = ni_find_attr(ni, attr_b, &le, type, name, name_len, &vcn,
 552:					    &mi);
 553:			if (!attr) {
 554:				err = -EINVAL;
 555:				goto bad_inode;
 556:			}
 557:	
 558:	next_le_1:
 559:			svcn = le64_to_cpu(attr->nres.svcn);
 560:			evcn = le64_to_cpu(attr->nres.evcn);
 561:		}
 562:		/*
 563:		 * Here we have:
 564:		 * attr,mi,le - last attribute segment (containing 'vcn').
 565:		 * attr_b,mi_b,le_b - base (primary) attribute segment.
 566:		 */
 567:	next_le:
 568:		rec = mi->mrec;
 569:		err = attr_load_runs(attr, ni, run, NULL);
 570:		if (err)
 571:			goto out;
 572:	
 573:		if (new_size > old_size) {
 574:			CLST to_allocate;
 575:			size_t free;
 576:	
 577:			if (new_alloc <= old_alloc) {
 578:				attr_b->nres.data_size = cpu_to_le64(new_size);
 579:				mi_b->dirty = dirty = true;
 580:				goto ok;
 581:			}
 582:	
 583:			/*
 584:			 * Add clusters. In simple case we have to:
 585:			 *  - allocate space (vcn, lcn, len)
 586:			 *  - update packed run in 'mi'
 587:			 *  - update attr->nres.evcn
 588:			 *  - update attr_b->nres.data_size/attr_b->nres.alloc_size
 589:			 */
 590:			to_allocate = new_alen - old_alen;
 591:	add_alloc_in_same_attr_seg:
 592:			lcn = 0;
 593:			if (is_mft) {
 594:				/* MFT allocates clusters from MFT zone. */
 595:				pre_alloc = 0;
 596:			} else if (is_ext) {
 597:				/* No preallocate for sparse/compress. */
 598:				pre_alloc = 0;
 599:			} else if (pre_alloc == -1) {
 600:				pre_alloc = 0;
 601:				if (type == ATTR_DATA && !name_len &&
 602:				    sbi->options->prealloc) {
 603:					pre_alloc = bytes_to_cluster(
 604:							    sbi, get_pre_allocated(
 605:									 new_size)) -
 606:						    new_alen;
 607:				}
 608:	
 609:				/* Get the last LCN to allocate from. */
 610:				if (old_alen &&
 611:				    !run_lookup_entry(run, vcn, &lcn, NULL, NULL)) {
 612:					lcn = SPARSE_LCN;
 613:				}
 614:	
 615:				if (lcn == SPARSE_LCN)
 616:					lcn = 0;
 617:				else if (lcn)
 618:					lcn += 1;
 619:	
 620:				free = wnd_zeroes(&sbi->used.bitmap);
 621:				if (to_allocate > free) {
 622:					err = -ENOSPC;
 623:					goto out;
 624:				}
 625:	
 626:				if (pre_alloc && to_allocate + pre_alloc > free)
 627:					pre_alloc = 0;
 628:			}
 629:	
 630:			vcn = old_alen;
 631:	
 632:			if (is_ext) {
 633:				if (!run_add_entry(run, vcn, SPARSE_LCN, to_allocate,
 634:						   false)) {
 635:					err = -ENOMEM;
 636:					goto out;
 637:				}
 638:				alen = to_allocate;
 639:			} else {
 640:				/* ~3 bytes per fragment. */
 641:				err = attr_allocate_clusters(
 642:					sbi, run, run_da, vcn, lcn, to_allocate,
 643:					&pre_alloc,
 644:					is_mft ? ALLOCATE_MFT : ALLOCATE_DEF, &alen,
 645:					is_mft ? 0 :
 646:						 (sbi->record_size -
 647:						  le32_to_cpu(rec->used) + 8) /
 648:								 3 +
 649:							 1,
 650:					NULL, NULL);
 651:				if (err)
 652:					goto out;
 653:			}
 654:	
 655:			done += alen;
 656:			vcn += alen;
 657:			if (to_allocate > alen)
 658:				to_allocate -= alen;
 659:			else
 660:				to_allocate = 0;
 661:	
 662:	pack_runs:
 663:			err = mi_pack_runs(mi, attr, run, vcn - svcn);
 664:			if (err)
 665:				goto undo_1;
 666:	
 667:			next_svcn = le64_to_cpu(attr->nres.evcn) + 1;
 668:			new_alloc_tmp = (u64)next_svcn << cluster_bits;
 669:			attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp);
 670:			mi_b->dirty = dirty = true;
 671:	
 672:			if (next_svcn >= vcn && !to_allocate) {
 673:				/* Normal way. Update attribute and exit. */
 674:				attr_b->nres.data_size = cpu_to_le64(new_size);
 675:				goto ok;
 676:			}
 677:	
 678:			/* At least two MFT to avoid recursive loop. */
 679:			if (is_mft && next_svcn == vcn &&
 680:			    ((u64)done << sbi->cluster_bits) >= 2 * sbi->record_size) {
 681:				new_size = new_alloc_tmp;
 682:				attr_b->nres.data_size = attr_b->nres.alloc_size;
 683:				goto ok;
 684:			}
 685:	
 686:			if (le32_to_cpu(rec->used) < sbi->record_size) {
 687:				old_alen = next_svcn;
 688:				evcn = old_alen - 1;
 689:				goto add_alloc_in_same_attr_seg;
 690:			}
 691:	
 692:			attr_b->nres.data_size = attr_b->nres.alloc_size;
 693:			if (new_alloc_tmp < old_valid)
 694:				attr_b->nres.valid_size = attr_b->nres.data_size;
 695:	
 696:			if (type == ATTR_LIST) {
 697:				err = ni_expand_list(ni);
 698:				if (err)
 699:					goto undo_2;
 700:				if (next_svcn < vcn)
 701:					goto pack_runs;
 702:	
 703:				/* Layout of records is changed. */
 704:				goto again;
 705:			}
 706:	
 707:			if (!nb->attr_list.size) {
 708:				err = ni_create_attr_list(nb);
 709:				/* In case of error layout of records is not changed. */
 710:				if (err)
 711:					goto undo_2;
 712:				/* Layout of records is changed. */
 713:			}
 714:	
 715:			if (next_svcn >= vcn) {
 716:				/* This is MFT data, repeat. */
 717:				goto again;
 718:			}
 719:	
 720:			/* Insert new attribute segment. */
 721:			err = ni_insert_nonresident(ni, type, name, name_len, run,
 722:						    next_svcn, vcn - next_svcn,
 723:						    attr_b->flags, &attr, &mi, NULL);
 724:	
 725:			/*
 726:			 * Layout of records maybe changed.
 727:			 * Find base attribute to update.
 728:			 */
 729:			le_b = NULL;
 730:			attr_b = ni_find_attr(ni, NULL, &le_b, type, name, name_len,
 731:					      NULL, &mi_b);
 732:			if (!attr_b) {
 733:				err = -EINVAL;
 734:				goto bad_inode;
 735:			}
 736:	
 737:			if (err) {
 738:				/* ni_insert_nonresident failed. */
 739:				attr = NULL;
 740:				goto undo_2;
 741:			}
 742:	
 743:			/* keep runs for $MFT::$ATTR_DATA and $MFT::$ATTR_BITMAP. */
 744:			if (ni->mi.rno != MFT_REC_MFT)
 745:				run_truncate_head(run, evcn + 1);
 746:	
 747:			svcn = le64_to_cpu(attr->nres.svcn);
 748:			evcn = le64_to_cpu(attr->nres.evcn);
 749:	
 750:			/*
 751:			 * Attribute is in consistency state.
 752:			 * Save this point to restore to if next steps fail.
 753:			 */
 754:			old_valid = old_size = old_alloc = (u64)vcn << cluster_bits;
 755:			attr_b->nres.valid_size = attr_b->nres.data_size =
 756:				attr_b->nres.alloc_size = cpu_to_le64(old_size);
 757:			mi_b->dirty = dirty = true;
 758:			goto again_1;
 759:		}
 760:	
 761:		if (new_size != old_size ||
 762:		    (new_alloc != old_alloc && !keep_prealloc)) {
 763:			/*
 764:			 * Truncate clusters. In simple case we have to:
 765:			 *  - update packed run in 'mi'
 766:			 *  - update attr->nres.evcn
 767:			 *  - update attr_b->nres.data_size/attr_b->nres.alloc_size
 768:			 *  - mark and trim clusters as free (vcn, lcn, len)
 769:			 */
 770:			CLST dlen = 0;
 771:	
 772:			vcn = max(svcn, new_alen);
 773:			new_alloc_tmp = (u64)vcn << cluster_bits;
 774:	
 775:			if (vcn > svcn) {
 776:				err = mi_pack_runs(mi, attr, run, vcn - svcn);
 777:				if (err)
 778:					goto out;
 779:			} else if (le && le->vcn) {
 780:				u16 le_sz = le16_to_cpu(le->size);
 781:	
 782:				/*
 783:				 * NOTE: List entries for one attribute are always
 784:				 * the same size. We deal with last entry (vcn==0)
 785:				 * and it is not first in entries array
 786:				 * (list entry for std attribute always first).
 787:				 * So it is safe to step back.
 788:				 */
 789:				mi_remove_attr(NULL, mi, attr);
 790:	
 791:				if (!al_remove_le(ni, le)) {
 792:					err = -EINVAL;
 793:					goto bad_inode;
 794:				}
 795:	
 796:				le = (struct ATTR_LIST_ENTRY *)((u8 *)le - le_sz);
 797:			} else {
 798:				attr->nres.evcn = cpu_to_le64((u64)vcn - 1);
 799:				mi->dirty = true;
 800:			}
 801:	
 802:			attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp);
 803:	
 804:			if (vcn == new_alen) {
 805:				attr_b->nres.data_size = cpu_to_le64(new_size);
 806:				if (new_size < old_valid)
 807:					attr_b->nres.valid_size =
 808:						attr_b->nres.data_size;
 809:			} else {
 810:				if (new_alloc_tmp <=
 811:				    le64_to_cpu(attr_b->nres.data_size))
 812:					attr_b->nres.data_size =
 813:						attr_b->nres.alloc_size;
 814:				if (new_alloc_tmp <
 815:				    le64_to_cpu(attr_b->nres.valid_size))
 816:					attr_b->nres.valid_size =
 817:						attr_b->nres.alloc_size;
 818:			}
 819:			mi_b->dirty = dirty = true;
 820:	
 821:			err = run_deallocate_ex(sbi, run, vcn, evcn - vcn + 1, &dlen,
 822:						true, run_da);
 823:			if (err)
 824:				goto out;
 825:	
 826:			if (is_ext) {
 827:				/* dlen - really deallocated clusters. */
 828:				le64_sub_cpu(&attr_b->nres.total_size,
 829:					     (u64)dlen << cluster_bits);
 830:			}
 831:	
 832:			run_truncate(run, vcn);
 833:	
 834:			if (new_alloc_tmp <= new_alloc)
 835:				goto ok;
 836:	
 837:			old_size = new_alloc_tmp;
 838:			vcn = svcn - 1;
 839:	
 840:			if (le == le_b) {
 841:				attr = attr_b;
 842:				mi = mi_b;
 843:				evcn = svcn - 1;
 844:				svcn = 0;
 845:				goto next_le;
 846:			}
 847:	
 848:			if (le->type != type || le->name_len != name_len ||
 849:			    memcmp(le_name(le), name, name_len * sizeof(short))) {
 850:				err = -EINVAL;
 851:				goto bad_inode;
 852:			}
 853:	
 854:			err = ni_load_mi(ni, le, &mi);
 855:			if (err)
 856:				goto out;
 857:	
 858:			attr = mi_find_attr(ni, mi, NULL, type, name, name_len,
 859:					    &le->id);
 860:			if (!attr) {
 861:				err = -EINVAL;
 862:				goto bad_inode;
 863:			}
 864:			goto next_le_1;
 865:		}
 866:	
 867:	ok:
 868:		if (new_valid) {
 869:			__le64 valid = cpu_to_le64(min(*new_valid, new_size));
 870:	
 871:			if (attr_b->nres.valid_size != valid) {
 872:				attr_b->nres.valid_size = valid;
 873:				mi_b->dirty = true;
 874:			}
 875:		}
 876:	
 877:	ok1:
 878:		if (ret)
 879:			*ret = attr_b;
 880:	
 881:		if ((type == ATTR_DATA || (type == ATTR_ALLOC && name == I30_NAME))) {
 882:			/* Update inode_set_bytes. */
 883:			if (attr_b->non_res &&
 884:			    inode_get_bytes(&ni->vfs_inode) != new_alloc) {
 885:				inode_set_bytes(&ni->vfs_inode, new_alloc);
 886:				dirty = true;
 887:			}
 888:	
 889:			i_size_write(&ni->vfs_inode, new_size);
 890:	
 891:			/* Don't forget to update duplicate information in parent. */
 892:			if (dirty) {
 893:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 894:				mark_inode_dirty(&ni->vfs_inode);
 895:			}
 896:		}
 897:	
 898:		return 0;
 899:	
 900:	undo_2:
 901:		vcn -= alen;
 902:		attr_b->nres.data_size = cpu_to_le64(old_size);
 903:		attr_b->nres.valid_size = cpu_to_le64(old_valid);
 904:		attr_b->nres.alloc_size = cpu_to_le64(old_alloc);
 905:	
 906:		/* Restore 'attr' and 'mi'. */
 907:		if (attr)
 908:			goto restore_run;
 909:	
 910:		if (le64_to_cpu(attr_b->nres.svcn) <= svcn &&
 911:		    svcn <= le64_to_cpu(attr_b->nres.evcn)) {
 912:			attr = attr_b;
 913:			le = le_b;
 914:			mi = mi_b;
 915:		} else if (!le_b) {
 916:			err = -EINVAL;
 917:			goto bad_inode;
 918:		} else {
 919:			le = le_b;
 920:			attr = ni_find_attr(ni, attr_b, &le, type, name, name_len,
 921:					    &svcn, &mi);
 922:			if (!attr)
 923:				goto bad_inode;
 924:		}
 925:	
 926:	restore_run:
 927:		if (mi_pack_runs(mi, attr, run, evcn - svcn + 1))
 928:			is_bad = true;
 929:	
 930:	undo_1:
 931:		run_deallocate_ex(sbi, run, vcn, alen, NULL, false, run_da);
 932:	
 933:		run_truncate(run, vcn);
 934:	out:
 935:		if (is_bad) {
 936:	bad_inode:
 937:			_ntfs_bad_inode(&ni->vfs_inode);
 938:		}
 939:		return err;
 940:	}
 SourceFile:fs/ntfs3/attrib.c]

73/2 2026/09/17 10:47 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 45723
							output: 24
							thoughts: 0
						

74/2 2026/09/17 10:47 tool codesearch-definition-source
0m Args:
map[Name:ntfs_read_folio]

Results:
map[SourceCode: 826:	static int ntfs_read_folio(struct file *file, struct folio *folio)
 827:	{
 828:		int err;
 829:		struct address_space *mapping = folio->mapping;
 830:		struct inode *inode = mapping->host;
 831:		struct ntfs_inode *ni = ntfs_i(inode);
 832:		loff_t vbo = folio_pos(folio);
 833:		struct iomap_read_folio_ctx ctx = {
 834:			.cur_folio = folio,
 835:			.ops = &ntfs_iomap_bio_read_ops,
 836:		};
 837:	
 838:		if (unlikely(is_bad_ni(ni))) {
 839:			folio_unlock(folio);
 840:			return -EIO;
 841:		}
 842:	
 843:		if (ni->i_valid <= vbo) {
 844:			folio_zero_range(folio, 0, folio_size(folio));
 845:			folio_mark_uptodate(folio);
 846:			folio_unlock(folio);
 847:			return 0;
 848:		}
 849:	
 850:		if (is_compressed(ni)) {
 851:			/* ni_lock is taken inside ni_read_folio_cmpr after page locks */
 852:			err = ni_read_folio_cmpr(ni, folio);
 853:			return err;
 854:		}
 855:	
 856:		iomap_read_folio(&ntfs_iomap_ops, &ctx, NULL);
 857:		return 0;
 858:	}
 SourceFile:fs/ntfs3/inode.c]

75/2 2026/09/17 10:47 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 46268
							output: 26
							thoughts: 0
						

76/2 2026/09/17 10:48 tool codesearch-definition-source
0m Args:
map[Name:ntfs_iomap_begin]

Results:
map[SourceCode: 921:	/*
 922:	 * Function to get mapping vbo -> lbo.
 923:	 * used with:
 924:	 * - iomap_zero_range
 925:	 * - iomap_truncate_page
 926:	 * - iomap_dio_rw
 927:	 * - iomap_file_buffered_write
 928:	 * - iomap_bmap
 929:	 * - iomap_fiemap
 930:	 * - iomap_bio_read_folio
 931:	 * - iomap_bio_readahead
 932:	 */
 933:	static int ntfs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
 934:				    unsigned int flags, struct iomap *iomap,
 935:				    struct iomap *srcmap)
 936:	{
 937:		struct ntfs_inode *ni = ntfs_i(inode);
 938:		struct ntfs_sb_info *sbi = ni->mi.sbi;
 939:		u8 cluster_bits = sbi->cluster_bits;
 940:		CLST vcn = offset >> cluster_bits;
 941:		u32 off = offset & sbi->cluster_mask;
 942:		bool rw = flags & IOMAP_WRITE;
 943:		loff_t endbyte = offset + length;
 944:		void *res = NULL;
 945:		int err;
 946:		CLST lcn, clen, clen_max = 1;
 947:		bool new_clst = false;
 948:		bool no_da;
 949:		bool zero = false;
 950:		if (unlikely(ntfs3_forced_shutdown(sbi->sb)))
 951:			return -EIO;
 952:	
 953:		if (flags & IOMAP_REPORT) {
 954:			if (offset > ntfs_get_maxbytes(ni)) {
 955:				/* called from fiemap/bmap. */
 956:				return -EINVAL;
 957:			}
 958:	
 959:			if (offset >= inode->i_size) {
 960:				/* special code for report. */
 961:				return -ENOENT;
 962:			}
 963:		}
 964:	
 965:		if (IOMAP_ZERO == flags && (endbyte & sbi->cluster_mask)) {
 966:			rw = true;
 967:		} else if (rw) {
 968:			clen_max = bytes_to_cluster(sbi, endbyte) - vcn;
 969:		}
 970:	
 971:		/*
 972:		 * Force to allocate clusters if directIO(write) or writeback_range.
 973:		 * NOTE: attr_data_get_block allocates clusters only for sparse file.
 974:		 * Normal file allocates clusters in attr_set_size.
 975:		*/
 976:		no_da = flags == (IOMAP_DIRECT | IOMAP_WRITE) || srcmap == WB_NO_DA;
 977:	
 978:		err = attr_data_get_block(ni, vcn, clen_max, &lcn, &clen,
 979:					  rw ? &new_clst : NULL, zero, &res, no_da);
 980:	
 981:		if (err) {
 982:			return err;
 983:		}
 984:	
 985:		if (lcn == EOF_LCN) {
 986:			/* request out of file. */
 987:			if (flags & IOMAP_REPORT) {
 988:				/* special code for report. */
 989:				return -ENOENT;
 990:			}
 991:	
 992:			if (rw) {
 993:				/* should never be here. */
 994:				return -EINVAL;
 995:			}
 996:			lcn = SPARSE_LCN;
 997:		}
 998:	
 999:		iomap->flags = new_clst ? IOMAP_F_NEW : 0;
1000:	
1001:		if (lcn == RESIDENT_LCN) {
1002:			if (offset >= clen) {
1003:				if (res)
1004:					__free_page(virt_to_page(res));
1005:				if (flags & IOMAP_REPORT) {
1006:					/* special code for report. */
1007:					return -ENOENT;
1008:				}
1009:				return -EFAULT;
1010:			}
1011:	
1012:			iomap->private = iomap->inline_data = res;
1013:			iomap->type = IOMAP_INLINE;
1014:			iomap->offset = 0;
1015:			iomap->length = clen; /* resident size in bytes. */
1016:			return 0;
1017:		}
1018:	
1019:		if (!clen) {
1020:			/* broken file? */
1021:			return -EINVAL;
1022:		}
1023:	
1024:		iomap->bdev = inode->i_sb->s_bdev;
1025:		iomap->offset = offset;
1026:		iomap->length = ((loff_t)clen << cluster_bits) - off;
1027:	
1028:		if (lcn == COMPRESSED_LCN) {
1029:			/* should never be here. */
1030:			return -EOPNOTSUPP;
1031:		}
1032:	
1033:		if (lcn == DELALLOC_LCN) {
1034:			iomap->type = IOMAP_DELALLOC;
1035:			iomap->addr = IOMAP_NULL_ADDR;
1036:		} else {
1037:			/* Translate clusters into bytes. */
1038:			iomap->addr = ((loff_t)lcn << cluster_bits) + off;
1039:			if (length && iomap->length > length)
1040:				iomap->length = length;
1041:			else
1042:				endbyte = offset + iomap->length;
1043:	
1044:			if (lcn == SPARSE_LCN) {
1045:				iomap->addr = IOMAP_NULL_ADDR;
1046:				iomap->type = IOMAP_HOLE;
1047:				//			if (IOMAP_ZERO == flags && !off) {
1048:				//				iomap->length = (endbyte - offset) &
1049:				//						sbi->cluster_mask_inv;
1050:				//			}
1051:			} else if (endbyte <= ni->i_valid) {
1052:				iomap->type = IOMAP_MAPPED;
1053:			} else if (offset < ni->i_valid) {
1054:				iomap->type = IOMAP_MAPPED;
1055:				if (flags & IOMAP_REPORT)
1056:					iomap->length = ni->i_valid - offset;
1057:			} else if (rw || (flags & IOMAP_ZERO)) {
1058:				iomap->type = IOMAP_MAPPED;
1059:			} else {
1060:				iomap->type = IOMAP_UNWRITTEN;
1061:			}
1062:		}
1063:	
1064:		if ((flags & IOMAP_ZERO) &&
1065:		    (iomap->type == IOMAP_MAPPED || iomap->type == IOMAP_DELALLOC)) {
1066:			/* Avoid too large requests. */
1067:			u32 tail;
1068:			u32 off_a = offset & (PAGE_SIZE - 1);
1069:			if (off_a)
1070:				tail = PAGE_SIZE - off_a;
1071:			else
1072:				tail = PAGE_SIZE;
1073:	
1074:			if (iomap->length > tail)
1075:				iomap->length = tail;
1076:		}
1077:	
1078:		return 0;
1079:	}
 SourceFile:fs/ntfs3/inode.c]

77/2 2026/09/17 10:48 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 48731
							output: 28
							thoughts: 0
						

78/2 2026/09/17 10:48 tool codesearch-definition-source
0m Error:
log-in to see details

Args:
map[Name:ntfs_iomap_read_folio]

Results:
map[SourceCode: SourceFile:]

79/2 2026/09/17 10:48 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 48780
							output: 27
							thoughts: 0
						

80/2 2026/09/17 10:48 tool codesearch-definition-source
0m Args:
map[Name:iomap_read_inline_data]

Results:
map[SourceCode: 409:	/**
 410:	 * iomap_read_inline_data - copy inline data into the page cache
 411:	 * @iter: iteration structure
 412:	 * @folio: folio to copy to
 413:	 *
 414:	 * Copy the inline data in @iter into @folio and zero out the rest of the folio.
 415:	 * Only a single IOMAP_INLINE extent is allowed at the end of each file.
 416:	 * Returns zero for success to complete the read, or the usual negative errno.
 417:	 */
 418:	static int iomap_read_inline_data(const struct iomap_iter *iter,
 419:			struct folio *folio)
 420:	{
 421:		const struct iomap *iomap = iomap_iter_srcmap(iter);
 422:		size_t size = i_size_read(iter->inode) - iomap->offset;
 423:		size_t offset = offset_in_folio(folio, iomap->offset);
 424:	
 425:		if (WARN_ON_ONCE(!iomap->inline_data))
 426:			return -EIO;
 427:	
 428:		if (folio_test_uptodate(folio))
 429:			return 0;
 430:	
 431:		if (WARN_ON_ONCE(size > iomap->length)) {
 432:			fserror_report_io(iter->inode, FSERR_BUFFERED_READ,
 433:					  iomap->offset, size, -EIO, GFP_NOFS);
 434:			return -EIO;
 435:		}
 436:		if (offset > 0)
 437:			ifs_alloc(iter->inode, folio, iter->flags);
 438:	
 439:		folio_fill_tail(folio, offset, iomap->inline_data, size);
 440:		iomap_set_range_uptodate(folio, offset, folio_size(folio) - offset);
 441:		return 0;
 442:	}
 SourceFile:fs/iomap/buffered-io.c]

81/2 2026/09/17 10:48 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 49431
							output: 27
							thoughts: 0
						

82/2 2026/09/17 10:49 tool codesearch-definition-source
0m Args:
map[Name:iomap_read_folio_iter]

Results:
map[SourceCode: 557:	static int iomap_read_folio_iter(struct iomap_iter *iter,
 558:			struct iomap_read_folio_ctx *ctx, size_t *bytes_submitted)
 559:	{
 560:		const struct iomap *iomap = &iter->iomap;
 561:		loff_t pos = iter->pos;
 562:		loff_t length = iomap_length(iter);
 563:		struct folio *folio = ctx->cur_folio;
 564:		size_t folio_len = folio_size(folio);
 565:		struct iomap_folio_state *ifs;
 566:		size_t poff, plen;
 567:		loff_t pos_diff;
 568:		int ret;
 569:	
 570:		if (iomap->type == IOMAP_INLINE) {
 571:			ret = iomap_read_inline_data(iter, folio);
 572:			if (ret)
 573:				return ret;
 574:			return iomap_iter_advance(iter, length);
 575:		}
 576:	
 577:		ifs = ifs_alloc(iter->inode, folio, iter->flags);
 578:	
 579:		length = min_t(loff_t, length, folio_len - offset_in_folio(folio, pos));
 580:		while (length) {
 581:			iomap_adjust_read_range(iter->inode, folio, &pos, length, &poff,
 582:					&plen);
 583:	
 584:			pos_diff = pos - iter->pos;
 585:			if (WARN_ON_ONCE(pos_diff + plen > length))
 586:				return -EIO;
 587:	
 588:			ret = iomap_iter_advance(iter, pos_diff);
 589:			if (ret)
 590:				return ret;
 591:	
 592:			if (plen == 0)
 593:				return 0;
 594:	
 595:			/*
 596:			 * Handling of fsverity "holes". We hit this for two case:
 597:			 *   1. No need to go further, the hole after fsverity
 598:			 *	descriptor is the end of the fsverity metadata.
 599:			 *
 600:			 *   2. This folio contains merkle tree blocks which need to be
 601:			 *	synthesized. If we already have fsverity info (ctx->vi)
 602:			 *	synthesize these blocks.
 603:			 */
 604:			if ((iomap->flags & IOMAP_F_FSVERITY) &&
 605:			    iomap->type == IOMAP_HOLE) {
 606:				if (ctx->vi)
 607:					fsverity_fill_zerohash(folio, poff, plen,
 608:							       ctx->vi);
 609:				iomap_set_range_uptodate(folio, poff, plen);
 610:			} else if (iomap_block_needs_zeroing(iter, pos)) {
 611:				/* zero post-eof blocks as the page may be mapped */
 612:				folio_zero_range(folio, poff, plen);
 613:				if (ctx->vi &&
 614:				    !fsverity_verify_blocks(ctx->vi, folio, plen, poff))
 615:					return -EIO;
 616:				iomap_set_range_uptodate(folio, poff, plen);
 617:			} else {
 618:				if (!*bytes_submitted)
 619:					iomap_read_init(folio);
 620:				ret = ctx->ops->read_folio_range(iter, ctx, plen);
 621:				if (ret < 0)
 622:					fserror_report_io(iter->inode,
 623:							  FSERR_BUFFERED_READ, pos,
 624:							  plen, ret, GFP_NOFS);
 625:				if (ret)
 626:					return ret;
 627:	
 628:				*bytes_submitted += plen;
 629:				/*
 630:				 * Hand off folio ownership to the IO helper when:
 631:				 * 1) The entire folio has been submitted for IO, or
 632:				 * 2) There is no ifs attached to the folio
 633:				 *
 634:				 * Case (2) occurs when 1 << i_blkbits matches the folio
 635:				 * size but the underlying filesystem or block device
 636:				 * uses a smaller granularity for IO.
 637:				 */
 638:				if (*bytes_submitted == folio_len || !ifs)
 639:					ctx->cur_folio = NULL;
 640:			}
 641:	
 642:			ret = iomap_iter_advance(iter, plen);
 643:			if (ret)
 644:				return ret;
 645:			length -= pos_diff + plen;
 646:			pos = iter->pos;
 647:		}
 648:		return 0;
 649:	}
 SourceFile:fs/iomap/buffered-io.c]

83/2 2026/09/17 10:49 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 50969
							output: 25
							thoughts: 0
						

84/2 2026/09/17 10:49 tool codesearch-definition-source
0m Args:
map[Name:iomap_read_folio]

Results:
map[SourceCode: 651:	void iomap_read_folio(const struct iomap_ops *ops,
 652:			struct iomap_read_folio_ctx *ctx, void *private)
 653:	{
 654:		struct folio *folio = ctx->cur_folio;
 655:		struct iomap_iter iter = {
 656:			.inode		= folio->mapping->host,
 657:			.pos		= folio_pos(folio),
 658:			.len		= folio_size(folio),
 659:			.private	= private,
 660:		};
 661:		size_t bytes_submitted = 0;
 662:		int ret;
 663:	
 664:		trace_iomap_readpage(iter.inode, 1);
 665:	
 666:		/*
 667:		 * Fetch fsverity_info for both data and fsverity metadata, as iomap
 668:		 * needs zeroed hash for merkle tree block synthesis
 669:		 */
 670:		ctx->vi = fsverity_get_info(iter.inode);
 671:		if (ctx->vi && iter.pos < i_size_read(iter.inode))
 672:			fsverity_readahead(ctx->vi, folio->index,
 673:					   folio_nr_pages(folio));
 674:	
 675:		while ((ret = iomap_iter(&iter, ops)) > 0) {
 676:			iter.status = iomap_read_folio_iter(&iter, ctx,
 677:					&bytes_submitted);
 678:			if (ctx->read_ctx && ctx->ops->submit_read)
 679:				ctx->ops->submit_read(&iter, ctx);
 680:		}
 681:	
 682:		if (ctx->cur_folio)
 683:			iomap_read_end(ctx->cur_folio, bytes_submitted);
 684:	}
 SourceFile:fs/iomap/buffered-io.c]

85/2 2026/09/17 10:49 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 51579
							output: 23
							thoughts: 0
						

86/2 2026/09/17 10:49 tool codesearch-definition-source
0m Args:
map[Name:iomap_iter]

Results:
map[SourceCode: 248:	/**
 249:	 * struct iomap_iter - Iterate through a range of a file
 250:	 * @inode: Set at the start of the iteration and should not change.
 251:	 * @pos: The current file position we are operating on.  It is updated by
 252:	 *	calls to iomap_iter().  Treat as read-only in the body.
 253:	 * @len: The remaining length of the file segment we're operating on.
 254:	 *	It is updated at the same time as @pos.
 255:	 * @iter_start_pos: The original start pos for the current iomap. Used for
 256:	 *	incremental iter advance.
 257:	 * @status: Status of the most recent iteration. Zero on success or a negative
 258:	 *	errno on error.
 259:	 * @flags: Zero or more of the iomap_begin flags above.
 260:	 * @iomap: Map describing the I/O iteration
 261:	 * @srcmap: Source map for COW operations
 262:	 */
 263:	struct iomap_iter {
 264:		struct inode *inode;
 265:		loff_t pos;
 266:		u64 len;
 267:		loff_t iter_start_pos;
 268:		int status;
 269:		unsigned flags;
 270:		struct iomap iomap;
 271:		struct iomap srcmap;
 272:		struct folio_batch *fbatch;
 273:		void *private;
 274:	};
 SourceFile:include/linux/iomap.h]

87/2 2026/09/17 10:49 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 52079
							output: 23
							thoughts: 0
						

88/2 2026/09/17 10:50 tool codesearch-definition-source
0m Args:
map[Name:iomap_iter]

Results:
map[SourceCode: 248:	/**
 249:	 * struct iomap_iter - Iterate through a range of a file
 250:	 * @inode: Set at the start of the iteration and should not change.
 251:	 * @pos: The current file position we are operating on.  It is updated by
 252:	 *	calls to iomap_iter().  Treat as read-only in the body.
 253:	 * @len: The remaining length of the file segment we're operating on.
 254:	 *	It is updated at the same time as @pos.
 255:	 * @iter_start_pos: The original start pos for the current iomap. Used for
 256:	 *	incremental iter advance.
 257:	 * @status: Status of the most recent iteration. Zero on success or a negative
 258:	 *	errno on error.
 259:	 * @flags: Zero or more of the iomap_begin flags above.
 260:	 * @iomap: Map describing the I/O iteration
 261:	 * @srcmap: Source map for COW operations
 262:	 */
 263:	struct iomap_iter {
 264:		struct inode *inode;
 265:		loff_t pos;
 266:		u64 len;
 267:		loff_t iter_start_pos;
 268:		int status;
 269:		unsigned flags;
 270:		struct iomap iomap;
 271:		struct iomap srcmap;
 272:		struct folio_batch *fbatch;
 273:		void *private;
 274:	};
 SourceFile:include/linux/iomap.h]

89/2 2026/09/17 10:50 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 52579
							output: 31
							thoughts: 0
						

90/2 2026/09/17 10:50 tool grepper
0m Args:
map[Expression:int iomap_iter PathPrefix:fs/iomap]

Results:
map[Output:fs/iomap/iter.c=13=static inline void iomap_iter_clean_fbatch(const struct iomap_iter *iter,
--
fs/iomap/iter.c-25-/* Advance the current iterator position and decrement the remaining length */
fs/iomap/iter.c:26:int iomap_iter_advance(struct iomap_iter *iter, u64 count)
fs/iomap/iter.c-27-{
--
fs/iomap/iter.c=35=static inline void iomap_iter_done(struct iomap_iter *iter)
--
fs/iomap/iter.c-62- */
fs/iomap/iter.c:63:int iomap_iter_continue(const struct iomap_iter *iter, struct iomap *iomap,
fs/iomap/iter.c-64-		struct iomap *srcmap, int ret)
--
fs/iomap/iter.c=98=EXPORT_SYMBOL_GPL(iomap_iter_continue);
--
fs/iomap/iter.c-114- */
fs/iomap/iter.c:115:int iomap_iter(struct iomap_iter *iter, const struct iomap_ops *ops)
fs/iomap/iter.c-116-{
]

91/2 2026/09/17 10:50 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 52965
							output: 23
							thoughts: 0
						

92/2 2026/09/17 10:50 tool codesearch-definition-source
0m Args:
map[Name:iomap_iter]

Results:
map[SourceCode: 248:	/**
 249:	 * struct iomap_iter - Iterate through a range of a file
 250:	 * @inode: Set at the start of the iteration and should not change.
 251:	 * @pos: The current file position we are operating on.  It is updated by
 252:	 *	calls to iomap_iter().  Treat as read-only in the body.
 253:	 * @len: The remaining length of the file segment we're operating on.
 254:	 *	It is updated at the same time as @pos.
 255:	 * @iter_start_pos: The original start pos for the current iomap. Used for
 256:	 *	incremental iter advance.
 257:	 * @status: Status of the most recent iteration. Zero on success or a negative
 258:	 *	errno on error.
 259:	 * @flags: Zero or more of the iomap_begin flags above.
 260:	 * @iomap: Map describing the I/O iteration
 261:	 * @srcmap: Source map for COW operations
 262:	 */
 263:	struct iomap_iter {
 264:		struct inode *inode;
 265:		loff_t pos;
 266:		u64 len;
 267:		loff_t iter_start_pos;
 268:		int status;
 269:		unsigned flags;
 270:		struct iomap iomap;
 271:		struct iomap srcmap;
 272:		struct folio_batch *fbatch;
 273:		void *private;
 274:	};
 SourceFile:include/linux/iomap.h]

93/2 2026/09/17 10:51 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 53465
							output: 37
							thoughts: 0
						

94/2 2026/09/17 10:51 tool read-file
0m Args:
map[File:fs/iomap/iter.c FirstLine:115 LineCount:50]

Results:
map[Contents: 115:	int iomap_iter(struct iomap_iter *iter, const struct iomap_ops *ops)
 116:	{
 117:		int ret;
 118:	
 119:		trace_iomap_iter(iter, ops, _RET_IP_);
 120:	
 121:		if (ops->iomap_next)
 122:			ret = ops->iomap_next(iter, &iter->iomap, &iter->srcmap);
 123:		else
 124:			ret = iomap_iter_next(iter, &iter->iomap, &iter->srcmap,
 125:					ops->iomap_begin, ops->iomap_end);
 126:	
 127:		iter->status = 0;
 128:		if (ret > 0)
 129:			iomap_iter_done(iter);
 130:		else if (ret < 0)
 131:			iomap_iter_clean_fbatch(iter, &iter->iomap);
 132:	
 133:		return ret;
 134:	}
]

95/2 2026/09/17 10:51 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 53835
							output: 36
							thoughts: 0
						

96/2 2026/09/17 10:51 tool read-file
0m Args:
map[File:fs/iomap/iter.c FirstLine:63 LineCount:30]

Results:
map[Contents:  63:	int iomap_iter_continue(const struct iomap_iter *iter, struct iomap *iomap,
  64:			struct iomap *srcmap, int ret)
  65:	{
  66:		const bool stale = iomap->flags & IOMAP_F_STALE;
  67:		const ssize_t advanced = iter->pos - iter->iter_start_pos;
  68:	
  69:		if (ret < 0 && !advanced)
  70:			return ret;
  71:	
  72:		/*
  73:		 * Use iter->len to determine whether to continue onto the next mapping.
  74:		 * Explicitly terminate on error status or if the current iter has not
  75:		 * advanced at all (i.e. no work was done for some reason) unless the
  76:		 * mapping has been marked stale and needs to be reprocessed.
  77:		 */
  78:		if (WARN_ON_ONCE(iter->status > 0))
  79:			/* detect old return semantics where this would advance */
  80:			ret = -EIO;
  81:		else if (iter->status < 0)
  82:			ret = iter->status;
  83:		else if (iter->len == 0 || (!advanced && !stale))
  84:			ret = 0;
  85:		else
  86:			ret = 1;
  87:	
  88:		iomap_iter_clean_fbatch(iter, iomap);
  89:	
  90:		if (ret <= 0)
  91:			return ret;
  92:	
]

97/2 2026/09/17 10:51 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 54320
							output: 35
							thoughts: 0
						

98/2 2026/09/17 10:52 tool read-file
0m Args:
map[File:fs/iomap/iter.c FirstLine:1 LineCount:60]

Results:
map[Contents:   1:	// SPDX-License-Identifier: GPL-2.0
   2:	/*
   3:	 * Copyright (C) 2010 Red Hat, Inc.
   4:	 * Copyright (c) 2016-2021 Christoph Hellwig.
   5:	 */
   6:	#include <linux/iomap.h>
   7:	#include "trace.h"
   8:	
   9:	/*
  10:	 * Release the iter folio batch. Note that the iomap flag is meant to control
  11:	 * the I/O path for the mapping and may not be set in error situations.
  12:	 */
  13:	static inline void iomap_iter_clean_fbatch(const struct iomap_iter *iter,
  14:			struct iomap *iomap)
  15:	{
  16:		if (!iter->fbatch)
  17:			return;
  18:		iomap->flags &= ~IOMAP_F_FOLIO_BATCH;
  19:		if (folio_batch_count(iter->fbatch)) {
  20:			folio_batch_release(iter->fbatch);
  21:			folio_batch_reinit(iter->fbatch);
  22:		}
  23:	}
  24:	
  25:	/* Advance the current iterator position and decrement the remaining length */
  26:	int iomap_iter_advance(struct iomap_iter *iter, u64 count)
  27:	{
  28:		if (WARN_ON_ONCE(count > iomap_length(iter)))
  29:			return -EIO;
  30:		iter->pos += count;
  31:		iter->len -= count;
  32:		return 0;
  33:	}
  34:	
  35:	static inline void iomap_iter_done(struct iomap_iter *iter)
  36:	{
  37:		WARN_ON_ONCE(iter->iomap.offset > iter->pos);
  38:		WARN_ON_ONCE(iter->iomap.length == 0);
  39:		WARN_ON_ONCE(iter->iomap.offset + iter->iomap.length <= iter->pos);
  40:		WARN_ON_ONCE(iter->iomap.flags & IOMAP_F_STALE);
  41:	
  42:		iter->iter_start_pos = iter->pos;
  43:	
  44:		trace_iomap_iter_dstmap(iter->inode, &iter->iomap);
  45:		if (iter->srcmap.type != IOMAP_HOLE)
  46:			trace_iomap_iter_srcmap(iter->inode, &iter->srcmap);
  47:	}
  48:	
  49:	/**
  50:	 * iomap_iter_continue - decide whether iteration should continue
  51:	 * @iter: iteration structure
  52:	 * @iomap: the mapping that was just processed
  53:	 * @srcmap: the source mapping that was just processed
  54:	 *
  55:	 * Helper normally called via iomap_iter_next(). Called after the previous
  56:	 * mapping has been finished to determine whether there is more of the file
  57:	 * range left to process.
  58:	 *
  59:	 * Returns 1 if there is more work to do, in which case @iomap and @srcmap are
  60:	 * cleared so the caller can produce the next mapping; zero if the range is
]

99/2 2026/09/17 10:52 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 55305
							output: 367
							thoughts: 0
						

100/2 2026/09/17 10:52 tool codeexpert
10m Args:
map[Question:In `ntfs_setattr` (fs/ntfs3/file.c), when extending the file size (`newsize > oldsize`), `truncate_setsize(inode, newsize)` is called before `ntfs_set_size(inode, newsize)`. `truncate_setsize` updates `inode->i_size` immediately.
If a concurrent page fault triggers `ntfs_read_folio` -> `iomap_read_folio` -> `ntfs_iomap_begin`, `ntfs_iomap_begin` will read the old resident attribute size (e.g., 5 bytes) because `ntfs_set_size` hasn't updated it yet. It sets `iomap->length = 5` and `iomap->offset = 0`.
Then `iomap_read_inline_data` is called, which computes `size = i_size_read(iter->inode) - iomap->offset`. Since `i_size` was already updated to 20 by `truncate_setsize`, `size` is 20.
Then it checks `WARN_ON_ONCE(size > iomap->length)` which is `20 > 5`, triggering the warning.

Is it correct to call `truncate_setsize` before `ntfs_set_size` when extending the file size? In ext4 and xfs, `truncate_setsize` is called *after* allocating blocks or updating the on-disk size, or under a lock that prevents concurrent reads. How should this be fixed in `ntfs_setattr`?]

Results:
map[Answer:### 1. Is it correct to call `truncate_setsize` before `ntfs_set_size` when extending the file size?

**No, it is incorrect.**

- `truncate_setsize(inode, newsize)` immediately updates the in-memory `inode->i_size` via `i_size_write(inode, newsize)` and calls `pagecache_isize_extended()`.
- While `ntfs_setattr` holds `inode->i_rwsem`, page faults (`filemap_fault`) do **not** take `i_rwsem`. In `filemap_fault()`, folios are allocated and read holding only `filemap_invalidate_lock_shared(mapping)` (or under folio lock), not `i_rwsem`.
- If `truncate_setsize` is called before `ntfs_set_size`, a concurrent page fault can read the newly updated `inode->i_size` while the on-disk attribute length has not yet been modified by `ntfs_set_size`. When `ntfs_iomap_begin()` executes, it reads the old resident attribute length (e.g. 5 bytes) into `iomap->length`. Subsequently, `iomap_read_inline_data()` calculates `size = i_size_read(inode) - iomap->offset` (e.g. 20 bytes), which triggers `WARN_ON_ONCE(size > iomap->length)` and fails with `-EIO`.
- Furthermore, if `ntfs_set_size()` fails (e.g., due to `-EFBIG`, `-ENOSPC`, or disk I/O errors), the page cache has already been extended prematurely, requiring error rollback of `inode->i_size`.

---

### 2. How ext4 and XFS prevent concurrent reads/faults from observing intermediate states

Both filesystems serialize size modifications against page faults using `mapping->invalidate_lock` (or filesystem-specific lock abstractions mapping to it), and they sequence metadata updates appropriately:

1. **XFS (`xfs_vn_setattr` / `xfs_vn_setattr_size`)**:
   - `xfs_vn_setattr` acquires `xfs_ilock(ip, XFS_MMAPLOCK_EXCL)` before performing any size updates.
   - In XFS, `XFS_MMAPLOCK_EXCL` / `XFS_MMAPLOCK_SHARED` directly correspond to `down_write` / `down_read` of `inode->i_mapping->invalidate_lock`.
   - `filemap_fault()` takes `filemap_invalidate_lock_shared` when instantiating or reading non-uptodate folios. Holding `XFS_MMAPLOCK_EXCL` completely blocks concurrent page faults from running during truncate or file extension.
   - Under this lock, XFS zeroes beyond EOF (`xfs_zero_range`), updates page cache / size via `truncate_setsize`, logs the on-disk metadata (`ip->i_disk_size = newsize`), commits the transaction, and only then releases `XFS_MMAPLOCK_EXCL`.

2. **ext4 (`ext4_setattr`)**:
   - `ext4_setattr` holds `filemap_invalidate_lock(inode->i_mapping)` throughout the entire size change operation.
   - For file extension (`!shrink`), it first zeroes post-EOF folio tails (`ext4_block_zero_eof`), takes a journal handle, takes `down_write(&EXT4_I(inode)->i_data_sem)`, updates `EXT4_I(inode)->i_disksize` and calls `i_size_write(inode, attr->ia_size)` together under lock, and calls `pagecache_isize_extended(inode, oldsize, inode->i_size)`.
   - Concurrent faults are serialized because `ext4_page_mkwrite` and `filemap_fault` take `filemap_invalidate_lock_shared()`.

---

### 3. How this should be fixed in `ntfs_setattr`

To fix this issue in `fs/ntfs3/file.c`:

1. **Serialize page faults using `filemap_invalidate_lock`**:
   Surround the size modification block with `filemap_invalidate_lock(inode->i_mapping)` and `filemap_invalidate_unlock(inode->i_mapping)`. This blocks concurrent `filemap_fault()` calls from reading or populating folios while the size and attributes are changing.

2. **Order operations depending on whether extending or shrinking**:
   - **When extending (`newsize > oldsize`)**:
     Call `ntfs_set_size(inode, newsize)` **first** to resize/convert the attribute (including converting resident data to non-resident if necessary and allocating clusters). Once metadata and allocations succeed, call `truncate_setsize(inode, newsize)` (or `i_size_write(inode, newsize)` followed by `pagecache_isize_extended(inode, oldsize, newsize)`).
   - **When shrinking (`newsize < oldsize`)**:
     Call `truncate_setsize(inode, newsize)` first (to unmap and truncate folios beyond the new EOF so they are not written back to deallocated blocks), followed by `ntfs_set_size(inode, newsize)` to shrink the attribute and free unused clusters on disk.
   - **Error Handling**:
     If `ntfs_set_size` fails during shrinking, roll back `inode->i_size` under `filemap_invalidate_lock`.

**Example Patch Outline**:
```c
	if (newsize != oldsize) {
		filemap_invalidate_lock(inode->i_mapping);

		if (newsize > oldsize) {
			err = ntfs_set_size(inode, newsize);
			if (!err)
				truncate_setsize(inode, newsize);
		} else {
			truncate_setsize(inode, newsize);
			err = ntfs_set_size(inode, newsize);
			if (err)
				i_size_write(inode, oldsize);
		}

		filemap_invalidate_unlock(inode->i_mapping);

		if (err)
			goto out;

		ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
		ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
		inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
	}
```

---

### Limitations / Unverified Parts
- We verified the locking and ordering mechanisms in `ext4`, `xfs`, `ntfs`, `zonefs`, and `mm/filemap.c`.
- In `ntfs3`, `ntfs_set_size()` internally acquires `ni_lock(ni)` and `ni->file.run_lock`. The deadlock-freedom of locking `filemap_invalidate_lock` before `ni_lock` and `run_lock` was verified against other callers in `fs/ntfs3/file.c` (e.g., `ntfs_fallocate()`, which already takes `filemap_invalidate_lock` before acquiring internal NTFS locks).
- Exact post-EOF folio tail zeroing behavior (such as `iomap_zero_range` for extending beyond EOF cluster boundaries) should also be evaluated if sparse or unwritten extent semantics require zeroing intermediate page cache folios.]

101/3 2026/09/17 10:52 agent codeexpert
10m Model:
core

Results:
map[Answer:### 1. Is it correct to call `truncate_setsize` before `ntfs_set_size` when extending the file size?

**No, it is incorrect.**

- `truncate_setsize(inode, newsize)` immediately updates the in-memory `inode->i_size` via `i_size_write(inode, newsize)` and calls `pagecache_isize_extended()`.
- While `ntfs_setattr` holds `inode->i_rwsem`, page faults (`filemap_fault`) do **not** take `i_rwsem`. In `filemap_fault()`, folios are allocated and read holding only `filemap_invalidate_lock_shared(mapping)` (or under folio lock), not `i_rwsem`.
- If `truncate_setsize` is called before `ntfs_set_size`, a concurrent page fault can read the newly updated `inode->i_size` while the on-disk attribute length has not yet been modified by `ntfs_set_size`. When `ntfs_iomap_begin()` executes, it reads the old resident attribute length (e.g. 5 bytes) into `iomap->length`. Subsequently, `iomap_read_inline_data()` calculates `size = i_size_read(inode) - iomap->offset` (e.g. 20 bytes), which triggers `WARN_ON_ONCE(size > iomap->length)` and fails with `-EIO`.
- Furthermore, if `ntfs_set_size()` fails (e.g., due to `-EFBIG`, `-ENOSPC`, or disk I/O errors), the page cache has already been extended prematurely, requiring error rollback of `inode->i_size`.

---

### 2. How ext4 and XFS prevent concurrent reads/faults from observing intermediate states

Both filesystems serialize size modifications against page faults using `mapping->invalidate_lock` (or filesystem-specific lock abstractions mapping to it), and they sequence metadata updates appropriately:

1. **XFS (`xfs_vn_setattr` / `xfs_vn_setattr_size`)**:
   - `xfs_vn_setattr` acquires `xfs_ilock(ip, XFS_MMAPLOCK_EXCL)` before performing any size updates.
   - In XFS, `XFS_MMAPLOCK_EXCL` / `XFS_MMAPLOCK_SHARED` directly correspond to `down_write` / `down_read` of `inode->i_mapping->invalidate_lock`.
   - `filemap_fault()` takes `filemap_invalidate_lock_shared` when instantiating or reading non-uptodate folios. Holding `XFS_MMAPLOCK_EXCL` completely blocks concurrent page faults from running during truncate or file extension.
   - Under this lock, XFS zeroes beyond EOF (`xfs_zero_range`), updates page cache / size via `truncate_setsize`, logs the on-disk metadata (`ip->i_disk_size = newsize`), commits the transaction, and only then releases `XFS_MMAPLOCK_EXCL`.

2. **ext4 (`ext4_setattr`)**:
   - `ext4_setattr` holds `filemap_invalidate_lock(inode->i_mapping)` throughout the entire size change operation.
   - For file extension (`!shrink`), it first zeroes post-EOF folio tails (`ext4_block_zero_eof`), takes a journal handle, takes `down_write(&EXT4_I(inode)->i_data_sem)`, updates `EXT4_I(inode)->i_disksize` and calls `i_size_write(inode, attr->ia_size)` together under lock, and calls `pagecache_isize_extended(inode, oldsize, inode->i_size)`.
   - Concurrent faults are serialized because `ext4_page_mkwrite` and `filemap_fault` take `filemap_invalidate_lock_shared()`.

---

### 3. How this should be fixed in `ntfs_setattr`

To fix this issue in `fs/ntfs3/file.c`:

1. **Serialize page faults using `filemap_invalidate_lock`**:
   Surround the size modification block with `filemap_invalidate_lock(inode->i_mapping)` and `filemap_invalidate_unlock(inode->i_mapping)`. This blocks concurrent `filemap_fault()` calls from reading or populating folios while the size and attributes are changing.

2. **Order operations depending on whether extending or shrinking**:
   - **When extending (`newsize > oldsize`)**:
     Call `ntfs_set_size(inode, newsize)` **first** to resize/convert the attribute (including converting resident data to non-resident if necessary and allocating clusters). Once metadata and allocations succeed, call `truncate_setsize(inode, newsize)` (or `i_size_write(inode, newsize)` followed by `pagecache_isize_extended(inode, oldsize, newsize)`).
   - **When shrinking (`newsize < oldsize`)**:
     Call `truncate_setsize(inode, newsize)` first (to unmap and truncate folios beyond the new EOF so they are not written back to deallocated blocks), followed by `ntfs_set_size(inode, newsize)` to shrink the attribute and free unused clusters on disk.
   - **Error Handling**:
     If `ntfs_set_size` fails during shrinking, roll back `inode->i_size` under `filemap_invalidate_lock`.

**Example Patch Outline**:
```c
	if (newsize != oldsize) {
		filemap_invalidate_lock(inode->i_mapping);

		if (newsize > oldsize) {
			err = ntfs_set_size(inode, newsize);
			if (!err)
				truncate_setsize(inode, newsize);
		} else {
			truncate_setsize(inode, newsize);
			err = ntfs_set_size(inode, newsize);
			if (err)
				i_size_write(inode, oldsize);
		}

		filemap_invalidate_unlock(inode->i_mapping);

		if (err)
			goto out;

		ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
		ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
		inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
	}
```

---

### Limitations / Unverified Parts
- We verified the locking and ordering mechanisms in `ext4`, `xfs`, `ntfs`, `zonefs`, and `mm/filemap.c`.
- In `ntfs3`, `ntfs_set_size()` internally acquires `ni_lock(ni)` and `ni->file.run_lock`. The deadlock-freedom of locking `filemap_invalidate_lock` before `ni_lock` and `run_lock` was verified against other callers in `fs/ntfs3/file.c` (e.g., `ntfs_fallocate()`, which already takes `filemap_invalidate_lock` before acquiring internal NTFS locks).
- Exact post-EOF folio tail zeroing behavior (such as `iomap_zero_range` for extending beyond EOF cluster boundaries) should also be evaluated if sparse or unwritten extent semantics require zeroing intermediate page cache folios.]

Instruction:
You are a capable Linux kernel developer tasked with researching complex questions
about kernel source code. You will be given a concrete question, and need to provide
a concrete answer.
Research the question using targeted, efficient tool calls. Don't make assumptions,
or rely on your previous knowledge about the kernel source code, use available tools
to access the actual source code. Keep your tool calls focused and limited to the
scope of the question. Do not explore tangential code paths or perform unbounded searches.
Use all available sources of information:
 - kernel source code
 - documentation in the Documentation dir in the source tree
 - git commits descriptions, git blame

Do not guess file names or file paths and attempt to read them without
verifying their existence first using content search or directory listing tools.
If a file, symbol, or directory is not found via content search (grepper) or
directory listing (codesearch-dir-index), treat it as completely absent.
Do not attempt to guess alternative names, extensions, or directories.

Tool Selection Guidelines:
1. For C functions, structs, and variables: Prefer codesearch-definition-source
   or codesearch-struct-layout FIRST to retrieve clean, exact definitions
   without line-number guessing.
2. If symbol lookup fails (e.g., preprocessor macros, macro-generated code, or
   disabled #ifdef branches), fall back to read-file or grepper.
3. For file headers, #include directives, preprocessor macro definitions, and
   non-C files (Kconfig, Makefiles, docs): Use read-file or grepper directly.
4. Be concise and targeted. Answer the question as directly and concisely as possible
   once you have located the relevant code or definitions. If a symbol or function cannot
   be found after targeted searches, conclude with the best available information rather
   than continuing repetitive searches.
Do NOT use git-log to search for the presence or existence of files in the
repository. git-log is only for tracing commit history of files that are
already present in the current checkout. If a file does not exist in the
current checkout, it cannot be used for reproduction.

Avoid running broad git-log queries (such as searches on the entire repo)
without a specific 'PathPrefix' to restrict the scope, as these are very
expensive and will time out.
If a git-log tool call times out, do not retry the query with the same broad
scope. You must specify a tighter, narrower 'PathPrefix' for subsequent queries.

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:
In `ntfs_setattr` (fs/ntfs3/file.c), when extending the file size (`newsize > oldsize`), `truncate_setsize(inode, newsize)` is called before `ntfs_set_size(inode, newsize)`. `truncate_setsize` updates `inode->i_size` immediately.
If a concurrent page fault triggers `ntfs_read_folio` -> `iomap_read_folio` -> `ntfs_iomap_begin`, `ntfs_iomap_begin` will read the old resident attribute size (e.g., 5 bytes) because `ntfs_set_size` hasn't updated it yet. It sets `iomap->length = 5` and `iomap->offset = 0`.
Then `iomap_read_inline_data` is called, which computes `size = i_size_read(iter->inode) - iomap->offset`. Since `i_size` was already updated to 20 by `truncate_setsize`, `size` is 20.
Then it checks `WARN_ON_ONCE(size > iomap->length)` which is `20 > 5`, triggering the warning.

Is it correct to call `truncate_setsize` before `ntfs_set_size` when extending the file size? In ext4 and xfs, `truncate_setsize` is called *after* allocating blocks or updating the on-disk size, or under a lock that prevents concurrent reads. How should this be fixed in `ntfs_setattr`?

102/4 2026/09/17 10:52 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 4499
							output: 107
							thoughts: 431
						

Thoughts:
**Analyzing the NTFS File Size Extension Vulnerability**

Okay, so the issue at hand seems pretty clear. When `ntfs_setattr` in the NTFS3 filesystem extends a file's size (`newsize > oldsize`), it calls `truncate_setsize(inode, newsize)` *before* `ntfs_set_size(inode, newsize)`. This immediately updates `inode->i_size`. The problem is, this creates a potential race condition.

If a concurrent page fault kicks off a read operation via `ntfs_read_folio`, `iomap_read_folio`, and `ntfs_iomap_begin`, the read operation might see the *old* resident attribute size because `ntfs_set_size` hasn't had a chance to update the metadata yet. `ntfs_iomap_begin` then sets `iomap->length` to this outdated size (say, 5 bytes). The read continues, and `iomap_read_inline_data` is called. Here, the read calculates `size = i_size_read(iter->inode) - iomap->offset`. Since `i_size` has already been updated to the *new* size (20, thanks to `truncate_setsize`), this calculation results in `size` being 20.  Finally, we hit the `WARN_ON_ONCE(size > iomap->length)` check, which is now `20 > 5`, triggering the warning.

The core question here is whether calling `truncate_setsize` before `ntfs_set_size` is the correct approach for extending file size. It seems suspect, given that ext4 and xfs do things differently. In those filesystems, `truncate_setsize` is called *after* allocating blocks or updating the on-disk size, or there's some locking mechanism in place to prevent concurrent reads during the size update. Clearly, this is the root cause.

My next step is to dive into `fs/ntfs3/file.c` and explore the related functions: `ntfs_setattr`, `ntfs_set_size`, and other supporting routines. I'll need to examine how these functions interact and where this critical sequence of events takes place. I'll probably start with `codesearch-definition-source`, `grepper`, or even just `read-file` to get a good understanding of the control flow and data dependencies. My goal is to pinpoint exactly where this race window exists and propose a fix.



103/4 2026/09/17 10:52 tool grepper
0m Args:
map[Expression:ntfs_setattr PathPrefix:fs/ntfs3]

Results:
map[Output:fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-703-/*
fs/ntfs3/file.c:704: * ntfs_setattr - inode_operations::setattr
fs/ntfs3/file.c-705- */
fs/ntfs3/file.c:706:int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/ntfs3/file.c-707-		 struct iattr *attr)
--
fs/ntfs3/file.c=1575=const struct inode_operations ntfs_file_inode_operations = {
fs/ntfs3/file.c-1576-	.getattr	= ntfs_getattr,
fs/ntfs3/file.c:1577:	.setattr	= ntfs_setattr,
fs/ntfs3/file.c-1578-	.listxattr	= ntfs_listxattr,
--
fs/ntfs3/inode.c=2293=const struct inode_operations ntfs_link_inode_operations = {
fs/ntfs3/inode.c-2294-	.get_link	= ntfs_get_link,
fs/ntfs3/inode.c:2295:	.setattr	= ntfs_setattr,
fs/ntfs3/inode.c-2296-	.listxattr	= ntfs_listxattr,
--
fs/ntfs3/namei.c=529=const struct inode_operations ntfs_dir_inode_operations = {
--
fs/ntfs3/namei.c-540-	.set_acl	= ntfs_set_acl,
fs/ntfs3/namei.c:541:	.setattr	= ntfs_setattr,
fs/ntfs3/namei.c-542-	.getattr	= ntfs_getattr,
--
fs/ntfs3/namei.c=549=const struct inode_operations ntfs_special_inode_operations = {
fs/ntfs3/namei.c:550:	.setattr	= ntfs_setattr,
fs/ntfs3/namei.c-551-	.getattr	= ntfs_getattr,
--
fs/ntfs3/ntfs_fs.h=556=int ntfs_getattr(struct mnt_idmap *idmap, const struct path *path,
fs/ntfs3/ntfs_fs.h-557-		 struct kstat *stat, u32 request_mask, u32 flags);
fs/ntfs3/ntfs_fs.h:558:int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/ntfs3/ntfs_fs.h-559-		 struct iattr *attr);
--
fs/ntfs3/xattr.c=691=int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode,
--
fs/ntfs3/xattr.c-722-/*
fs/ntfs3/xattr.c:723: * ntfs_acl_chmod - Helper for ntfs_setattr().
fs/ntfs3/xattr.c-724- */
]

104/4 2026/09/17 10:52 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:ntfs_setattr]

Results:
map[SourceCode: 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
 770:		if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE))
 771:			ntfs_save_wsl_perm(inode, NULL);
 772:		mark_inode_dirty(inode);
 773:	out:
 774:		return err;
 775:	}
 SourceFile:fs/ntfs3/file.c]

105/4 2026/09/17 10:52 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:ntfs_set_size]

Results:
map[SourceCode: 883:	int ntfs_set_size(struct inode *inode, u64 new_size)
 884:	{
 885:		struct super_block *sb = inode->i_sb;
 886:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 887:		struct ntfs_inode *ni = ntfs_i(inode);
 888:		int err;
 889:	
 890:		/* Check for maximum file size. */
 891:		if (is_sparsed(ni) || is_compressed(ni)) {
 892:			if (new_size > sbi->maxbytes_sparse) {
 893:				return -EFBIG;
 894:			}
 895:		} else if (new_size > sbi->maxbytes) {
 896:			return -EFBIG;
 897:		}
 898:	
 899:		/* Mark rw ntfs as dirty. It will be cleared at umount. */
 900:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 901:	
 902:		ni_lock(ni);
 903:		down_write(&ni->file.run_lock);
 904:		if (new_size < ni->i_valid)
 905:			ni->i_valid = new_size;
 906:	
 907:		/* last 'true' means keep preallocated. */
 908:		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
 909:				    &ni->file.run, new_size, &ni->i_valid, true);
 910:	
 911:		up_write(&ni->file.run_lock);
 912:		ni_unlock(ni);
 913:	
 914:		return err;
 915:	}
 SourceFile:fs/ntfs3/inode.c]

106/4 2026/09/17 10:52 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 8108
							output: 37
							thoughts: 303
						

Thoughts:
**Analyzing `ntfs_setattr` and its Interactions**

Okay, let's break down this `ntfs_setattr` function. My initial impression is that it's handling file attribute changes, specifically focusing on size adjustments. The first thing that catches my eye is the check for `ATTR_SIZE` within the `ia_valid` mask – that's the trigger. It seems like the code is only interested in handling size changes if the `ATTR_SIZE` flag is set.

The code immediately addresses a potential edge case: compression. The `WARN_ON` suggests a condition that *shouldn't* occur. If a compressed file somehow ends up here, it bails out with an `-EOPNOTSUPP` error. A clear indication that this particular code path isn't designed to handle compressed files, which makes sense considering NTFS's complexity with compression. Good defensive coding.

The core logic revolves around comparing the proposed new size (`newsize`) with the current size (`oldsize`). It makes sure that this is a change and not the same value, it will not continue with the changes if the sizes are the same. This implies an existing implementation with a different set of optimizations. I notice the call to `inode_dio_wait(inode)`. This indicates that direct I/O (DIO) might be involved. This call suggests that the system waits for any pending DIO operations to complete before proceeding with the size change. This is essential to ensure data consistency, particularly when dealing with concurrent access.

So, if there *is* a size change, the code calls `truncate_setsize`. Now, this is the crucial part. I need to understand what `truncate_setsize` does. The name is clear; it deals with file truncation, which means I should go look at the implementation. I'll need to check the definition to understand the precise details of how `truncate_setsize` actually modifies the file's size and manages associated data blocks or clusters.

After `truncate_setsize`, it proceeds to the call to `ntfs_set_size`. This is also a key operation: it appears to actually perform the NTFS-specific size modification. The code includes a rollback mechanism: if `ntfs_set_size` fails, the size is restored to its original value, which is critical for maintaining file system integrity. It also then updates some flags to note the state change and potentially trigger a parent directory update. The mtime and ctime are updated, which is expected with a change of size. Good practices. I will need to look up these functions to understand what they entail.



107/4 2026/09/17 10:53 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:truncate_setsize]

Results:
map[SourceCode: 803:	/**
 804:	 * truncate_setsize - update inode and pagecache for a new file size
 805:	 * @inode: inode
 806:	 * @newsize: new file size
 807:	 *
 808:	 * truncate_setsize updates i_size and performs pagecache truncation (if
 809:	 * necessary) to @newsize. It will be typically be called from the filesystem's
 810:	 * setattr function when ATTR_SIZE is passed in.
 811:	 *
 812:	 * Must be called with a lock serializing truncates and writes (generally
 813:	 * i_rwsem but e.g. xfs uses a different lock) and before all filesystem
 814:	 * specific block truncation has been performed.
 815:	 */
 816:	void truncate_setsize(struct inode *inode, loff_t newsize)
 817:	{
 818:		loff_t oldsize = inode->i_size;
 819:	
 820:		i_size_write(inode, newsize);
 821:		if (newsize > oldsize)
 822:			pagecache_isize_extended(inode, oldsize, newsize);
 823:		truncate_pagecache(inode, newsize);
 824:	}
 SourceFile:mm/truncate.c]

108/4 2026/09/17 10:53 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 9380
							output: 114
							thoughts: 163
						

Thoughts:
**My Line of Inquiry: Truncation vs. Extension in Filesystem Operations**

Okay, so I'm looking at this `truncate_setsize` function, and the documentation immediately triggers some thoughts. It states it should be called with a lock serializing truncates and writes, and *before* filesystem-specific block truncation. Hold on a second, that 'before' part... that's crucial and really applies specifically to *shrinking* a file.

My mind immediately starts to race: What about the reverse scenario – file *extension*? Does the call pattern change? Is there a difference in the locking requirements or timing when we're growing a file versus shrinking it? The wording of the doc seems very specific to truncation, so I need to explore this difference.

Alright, to get a handle on this, I need to see how various filesystems implement this in practice, and how they handle extension versus shrinking operations. Time to dig into the source code. I need to search for how `truncate_setsize` is called across different implementations: ext4, xfs, btrfs, f2fs, iomap... I'll check how they manage the interplay between `setattr` and calls to `truncate_setsize` for these operations. I need to see if there's a consistent pattern or if different filesystems have different strategies based on their internal structures. It's time to get my hands dirty.



109/4 2026/09/17 10:53 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:truncate_setsize PathPrefix:fs/ext4]

Results:
map[Output:]

110/4 2026/09/17 10:53 tool grepper
0m Args:
map[Expression:truncate_setsize PathPrefix:fs/xfs]

Results:
map[Output:fs/xfs/xfs_iops.c=905=xfs_vn_setattr_size(
--
fs/xfs/xfs_iops.c-1008-	 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
fs/xfs/xfs_iops.c:1009:	 * complete. The truncate_setsize() call also cleans partial EOF page
fs/xfs/xfs_iops.c-1010-	 * PTEs on extending truncates and hence ensures sub-page block size
--
fs/xfs/xfs_iops.c-1025-	 */
fs/xfs/xfs_iops.c:1026:	truncate_setsize(inode, newsize);
fs/xfs/xfs_iops.c-1027-
]

111/4 2026/09/17 10:53 tool grepper
0m Args:
map[Expression:truncate_setsize PathPrefix:fs/btrfs]

Results:
map[Output:fs/btrfs/file.c=1526=int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
--
fs/btrfs/file.c-1809- * protect against truncate races as the page could now be beyond EOF.  Because
fs/btrfs/file.c:1810: * truncate_setsize() writes the inode size before removing pages, once we have
fs/btrfs/file.c-1811- * the page lock we can determine safely if the page is beyond EOF. If it is not
--
fs/btrfs/inode.c=5391=static int btrfs_setsize(struct inode *inode, struct iattr *attr)
--
fs/btrfs/inode.c-5460-
fs/btrfs/inode.c:5461:		truncate_setsize(inode, newsize);
fs/btrfs/inode.c-5462-
]

112/4 2026/09/17 10:53 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:truncate_setsize PathPrefix:fs/iomap]

Results:
map[Output:]

113/4 2026/09/17 10:53 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 10459
							output: 37
							thoughts: 55
						

Thoughts:
**Examining the ext4 Filesystem for Truncation Behavior**

Alright, let's dive into the ext4 filesystem code. My immediate thought is to check `fs/ext4` for `truncate_setsize` because that seems like the natural function to investigate when dealing with file truncation. Huh, that's odd, no matches for `truncate_setsize`? Okay, that’s a red flag. Perhaps the function has a different name. Let's pivot and see what `ext4_setattr` is doing; maybe it handles the attribute changes that trigger a size adjustment.



114/4 2026/09/17 10:53 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ext4/inode.c Name:ext4_setattr]

Results:
map[SourceCode:5985:	/*
5986:	 * ext4_setattr()
5987:	 *
5988:	 * Called from notify_change.
5989:	 *
5990:	 * We want to trap VFS attempts to truncate the file as soon as
5991:	 * possible.  In particular, we want to make sure that when the VFS
5992:	 * shrinks i_size, we put the inode on the orphan list and modify
5993:	 * i_disksize immediately, so that during the subsequent flushing of
5994:	 * dirty pages and freeing of disk blocks, we can guarantee that any
5995:	 * commit will leave the blocks being flushed in an unused state on
5996:	 * disk.  (On recovery, the inode will get truncated and the blocks will
5997:	 * be freed, so we have a strong guarantee that no future commit will
5998:	 * leave these blocks visible to the user.)
5999:	 *
6000:	 * Another thing we have to assure is that if we are in ordered mode
6001:	 * and inode is still attached to the committing transaction, we must
6002:	 * we start writeout of all the dirty pages which are being truncated.
6003:	 * This way we are sure that all the data written in the previous
6004:	 * transaction are already on disk (truncate waits for pages under
6005:	 * writeback).
6006:	 *
6007:	 * Called with inode->i_rwsem down.
6008:	 */
6009:	int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
6010:			 struct iattr *attr)
6011:	{
6012:		struct inode *inode = d_inode(dentry);
6013:		int error, rc = 0;
6014:		int orphan = 0;
6015:		const unsigned int ia_valid = attr->ia_valid;
6016:		bool inc_ivers = true;
6017:	
6018:		error = ext4_emergency_state(inode->i_sb);
6019:		if (unlikely(error))
6020:			return error;
6021:	
6022:		if (unlikely(IS_IMMUTABLE(inode)))
6023:			return -EPERM;
6024:	
6025:		if (unlikely(IS_APPEND(inode) &&
6026:			     (ia_valid & (ATTR_MODE | ATTR_UID |
6027:					  ATTR_GID | ATTR_TIMES_SET))))
6028:			return -EPERM;
6029:	
6030:		error = setattr_prepare(idmap, dentry, attr);
6031:		if (error)
6032:			return error;
6033:	
6034:		error = fscrypt_prepare_setattr(dentry, attr);
6035:		if (error)
6036:			return error;
6037:	
6038:		if (is_quota_modification(idmap, inode, attr)) {
6039:			error = dquot_initialize(inode);
6040:			if (error)
6041:				return error;
6042:		}
6043:	
6044:		if (i_uid_needs_update(idmap, attr, inode) ||
6045:		    i_gid_needs_update(idmap, attr, inode)) {
6046:			handle_t *handle;
6047:	
6048:			/* (user+group)*(old+new) structure, inode write (sb,
6049:			 * inode block, ? - but truncate inode update has it) */
6050:			handle = ext4_journal_start(inode, EXT4_HT_QUOTA,
6051:				(EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb) +
6052:				 EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb)) + 3);
6053:			if (IS_ERR(handle)) {
6054:				error = PTR_ERR(handle);
6055:				goto err_out;
6056:			}
6057:	
6058:			/* dquot_transfer() calls back ext4_get_inode_usage() which
6059:			 * counts xattr inode references.
6060:			 */
6061:			down_read(&EXT4_I(inode)->xattr_sem);
6062:			error = dquot_transfer(idmap, inode, attr);
6063:			up_read(&EXT4_I(inode)->xattr_sem);
6064:	
6065:			if (error) {
6066:				ext4_journal_stop(handle);
6067:				return error;
6068:			}
6069:			/* Update corresponding info in inode so that everything is in
6070:			 * one transaction */
6071:			i_uid_update(idmap, attr, inode);
6072:			i_gid_update(idmap, attr, inode);
6073:			error = ext4_mark_inode_dirty(handle, inode);
6074:			ext4_journal_stop(handle);
6075:			if (unlikely(error)) {
6076:				return error;
6077:			}
6078:		}
6079:	
6080:		if (attr->ia_valid & ATTR_SIZE) {
6081:			handle_t *handle;
6082:			loff_t oldsize = inode->i_size;
6083:			loff_t old_disksize;
6084:			int shrink = (attr->ia_size < inode->i_size);
6085:	
6086:			if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
6087:				struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
6088:	
6089:				if (attr->ia_size > sbi->s_bitmap_maxbytes) {
6090:					return -EFBIG;
6091:				}
6092:			}
6093:			if (!S_ISREG(inode->i_mode)) {
6094:				return -EINVAL;
6095:			}
6096:	
6097:			if (attr->ia_size == inode->i_size)
6098:				inc_ivers = false;
6099:	
6100:			/*
6101:			 * If file has inline data but new size exceeds inline capacity,
6102:			 * convert to extent-based storage first to prevent inconsistent
6103:			 * state (inline flag set but size exceeds inline capacity).
6104:			 */
6105:			if (ext4_has_inline_data(inode) &&
6106:			    attr->ia_size > EXT4_I(inode)->i_inline_size) {
6107:				error = ext4_convert_inline_data(inode);
6108:				if (error)
6109:					goto err_out;
6110:			}
6111:	
6112:			if (shrink) {
6113:				if (ext4_should_order_data(inode)) {
6114:					error = ext4_begin_ordered_truncate(inode,
6115:								    attr->ia_size);
6116:					if (error)
6117:						goto err_out;
6118:				}
6119:				/*
6120:				 * Blocks are going to be removed from the inode. Wait
6121:				 * for dio in flight.
6122:				 */
6123:				inode_dio_wait(inode);
6124:			}
6125:	
6126:			filemap_invalidate_lock(inode->i_mapping);
6127:	
6128:			rc = ext4_break_layouts(inode);
6129:			if (rc) {
6130:				filemap_invalidate_unlock(inode->i_mapping);
6131:				goto err_out;
6132:			}
6133:	
6134:			if (attr->ia_size != inode->i_size) {
6135:				/* attach jbd2 jinode for EOF folio tail zeroing */
6136:				if (attr->ia_size & (inode->i_sb->s_blocksize - 1) ||
6137:				    oldsize & (inode->i_sb->s_blocksize - 1)) {
6138:					error = ext4_inode_attach_jinode(inode);
6139:					if (error)
6140:						goto out_mmap_sem;
6141:				}
6142:	
6143:				/*
6144:				 * Update c/mtime and tail zero the EOF folio on
6145:				 * truncate up. ext4_truncate() handles the shrink case
6146:				 * below.
6147:				 */
6148:				if (!shrink) {
6149:					inode_set_mtime_to_ts(inode,
6150:							      inode_set_ctime_current(inode));
6151:					if (oldsize & (inode->i_sb->s_blocksize - 1)) {
6152:						error = ext4_block_zero_eof(inode,
6153:								oldsize, LLONG_MAX);
6154:						if (error)
6155:							goto out_mmap_sem;
6156:					}
6157:				}
6158:	
6159:				handle = ext4_journal_start(inode, EXT4_HT_INODE, 3);
6160:				if (IS_ERR(handle)) {
6161:					error = PTR_ERR(handle);
6162:					goto out_mmap_sem;
6163:				}
6164:				if (ext4_handle_valid(handle) && shrink) {
6165:					error = ext4_orphan_add(handle, inode);
6166:					orphan = 1;
6167:				}
6168:	
6169:				if (shrink)
6170:					ext4_fc_track_range(handle, inode,
6171:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6172:						inode->i_sb->s_blocksize_bits,
6173:						EXT_MAX_BLOCKS - 1);
6174:				else
6175:					ext4_fc_track_range(
6176:						handle, inode,
6177:						(oldsize > 0 ? oldsize - 1 : oldsize) >>
6178:						inode->i_sb->s_blocksize_bits,
6179:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6180:						inode->i_sb->s_blocksize_bits);
6181:	
6182:				down_write(&EXT4_I(inode)->i_data_sem);
6183:				old_disksize = EXT4_I(inode)->i_disksize;
6184:				EXT4_I(inode)->i_disksize = attr->ia_size;
6185:	
6186:				/*
6187:				 * We have to update i_size under i_data_sem together
6188:				 * with i_disksize to avoid races with writeback code
6189:				 * running ext4_wb_update_i_disksize().
6190:				 */
6191:				if (!error)
6192:					i_size_write(inode, attr->ia_size);
6193:				else
6194:					EXT4_I(inode)->i_disksize = old_disksize;
6195:				up_write(&EXT4_I(inode)->i_data_sem);
6196:				rc = ext4_mark_inode_dirty(handle, inode);
6197:				if (!error)
6198:					error = rc;
6199:				ext4_journal_stop(handle);
6200:				if (error)
6201:					goto out_mmap_sem;
6202:				if (!shrink) {
6203:					pagecache_isize_extended(inode, oldsize,
6204:								 inode->i_size);
6205:				} else if (ext4_should_journal_data(inode)) {
6206:					ext4_wait_for_tail_page_commit(inode);
6207:				}
6208:			}
6209:	
6210:			/*
6211:			 * Truncate pagecache after we've waited for commit
6212:			 * in data=journal mode to make pages freeable.
6213:			 */
6214:			truncate_pagecache(inode, inode->i_size);
6215:			/*
6216:			 * Call ext4_truncate() even if i_size didn't change to
6217:			 * truncate possible preallocated blocks.
6218:			 */
6219:			if (attr->ia_size <= oldsize) {
6220:				rc = ext4_truncate(inode);
6221:				if (rc)
6222:					error = rc;
6223:			}
6224:	out_mmap_sem:
6225:			filemap_invalidate_unlock(inode->i_mapping);
6226:		}
6227:	
6228:		if (!error) {
6229:			if (inc_ivers)
6230:				inode_inc_iversion(inode);
6231:			setattr_copy(idmap, inode, attr);
6232:			mark_inode_dirty(inode);
6233:		}
6234:	
6235:		/*
6236:		 * If the call to ext4_truncate failed to get a transaction handle at
6237:		 * all, we need to clean up the in-core orphan list manually.
6238:		 */
6239:		if (orphan && inode->i_nlink)
6240:			ext4_orphan_del(NULL, inode);
6241:	
6242:		if (!error && (ia_valid & ATTR_MODE))
6243:			rc = posix_acl_chmod(idmap, dentry, inode->i_mode);
6244:	
6245:	err_out:
6246:		if  (error)
6247:			ext4_std_error(inode->i_sb, error);
6248:		if (!error)
6249:			error = rc;
6250:		return error;
6251:	}
 SourceFile:fs/ext4/inode.c]

115/4 2026/09/17 10:53 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 14746
							output: 45
							thoughts: 495
						

Thoughts:
**Analyzing Filesystem Truncation in ext4 and XFS**

Okay, let's dive into this. I'm focusing on how file size changes, specifically truncation, are handled in ext4 and comparing it with what XFS does. My immediate thought is to look at the `ext4` code, and I'm particularly interested in the sequence around `filemap_invalidate_lock`. That's where the page cache is invalidated, and it's key to understanding how data consistency is maintained during a file size update.

I see that `filemap_invalidate_lock` is called, and then it looks like we're acquiring a semaphore (`i_data_sem`) associated with the inode's data.  The existing disk size (`old_disksize`) is saved.  Then, the new size (`attr->ia_size`) is set, and the `i_size` is updated if there's no error.  If there *is* an error, it reverts the `i_disksize`. The write semaphore is released, then the inode is marked dirty and journaled. There are additional conditional steps to shrink the page cache.  Then it calls `ext4_truncate()`.  Finally, the `filemap_invalidate_unlock` is executed.  I understand that.  I see how the journal is involved and how they're ensuring data consistency, even if an error occurs during the operation.

Now, I want to compare this with XFS. The crucial thing is to look at the `xfs_vn_setattr_size` function, specifically in `fs/xfs/xfs_iops.c`. I need to see if XFS has similar locking mechanisms, page cache invalidation strategies, and journaling approaches for handling file truncation and size changes. This will allow me to draw some specific comparisons.



116/4 2026/09/17 10:53 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/xfs/xfs_iops.c Name:xfs_vn_setattr_size]

Results:
map[SourceCode: 901:	/*
 902:	 * Truncate file.  Must have write permission and not be a directory.
 903:	 */
 904:	int
 905:	xfs_vn_setattr_size(
 906:		struct mnt_idmap	*idmap,
 907:		struct dentry		*dentry,
 908:		struct iattr		*iattr)
 909:	{
 910:		struct inode		*inode = d_inode(dentry);
 911:		struct xfs_inode	*ip = XFS_I(inode);
 912:		struct xfs_mount	*mp = ip->i_mount;
 913:		xfs_off_t		oldsize = inode->i_size;
 914:		xfs_off_t		newsize = iattr->ia_size;
 915:		struct xfs_trans	*tp;
 916:		int			error;
 917:		uint			lock_flags = 0;
 918:		uint			resblks = 0;
 919:		bool			did_zeroing = false;
 920:		struct xfs_zone_alloc_ctx ac = { };
 921:	
 922:		xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
 923:		ASSERT(S_ISREG(inode->i_mode));
 924:		ASSERT((iattr->ia_valid & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET|
 925:			ATTR_MTIME_SET|ATTR_TIMES_SET)) == 0);
 926:	
 927:		trace_xfs_setattr(ip);
 928:	
 929:		error = xfs_vn_change_ok(idmap, dentry, iattr);
 930:		if (error)
 931:			return error;
 932:	
 933:		/*
 934:		 * Short circuit the truncate case for zero length files.
 935:		 */
 936:		if (newsize == 0 && oldsize == 0 && ip->i_df.if_nextents == 0) {
 937:			if (!(iattr->ia_valid & (ATTR_CTIME|ATTR_MTIME)))
 938:				return 0;
 939:	
 940:			/*
 941:			 * Use the regular setattr path to update the timestamps.
 942:			 */
 943:			iattr->ia_valid &= ~ATTR_SIZE;
 944:			return xfs_setattr_nonsize(idmap, dentry, ip, iattr);
 945:		}
 946:	
 947:		/*
 948:		 * Make sure that the dquots are attached to the inode.
 949:		 */
 950:		error = xfs_qm_dqattach(ip);
 951:		if (error)
 952:			return error;
 953:	
 954:		/*
 955:		 * Wait for all direct I/O to complete.
 956:		 */
 957:		inode_dio_wait(inode);
 958:	
 959:		/*
 960:		 * Normally xfs_zoned_space_reserve is supposed to be called outside the
 961:		 * IOLOCK.  For truncate we can't do that since ->setattr is called with
 962:		 * it already held by the VFS.  So for now chicken out and try to
 963:		 * allocate space under it.
 964:		 *
 965:		 * To avoid deadlocks this means we can't block waiting for space, which
 966:		 * can lead to spurious -ENOSPC if there are no directly available
 967:		 * blocks.  We mitigate this a bit by allowing zeroing to dip into the
 968:		 * reserved pool, but eventually the VFS calling convention needs to
 969:		 * change.
 970:		 */
 971:		if (xfs_is_zoned_inode(ip)) {
 972:			error = xfs_zoned_space_reserve(mp, 1,
 973:					XFS_ZR_NOWAIT | XFS_ZR_RESERVED, &ac);
 974:			if (error) {
 975:				if (error == -EAGAIN)
 976:					return -ENOSPC;
 977:				return error;
 978:			}
 979:		}
 980:	
 981:		/*
 982:		 * File data changes must be complete before we start the transaction to
 983:		 * modify the inode.  This needs to be done before joining the inode to
 984:		 * the transaction because the inode cannot be unlocked once it is a
 985:		 * part of the transaction.
 986:		 *
 987:		 * Start with zeroing any data beyond EOF that we may expose on file
 988:		 * extension, or zeroing out the rest of the block on a downward
 989:		 * truncate.
 990:		 */
 991:		if (newsize > oldsize) {
 992:			trace_xfs_zero_eof(ip, oldsize, newsize - oldsize);
 993:			error = xfs_zero_range(ip, oldsize, newsize - oldsize,
 994:					&ac, &did_zeroing);
 995:		} else {
 996:			error = xfs_truncate_page(ip, newsize, &ac, &did_zeroing);
 997:		}
 998:	
 999:		if (xfs_is_zoned_inode(ip))
1000:			xfs_zoned_space_unreserve(mp, &ac);
1001:	
1002:		if (error)
1003:			return error;
1004:	
1005:		/*
1006:		 * We've already locked out new page faults, so now we can safely remove
1007:		 * pages from the page cache knowing they won't get refaulted until we
1008:		 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
1009:		 * complete. The truncate_setsize() call also cleans partial EOF page
1010:		 * PTEs on extending truncates and hence ensures sub-page block size
1011:		 * filesystems are correctly handled, too.
1012:		 *
1013:		 * We have to do all the page cache truncate work outside the
1014:		 * transaction context as the "lock" order is page lock->log space
1015:		 * reservation as defined by extent allocation in the writeback path.
1016:		 * Hence a truncate can fail with ENOMEM from xfs_trans_alloc(), but
1017:		 * having already truncated the in-memory version of the file (i.e. made
1018:		 * user visible changes). There's not much we can do about this, except
1019:		 * to hope that the caller sees ENOMEM and retries the truncate
1020:		 * operation.
1021:		 *
1022:		 * And we update in-core i_size and truncate page cache beyond newsize
1023:		 * before writeback the [i_disk_size, newsize] range, so we're
1024:		 * guaranteed not to write stale data past the new EOF on truncate down.
1025:		 */
1026:		truncate_setsize(inode, newsize);
1027:	
1028:		/*
1029:		 * We are going to log the inode size change in this transaction so
1030:		 * any previous writes that are beyond the on disk EOF and the new
1031:		 * EOF that have not been written out need to be written here.  If we
1032:		 * do not write the data out, we expose ourselves to the null files
1033:		 * problem. Note that this includes any block zeroing we did above;
1034:		 * otherwise those blocks may not be zeroed after a crash.
1035:		 */
1036:		if (did_zeroing ||
1037:		    (newsize > ip->i_disk_size && oldsize != ip->i_disk_size)) {
1038:			error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping,
1039:							ip->i_disk_size, newsize - 1);
1040:			if (error)
1041:				return error;
1042:		}
1043:	
1044:		/*
1045:		 * For realtime inode with more than one block rtextsize, we need the
1046:		 * block reservation for bmap btree block allocations/splits that can
1047:		 * happen since it could split the tail written extent and convert the
1048:		 * right beyond EOF one to unwritten.
1049:		 */
1050:		if (xfs_inode_has_bigrtalloc(ip))
1051:			resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);
1052:	
1053:		error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, resblks,
1054:					0, 0, &tp);
1055:		if (error)
1056:			return error;
1057:	
1058:		lock_flags |= XFS_ILOCK_EXCL;
1059:		xfs_ilock(ip, XFS_ILOCK_EXCL);
1060:		xfs_trans_ijoin(tp, ip, 0);
1061:	
1062:		/*
1063:		 * Only change the c/mtime if we are changing the size or we are
1064:		 * explicitly asked to change it.  This handles the semantic difference
1065:		 * between truncate() and ftruncate() as implemented in the VFS.
1066:		 *
1067:		 * The regular truncate() case without ATTR_CTIME and ATTR_MTIME is a
1068:		 * special case where we need to update the times despite not having
1069:		 * these flags set.  For all other operations the VFS set these flags
1070:		 * explicitly if it wants a timestamp update.
1071:		 */
1072:		if (newsize != oldsize &&
1073:		    !(iattr->ia_valid & (ATTR_CTIME | ATTR_MTIME))) {
1074:			iattr->ia_ctime = iattr->ia_mtime =
1075:				current_time(inode);
1076:			iattr->ia_valid |= ATTR_CTIME | ATTR_MTIME;
1077:		}
1078:	
1079:		/*
1080:		 * The first thing we do is set the size to new_size permanently on
1081:		 * disk.  This way we don't have to worry about anyone ever being able
1082:		 * to look at the data being freed even in the face of a crash.
1083:		 * What we're getting around here is the case where we free a block, it
1084:		 * is allocated to another file, it is written to, and then we crash.
1085:		 * If the new data gets written to the file but the log buffers
1086:		 * containing the free and reallocation don't, then we'd end up with
1087:		 * garbage in the blocks being freed.  As long as we make the new size
1088:		 * permanent before actually freeing any blocks it doesn't matter if
1089:		 * they get written to.
1090:		 */
1091:		ip->i_disk_size = newsize;
1092:		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
1093:	
1094:		if (newsize <= oldsize) {
1095:			error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, newsize);
1096:			if (error)
1097:				goto out_trans_cancel;
1098:	
1099:			/*
1100:			 * Truncated "down", so we're removing references to old data
1101:			 * here - if we delay flushing for a long time, we expose
1102:			 * ourselves unduly to the notorious NULL files problem.  So,
1103:			 * we mark this inode and flush it when the file is closed,
1104:			 * and do not wait the usual (long) time for writeout.
1105:			 */
1106:			xfs_iflags_set(ip, XFS_ITRUNCATED);
1107:	
1108:			/* A truncate down always removes post-EOF blocks. */
1109:			xfs_inode_clear_eofblocks_tag(ip);
1110:		}
1111:	
1112:		setattr_copy(idmap, inode, iattr);
1113:		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
1114:	
1115:		XFS_STATS_INC(mp, xs_ig_attrchg);
1116:	
1117:		if (xfs_has_wsync(mp))
1118:			xfs_trans_set_sync(tp);
1119:	
1120:		error = xfs_trans_commit(tp);
1121:	out_unlock:
1122:		if (lock_flags)
1123:			xfs_iunlock(ip, lock_flags);
1124:		return error;
1125:	
1126:	out_trans_cancel:
1127:		xfs_trans_cancel(tp);
1128:		goto out_unlock;
1129:	}
 SourceFile:fs/xfs/xfs_iops.c]

117/4 2026/09/17 10:53 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 19482
							output: 43
							thoughts: 79
						

Thoughts:
Here's my thought process, as if I were analyzing that code:

**XFS Conundrum: Where's the MMAPLOCK?**

Okay, let's dive into this XFS code. Specifically, I'm looking at line 922. The line states `xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);`. Interesting. XFS is asserting that both the IOLOCK and the MMAPLOCK are held exclusively. The presence of that MMAPLOCK exclusivity is what's piquing my interest. I need to figure out where that exclusive mmap lock was acquired. Where could it have been taken prior to this assertion? Let's trace it back. The most likely candidate function call is `xfs_vn_setattr`. That's where I will look first, to see if the MMAPLOCK is being acquired there. It seems like the obvious place.



118/4 2026/09/17 10:54 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/xfs/xfs_iops.c Name:xfs_vn_setattr]

Results:
map[SourceCode:1131:	STATIC int
1132:	xfs_vn_setattr(
1133:		struct mnt_idmap	*idmap,
1134:		struct dentry		*dentry,
1135:		struct iattr		*iattr)
1136:	{
1137:		struct inode		*inode = d_inode(dentry);
1138:		struct xfs_inode	*ip = XFS_I(inode);
1139:		int			error;
1140:	
1141:		if (iattr->ia_valid & ATTR_SIZE) {
1142:			uint			iolock;
1143:	
1144:			xfs_ilock(ip, XFS_MMAPLOCK_EXCL);
1145:			iolock = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
1146:	
1147:			error = xfs_break_layouts(inode, &iolock, BREAK_UNMAP);
1148:			if (error) {
1149:				xfs_iunlock(ip, XFS_MMAPLOCK_EXCL);
1150:				return error;
1151:			}
1152:	
1153:			error = xfs_vn_setattr_size(idmap, dentry, iattr);
1154:			xfs_iunlock(ip, XFS_MMAPLOCK_EXCL);
1155:		} else {
1156:			trace_xfs_setattr(ip);
1157:	
1158:			error = xfs_vn_change_ok(idmap, dentry, iattr);
1159:			if (!error)
1160:				error = xfs_setattr_nonsize(idmap, dentry, ip, iattr);
1161:		}
1162:	
1163:		return error;
1164:	}
 SourceFile:fs/xfs/xfs_iops.c]

119/4 2026/09/17 10:54 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 20367
							output: 56
							thoughts: 157
						

Thoughts:
**Analyzing Filesystem Concurrency in the Face of Truncate/Setattr**

Okay, so I'm digging into how these filesystems handle concurrency, specifically when dealing with things like truncate and setattr operations. I need to understand how page faults behave in parallel with those. I'm starting with XFS, and I'm seeing that `xfs_ilock(ip, XFS_MMAPLOCK_EXCL)` is used. Right, that means a page fault in XFS actually takes `XFS_MMAPLOCK_SHARED`! That's a key observation – concurrent page faults are being blocked during a truncate or setattr operation due to that exclusive lock. Interesting...

Now, let's compare that to ext4. They use `filemap_invalidate_lock(inode->i_mapping)`. Hold on... what *lock* is actually involved in a page fault in a generic filesystem context? I need to clarify that. Does a generic page fault operation take `filemap_invalidate_lock_shared`? I doubt it, but I need to be sure. I'm going to check the code around `filemap_fault`, `filemap_page_mkwrite`, and maybe even jump over to something like `ntfs_read_folio` just to see the differences. I also need to verify that `filemap_invalidate_lock` isn't involved in page faults directly. I think I'm on to something here. Gotta compare these locking strategies to get a clear picture!



120/4 2026/09/17 10:54 tool grepper
0m Args:
map[Expression:filemap_invalidate_lock PathPrefix:mm/]

Results:
map[Output:mm/filemap.c=1021=EXPORT_SYMBOL(filemap_alloc_folio_noprof);
--
mm/filemap.c-1024-/*
mm/filemap.c:1025: * filemap_invalidate_lock_two - lock invalidate_lock for two mappings
mm/filemap.c-1026- *
--
mm/filemap.c-1031- */
mm/filemap.c:1032:void filemap_invalidate_lock_two(struct address_space *mapping1,
mm/filemap.c-1033-				 struct address_space *mapping2)
--
mm/filemap.c-1041-}
mm/filemap.c:1042:EXPORT_SYMBOL(filemap_invalidate_lock_two);
mm/filemap.c-1043-
--
mm/filemap.c=2563=static int filemap_update_page(struct kiocb *iocb,
--
mm/filemap.c-2572-	} else {
mm/filemap.c:2573:		filemap_invalidate_lock_shared(mapping);
mm/filemap.c-2574-	}
--
mm/filemap.c=2619=static int filemap_create_folio(struct kiocb *iocb, struct folio_batch *fbatch)
--
mm/filemap.c-2648-	 */
mm/filemap.c:2649:	filemap_invalidate_lock_shared(mapping);
mm/filemap.c-2650-	index = (iocb->ki_pos >> (PAGE_SHIFT + min_order)) << min_order;
--
mm/filemap.c=3555=vm_fault_t filemap_fault(struct vm_fault *vmf)
--
mm/filemap.c-3584-		if (unlikely(!folio_test_uptodate(folio))) {
mm/filemap.c:3585:			filemap_invalidate_lock_shared(mapping);
mm/filemap.c-3586-			mapping_locked = true;
--
mm/filemap.c-3603-		if (!mapping_locked) {
mm/filemap.c:3604:			filemap_invalidate_lock_shared(mapping);
mm/filemap.c-3605-			mapping_locked = true;
--
mm/filemap.c=4572=int filemap_invalidate_inode(struct inode *inode, bool flush,
--
mm/filemap.c-4583-	/* Prevent new folios from being added to the inode. */
mm/filemap.c:4584:	filemap_invalidate_lock(mapping);
mm/filemap.c-4585-
--
mm/readahead.c=326=static void do_page_cache_ra(struct readahead_control *ractl,
--
mm/readahead.c-346-
mm/readahead.c:347:	filemap_invalidate_lock_shared(mapping);
mm/readahead.c-348-	page_cache_ra_unbounded(ractl, nr_to_read, lookahead_size);
--
mm/readahead.c=481=void page_cache_ra_order(struct readahead_control *ractl,
--
mm/readahead.c-516-	nofs = memalloc_nofs_save();
mm/readahead.c:517:	filemap_invalidate_lock_shared(mapping);
mm/readahead.c-518-	/*
--
mm/secretmem.c=110=static vm_fault_t secretmem_fault(struct vm_fault *vmf)
--
mm/secretmem.c-124-
mm/secretmem.c:125:	filemap_invalidate_lock_shared(mapping);
mm/secretmem.c-126-
--
mm/secretmem.c=241=static int secretmem_setattr(struct mnt_idmap *idmap,
--
mm/secretmem.c-248-
mm/secretmem.c:249:	filemap_invalidate_lock(mapping);
mm/secretmem.c-250-
]

121/4 2026/09/17 10:54 tool grepper
0m Args:
map[Expression:filemap_invalidate_lock PathPrefix:fs/]

Results:
map[Output:fs/btrfs/volumes.c=1335=struct btrfs_super_block *btrfs_read_disk_super(struct block_device *bdev,
--
fs/btrfs/volumes.c-1366-
fs/btrfs/volumes.c:1367:	filemap_invalidate_lock_shared(mapping);
fs/btrfs/volumes.c-1368-	page = read_cache_page_gfp(mapping, bytenr >> PAGE_SHIFT, GFP_NOFS);
--
fs/btrfs/zoned.c=88=static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones,
--
fs/btrfs/zoned.c-133-
fs/btrfs/zoned.c:134:			filemap_invalidate_lock_shared(mapping);
fs/btrfs/zoned.c-135-			page[i] = read_cache_page_gfp(mapping,
--
fs/ceph/addr.c=1990=static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
--
fs/ceph/addr.c-2045-
fs/ceph/addr.c:2046:		filemap_invalidate_lock_shared(mapping);
fs/ceph/addr.c-2047-		page = find_or_create_page(mapping, 0,
--
fs/ceph/file.c=2784=static long ceph_fallocate(struct file *file, int mode,
--
fs/ceph/file.c-2841-
fs/ceph/file.c:2842:	filemap_invalidate_lock(inode->i_mapping);
fs/ceph/file.c-2843-	ceph_fscache_invalidate(inode, false);
--
fs/exfat/file.c=754=static int exfat_extend_valid_size(struct inode *inode, loff_t new_valid_size)
--
fs/exfat/file.c-779-		 */
fs/exfat/file.c:780:		filemap_invalidate_lock(inode->i_mapping);
fs/exfat/file.c-781-		if (gap_start < new_valid_size)
--
fs/exfat/file.c=943=static vm_fault_t exfat_page_mkwrite(struct vm_fault *vmf)
--
fs/exfat/file.c-987-
fs/exfat/file.c:988:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/exfat/file.c-989-	ret = iomap_page_mkwrite(vmf, &exfat_iomap_ops, NULL);
--
fs/ext2/inode.c=1224=static void ext2_truncate_blocks(struct inode *inode, loff_t offset)
--
fs/ext2/inode.c-1231-
fs/ext2/inode.c:1232:	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c-1233-	__ext2_truncate_blocks(inode, offset);
--
fs/ext2/inode.c=1237=static int ext2_setsize(struct inode *inode, loff_t newsize)
--
fs/ext2/inode.c-1254-
fs/ext2/inode.c:1255:	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c-1256-	truncate_setsize(inode, newsize);
--
fs/ext4/extents.c=4949=long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
--
fs/ext4/extents.c-4999-	 */
fs/ext4/extents.c:5000:	filemap_invalidate_lock(mapping);
fs/ext4/extents.c-5001-
--
fs/ext4/file.c=800=static vm_fault_t ext4_dax_huge_fault(struct vm_fault *vmf, unsigned int order)
--
fs/ext4/file.c-827-		file_update_time(vmf->vma->vm_file);
fs/ext4/file.c:828:		filemap_invalidate_lock_shared(mapping);
fs/ext4/file.c-829-retry:
--
fs/ext4/file.c-837-	} else {
fs/ext4/file.c:838:		filemap_invalidate_lock_shared(mapping);
fs/ext4/file.c-839-	}
--
fs/ext4/inode.c=4432=static void ext4_wait_dax_page(struct inode *inode)
--
fs/ext4/inode.c-4435-	schedule();
fs/ext4/inode.c:4436:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-4437-}
--
fs/ext4/inode.c=6009=int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ext4/inode.c-6125-
fs/ext4/inode.c:6126:		filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-6127-
--
fs/ext4/inode.c=6740=int ext4_change_inode_journal_flag(struct inode *inode, int val)
--
fs/ext4/inode.c-6773-	 */
fs/ext4/inode.c:6774:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-6775-	err = filemap_write_and_wait(inode->i_mapping);
--
fs/ext4/inode.c=6884=vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf)
--
fs/ext4/inode.c-6903-
fs/ext4/inode.c:6904:	filemap_invalidate_lock_shared(mapping);
fs/ext4/inode.c-6905-
--
fs/ext4/ioctl.c=375=static long swap_inode_boot_loader(struct super_block *sb,
--
fs/ext4/ioctl.c-411-
fs/ext4/ioctl.c:412:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/ioctl.c-413-	err = filemap_write_and_wait(inode->i_mapping);
--
fs/ext4/truncate.h=12=static inline void ext4_truncate_failed_write(struct inode *inode)
--
fs/ext4/truncate.h-19-	 */
fs/ext4/truncate.h:20:	filemap_invalidate_lock(mapping);
fs/ext4/truncate.h-21-	truncate_inode_pages(mapping, inode->i_size);
--
fs/f2fs/data.c=3646=void f2fs_write_failed(struct inode *inode, loff_t to)
--
fs/f2fs/data.c-3655-		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/data.c:3656:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/data.c-3657-
--
fs/f2fs/data.c=4187=static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk,
--
fs/f2fs/data.c-4202-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/data.c:4203:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/data.c-4204-
--
fs/f2fs/file.c=73=static int f2fs_zero_post_eof_page(struct inode *inode,
--
fs/f2fs/file.c-86-	if (lock)
fs/f2fs/file.c:87:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-88-	/* zero or drop pages only in range of [old_size, new_size] */
--
fs/f2fs/file.c=120=static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
--
fs/f2fs/file.c-186-	file_update_time(vmf->vma->vm_file);
fs/f2fs/file.c:187:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/f2fs/file.c-188-
--
fs/f2fs/file.c=637=static int finish_preallocate_blocks(struct inode *inode)
--
fs/f2fs/file.c-655-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:656:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-657-
--
fs/f2fs/file.c=1124=int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/f2fs/file.c-1227-		f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1228:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1229-
--
fs/f2fs/file.c=1346=static int f2fs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1394-			f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1395:			filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1396-
--
fs/f2fs/file.c=1630=static int f2fs_do_collapse(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1642-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1643:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1644-
--
fs/f2fs/file.c=1661=static int f2fs_collapse_range(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1686-	/* write out all moved pages, if possible */
fs/f2fs/file.c:1687:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1688-	ret = filemap_write_and_wait_range(inode->i_mapping, offset, LLONG_MAX);
--
fs/f2fs/file.c=1755=static int f2fs_zero_range(struct inode *inode, loff_t offset, loff_t len,
--
fs/f2fs/file.c-1811-			f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1812:			filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1813-
--
fs/f2fs/file.c=1868=static int f2fs_insert_range(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1893-
fs/f2fs/file.c:1894:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1895-	ret = f2fs_truncate_blocks(inode, i_size_read(inode), true);
--
fs/f2fs/file.c-1911-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1912:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1913-
--
fs/f2fs/file.c-1940-	/* write out all moved pages, if possible */
fs/f2fs/file.c:1941:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1942-	ret = filemap_write_and_wait_range(mapping, offset, LLONG_MAX);
--
fs/f2fs/file.c=3879=static int f2fs_ioc_release_dev_alias(struct file *filp)
--
fs/f2fs/file.c-3928-
fs/f2fs/file.c:3929:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-3930-	truncate_setsize(inode, 0);
--
fs/f2fs/file.c=4206=static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4257-	f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4258:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-4259-
--
fs/f2fs/file.c=4403=static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4435-	f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4436:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-4437-
--
fs/f2fs/file.c=4535=static int f2fs_sec_trim_file(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4600-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4601:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-4602-
--
fs/f2fs/file.c=4794=static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)
--
fs/f2fs/file.c-4801-
fs/f2fs/file.c:4802:	filemap_invalidate_lock_shared(mapping);
fs/f2fs/file.c-4803-	page_cache_ra_unbounded(&ractl, len, 0);
--
fs/f2fs/file.c=5631=static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/f2fs/file.c-5703-		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:5704:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-5705-		if (!f2fs_truncate(inode))
--
fs/fuse/dax.c=663=static void fuse_wait_dax_page(struct inode *inode)
--
fs/fuse/dax.c-666-	schedule();
fs/fuse/dax.c:667:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-668-}
--
fs/fuse/dax.c=755=static vm_fault_t __fuse_dax_fault(struct vm_fault *vmf, unsigned int order,
--
fs/fuse/dax.c-778-	 */
fs/fuse/dax.c:779:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/fuse/dax.c-780-	ret = dax_iomap_fault(vmf, order, &pfn, &error, &fuse_iomap_ops);
--
fs/fuse/dax.c=914=inode_inline_reclaim_one_dmap(struct fuse_conn_dax *fcd, struct inode *inode,
--
fs/fuse/dax.c-923-
fs/fuse/dax.c:924:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-925-
--
fs/fuse/dax.c=1076=static int lookup_and_reclaim_dmap(struct fuse_conn_dax *fcd,
--
fs/fuse/dax.c-1085-
fs/fuse/dax.c:1086:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-1087-	ret = fuse_dax_break_layouts(inode, dmap_start, dmap_end);
--
fs/fuse/dir.c=2145=int fuse_do_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/fuse/dir.c-2177-	if (FUSE_IS_DAX(inode) && is_truncate) {
fs/fuse/dir.c:2178:		filemap_invalidate_lock(mapping);
fs/fuse/dir.c-2179-		fault_blocked = true;
--
fs/fuse/file.c=250=static int fuse_open(struct inode *inode, struct file *file)
--
fs/fuse/file.c-271-	if (dax_truncate) {
fs/fuse/file.c:272:		filemap_invalidate_lock(inode->i_mapping);
fs/fuse/file.c-273-		err = fuse_dax_break_layouts(inode, 0, -1);
--
fs/fuse/file.c=2832=static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
--
fs/fuse/file.c-2859-	if (block_faults) {
fs/fuse/file.c:2860:		filemap_invalidate_lock(inode->i_mapping);
fs/fuse/file.c-2861-		err = fuse_dax_break_layouts(inode, 0, -1);
--
fs/ntfs/file.c=254=static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
--
fs/ntfs/file.c-278-	 */
fs/ntfs/file.c:279:	filemap_invalidate_lock(vi->i_mapping);
fs/ntfs/file.c-280-	if (attr->ia_size > old_size) {
--
fs/ntfs/file.c=676=static vm_fault_t ntfs_filemap_page_mkwrite(struct vm_fault *vmf)
--
fs/ntfs/file.c-691-	 */
fs/ntfs/file.c:692:	filemap_invalidate_lock_shared(mapping);
fs/ntfs/file.c-693-	ret = iomap_page_mkwrite(vmf, &ntfs_page_mkwrite_iomap_ops, NULL);
--
fs/ntfs/file.c=1127=static long ntfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
--
fs/ntfs/file.c-1170-	/* Take invalidate_lock for all fallocate operations to prevent races */
fs/ntfs/file.c:1171:	filemap_invalidate_lock(vi->i_mapping);
fs/ntfs/file.c-1172-
--
fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-519-		inode_dio_wait(inode);
fs/ntfs3/file.c:520:		filemap_invalidate_lock(mapping);
fs/ntfs3/file.c-521-		map_locked = true;
--
fs/smb/client/file.c=993=static int cifs_do_truncate(const unsigned int xid, struct dentry *dentry)
--
fs/smb/client/file.c-1005-
fs/smb/client/file.c:1006:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/file.c-1007-
--
fs/smb/client/smb2ops.c=3508=static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3531-
fs/smb/client/smb2ops.c:3532:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-3533-
--
fs/smb/client/smb2ops.c=3592=static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3610-
fs/smb/client/smb2ops.c:3611:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-3612-	/*
--
fs/smb/client/smb2ops.c=4014=static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4032-
fs/smb/client/smb2ops.c:4033:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-4034-	rc = filemap_write_and_wait_range(inode->i_mapping,
--
fs/smb/client/smb2ops.c=4078=static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4108-
fs/smb/client/smb2ops.c:4109:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-4110-	rc = filemap_write_and_wait_range(inode->i_mapping,
--
fs/udf/file.c=38=static vm_fault_t udf_page_mkwrite(struct vm_fault *vmf)
--
fs/udf/file.c-50-	file_update_time(vma->vm_file);
fs/udf/file.c:51:	filemap_invalidate_lock_shared(mapping);
fs/udf/file.c-52-	folio_lock(folio);
--
fs/udf/file.c=89=static ssize_t udf_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/udf/file.c-104-				 iocb->ki_pos + iov_iter_count(from))) {
fs/udf/file.c:105:		filemap_invalidate_lock(inode->i_mapping);
fs/udf/file.c-106-		retval = udf_expand_file_adinicb(inode);
--
fs/udf/file.c=215=static int udf_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/udf/file.c-236-	    attr->ia_size != i_size_read(inode)) {
fs/udf/file.c:237:		filemap_invalidate_lock(inode->i_mapping);
fs/udf/file.c-238-		error = udf_setsize(inode, attr->ia_size);
--
fs/verity/read_metadata.c=16=static int fsverity_read_merkle_tree(struct inode *inode,
--
fs/verity/read_metadata.c-38-	if (inode->i_sb->s_vop->readahead_merkle_tree) {
fs/verity/read_metadata.c:39:		filemap_invalidate_lock_shared(inode->i_mapping);
fs/verity/read_metadata.c-40-		inode->i_sb->s_vop->readahead_merkle_tree(
--
fs/xfs/xfs_bmap_util.c=1537=xfs_swap_extents(
--
fs/xfs/xfs_bmap_util.c-1558-	lock_two_nondirectories(VFS_I(ip), VFS_I(tip));
fs/xfs/xfs_bmap_util.c:1559:	filemap_invalidate_lock_two(VFS_I(ip)->i_mapping,
fs/xfs/xfs_bmap_util.c-1560-				    VFS_I(tip)->i_mapping);
--
fs/xfs/xfs_inode.c=2792=xfs_ilock2_io_mmap(
--
fs/xfs/xfs_inode.c-2810-	} else
fs/xfs/xfs_inode.c:2811:		filemap_invalidate_lock_two(VFS_I(ip1)->i_mapping,
fs/xfs/xfs_inode.c-2812-					    VFS_I(ip2)->i_mapping);
--
fs/xfs/xfs_iomap.c=2134=xfs_buffered_write_iomap_end(
--
fs/xfs/xfs_iomap.c-2167-	} else {
fs/xfs/xfs_iomap.c:2168:		filemap_invalidate_lock(inode->i_mapping);
fs/xfs/xfs_iomap.c-2169-		iomap_write_delalloc_release(inode, start_byte, end_byte, flags,
--
fs/zonefs/file.c=203=int zonefs_file_truncate(struct inode *inode, loff_t isize)
--
fs/zonefs/file.c-228-	/* Serialize against page faults */
fs/zonefs/file.c:229:	filemap_invalidate_lock(inode->i_mapping);
fs/zonefs/file.c-230-
--
fs/zonefs/file.c=297=static vm_fault_t zonefs_filemap_page_mkwrite(struct vm_fault *vmf)
--
fs/zonefs/file.c-315-	/* Serialize against truncates */
fs/zonefs/file.c:316:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/zonefs/file.c-317-	ret = iomap_page_mkwrite(vmf, &zonefs_write_iomap_ops, NULL);
]

122/4 2026/09/17 10:54 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 29291
							output: 37
							thoughts: 45
						

Thoughts:
Here's my take on those instructions, as if I'm the one thinking them:

**Diving into NTFS3 File Allocation**

Okay, time to get my hands dirty with this `ntfs3` code. Let's see... I need to refresh my memory on the file allocation implementation. Right, let's start by zeroing in on `fs/ntfs3/file.c`. Specifically, I want to jump over to line 520. That should give me a good jumping-off point to understand the core structures being used.

Then, I need to understand the details of `ntfs_fallocate` in `fs/ntfs3/file.c`. This is where the real work of file pre-allocation and sparse file management happens. I want to trace the code path and see how it interacts with the underlying disk structures and metadata. Knowing this function is crucial to understanding the details of how `ntfs3` handles space on the volume! Let's get to it!



123/4 2026/09/17 10:54 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:515 LineCount:50]

Results:
map[Contents: 515:		}
 516:	
 517:		if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
 518:			    FALLOC_FL_INSERT_RANGE)) {
 519:			inode_dio_wait(inode);
 520:			filemap_invalidate_lock(mapping);
 521:			map_locked = true;
 522:		}
 523:	
 524:		if (mode & FALLOC_FL_PUNCH_HOLE) {
 525:			u32 frame_size;
 526:			loff_t mask, vbo_a, end_a, tmp, from;
 527:	
 528:			err = filemap_write_and_wait_range(mapping, vbo_down,
 529:							   LLONG_MAX);
 530:			if (err)
 531:				goto out;
 532:	
 533:			truncate_pagecache(inode, vbo_down);
 534:	
 535:			ni_lock(ni);
 536:			err = attr_punch_hole(ni, vbo, len, &frame_size);
 537:			ni_unlock(ni);
 538:			if (!err)
 539:				goto ok;
 540:	
 541:			if (err != E_NTFS_NOTALIGNED)
 542:				goto out;
 543:	
 544:			/* Process not aligned punch. */
 545:			err = 0;
 546:			if (end > i_size)
 547:				end = i_size;
 548:			mask = frame_size - 1;
 549:			vbo_a = (vbo + mask) & ~mask;
 550:			end_a = end & ~mask;
 551:	
 552:			tmp = min(vbo_a, end);
 553:			from = min_t(loff_t, ni->i_valid, vbo);
 554:			/* Zero head of punch. */
 555:			if (tmp > from) {
 556:				err = iomap_zero_range(inode, from, tmp - from, NULL,
 557:						       &ntfs_iomap_ops,
 558:						       &ntfs_iomap_folio_ops, NULL);
 559:				if (err)
 560:					goto out;
 561:			}
 562:	
 563:			/* Aligned punch_hole. Deallocate clusters. */
 564:			if (end_a > vbo_a) {
]

124/4 2026/09/17 10:54 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 30335
							output: 36
							thoughts: 80
						

Thoughts:
Here's my take on the thought process, as requested:

**Diving into `ntfs_setattr_size`**

Okay, so I need to understand how file size attributes are handled within the NTFS filesystem, specifically in the legacy implementation, or whatever they're calling it these days. The goal is to see exactly what `fs/ntfs/file.c` does in relation to the function `ntfs_setattr_size`. I know that function is the key to managing file size updates, and I'm itching to dig into the guts of how it works at line 254. Let's see how that handles the `iattr` struct and modifies the inode.



125/4 2026/09/17 10:55 tool read-file
0m Args:
map[File:fs/ntfs/file.c FirstLine:254 LineCount:50]

Results:
map[Contents: 254:	static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
 255:	{
 256:		struct ntfs_inode *ni = NTFS_I(vi);
 257:		int err;
 258:		loff_t old_size = vi->i_size;
 259:	
 260:		if (NInoCompressed(ni) || NInoEncrypted(ni) || NInoWofCompressed(ni)) {
 261:			ntfs_warning(
 262:				vi->i_sb,
 263:				"Changes in inode size are not supported yet for %s files.",
 264:				NInoEncrypted(ni) ? "encrypted" : "compressed");
 265:			return -EOPNOTSUPP;
 266:		}
 267:	
 268:		err = inode_newsize_ok(vi, attr->ia_size);
 269:		if (err)
 270:			return err;
 271:	
 272:		inode_dio_wait(vi);
 273:	
 274:		/*
 275:		 * Serialize with page faults and pagecache instantiation so that
 276:		 * readers cannot observe the size change until the attribute
 277:		 * updates below have completed.
 278:		 */
 279:		filemap_invalidate_lock(vi->i_mapping);
 280:		if (attr->ia_size > old_size) {
 281:			truncate_pagecache(vi, old_size);
 282:			i_size_write(vi, attr->ia_size);
 283:			pagecache_isize_extended(vi, old_size, attr->ia_size);
 284:		} else {
 285:			truncate_setsize(vi, attr->ia_size);
 286:		}
 287:	
 288:		err = ntfs_truncate_vfs(vi, attr->ia_size, old_size);
 289:		if (err)
 290:			i_size_write(vi, old_size);
 291:		filemap_invalidate_unlock(vi->i_mapping);
 292:	
 293:		return err;
 294:	}
 295:	
 296:	/*
 297:	 * ntfs_setattr
 298:	 *
 299:	 * Called from notify_change() when an attribute is being changed.
 300:	 *
 301:	 * NOTE: Changes in inode size are not supported yet for compressed or
 302:	 * encrypted files.
 303:	 */
]

126/4 2026/09/17 10:55 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 31339
							output: 36
							thoughts: 68
						

Thoughts:
**Investigating a Recent NTFS File System Behavior**

Okay, so I'm diving into this `fs/ntfs/file.c` file again, specifically lines 274 to 291. Something there is catching my eye – maybe a performance anomaly, or potentially a subtle bug I need to understand better. But hold on, I need some context. When was this particular section of code introduced? What commit touched these lines?

Time to use the tools. I'll reach for `git blame` or `git log` and pinpoint the exact commit that brought that code into `fs/ntfs/file.c` at line 274. That'll provide the crucial history and hopefully the rationale behind the change. Understanding the "why" will allow me to assess the "what" with much more accuracy.



127/4 2026/09/17 10:55 tool git-blame
0m Args:
map[End:292 File:fs/ntfs/file.c Start:274]

Results:
map[Output:^fd73f4a66598 274) 	/*
^fd73f4a66598 275) 	 * Serialize with page faults and pagecache instantiation so that
^fd73f4a66598 276) 	 * readers cannot observe the size change until the attribute
^fd73f4a66598 277) 	 * updates below have completed.
^fd73f4a66598 278) 	 */
^fd73f4a66598 279) 	filemap_invalidate_lock(vi->i_mapping);
^fd73f4a66598 280) 	if (attr->ia_size > old_size) {
^fd73f4a66598 281) 		truncate_pagecache(vi, old_size);
^fd73f4a66598 282) 		i_size_write(vi, attr->ia_size);
^fd73f4a66598 283) 		pagecache_isize_extended(vi, old_size, attr->ia_size);
^fd73f4a66598 284) 	} else {
^fd73f4a66598 285) 		truncate_setsize(vi, attr->ia_size);
^fd73f4a66598 286) 	}
^fd73f4a66598 287) 
^fd73f4a66598 288) 	err = ntfs_truncate_vfs(vi, attr->ia_size, old_size);
^fd73f4a66598 289) 	if (err)
^fd73f4a66598 290) 		i_size_write(vi, old_size);
^fd73f4a66598 291) 	filemap_invalidate_unlock(vi->i_mapping);
^fd73f4a66598 292) 
]

128/4 2026/09/17 10:55 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 32178
							output: 30
							thoughts: 50
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm deep in the weeds of kernel development:

**Initial Confusion and Investigation**

Wait a minute, `fs/ntfs/file.c`? That's... unexpected. I could have sworn we were on `ntfs3` and I haven't heard about another NTFS implementation. Is this a completely new driver? Or is this a subtle refactor, perhaps a backport, or maybe even a rename in a different branch? Time to dig deeper. I need context. Let's see what's changed around that file with that commit ID: `fd73f4a66598`. That should give me the crucial details.



129/4 2026/09/17 10:55 tool git-show
0m Args:
map[Commit:fd73f4a66598 Stat:true]

Results:
map[Output:commit fd73f4a6659897191fa0d40695fe370925dd3780
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Sep 13 14:38:02 2026 -0700

    Linux 7.3-rc3

 .clang-format                                      |    808 +
 .clippy.toml                                       |     21 +
 .cocciconfig                                       |      3 +
 .editorconfig                                      |     27 +
 .get_maintainer.ignore                             |      9 +
 .gitattributes                                     |      5 +
 .gitignore                                         |    196 +
 .mailmap                                           |    996 +
 .pylintrc                                          |      2 +
 .rustfmt.toml                                      |     12 +
 COPYING                                            |     20 +
 CREDITS                                            |   4651 +
 Documentation/.gitignore                           |      3 +
 Documentation/.renames.txt                         |   1185 +
 Documentation/ABI/README                           |     98 +
 .../ABI/obsolete/automount-tracefs-debugfs         |     20 +
 Documentation/ABI/obsolete/o2cb                    |     11 +
 Documentation/ABI/obsolete/procfs-i8k              |     10 +
 Documentation/ABI/obsolete/sysfs-bus-iio           |    174 +
 Documentation/ABI/obsolete/sysfs-bus-usb           |     31 +
 Documentation/ABI/obsolete/sysfs-class-typec       |     48 +
 Documentation/ABI/obsolete/sysfs-cpuidle           |      9 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-arvo      |     53 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-isku      |    153 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-koneplus  |    145 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-konepure  |    105 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-kovaplus  |    116 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-lua       |      7 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-pyra      |    126 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-ryos      |    178 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-savu      |     77 +
 .../ABI/obsolete/sysfs-driver-intel_pmc_bxt        |     22 +
 Documentation/ABI/obsolete/sysfs-driver-ivpu       |     30 +
 .../ABI/obsolete/sysfs-driver-samsung-laptop       |     10 +
 Documentation/ABI/obsolete/sysfs-firmware-acpi     |      8 +
 Documentation/ABI/obsolete/sysfs-gpio              |     40 +
 .../ABI/obsolete/sysfs-kernel-fadump_enabled       |      9 +
 .../ABI/obsolete/sysfs-kernel-fadump_registered    |     10 +
 .../ABI/obsolete/sysfs-kernel-fadump_release_mem   |     10 +
 .../ABI/obsolete/sysfs-kernel-kexec-kdump          |     71 +
 .../ABI/obsolete/sysfs-platform-ideapad-laptop     |      8 +
 Documentation/ABI/removed/devfs                    |     13 +
 Documentation/ABI/removed/dv1394                   |     14 +
 Documentation/ABI/removed/ip_queue                 |      9 +
 Documentation/ABI/removed/net_dma                  |      8 +
 Documentation/ABI/removed/o2cb                     |     10 +
 Documentation/ABI/removed/raw1394                  |     16 +
 Documentation/ABI/removed/sysfs-bus-nfit           |     17 +
 Documentation/ABI/removed/sysfs-class-cxl          |    272 +
 Documentation/ABI/removed/sysfs-class-rfkill       |     13 +
 Documentation/ABI/removed/sysfs-firmware-efi-vars  |     12 +
 .../removed/sysfs-kernel-fadump_release_opalcore   |      9 +
 Documentation/ABI/removed/sysfs-kernel-uids        |     14 +
 Documentation/ABI/removed/sysfs-mce                |     37 +
 .../ABI/removed/sysfs-selinux-checkreqprot         |     26 +
 Documentation/ABI/removed/sysfs-selinux-disable    |     29 +
 Documentation/ABI/removed/sysfs-selinux-user       |     12 +
 Documentation/ABI/removed/video1394                |     17 +
 Documentation/ABI/stable/configfs-nvmet            |    352 +
 Documentation/ABI/stable/firewire-cdev             |    111 +
 Documentation/ABI/stable/o2cb                      |     10 +
 Documentation/ABI/stable/procfs-audit_loginuid     |     27 +
 Documentation/ABI/stable/syscalls                  |     10 +
 Documentation/ABI/stable/sysfs-acpi-pmprofile      |     28 +
 Documentation/ABI/stable/sysfs-block               |    941 +
 Documentation/ABI/stable/sysfs-bus-firewire        |    136 +
 Documentation/ABI/stable/sysfs-bus-fsl-mc          |     19 +
 Documentation/ABI/stable/sysfs-bus-mhi             |     44 +
 Documentation/ABI/stable/sysfs-bus-nvmem           |     50 +
 Documentation/ABI/stable/sysfs-bus-usb             |    142 +
 Documentation/ABI/stable/sysfs-bus-vmbus           |    187 +
 Documentation/ABI/stable/sysfs-bus-w1              |     12 +
 Documentation/ABI/stable/sysfs-bus-xen-backend     |     84 +
 Documentation/ABI/stable/sysfs-class-backlight     |     63 +
 Documentation/ABI/stable/sysfs-class-bluetooth     |      9 +
 Documentation/ABI/stable/sysfs-class-infiniband    |    784 +
 Documentation/ABI/stable/sysfs-class-rfkill        |     93 +
 Documentation/ABI/stable/sysfs-class-tpm           |    210 +
 Documentation/ABI/stable/sysfs-class-ubi           |    221 +
 Documentation/ABI/stable/sysfs-class-udc           |     93 +
 Documentation/ABI/stable/sysfs-devices             |     32 +
 Documentation/ABI/stable/sysfs-devices-node        |    238 +
 Documentation/ABI/stable/sysfs-devices-system-cpu  |    117 +
 .../ABI/stable/sysfs-devices-system-xen_memory     |     86 +
 Documentation/ABI/stable/sysfs-driver-aspeed-vuart |     24 +
 Documentation/ABI/stable/sysfs-driver-dma-idxd     |    376 +
 Documentation/ABI/stable/sysfs-driver-dma-ioatdma  |     30 +
 .../ABI/stable/sysfs-driver-firmware-zynqmp        |    256 +
 Documentation/ABI/stable/sysfs-driver-ib_srp       |    192 +
 Documentation/ABI/stable/sysfs-driver-misc-cp500   |     25 +
 Documentation/ABI/stable/sysfs-driver-mlxreg-io    |    815 +
 Documentation/ABI/stable/sysfs-driver-qaic         |     19 +
 Documentation/ABI/stable/sysfs-driver-qla2xxx      |      8 +
 Documentation/ABI/stable/sysfs-driver-speakup      |    394 +
 Documentation/ABI/stable/sysfs-driver-usb-usbtmc   |     27 +
 Documentation/ABI/stable/sysfs-driver-w1_ds2438    |     13 +
 Documentation/ABI/stable/sysfs-driver-w1_ds28e04   |     15 +
 Documentation/ABI/stable/sysfs-driver-w1_ds28ea00  |      6 +
 Documentation/ABI/stable/sysfs-firmware-opal-dump  |     46 +
 Documentation/ABI/stable/sysfs-firmware-opal-elog  |     62 +
 Documentation/ABI/stable/sysfs-fs-orangefs         |     87 +
 Documentation/ABI/stable/sysfs-hypervisor-xen      |    135 +
 Documentation/ABI/stable/sysfs-kernel-notes        |      5 +
 .../ABI/stable/sysfs-kernel-time-aux-clocks        |      5 +
 Documentation/ABI/stable/sysfs-module              |     47 +
 Documentation/ABI/stable/sysfs-nvme                |    453 +
 Documentation/ABI/stable/sysfs-platform-wmi-bmof   |      7 +
 Documentation/ABI/stable/sysfs-transport-srp       |     58 +
 Documentation/ABI/stable/thermal-notification      |      4 +
 Documentation/ABI/stable/vdso                      |     37 +
 Documentation/ABI/testing/amdpmf-interface         |     73 +
 Documentation/ABI/testing/configfs-acpi            |     52 +
 Documentation/ABI/testing/configfs-iio             |     34 +
 Documentation/ABI/testing/configfs-most            |    241 +
 Documentation/ABI/testing/configfs-rdma_cm         |     34 +
 .../ABI/testing/configfs-spear-pcie-gadget         |     33 +
 Documentation/ABI/testing/configfs-stp-policy      |     48 +
 .../ABI/testing/configfs-stp-policy-p_sys-t        |     41 +
 .../ABI/testing/configfs-thunderbolt_stream        |     98 +
 Documentation/ABI/testing/configfs-tsm-report      |    161 +
 Documentation/ABI/testing/configfs-usb-gadget      |    158 +
 Documentation/ABI/testing/configfs-usb-gadget-acm  |     15 +
 Documentation/ABI/testing/configfs-usb-gadget-ecm  |     20 +
 Documentation/ABI/testing/configfs-usb-gadget-eem  |     16 +
 Documentation/ABI/testing/configfs-usb-gadget-ffs  |     17 +
 Documentation/ABI/testing/configfs-usb-gadget-hid  |     13 +
 .../ABI/testing/configfs-usb-gadget-loopback       |     10 +
 .../ABI/testing/configfs-usb-gadget-mass-storage   |     41 +
 Documentation/ABI/testing/configfs-usb-gadget-midi |     15 +
 .../ABI/testing/configfs-usb-gadget-midi2          |     54 +
 Documentation/ABI/testing/configfs-usb-gadget-ncm  |     15 +
 Documentation/ABI/testing/configfs-usb-gadget-obex |      9 +
 .../ABI/testing/configfs-usb-gadget-phonet         |      8 +
 .../ABI/testing/configfs-usb-gadget-printer        |     11 +
 .../ABI/testing/configfs-usb-gadget-rndis          |     19 +
 .../ABI/testing/configfs-usb-gadget-serial         |      9 +
 .../ABI/testing/configfs-usb-gadget-sourcesink     |     16 +
 .../ABI/testing/configfs-usb-gadget-subset         |     16 +
 Documentation/ABI/testing/configfs-usb-gadget-tcm  |      6 +
 Documentation/ABI/testing/configfs-usb-gadget-uac1 |     41 +
 .../ABI/testing/configfs-usb-gadget-uac1_legacy    |      9 +
 Documentation/ABI/testing/configfs-usb-gadget-uac2 |     51 +
 Documentation/ABI/testing/configfs-usb-gadget-uvc  |    438 +
 Documentation/ABI/testing/debugfs-alienware-wmi    |     64 +
 Documentation/ABI/testing/debugfs-amd-iommu        |    131 +
 Documentation/ABI/testing/debugfs-cdns-pcie        |      5 +
 Documentation/ABI/testing/debugfs-cec-error-inj    |     40 +
 Documentation/ABI/testing/debugfs-cros-ec          |     78 +
 Documentation/ABI/testing/debugfs-cxl              |    157 +
 Documentation/ABI/testing/debugfs-dell-wmi-ddv     |     34 +
 Documentation/ABI/testing/debugfs-driver-dcc       |    127 +
 Documentation/ABI/testing/debugfs-driver-genwqe    |     91 +
 .../ABI/testing/debugfs-driver-habanalabs          |    323 +
 Documentation/ABI/testing/debugfs-driver-qat       |    109 +
 .../ABI/testing/debugfs-driver-qat_telemetry       |    259 +
 Documentation/ABI/testing/debugfs-dwc-pcie         |    157 +
 Documentation/ABI/testing/debugfs-ec               |     21 +
 Documentation/ABI/testing/debugfs-hisi-hpre        |    200 +
 Documentation/ABI/testing/debugfs-hisi-migration   |     25 +
 Documentation/ABI/testing/debugfs-hisi-sec         |    173 +
 Documentation/ABI/testing/debugfs-hisi-zip         |    174 +
 Documentation/ABI/testing/debugfs-hyperv           |     23 +
 Documentation/ABI/testing/debugfs-ideapad          |     19 +
 Documentation/ABI/testing/debugfs-iio-ad9467       |     39 +
 Documentation/ABI/testing/debugfs-iio-backend      |     20 +
 Documentation/ABI/testing/debugfs-intel-iommu      |    276 +
 Documentation/ABI/testing/debugfs-moxtet           |     35 +
 Documentation/ABI/testing/debugfs-msi-wmi-platform |     14 +
 Documentation/ABI/testing/debugfs-olpc             |     16 +
 Documentation/ABI/testing/debugfs-pcie-ptm         |     70 +
 Documentation/ABI/testing/debugfs-pfo-nx-crypto    |     45 +
 Documentation/ABI/testing/debugfs-scmi             |     70 +
 Documentation/ABI/testing/debugfs-scmi-raw         |    208 +
 Documentation/ABI/testing/debugfs-tpmi             |     40 +
 Documentation/ABI/testing/debugfs-vfio             |     57 +
 Documentation/ABI/testing/debugfs-wilco-ec         |     45 +
 Documentation/ABI/testing/dell-smbios-wmi          |     41 +
 Documentation/ABI/testing/dev-kmsg                 |    127 +
 Documentation/ABI/testing/devlink-resource-mlxsw   |     33 +
 Documentation/ABI/testing/evm                      |    109 +
 Documentation/ABI/testing/gpio-cdev                |     28 +
 Documentation/ABI/testing/ima_policy               |    196 +
 Documentation/ABI/testing/ppc-memtrace             |     46 +
 Documentation/ABI/testing/procfs-attr-current      |     20 +
 Documentation/ABI/testing/procfs-attr-exec         |     20 +
 Documentation/ABI/testing/procfs-attr-prev         |     19 +
 Documentation/ABI/testing/procfs-diskstats         |     43 +
 .../ABI/testing/procfs-nfsd-reply_cache_stats      |     38 +
 Documentation/ABI/testing/procfs-smaps_rollup      |     42 +
 Documentation/ABI/testing/pstore                   |     47 +
 Documentation/ABI/testing/rtc-cdev                 |     50 +
 Documentation/ABI/testing/securityfs-secrets-coco  |     51 +
 Documentation/ABI/testing/sysfs-amd-pmc            |     13 +
 Documentation/ABI/testing/sysfs-amd-pmf            |     13 +
 Documentation/ABI/testing/sysfs-ata                |    140 +
 .../ABI/testing/sysfs-auxdisplay-linedisp          |     90 +
 Documentation/ABI/testing/sysfs-block-aoe          |     45 +
 Documentation/ABI/testing/sysfs-block-bcache       |    149 +
 Documentation/ABI/testing/sysfs-block-device       |    119 +
 Documentation/ABI/testing/sysfs-block-dm           |     47 +
 Documentation/ABI/testing/sysfs-block-loop         |     50 +
 Documentation/ABI/testing/sysfs-block-rnbd         |     64 +
 Documentation/ABI/testing/sysfs-block-rssd         |      5 +
 Documentation/ABI/testing/sysfs-block-zram         |    166 +
 Documentation/ABI/testing/sysfs-bus-acpi           |     98 +
 Documentation/ABI/testing/sysfs-bus-amba           |     20 +
 Documentation/ABI/testing/sysfs-bus-auxiliary      |      9 +
 Documentation/ABI/testing/sysfs-bus-bcma           |     31 +
 Documentation/ABI/testing/sysfs-bus-cdx            |    121 +
 Documentation/ABI/testing/sysfs-bus-coreboot       |     45 +
 .../ABI/testing/sysfs-bus-coresight-devices-cti    |    247 +
 .../sysfs-bus-coresight-devices-dummy-source       |     21 +
 .../ABI/testing/sysfs-bus-coresight-devices-etb10  |     88 +
 .../ABI/testing/sysfs-bus-coresight-devices-etm3x  |    328 +
 .../ABI/testing/sysfs-bus-coresight-devices-etm4x  |    532 +
 .../ABI/testing/sysfs-bus-coresight-devices-funnel |     18 +
 .../ABI/testing/sysfs-bus-coresight-devices-stm    |     59 +
 .../ABI/testing/sysfs-bus-coresight-devices-tmc    |    115 +
 .../ABI/testing/sysfs-bus-coresight-devices-tpda   |     69 +
 .../ABI/testing/sysfs-bus-coresight-devices-tpdm   |    290 +
 .../ABI/testing/sysfs-bus-coresight-devices-trbe   |     20 +
 .../testing/sysfs-bus-coresight-devices-ultra_smb  |     31 +
 Documentation/ABI/testing/sysfs-bus-counter        |    477 +
 Documentation/ABI/testing/sysfs-bus-css            |     56 +
 Documentation/ABI/testing/sysfs-bus-cxl            |    646 +
 Documentation/ABI/testing/sysfs-bus-dax            |    177 +
 Documentation/ABI/testing/sysfs-bus-dfl            |     17 +
 .../ABI/testing/sysfs-bus-dfl-devices-emif         |     25 +
 .../ABI/testing/sysfs-bus-dfl-devices-n3000-nios   |     47 +
 .../ABI/testing/sysfs-bus-event_source-devices     |     24 +
 .../testing/sysfs-bus-event_source-devices-caps    |     24 +
 .../testing/sysfs-bus-event_source-devices-dfl_fme |    104 +
 .../ABI/testing/sysfs-bus-event_source-devices-dsa |     30 +
 .../testing/sysfs-bus-event_source-devices-events  |    102 +
 .../testing/sysfs-bus-event_source-devices-format  |     21 +
 .../sysfs-bus-event_source-devices-hisi_ptt        |    113 +
 .../testing/sysfs-bus-event_source-devices-hv_24x7 |     98 +
 .../testing/sysfs-bus-event_source-devices-hv_gpci |    242 +
 .../testing/sysfs-bus-event_source-devices-iommu   |     37 +
 .../testing/sysfs-bus-event_source-devices-rdpmc   |     44 +
 .../testing/sysfs-bus-event_source-devices-uncore  |     13 +
 .../testing/sysfs-bus-event_source-devices-vpa-dtl |     25 +
 .../testing/sysfs-bus-event_source-devices-vpa-pmu |     25 +
 Documentation/ABI/testing/sysfs-bus-fcoe           |    138 +
 Documentation/ABI/testing/sysfs-bus-fsi            |     46 +
 .../ABI/testing/sysfs-bus-fsi-devices-sbefifo      |     10 +
 Documentation/ABI/testing/sysfs-bus-fsl-mc         |     25 +
 Documentation/ABI/testing/sysfs-bus-hsi            |     19 +
 .../ABI/testing/sysfs-bus-i2c-devices-bq32k        |      7 +
 .../ABI/testing/sysfs-bus-i2c-devices-fsa9480      |     27 +
 .../ABI/testing/sysfs-bus-i2c-devices-hm6352       |     21 +
 .../ABI/testing/sysfs-bus-i2c-devices-lm3533       |     15 +
 .../ABI/testing/sysfs-bus-i2c-devices-m24lr        |    100 +
 .../ABI/testing/sysfs-bus-i2c-devices-pca954x      |     23 +
 .../testing/sysfs-bus-i2c-devices-turris-omnia-mcu |    113 +
 Documentation/ABI/testing/sysfs-bus-i3c            |    194 +
 Documentation/ABI/testing/sysfs-bus-iio            |   2511 +
 .../ABI/testing/sysfs-bus-iio-accel-adxl372        |      7 +
 .../ABI/testing/sysfs-bus-iio-accel-bmc150         |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-ad9739a    |     19 +
 .../ABI/testing/sysfs-bus-iio-adc-ad-sigma-delta   |     23 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130 |     20 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 |     27 +
 .../ABI/testing/sysfs-bus-iio-adc-ad7280a          |     13 +
 .../testing/sysfs-bus-iio-adc-envelope-detector    |     39 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-hi8435 |     48 +
 .../ABI/testing/sysfs-bus-iio-adc-max11410         |     13 +
 .../ABI/testing/sysfs-bus-iio-adc-mcp3564          |     53 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-mt6360 |     78 +
 .../ABI/testing/sysfs-bus-iio-adc-pac1934          |      9 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-stm32  |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-bno055     |     81 +
 Documentation/ABI/testing/sysfs-bus-iio-cdc-ad7746 |     11 +
 .../ABI/testing/sysfs-bus-iio-chemical-sgp40       |     17 +
 .../ABI/testing/sysfs-bus-iio-chemical-sunrise-co2 |     38 +
 .../ABI/testing/sysfs-bus-iio-chemical-vz89x       |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-cros-ec    |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-dac        |     61 +
 Documentation/ABI/testing/sysfs-bus-iio-dac-ad5766 |     31 +
 .../ABI/testing/sysfs-bus-iio-dac-dpot-dac         |      8 +
 .../ABI/testing/sysfs-bus-iio-dac-ltc2688          |     55 +
 .../ABI/testing/sysfs-bus-iio-dfsdm-adc-stm32      |     22 +
 .../ABI/testing/sysfs-bus-iio-distance-srf08       |     17 +
 Documentation/ABI/testing/sysfs-bus-iio-dma-buffer |     19 +
 .../ABI/testing/sysfs-bus-iio-filter-admv8818      |     18 +
 Documentation/ABI/testing/sysfs-bus-iio-flow       |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-frequency  |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-ad9523     |     31 +
 .../ABI/testing/sysfs-bus-iio-frequency-adf4350    |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-adf4371    |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-admv1013   |     38 +
 .../ABI/testing/sysfs-bus-iio-frequency-admv1014   |     23 +
 .../ABI/testing/sysfs-bus-iio-gyro-bmg160          |      7 +
 .../ABI/testing/sysfs-bus-iio-health-afe440x       |     39 +
 Documentation/ABI/testing/sysfs-bus-iio-humidity   |     10 +
 .../sysfs-bus-iio-impedance-analyzer-ad5933        |     35 +
 Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc |     15 +
 .../ABI/testing/sysfs-bus-iio-inv_icm42600         |     18 +
 Documentation/ABI/testing/sysfs-bus-iio-isl29501   |     47 +
 .../ABI/testing/sysfs-bus-iio-light-isl29018       |     21 +
 .../ABI/testing/sysfs-bus-iio-light-lm3533-als     |     56 +
 .../ABI/testing/sysfs-bus-iio-light-si1133         |     22 +
 .../ABI/testing/sysfs-bus-iio-light-tsl2583        |     20 +
 .../ABI/testing/sysfs-bus-iio-light-tsl2772        |     13 +
 .../ABI/testing/sysfs-bus-iio-magnetometer-hmc5843 |     20 +
 Documentation/ABI/testing/sysfs-bus-iio-meas-spec  |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-mpu6050    |     13 +
 .../testing/sysfs-bus-iio-potentiometer-mcp4531    |      8 +
 Documentation/ABI/testing/sysfs-bus-iio-proximity  |     24 +
 .../ABI/testing/sysfs-bus-iio-proximity-as3935     |     15 +
 .../ABI/testing/sysfs-bus-iio-resolver-ad2s1210    |     27 +
 Documentation/ABI/testing/sysfs-bus-iio-sps30      |     28 +
 Documentation/ABI/testing/sysfs-bus-iio-sx9310     |     10 +
 Documentation/ABI/testing/sysfs-bus-iio-sx9324     |     29 +
 .../ABI/testing/sysfs-bus-iio-thermocouple         |     18 +
 .../ABI/testing/sysfs-bus-iio-timer-stm32          |    143 +
 .../ABI/testing/sysfs-bus-iio-trigger-sysfs        |     42 +
 Documentation/ABI/testing/sysfs-bus-iio-vf610      |     16 +
 .../ABI/testing/sysfs-bus-intel_th-devices-gth     |     52 +
 .../ABI/testing/sysfs-bus-intel_th-devices-msc     |     54 +
 .../ABI/testing/sysfs-bus-intel_th-devices-pti     |     24 +
 .../ABI/testing/sysfs-bus-intel_th-output-devices  |     15 +
 Documentation/ABI/testing/sysfs-bus-mcb            |     29 +
 Documentation/ABI/testing/sysfs-bus-mdio           |     72 +
 Documentation/ABI/testing/sysfs-bus-media          |      6 +
 Documentation/ABI/testing/sysfs-bus-mei            |     56 +
 Documentation/ABI/testing/sysfs-bus-mmc            |      4 +
 Documentation/ABI/testing/sysfs-bus-most           |    299 +
 Documentation/ABI/testing/sysfs-bus-moxtet-devices |     17 +
 Documentation/ABI/testing/sysfs-bus-nfit           |    233 +
 Documentation/ABI/testing/sysfs-bus-nvdimm         |     60 +
 Documentation/ABI/testing/sysfs-bus-optee-devices  |     17 +
 Documentation/ABI/testing/sysfs-bus-papr-pmem      |     75 +
 Documentation/ABI/testing/sysfs-bus-pci            |    704 +
 .../ABI/testing/sysfs-bus-pci-devices-aer          |    163 +
 .../ABI/testing/sysfs-bus-pci-devices-avs          |      8 +
 .../ABI/testing/sysfs-bus-pci-devices-catpt        |     17 +
 .../ABI/testing/sysfs-bus-pci-devices-cciss        |     80 +
 .../ABI/testing/sysfs-bus-pci-devices-pvpanic      |     26 +
 .../ABI/testing/sysfs-bus-pci-drivers-btintel_pcie |     15 +
 .../ABI/testing/sysfs-bus-pci-drivers-ehci_hcd     |     46 +
 .../ABI/testing/sysfs-bus-pci-drivers-janz-cmodio  |      8 +
 .../ABI/testing/sysfs-bus-pci-drivers-xhci_hcd     |    129 +
 Documentation/ABI/testing/sysfs-bus-peci           |     16 +
 Documentation/ABI/testing/sysfs-bus-platform       |     56 +
 .../sysfs-bus-platform-devices-ampere-smpro        |    325 +
 .../testing/sysfs-bus-platform-devices-occ-hwmon   |     13 +
 .../sysfs-bus-platform-drivers-amd_x3d_vcache      |     12 +
 .../ABI/testing/sysfs-bus-platform-onboard-usb-dev |      9 +
 Documentation/ABI/testing/sysfs-bus-rapidio        |    201 +
 Documentation/ABI/testing/sysfs-bus-rbd            |    173 +
 Documentation/ABI/testing/sysfs-bus-rpmsg          |     95 +
 Documentation/ABI/testing/sysfs-bus-siox           |     90 +
 .../ABI/testing/sysfs-bus-soundwire-master         |     23 +
 .../ABI/testing/sysfs-bus-soundwire-slave          |    109 +
 .../ABI/testing/sysfs-bus-spi-devices-spi-nor      |     40 +
 .../testing/sysfs-bus-surface_aggregator-tabletsw  |     57 +
 Documentation/ABI/testing/sysfs-bus-thunderbolt    |    370 +
 Documentation/ABI/testing/sysfs-bus-typec          |     51 +
 Documentation/ABI/testing/sysfs-bus-usb            |    607 +
 .../ABI/testing/sysfs-bus-usb-devices-usbsevseg    |     46 +
 Documentation/ABI/testing/sysfs-bus-usb-lvstest    |     60 +
 Documentation/ABI/testing/sysfs-bus-vdpa           |     57 +
 Documentation/ABI/testing/sysfs-bus-vfio-mdev      |    113 +
 Documentation/ABI/testing/sysfs-bus-vmbus          |     21 +
 Documentation/ABI/testing/sysfs-bus-wmi            |     81 +
 Documentation/ABI/testing/sysfs-c2port             |     81 +
 Documentation/ABI/testing/sysfs-cfq-target-latency |      8 +
 Documentation/ABI/testing/sysfs-class              |     16 +
 Documentation/ABI/testing/sysfs-class-backlight    |    186 +
 .../testing/sysfs-class-backlight-driver-lm3533    |     54 +
 .../ABI/testing/sysfs-class-backlight-lm3639       |     11 +
 Documentation/ABI/testing/sysfs-class-bdi          |    134 +
 Documentation/ABI/testing/sysfs-class-bsr          |     25 +
 Documentation/ABI/testing/sysfs-class-chromeos     |     53 +
 .../sysfs-class-chromeos-driver-cros-ec-lightbar   |     74 +
 .../sysfs-class-chromeos-driver-cros-ec-vbc        |      6 +
 Documentation/ABI/testing/sysfs-class-devfreq      |    143 +
 .../ABI/testing/sysfs-class-devfreq-event          |     25 +
 Documentation/ABI/testing/sysfs-class-devlink      |    130 +
 Documentation/ABI/testing/sysfs-class-drm          |      8 +
 Documentation/ABI/testing/sysfs-class-extcon       |    101 +
 Documentation/ABI/testing/sysfs-class-fc           |     27 +
 Documentation/ABI/testing/sysfs-class-fc_host      |     23 +
 .../ABI/testing/sysfs-class-fc_remote_ports        |     23 +
 Documentation/ABI/testing/sysfs-class-firmware     |     77 +
 .../ABI/testing/sysfs-class-firmware-attributes    |    494 +
 Documentation/ABI/testing/sysfs-class-fpga-bridge  |     11 +
 Documentation/ABI/testing/sysfs-class-fpga-manager |     60 +
 Documentation/ABI/testing/sysfs-class-fpga-region  |      9 +
 Documentation/ABI/testing/sysfs-class-gnss         |     17 +
 Documentation/ABI/testing/sysfs-class-hwmon        |   1089 +
 .../ABI/testing/sysfs-class-ieee80211-rtw89        |     24 +
 Documentation/ABI/testing/sysfs-class-intel_pmt    |    119 +
 .../ABI/testing/sysfs-class-intel_pmt-features     |    134 +
 Documentation/ABI/testing/sysfs-class-iommu        |     17 +
 .../ABI/testing/sysfs-class-iommu-amd-iommu        |     14 +
 .../ABI/testing/sysfs-class-iommu-intel-iommu      |     32 +
 Documentation/ABI/testing/sysfs-class-issei        |     73 +
 Documentation/ABI/testing/sysfs-class-lcd          |     23 +
 Documentation/ABI/testing/sysfs-class-led          |     89 +
 .../ABI/testing/sysfs-class-led-driver-aw200xx     |      5 +
 .../ABI/testing/sysfs-class-led-driver-lm3533      |     73 +
 .../testing/sysfs-class-led-driver-turris-omnia    |     28 +
 Documentation/ABI/testing/sysfs-class-led-flash    |     89 +
 .../ABI/testing/sysfs-class-led-multicolor         |     37 +
 .../ABI/testing/sysfs-class-led-trigger-netdev     |    192 +
 .../ABI/testing/sysfs-class-led-trigger-oneshot    |     36 +
 .../ABI/testing/sysfs-class-led-trigger-pattern    |     50 +
 .../ABI/testing/sysfs-class-led-trigger-tty        |     62 +
 .../ABI/testing/sysfs-class-led-trigger-usbport    |     13 +
 Documentation/ABI/testing/sysfs-class-leds-gt683r  |     18 +
 Documentation/ABI/testing/sysfs-class-mei          |    105 +
 Documentation/ABI/testing/sysfs-class-mic          |    178 +
 Documentation/ABI/testing/sysfs-class-mtd          |    242 +
 Documentation/ABI/testing/sysfs-class-mux          |     16 +
 Documentation/ABI/testing/sysfs-class-net          |    354 +
 Documentation/ABI/testing/sysfs-class-net-cdc_ncm  |    168 +
 Documentation/ABI/testing/sysfs-class-net-dsa      |     14 +
 Documentation/ABI/testing/sysfs-class-net-grcan    |     35 +
 .../ABI/testing/sysfs-class-net-janz-ican3         |     19 +
 Documentation/ABI/testing/sysfs-class-net-peak_usb |     19 +
 Documentation/ABI/testing/sysfs-class-net-phydev   |     75 +
 Documentation/ABI/testing/sysfs-class-net-qmi      |     76 +
 Documentation/ABI/testing/sysfs-class-net-queues   |    121 +
 .../ABI/testing/sysfs-class-net-statistics         |    217 +
 Documentation/ABI/testing/sysfs-class-ocxl         |     51 +
 .../ABI/testing/sysfs-class-platform-profile       |     50 +
 Documentation/ABI/testing/sysfs-class-power        |    906 +
 .../ABI/testing/sysfs-class-power-bd71828          |     13 +
 Documentation/ABI/testing/sysfs-class-power-gaokun |     27 +
 .../ABI/testing/sysfs-class-power-ltc4162l         |     82 +
 .../ABI/testing/sysfs-class-power-max1720x         |     32 +
 Documentation/ABI/testing/sysfs-class-power-mp2629 |      9 +
 Documentation/ABI/testing/sysfs-class-power-rt9467 |     19 +
 Documentation/ABI/testing/sysfs-class-power-rt9471 |     32 +
 Documentation/ABI/testing/sysfs-class-power-rt9756 |     30 +
 .../ABI/testing/sysfs-class-power-surface          |     15 +
 .../ABI/testing/sysfs-class-power-twl4030          |     33 +
 Documentation/ABI/testing/sysfs-class-power-wilco  |     40 +
 Documentation/ABI/testing/sysfs-class-powercap     |    152 +
 Documentation/ABI/testing/sysfs-class-pwm          |     88 +
 Documentation/ABI/testing/sysfs-class-rapidio      |     59 +
 Documentation/ABI/testing/sysfs-class-rc           |    137 +
 Documentation/ABI/testing/sysfs-class-rc-nuvoton   |     15 +
 .../testing/sysfs-class-reboot-mode-reboot_modes   |     39 +
 Documentation/ABI/testing/sysfs-class-regulator    |    453 +
 Documentation/ABI/testing/sysfs-class-remoteproc   |    104 +
 Documentation/ABI/testing/sysfs-class-rnbd-client  |    133 +
 Documentation/ABI/testing/sysfs-class-rnbd-server  |     58 +
 Documentation/ABI/testing/sysfs-class-rtc          |     91 +
 .../sysfs-class-rtc-rtc0-device-rtc_calibration    |     14 +
 Documentation/ABI/testing/sysfs-class-rtrs-client  |    146 +
 Documentation/ABI/testing/sysfs-class-rtrs-server  |     53 +
 Documentation/ABI/testing/sysfs-class-scsi_host    |    119 +
 Documentation/ABI/testing/sysfs-class-scsi_tape    |    109 +
 Documentation/ABI/testing/sysfs-class-spi-eeprom   |     30 +
 Documentation/ABI/testing/sysfs-class-spi-master   |     34 +
 Documentation/ABI/testing/sysfs-class-stm          |     24 +
 Documentation/ABI/testing/sysfs-class-stm_source   |     11 +
 Documentation/ABI/testing/sysfs-class-switchtec    |     96 +
 Documentation/ABI/testing/sysfs-class-tee          |     25 +
 Documentation/ABI/testing/sysfs-class-thermal      |    259 +
 Documentation/ABI/testing/sysfs-class-tsm          |      9 +
 Documentation/ABI/testing/sysfs-class-typec        |    386 +
 .../ABI/testing/sysfs-class-usb_power_delivery     |    284 +
 Documentation/ABI/testing/sysfs-class-usb_role     |     27 +
 Documentation/ABI/testing/sysfs-class-vduse        |     33 +
 Documentation/ABI/testing/sysfs-class-wakeup       |     76 +
 Documentation/ABI/testing/sysfs-class-watchdog     |    129 +
 Documentation/ABI/testing/sysfs-class-zram         |     24 +
 Documentation/ABI/testing/sysfs-dev                |     21 +
 Documentation/ABI/testing/sysfs-devices            |     25 +
 Documentation/ABI/testing/sysfs-devices-consumer   |      9 +
 Documentation/ABI/testing/sysfs-devices-coredump   |     10 +
 Documentation/ABI/testing/sysfs-devices-edac       |    157 +
 .../ABI/testing/sysfs-devices-faux-tdx-host        |     26 +
 .../ABI/testing/sysfs-devices-firmware_node        |     17 +
 Documentation/ABI/testing/sysfs-devices-lpss_ltr   |     44 +
 Documentation/ABI/testing/sysfs-devices-mapping    |     62 +
 Documentation/ABI/testing/sysfs-devices-memory     |    120 +
 Documentation/ABI/testing/sysfs-devices-mmc        |     21 +
 Documentation/ABI/testing/sysfs-devices-online     |     20 +
 .../ABI/testing/sysfs-devices-pci-host-bridge      |     45 +
 .../ABI/testing/sysfs-devices-physical_location    |     42 +
 .../ABI/testing/sysfs-devices-platform-ACPI-TAD    |    117 +
 .../testing/sysfs-devices-platform-_UDC_-gadget    |     23 +
 .../ABI/testing/sysfs-devices-platform-docg3       |     40 +
 .../ABI/testing/sysfs-devices-platform-dock        |     39 +
 .../ABI/testing/sysfs-devices-platform-ipmi        |    242 +
 .../testing/sysfs-devices-platform-kunpeng_hccs    |    126 +
 .../sysfs-devices-platform-sh_mobile_lcdc_fb       |     44 +
 .../ABI/testing/sysfs-devices-platform-soc-ipa     |    114 +
 .../testing/sysfs-devices-platform-stratix10-rsu   |    232 +
 .../ABI/testing/sysfs-devices-platform-trackpoint  |    115 +
 Documentation/ABI/testing/sysfs-devices-power      |    307 +
 .../ABI/testing/sysfs-devices-power_resources_D0   |     13 +
 .../ABI/testing/sysfs-devices-power_resources_D1   |     14 +
 .../ABI/testing/sysfs-devices-power_resources_D2   |     14 +
 .../testing/sysfs-devices-power_resources_D3hot    |     14 +
 .../testing/sysfs-devices-power_resources_wakeup   |     13 +
 .../ABI/testing/sysfs-devices-power_state          |     20 +
 .../ABI/testing/sysfs-devices-real_power_state     |     23 +
 Documentation/ABI/testing/sysfs-devices-removable  |     20 +
 .../ABI/testing/sysfs-devices-resource_in_use      |     12 +
 Documentation/ABI/testing/sysfs-devices-soc        |     95 +
 .../ABI/testing/sysfs-devices-software_node        |     10 +
 .../ABI/testing/sysfs-devices-state_synced         |     29 +
 Documentation/ABI/testing/sysfs-devices-sun        |     14 +
 Documentation/ABI/testing/sysfs-devices-supplier   |      9 +
 Documentation/ABI/testing/sysfs-devices-system-cpu |    808 +
 .../ABI/testing/sysfs-devices-system-ibm-rtl       |     24 +
 .../ABI/testing/sysfs-devices-system-xen_cpu       |     20 +
 Documentation/ABI/testing/sysfs-devices-vfio-dev   |      8 +
 .../testing/sysfs-devices-virtual-misc-tdx_guest   |     63 +
 .../ABI/testing/sysfs-devices-waiting_for_supplier |     17 +
 Documentation/ABI/testing/sysfs-devices-xenbus     |     41 +
 Documentation/ABI/testing/sysfs-driver-altera-cvp  |      8 +
 Documentation/ABI/testing/sysfs-driver-amd-sfh     |     13 +
 .../ABI/testing/sysfs-driver-aspeed-uart-routing   |     27 +
 .../ABI/testing/sysfs-driver-bd9571mwv-regulator   |     31 +
 Documentation/ABI/testing/sysfs-driver-ccp         |    120 +
 .../ABI/testing/sysfs-driver-chromeos-acpi         |    152 +
 .../ABI/testing/sysfs-driver-dell-dw5826e-reset    |      9 +
 Documentation/ABI/testing/sysfs-driver-eud         |      9 +
 .../ABI/testing/sysfs-driver-framer-pef2256        |      8 +
 .../ABI/testing/sysfs-driver-fsi-master-gpio       |     10 +
 Documentation/ABI/testing/sysfs-driver-ge-achc     |     15 +
 Documentation/ABI/testing/sysfs-driver-genwqe      |     78 +
 Documentation/ABI/testing/sysfs-driver-habanalabs  |    265 +
 Documentation/ABI/testing/sysfs-driver-hid         |     20 +
 .../ABI/testing/sysfs-driver-hid-appletb-kbd       |     13 +
 Documentation/ABI/testing/sysfs-driver-hid-corsair |     15 +
 .../ABI/testing/sysfs-driver-hid-corsair-void      |     38 +
 Documentation/ABI/testing/sysfs-driver-hid-lenovo  |     60 +
 .../ABI/testing/sysfs-driver-hid-lenovo-go         |    724 +
 .../ABI/testing/sysfs-driver-hid-lenovo-go-s       |    304 +
 .../ABI/testing/sysfs-driver-hid-logitech-hidpp    |     19 +
 .../ABI/testing/sysfs-driver-hid-logitech-lg4ff    |     75 +
 .../ABI/testing/sysfs-driver-hid-multitouch        |      9 +
 Documentation/ABI/testing/sysfs-driver-hid-ntrig   |     73 +
 Documentation/ABI/testing/sysfs-driver-hid-picolcd |     43 +
 .../ABI/testing/sysfs-driver-hid-prodikeys         |     29 +
 .../ABI/testing/sysfs-driver-hid-roccat-kone       |    125 +
 Documentation/ABI/testing/sysfs-driver-hid-srws1   |     21 +
 Documentation/ABI/testing/sysfs-driver-hid-wiimote |     85 +
 .../ABI/testing/sysfs-driver-input-axp-pek         |     11 +
 .../ABI/testing/sysfs-driver-input-cros-ec-keyb    |      6 +
 .../ABI/testing/sysfs-driver-input-exc3000         |     26 +
 Documentation/ABI/testing/sysfs-driver-intc_sar    |     54 +
 .../ABI/testing/sysfs-driver-intel-i915-hwmon      |     93 +
 .../ABI/testing/sysfs-driver-intel-m10-bmc         |     36 +
 .../testing/sysfs-driver-intel-m10-bmc-sec-update  |     61 +
 .../ABI/testing/sysfs-driver-intel-rapid-start     |     21 +
 .../ABI/testing/sysfs-driver-intel-xe-hwmon        |    315 +
 .../ABI/testing/sysfs-driver-intel-xe-ras          |     30 +
 .../ABI/testing/sysfs-driver-intel-xe-sriov        |    190 +
 Documentation/ABI/testing/sysfs-driver-intel_sdsi  |     90 +
 Documentation/ABI/testing/sysfs-driver-ivpu        |     65 +
 .../ABI/testing/sysfs-driver-jz4780-efuse          |     20 +
 .../ABI/testing/sysfs-driver-lenovo-yb9-kbdock     |     19 +
 .../ABI/testing/sysfs-driver-panfrost-profiling    |     10 +
 .../ABI/testing/sysfs-driver-panthor-profiling     |     10 +
 Documentation/ABI/testing/sysfs-driver-pciback     |     28 +
 Documentation/ABI/testing/sysfs-driver-ppi         |     75 +
 Documentation/ABI/testing/sysfs-driver-qaic        |     18 +
 Documentation/ABI/testing/sysfs-driver-qat         |    167 +
 Documentation/ABI/testing/sysfs-driver-qat_kpt     |     97 +
 Documentation/ABI/testing/sysfs-driver-qat_ras     |     41 +
 Documentation/ABI/testing/sysfs-driver-qat_rl      |    226 +
 Documentation/ABI/testing/sysfs-driver-qat_svn     |    114 +
 .../ABI/testing/sysfs-driver-samsung-laptop        |     37 +
 Documentation/ABI/testing/sysfs-driver-spi-intel   |     20 +
 Documentation/ABI/testing/sysfs-driver-st          |     12 +
 Documentation/ABI/testing/sysfs-driver-tegra-fuse  |     11 +
 .../ABI/testing/sysfs-driver-toshiba_acpi          |    223 +
 .../ABI/testing/sysfs-driver-toshiba_haps          |     22 +
 .../ABI/testing/sysfs-driver-typec-displayport     |     74 +
 Documentation/ABI/testing/sysfs-driver-uacce       |     57 +
 Documentation/ABI/testing/sysfs-driver-ucsi-ccg    |      6 +
 Documentation/ABI/testing/sysfs-driver-ufs         |   1793 +
 .../ABI/testing/sysfs-driver-uio_pci_sva-pasid     |     29 +
 .../ABI/testing/sysfs-driver-uniwill-laptop        |    105 +
 Documentation/ABI/testing/sysfs-driver-w1_ds28e17  |     24 +
 Documentation/ABI/testing/sysfs-driver-w1_therm    |    190 +
 Documentation/ABI/testing/sysfs-driver-wacom       |    105 +
 Documentation/ABI/testing/sysfs-driver-xdata       |     49 +
 Documentation/ABI/testing/sysfs-driver-xen-blkback |     46 +
 .../ABI/testing/sysfs-driver-xen-blkfront          |     19 +
 .../ABI/testing/sysfs-driver-xilinx-tmr-manager    |     16 +
 Documentation/ABI/testing/sysfs-driver-zynqmp-fpga |     73 +
 Documentation/ABI/testing/sysfs-edac-ecs           |     74 +
 Documentation/ABI/testing/sysfs-edac-memory-repair |    206 +
 Documentation/ABI/testing/sysfs-edac-scrub         |     85 +
 Documentation/ABI/testing/sysfs-firmware-acpi      |    277 +
 .../ABI/testing/sysfs-firmware-dmi-entries         |    114 +
 .../ABI/testing/sysfs-firmware-dmi-tables          |     22 +
 Documentation/ABI/testing/sysfs-firmware-efi       |     45 +
 Documentation/ABI/testing/sysfs-firmware-efi-esrt  |     87 +
 .../ABI/testing/sysfs-firmware-efi-runtime-map     |     36 +
 Documentation/ABI/testing/sysfs-firmware-gsmi      |     58 +
 Documentation/ABI/testing/sysfs-firmware-initrd    |      8 +
 .../ABI/testing/sysfs-firmware-lefi-boardinfo      |     35 +
 Documentation/ABI/testing/sysfs-firmware-log       |      7 +
 Documentation/ABI/testing/sysfs-firmware-memmap    |     75 +
 Documentation/ABI/testing/sysfs-firmware-ofw       |     52 +
 .../ABI/testing/sysfs-firmware-opal-powercap       |     31 +
 Documentation/ABI/testing/sysfs-firmware-opal-psr  |     18 +
 .../ABI/testing/sysfs-firmware-opal-sensor-groups  |     21 +
 .../testing/sysfs-firmware-papr-energy-scale-info  |     29 +
 Documentation/ABI/testing/sysfs-firmware-plpks     |     58 +
 .../ABI/testing/sysfs-firmware-qemu_fw_cfg         |    103 +
 .../ABI/testing/sysfs-firmware-sev-vulnerabilities |     19 +
 Documentation/ABI/testing/sysfs-firmware-sgi_uv    |    159 +
 .../ABI/testing/sysfs-firmware-turris-mox-rwtm     |     28 +
 Documentation/ABI/testing/sysfs-fs-erofs           |     49 +
 Documentation/ABI/testing/sysfs-fs-ext4            |    118 +
 Documentation/ABI/testing/sysfs-fs-f2fs            |   1022 +
 Documentation/ABI/testing/sysfs-fs-nilfs2          |    269 +
 Documentation/ABI/testing/sysfs-fs-ubifs           |     35 +
 Documentation/ABI/testing/sysfs-fs-virtiofs        |     11 +
 Documentation/ABI/testing/sysfs-fs-xfs             |     37 +
 Documentation/ABI/testing/sysfs-hypervisor-xen     |     46 +
 Documentation/ABI/testing/sysfs-ibft               |     33 +
 .../ABI/testing/sysfs-kernel-address_bits          |     10 +
 Documentation/ABI/testing/sysfs-kernel-boot_params |     39 +
 Documentation/ABI/testing/sysfs-kernel-btf         |     25 +
 .../ABI/testing/sysfs-kernel-cpu_byteorder         |     12 +
 Documentation/ABI/testing/sysfs-kernel-fadump      |     59 +
 Documentation/ABI/testing/sysfs-kernel-fscaps      |      8 +
 .../ABI/testing/sysfs-kernel-hardlockup_count      |      7 +
 .../ABI/testing/sysfs-kernel-iommu_groups          |     64 +
 Documentation/ABI/testing/sysfs-kernel-irq         |     60 +
 Documentation/ABI/testing/sysfs-kernel-kexec-kdump |     61 +
 Documentation/ABI/testing/sysfs-kernel-livepatch   |     95 +
 Documentation/ABI/testing/sysfs-kernel-mm          |      6 +
 Documentation/ABI/testing/sysfs-kernel-mm-cma      |     44 +
 Documentation/ABI/testing/sysfs-kernel-mm-damon    |    664 +
 .../ABI/testing/sysfs-kernel-mm-hugepages          |     17 +
 Documentation/ABI/testing/sysfs-kernel-mm-ksm      |     61 +
 .../ABI/testing/sysfs-kernel-mm-memory-tiers       |     25 +
 .../ABI/testing/sysfs-kernel-mm-mempolicy          |      4 +
 .../sysfs-kernel-mm-mempolicy-weighted-interleave  |     54 +
 Documentation/ABI/testing/sysfs-kernel-mm-numa     |     28 +
 Documentation/ABI/testing/sysfs-kernel-mm-swap     |     16 +
 .../testing/sysfs-kernel-mm-transparent-hugepage   |     18 +
 Documentation/ABI/testing/sysfs-kernel-oops_count  |      6 +
 .../ABI/testing/sysfs-kernel-rcu_stall_count       |      6 +
 Documentation/ABI/testing/sysfs-kernel-reboot      |     40 +
 Documentation/ABI/testing/sysfs-kernel-slab        |    526 +
 .../ABI/testing/sysfs-kernel-softlockup_count      |      7 +
 Documentation/ABI/testing/sysfs-kernel-vmcoreinfo  |     14 +
 Documentation/ABI/testing/sysfs-kernel-warn_count  |      6 +
 Documentation/ABI/testing/sysfs-mce                |     97 +
 .../ABI/testing/sysfs-memory-page-offline          |     44 +
 Documentation/ABI/testing/sysfs-module             |     84 +
 Documentation/ABI/testing/sysfs-nvmem-cells        |     21 +
 Documentation/ABI/testing/sysfs-ocfs2              |     89 +
 .../ABI/testing/sysfs-platform-alienware-wmi       |     14 +
 .../ABI/testing/sysfs-platform-asus-laptop         |     71 +
 Documentation/ABI/testing/sysfs-platform-asus-wmi  |    240 +
 Documentation/ABI/testing/sysfs-platform-at91      |     27 +
 Documentation/ABI/testing/sysfs-platform-ayaneo-ec |     19 +
 .../ABI/testing/sysfs-platform-brcmstb-gisb-arb    |      8 +
 .../ABI/testing/sysfs-platform-brcmstb-memc        |     15 +
 .../ABI/testing/sysfs-platform-chipidea-usb-otg    |     56 +
 .../ABI/testing/sysfs-platform-chipidea-usb2       |      9 +
 .../ABI/testing/sysfs-platform-dell-laptop         |     73 +
 .../ABI/testing/sysfs-platform-dell-privacy-wmi    |     71 +
 .../ABI/testing/sysfs-platform-dell-smbios         |     21 +
 .../ABI/testing/sysfs-platform-dell-wmi-ddv        |      9 +
 Documentation/ABI/testing/sysfs-platform-dfl-fme   |    246 +
 Documentation/ABI/testing/sysfs-platform-dfl-port  |    101 +
 Documentation/ABI/testing/sysfs-platform-dptf      |    157 +
 .../ABI/testing/sysfs-platform-eeepc-laptop        |     56 +
 Documentation/ABI/testing/sysfs-platform-hidma     |      9 +
 .../ABI/testing/sysfs-platform-hidma-mgmt          |     97 +
 .../ABI/testing/sysfs-platform-i2c-demux-pinctrl   |     18 +
 .../ABI/testing/sysfs-platform-ideapad-laptop      |     52 +
 Documentation/ABI/testing/sysfs-platform-intel-ifs |     52 +
 Documentation/ABI/testing/sysfs-platform-intel-pmc |     22 +
 .../testing/sysfs-platform-intel-wmi-sbl-fw-update |     13 +
 .../testing/sysfs-platform-intel-wmi-thunderbolt   |     12 +
 Documentation/ABI/testing/sysfs-platform-kim       |     49 +
 Documentation/ABI/testing/sysfs-platform-lg-laptop |     36 +
 .../ABI/testing/sysfs-platform-mellanox-bootctl    |    162 +
 .../ABI/testing/sysfs-platform-mellanox-pmc        |     64 +
 .../ABI/testing/sysfs-platform-msi-laptop          |     83 +
 Documentation/ABI/testing/sysfs-platform-oxp       |     25 +
 .../ABI/testing/sysfs-platform-phy-rcar-gen3-usb2  |     17 +
 .../ABI/testing/sysfs-platform-power-on-reason     |     12 +
 .../ABI/testing/sysfs-platform-renesas_usb3        |     17 +
 Documentation/ABI/testing/sysfs-platform-silicom   |     30 +
 Documentation/ABI/testing/sysfs-platform-sst-atom  |     26 +
 Documentation/ABI/testing/sysfs-platform-tahvo-usb |     16 +
 Documentation/ABI/testing/sysfs-platform-ts5500    |     54 +
 .../ABI/testing/sysfs-platform-twl4030-usb         |      8 +
 .../ABI/testing/sysfs-platform-usbip-vudc          |     38 +
 Documentation/ABI/testing/sysfs-platform-wilco-ec  |     58 +
 Documentation/ABI/testing/sysfs-platform_profile   |     40 +
 Documentation/ABI/testing/sysfs-power              |    472 +
 Documentation/ABI/testing/sysfs-pps                |     73 +
 Documentation/ABI/testing/sysfs-pps-gen            |     43 +
 Documentation/ABI/testing/sysfs-pps-gen-tio        |      6 +
 Documentation/ABI/testing/sysfs-profiling          |     13 +
 Documentation/ABI/testing/sysfs-ptp                |    142 +
 Documentation/ABI/testing/sysfs-secvar             |     65 +
 Documentation/ABI/testing/sysfs-timecard           |    293 +
 Documentation/ABI/testing/sysfs-tty                |    166 +
 Documentation/ABI/testing/sysfs-uevent             |     51 +
 Documentation/ABI/testing/usb-charger-uevent       |     54 +
 Documentation/ABI/testing/usb-uevent               |     27 +
 Documentation/Changes                              |      1 +
 Documentation/CodingStyle                          |      1 +
 Documentation/Kconfig                              |     28 +
 Documentation/Makefile                             |    115 +
 Documentation/PCI/acpi-info.rst                    |    192 +
 Documentation/PCI/boot-interrupts.rst              |    159 +
 Documentation/PCI/controller/index.rst             |     11 +
 .../PCI/controller/pci-controller-drivers.rst      |    402 +
 .../PCI/controller/rcar-pcie-firmware.rst          |     32 +
 .../PCI/endpoint/function/binding/pci-ntb.rst      |     38 +
 .../PCI/endpoint/function/binding/pci-test.rst     |     26 +
 Documentation/PCI/endpoint/index.rst               |     21 +
 Documentation/PCI/endpoint/pci-endpoint-cfs.rst    |    138 +
 Documentation/PCI/endpoint/pci-endpoint.rst        |    283 +
 Documentation/PCI/endpoint/pci-ntb-function.rst    |    348 +
 Documentation/PCI/endpoint/pci-ntb-howto.rst       |    158 +
 Documentation/PCI/endpoint/pci-nvme-function.rst   |     13 +
 Documentation/PCI/endpoint/pci-test-function.rst   |    103 +
 Documentation/PCI/endpoint/pci-test-howto.rst      |    239 +
 Documentation/PCI/endpoint/pci-vntb-function.rst   |    129 +
 Documentation/PCI/endpoint/pci-vntb-howto.rst      |    169 +
 Documentation/PCI/index.rst                        |     22 +
 Documentation/PCI/msi-howto.rst                    |    300 +
 Documentation/PCI/pci-error-recovery.rst           |    471 +
 Documentation/PCI/pci-iov-howto.rst                |    171 +
 Documentation/PCI/pci.rst                          |    578 +
 Documentation/PCI/pcieaer-howto.rst                |    267 +
 Documentation/PCI/pciebus-howto.rst                |    228 +
 Documentation/PCI/sysfs-pci.rst                    |    138 +
 Documentation/PCI/tph.rst                          |    132 +
 .../Design/Data-Structures/BigTreeClassicRCU.svg   |    474 +
 .../BigTreePreemptRCUBHdyntickCB.svg               |    662 +
 .../RCU/Design/Data-Structures/Data-Structures.rst |   1196 +
 .../Design/Data-Structures/HugeTreeClassicRCU.svg  |    939 +
 .../RCU/Design/Data-Structures/TreeLevel.svg       |    828 +
 .../RCU/Design/Data-Structures/TreeMapping.svg     |    305 +
 .../Design/Data-Structures/TreeMappingLevel.svg    |    380 +
 .../RCU/Design/Data-Structures/blkd_task.svg       |    631 +
 .../RCU/Design/Data-Structures/nxtlist.svg         |    386 +
 .../Design/Expedited-Grace-Periods/ExpRCUFlow.svg  |    830 +
 .../Expedited-Grace-Periods/ExpSchedFlow.svg       |    830 +
 .../Expedited-Grace-Periods.rst                    |    521 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel0.svg |    275 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel1.svg |    275 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel2.svg |    287 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel3.svg |    323 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel4.svg |    323 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel5.svg |    335 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel6.svg |    335 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel7.svg |    347 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel8.svg |    311 +
 .../Memory-Ordering/Tree-RCU-Memory-Ordering.rst   |    648 +
 .../TreeRCU-callback-invocation.svg                |    486 +
 .../Memory-Ordering/TreeRCU-callback-registry.svg  |    646 +
 .../RCU/Design/Memory-Ordering/TreeRCU-dyntick.svg |    700 +
 .../Design/Memory-Ordering/TreeRCU-gp-cleanup.svg  |   1133 +
 .../RCU/Design/Memory-Ordering/TreeRCU-gp-fqs.svg  |   1309 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-1.svg   |    658 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-2.svg   |    656 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-3.svg   |    636 +
 .../RCU/Design/Memory-Ordering/TreeRCU-gp.svg      |   5135 +
 .../RCU/Design/Memory-Ordering/TreeRCU-hotplug.svg |    775 +
 .../RCU/Design/Memory-Ordering/TreeRCU-qs.svg      |   1095 +
 .../RCU/Design/Memory-Ordering/rcu_node-lock.svg   |    229 +
 .../Design/Requirements/GPpartitionReaders1.svg    |    374 +
 .../Design/Requirements/ReadersPartitionGP1.svg    |    639 +
 .../RCU/Design/Requirements/Requirements.rst       |   2873 +
 Documentation/RCU/NMI-RCU.rst                      |    123 +
 Documentation/RCU/RTFP.txt                         |   2812 +
 Documentation/RCU/UP.rst                           |    152 +
 Documentation/RCU/checklist.rst                    |    556 +
 Documentation/RCU/index.rst                        |     30 +
 Documentation/RCU/listRCU.rst                      |    511 +
 Documentation/RCU/lockdep-splat.rst                |    115 +
 Documentation/RCU/lockdep.rst                      |    119 +
 Documentation/RCU/rcu.rst                          |     93 +
 Documentation/RCU/rcu_dereference.rst              |    502 +
 Documentation/RCU/rcubarrier.rst                   |    377 +
 Documentation/RCU/rculist_nulls.rst                |    215 +
 Documentation/RCU/rcuref.rst                       |    158 +
 Documentation/RCU/stallwarn.rst                    |    491 +
 Documentation/RCU/torture.rst                      |    374 +
 Documentation/RCU/whatisRCU.rst                    |   1415 +
 Documentation/SubmittingPatches                    |      1 +
 Documentation/accel/amdxdna/amdnpu.rst             |    306 +
 Documentation/accel/amdxdna/index.rst              |     11 +
 Documentation/accel/index.rst                      |     13 +
 Documentation/accel/introduction.rst               |    110 +
 Documentation/accel/qaic/aic080.rst                |     14 +
 Documentation/accel/qaic/aic100.rst                |    538 +
 Documentation/accel/qaic/index.rst                 |     14 +
 Documentation/accel/qaic/qaic.rst                  |    209 +
 Documentation/accel/rocket/index.rst               |     19 +
 Documentation/accounting/cgroupstats.rst           |     31 +
 Documentation/accounting/delay-accounting.rst      |    214 +
 Documentation/accounting/index.rst                 |     14 +
 Documentation/accounting/psi.rst                   |    188 +
 Documentation/accounting/taskstats-struct.rst      |    199 +
 Documentation/accounting/taskstats.rst             |    182 +
 Documentation/admin-guide/LSM/LoadPin.rst          |     31 +
 Documentation/admin-guide/LSM/SELinux.rst          |     44 +
 Documentation/admin-guide/LSM/SafeSetID.rst        |    118 +
 Documentation/admin-guide/LSM/Smack.rst            |    871 +
 Documentation/admin-guide/LSM/Yama.rst             |     75 +
 Documentation/admin-guide/LSM/apparmor.rst         |     54 +
 Documentation/admin-guide/LSM/index.rst            |     51 +
 Documentation/admin-guide/LSM/ipe.rst              |    835 +
 Documentation/admin-guide/LSM/landlock.rst         |    298 +
 Documentation/admin-guide/LSM/tomoyo.rst           |     52 +
 .../admin-guide/RAS/address-translation.rst        |     24 +
 Documentation/admin-guide/RAS/error-decoding.rst   |     21 +
 Documentation/admin-guide/RAS/index.rst            |      7 +
 Documentation/admin-guide/RAS/main.rst             |   1087 +
 Documentation/admin-guide/README.rst               |    360 +
 Documentation/admin-guide/abi-obsolete-files.rst   |      7 +
 Documentation/admin-guide/abi-obsolete.rst         |     13 +
 Documentation/admin-guide/abi-removed-files.rst    |      7 +
 Documentation/admin-guide/abi-removed.rst          |      7 +
 Documentation/admin-guide/abi-stable-files.rst     |      7 +
 Documentation/admin-guide/abi-stable.rst           |     16 +
 Documentation/admin-guide/abi-testing-files.rst    |      7 +
 Documentation/admin-guide/abi-testing.rst          |     22 +
 Documentation/admin-guide/abi.rst                  |     29 +
 Documentation/admin-guide/acpi/cppc_sysfs.rst      |     78 +
 .../admin-guide/acpi/fan_performance_states.rst    |     90 +
 Documentation/admin-guide/acpi/index.rst           |     14 +
 .../admin-guide/acpi/initrd_table_override.rst     |    115 +
 Documentation/admin-guide/acpi/ssdt-overlays.rst   |    181 +
 Documentation/admin-guide/aoe/aoe.rst              |    150 +
 Documentation/admin-guide/aoe/autoload.sh          |     17 +
 Documentation/admin-guide/aoe/examples.rst         |     23 +
 Documentation/admin-guide/aoe/index.rst            |     10 +
 Documentation/admin-guide/aoe/status.sh            |     30 +
 Documentation/admin-guide/aoe/todo.rst             |     17 +
 Documentation/admin-guide/aoe/udev-install.sh      |     33 +
 Documentation/admin-guide/aoe/udev.txt             |     26 +
 .../admin-guide/auxdisplay/cfag12864b.rst          |     98 +
 Documentation/admin-guide/auxdisplay/index.rst     |      9 +
 Documentation/admin-guide/auxdisplay/ks0108.rst    |     50 +
 Documentation/admin-guide/bcache.rst               |    644 +
 Documentation/admin-guide/binderfs.rst             |     87 +
 Documentation/admin-guide/binfmt-misc.rst          |    391 +
 .../blockdev/drbd/DRBD-8.3-data-packets.svg        |    588 +
 .../blockdev/drbd/DRBD-data-packets.svg            |    459 +
 .../admin-guide/blockdev/drbd/conn-states-8.dot    |     18 +
 .../blockdev/drbd/data-structure-v9.rst            |     42 +
 .../admin-guide/blockdev/drbd/disk-states-8.dot    |     16 +
 .../drbd/drbd-connection-state-overview.dot        |     85 +
 .../admin-guide/blockdev/drbd/figures.rst          |     30 +
 Documentation/admin-guide/blockdev/drbd/index.rst  |     19 +
 .../admin-guide/blockdev/drbd/peer-states-8.dot    |      8 +
 Documentation/admin-guide/blockdev/floppy.rst      |    255 +
 Documentation/admin-guide/blockdev/index.rst       |     17 +
 Documentation/admin-guide/blockdev/nbd.rst         |     31 +
 Documentation/admin-guide/blockdev/paride.rst      |    207 +
 Documentation/admin-guide/blockdev/ramdisk.rst     |    153 +
 Documentation/admin-guide/blockdev/zoned_loop.rst  |    191 +
 Documentation/admin-guide/blockdev/zram.rst        |    610 +
 Documentation/admin-guide/bootconfig.rst           |    416 +
 Documentation/admin-guide/braille-console.rst      |     38 +
 Documentation/admin-guide/btmrvl.rst               |    124 +
 Documentation/admin-guide/bug-bisect.rst           |    165 +
 Documentation/admin-guide/bug-hunting.rst          |    370 +
 .../admin-guide/cgroup-v1/blkio-controller.rst     |    301 +
 Documentation/admin-guide/cgroup-v1/cgroups.rst    |    697 +
 Documentation/admin-guide/cgroup-v1/cpuacct.rst    |     50 +
 Documentation/admin-guide/cgroup-v1/cpusets.rst    |    874 +
 Documentation/admin-guide/cgroup-v1/devices.rst    |    132 +
 .../admin-guide/cgroup-v1/freezer-subsystem.rst    |    131 +
 Documentation/admin-guide/cgroup-v1/hugetlb.rst    |    139 +
 Documentation/admin-guide/cgroup-v1/index.rst      |     24 +
 Documentation/admin-guide/cgroup-v1/memcg_test.rst |    342 +
 Documentation/admin-guide/cgroup-v1/memory.rst     |    926 +
 Documentation/admin-guide/cgroup-v1/misc.rst       |      4 +
 Documentation/admin-guide/cgroup-v1/net_cls.rst    |     44 +
 Documentation/admin-guide/cgroup-v1/net_prio.rst   |     57 +
 Documentation/admin-guide/cgroup-v1/pids.rst       |     93 +
 Documentation/admin-guide/cgroup-v1/rdma.rst       |    191 +
 Documentation/admin-guide/cgroup-v2.rst            |   3581 +
 Documentation/admin-guide/cifs/authors.rst         |     69 +
 Documentation/admin-guide/cifs/changes.rst         |      9 +
 Documentation/admin-guide/cifs/index.rst           |     14 +
 Documentation/admin-guide/cifs/introduction.rst    |     53 +
 Documentation/admin-guide/cifs/todo.rst            |    133 +
 Documentation/admin-guide/cifs/usage.rst           |    864 +
 Documentation/admin-guide/cifs/winucase_convert.pl |     62 +
 Documentation/admin-guide/clearing-warn-once.rst   |      9 +
 Documentation/admin-guide/cpu-isolation.rst        |    357 +
 Documentation/admin-guide/cpu-load.rst             |    117 +
 Documentation/admin-guide/cputopology.rst          |    101 +
 Documentation/admin-guide/dell_rbu.rst             |    128 +
 .../admin-guide/device-mapper/cache-policies.rst   |    131 +
 Documentation/admin-guide/device-mapper/cache.rst  |    337 +
 Documentation/admin-guide/device-mapper/delay.rst  |     54 +
 .../admin-guide/device-mapper/dm-clone.rst         |    333 +
 .../admin-guide/device-mapper/dm-crypt.rst         |    212 +
 .../admin-guide/device-mapper/dm-dust.rst          |    305 +
 Documentation/admin-guide/device-mapper/dm-ebs.rst |     51 +
 .../admin-guide/device-mapper/dm-flakey.rst        |     88 +
 Documentation/admin-guide/device-mapper/dm-ima.rst |    718 +
 .../admin-guide/device-mapper/dm-init.rst          |    133 +
 .../admin-guide/device-mapper/dm-inlinecrypt.rst   |    129 +
 .../admin-guide/device-mapper/dm-integrity.rst     |    321 +
 Documentation/admin-guide/device-mapper/dm-io.rst  |     75 +
 Documentation/admin-guide/device-mapper/dm-log.rst |     57 +
 .../admin-guide/device-mapper/dm-pcache.rst        |    202 +
 .../admin-guide/device-mapper/dm-queue-length.rst  |     48 +
 .../admin-guide/device-mapper/dm-raid.rst          |    489 +
 .../admin-guide/device-mapper/dm-service-time.rst  |    101 +
 .../admin-guide/device-mapper/dm-uevent.rst        |    110 +
 .../admin-guide/device-mapper/dm-zoned.rst         |    194 +
 Documentation/admin-guide/device-mapper/era.rst    |    116 +
 Documentation/admin-guide/device-mapper/index.rst  |     43 +
 Documentation/admin-guide/device-mapper/kcopyd.rst |     47 +
 Documentation/admin-guide/device-mapper/linear.rst |     63 +
 .../admin-guide/device-mapper/log-writes.rst       |    145 +
 .../admin-guide/device-mapper/persistent-data.rst  |     88 +
 .../admin-guide/device-mapper/snapshot.rst         |    196 +
 .../admin-guide/device-mapper/statistics.rst       |    225 +
 .../admin-guide/device-mapper/striped.rst          |     61 +
 Documentation/admin-guide/device-mapper/switch.rst |    141 +
 .../device-mapper/thin-provisioning.rst            |    427 +
 .../admin-guide/device-mapper/unstriped.rst        |    135 +
 .../admin-guide/device-mapper/vdo-design.rst       |    633 +
 Documentation/admin-guide/device-mapper/vdo.rst    |    413 +
 Documentation/admin-guide/device-mapper/verity.rst |    349 +
 .../admin-guide/device-mapper/writecache.rst       |    114 +
 Documentation/admin-guide/device-mapper/zero.rst   |     37 +
 Documentation/admin-guide/devices.rst              |    270 +
 Documentation/admin-guide/devices.txt              |   3081 +
 Documentation/admin-guide/dynamic-debug-howto.rst  |    392 +
 Documentation/admin-guide/edid.rst                 |     27 +
 Documentation/admin-guide/efi-stub.rst             |    103 +
 Documentation/admin-guide/ext4.rst                 |    611 +
 Documentation/admin-guide/features.rst             |      3 +
 .../admin-guide/filesystem-monitoring.rst          |     78 +
 Documentation/admin-guide/gpio/gpio-aggregator.rst |    218 +
 Documentation/admin-guide/gpio/gpio-mockup.rst     |     59 +
 Documentation/admin-guide/gpio/gpio-sim.rst        |    137 +
 Documentation/admin-guide/gpio/gpio-virtuser.rst   |    177 +
 Documentation/admin-guide/gpio/index.rst           |     14 +
 Documentation/admin-guide/gpio/obsolete.rst        |     13 +
 .../admin-guide/hw-vuln/attack_vector_controls.rst |    236 +
 .../admin-guide/hw-vuln/core-scheduling.rst        |    226 +
 .../admin-guide/hw-vuln/cross-thread-rsb.rst       |     91 +
 .../admin-guide/hw-vuln/gather_data_sampling.rst   |    109 +
 Documentation/admin-guide/hw-vuln/index.rst        |     29 +
 .../hw-vuln/indirect-target-selection.rst          |    168 +
 Documentation/admin-guide/hw-vuln/l1d_flush.rst    |     69 +
 Documentation/admin-guide/hw-vuln/l1tf.rst         |    615 +
 Documentation/admin-guide/hw-vuln/mds.rst          |    303 +
 Documentation/admin-guide/hw-vuln/multihit.rst     |    167 +
 .../admin-guide/hw-vuln/old_microcode.rst          |     21 +
 .../hw-vuln/processor_mmio_stale_data.rst          |    269 +
 .../admin-guide/hw-vuln/reg-file-data-sampling.rst |     96 +
 Documentation/admin-guide/hw-vuln/rsb.rst          |    268 +
 .../special-register-buffer-data-sampling.rst      |    150 +
 Documentation/admin-guide/hw-vuln/spectre.rst      |    725 +
 Documentation/admin-guide/hw-vuln/srso.rst         |    242 +
 .../admin-guide/hw-vuln/tsx_async_abort.rst        |    270 +
 Documentation/admin-guide/hw-vuln/vmscape.rst      |    110 +
 Documentation/admin-guide/hw_random.rst            |    104 +
 Documentation/admin-guide/index.rst                |    192 +
 Documentation/admin-guide/init.rst                 |     48 +
 Documentation/admin-guide/initrd.rst               |    383 +
 Documentation/admin-guide/iostats.rst              |    187 +
 Documentation/admin-guide/java.rst                 |    423 +
 Documentation/admin-guide/jfs.rst                  |     66 +
 Documentation/admin-guide/kdump/gdbmacros.txt      |    323 +
 Documentation/admin-guide/kdump/index.rst          |     13 +
 Documentation/admin-guide/kdump/kdump.rst          |    612 +
 Documentation/admin-guide/kdump/vmcoreinfo.rst     |    596 +
 Documentation/admin-guide/kernel-parameters.rst    |    135 +
 Documentation/admin-guide/kernel-parameters.txt    |   8709 +
 .../admin-guide/kernel-per-CPU-kthreads.rst        |    325 +
 .../admin-guide/laptops/alienware-wmi.rst          |    127 +
 Documentation/admin-guide/laptops/asus-laptop.rst  |    271 +
 .../admin-guide/laptops/disk-shock-protection.rst  |    151 +
 Documentation/admin-guide/laptops/index.rst        |     19 +
 Documentation/admin-guide/laptops/lg-laptop.rst    |     82 +
 .../admin-guide/laptops/samsung-galaxybook.rst     |    174 +
 Documentation/admin-guide/laptops/sony-laptop.rst  |    174 +
[Output truncated: showing 1000 of 96042 lines]]

130/4 2026/09/17 10:56 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 54242
							output: 22
							thoughts: 49
						

Thoughts:
Okay, let's break this down.

**Investigating the `fs/ntfs` Directory**

Hmm, I'm trying to figure something out, probably related to the file system, but where did `fs/ntfs` come up in the git history or the project structure? I need to quickly see what's *actually* in the `fs/ntfs` directory. My usual approach would be to dive into the codebase, but I'll skip that. Let's see if `codesearch-dir-index` has a faster answer for me. That should give me a good overview of what's present in that directory without having to parse all the source code myself.



131/4 2026/09/17 10:56 tool codesearch-dir-index
0m Args:
map[Dir:fs/ntfs]

Results:
map[Files:[aops.c attrib.c attrib.h attrlist.c attrlist.h bdev-io.c bitmap.c bitmap.h collate.c collate.h compress.c debug.c debug.h dir.c dir.h ea.c ea.h file.c index.c index.h inode.c inode.h iomap.c iomap.h layout.h lcnalloc.c lcnalloc.h logfile.c logfile.h malloc.h mft.c mft.h mst.c namei.c ntfs.h ntfs_codec.h object_id.c object_id.h reparse.c reparse.h runlist.c runlist.h super.c sysctl.c sysctl.h time.h unistr.c upcase.c volume.h wof.c] Subdirs:[lib]]

132/4 2026/09/17 10:56 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 54815
							output: 23
							thoughts: 33
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own:

**Analyzing the NTFS3 Implementation**

Alright, time to dig into `fs/ntfs3`. My first step, as always, is to get a lay of the land. I'm going to leverage my existing knowledge and experience, so let's use `codesearch-dir-index` to get a quick overview of how the filesystem interacts with our broader kernel code base. This search should help me rapidly identify key areas and potential integration points I should be aware of. I'm expecting to find references related to the inode management, the data structures used, and the low-level disk access. It's the standard first step - establish the current state.



133/4 2026/09/17 10:56 tool codesearch-dir-index
0m Args:
map[Dir:fs/ntfs3]

Results:
map[Files:[attrib.c attrlist.c bitfunc.c bitmap.c debug.h dir.c file.c frecord.c fslog.c fsntfs.c index.c inode.c lznt.c namei.c ntfs.h ntfs_fs.h record.c run.c super.c upcase.c xattr.c] Subdirs:[lib]]

134/4 2026/09/17 10:56 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 55186
							output: 28
							thoughts: 67
						

Thoughts:
Here's my take on this – a quick scan and assessment, as I see it.

**Quick NTFS File System Investigation**

Okay, so I need to dive into this. Based on what's been flagged, I'm thinking the likely culprit lies within the NTFS file system code. I'll need to double-check a few key functions: `ntfs_read_folio`, `ntfs_iomap_begin`, and the `iomap_read_inline_data` routines. Seems like a read operation issue somewhere. The question is, where exactly is the hiccup?

My first step is to locate those functions within the file system code, specifically within the `fs/ntfs3` directory. That will give me a point of departure, and I can start tracing through the execution flow to see where the problem is originating. From there, I can begin to assess how the data is being read and identify any potential bottlenecks or logical errors.



135/4 2026/09/17 10:57 tool grepper
0m Args:
map[Expression:read_folio PathPrefix:fs/ntfs3]

Results:
map[Output:fs/ntfs3/frecord.c=1896=static struct folio *ntfs_lock_new_page(struct address_space *mapping,
--
fs/ntfs3/frecord.c-1923-/*
fs/ntfs3/frecord.c:1924: * ni_read_folio_cmpr
fs/ntfs3/frecord.c-1925- *
--
fs/ntfs3/frecord.c-1928- */
fs/ntfs3/frecord.c:1929:int ni_read_folio_cmpr(struct ntfs_inode *ni, struct folio *folio)
fs/ntfs3/frecord.c-1930-{
--
fs/ntfs3/inode.c=813=static void ntfs_iomap_bio_submit_read(const struct iomap_iter *iter,
fs/ntfs3/inode.c:814:				       struct iomap_read_folio_ctx *ctx)
fs/ntfs3/inode.c-815-{
--
fs/ntfs3/inode.c=820=static const struct iomap_read_ops ntfs_iomap_bio_read_ops = {
fs/ntfs3/inode.c:821:	.read_folio_range	= iomap_bio_read_folio_range,
fs/ntfs3/inode.c-822-	.submit_read		= ntfs_iomap_bio_submit_read,
--
fs/ntfs3/inode.c-825-
fs/ntfs3/inode.c:826:static int ntfs_read_folio(struct file *file, struct folio *folio)
fs/ntfs3/inode.c-827-{
--
fs/ntfs3/inode.c-832-	loff_t vbo = folio_pos(folio);
fs/ntfs3/inode.c:833:	struct iomap_read_folio_ctx ctx = {
fs/ntfs3/inode.c-834-		.cur_folio = folio,
--
fs/ntfs3/inode.c-850-	if (is_compressed(ni)) {
fs/ntfs3/inode.c:851:		/* ni_lock is taken inside ni_read_folio_cmpr after page locks */
fs/ntfs3/inode.c:852:		err = ni_read_folio_cmpr(ni, folio);
fs/ntfs3/inode.c-853-		return err;
--
fs/ntfs3/inode.c-855-
fs/ntfs3/inode.c:856:	iomap_read_folio(&ntfs_iomap_ops, &ctx, NULL);
fs/ntfs3/inode.c-857-	return 0;
--
fs/ntfs3/inode.c=860=static void ntfs_readahead(struct readahead_control *rac)
--
fs/ntfs3/inode.c-864-	struct ntfs_inode *ni = ntfs_i(inode);
fs/ntfs3/inode.c:865:	struct iomap_read_folio_ctx ctx = {
fs/ntfs3/inode.c-866-		.ops = &ntfs_iomap_bio_read_ops,
--
fs/ntfs3/inode.c=883=int ntfs_set_size(struct inode *inode, u64 new_size)
--
fs/ntfs3/inode.c-929- * - iomap_fiemap
fs/ntfs3/inode.c:930: * - iomap_bio_read_folio
fs/ntfs3/inode.c-931- * - iomap_bio_readahead
--
fs/ntfs3/inode.c=2301=const struct address_space_operations ntfs_aops = {
fs/ntfs3/inode.c:2302:	.read_folio	= ntfs_read_folio,
fs/ntfs3/inode.c-2303-	.readahead	= ntfs_readahead,
--
fs/ntfs3/inode.c=2312=const struct address_space_operations ntfs_aops_cmpr = {
fs/ntfs3/inode.c:2313:	.read_folio	= ntfs_read_folio,
fs/ntfs3/inode.c-2314-	.dirty_folio	= iomap_dirty_folio,
--
fs/ntfs3/ntfs_fs.h=616=int ni_write_inode(struct inode *inode, int sync, const char *hint);
fs/ntfs3/ntfs_fs.h-617-#define _ni_write_inode(i, w) ni_write_inode(i, w, __func__)
fs/ntfs3/ntfs_fs.h:618:int ni_read_folio_cmpr(struct ntfs_inode *ni, struct folio *folio);
fs/ntfs3/ntfs_fs.h-619-int ni_decompress_file(struct ntfs_inode *ni);
]

136/4 2026/09/17 10:57 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 56795
							output: 37
							thoughts: 24
						

Thoughts:
Here's a summary of my thought process, as if I were the one thinking it:

**Diving into the NTFS Read Function**

Okay, time to get my hands dirty. Let's start by digging into the `ntfs_read_folio` function. I need to understand exactly how NTFS3 handles folio reads, specifically within the `fs/ntfs3/inode.c` context. I'm assuming there's some interesting logic here related to how the file system interacts with the underlying storage and caches data. I'm keen to see how the implementation deals with block sizes, extent mapping, and any potential optimizations they've put in place for read performance. Perhaps I'll find some insights that could be leveraged elsewhere, or maybe even identify some subtle issues that might be worth investigating more deeply. It's time to become intimate with the code.



137/4 2026/09/17 10:57 tool read-file
0m Args:
map[File:fs/ntfs3/inode.c FirstLine:825 LineCount:35]

Results:
map[Contents: 825:	
 826:	static int ntfs_read_folio(struct file *file, struct folio *folio)
 827:	{
 828:		int err;
 829:		struct address_space *mapping = folio->mapping;
 830:		struct inode *inode = mapping->host;
 831:		struct ntfs_inode *ni = ntfs_i(inode);
 832:		loff_t vbo = folio_pos(folio);
 833:		struct iomap_read_folio_ctx ctx = {
 834:			.cur_folio = folio,
 835:			.ops = &ntfs_iomap_bio_read_ops,
 836:		};
 837:	
 838:		if (unlikely(is_bad_ni(ni))) {
 839:			folio_unlock(folio);
 840:			return -EIO;
 841:		}
 842:	
 843:		if (ni->i_valid <= vbo) {
 844:			folio_zero_range(folio, 0, folio_size(folio));
 845:			folio_mark_uptodate(folio);
 846:			folio_unlock(folio);
 847:			return 0;
 848:		}
 849:	
 850:		if (is_compressed(ni)) {
 851:			/* ni_lock is taken inside ni_read_folio_cmpr after page locks */
 852:			err = ni_read_folio_cmpr(ni, folio);
 853:			return err;
 854:		}
 855:	
 856:		iomap_read_folio(&ntfs_iomap_ops, &ctx, NULL);
 857:		return 0;
 858:	}
 859:	
]

138/4 2026/09/17 10:57 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 57554
							output: 41
							thoughts: 27
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm already deep in kernel development and familiar with the NTFS3 filesystem:

**Diving into `ntfs_iomap_begin`**

Alright, time to get my hands dirty. I need to take a look at the `ntfs_iomap_begin` function. I know this is a core component for handling I/O mapping within the NTFS3 filesystem, and it's located right where it should be: `fs/ntfs3/inode.c`. I need to figure out how this function interacts with the rest of the file system and how it plays with data mapping. This is probably where the magic happens and I will need to delve into the details to understand it's role.



139/4 2026/09/17 10:57 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/inode.c Name:ntfs_iomap_begin]

Results:
map[SourceCode: 921:	/*
 922:	 * Function to get mapping vbo -> lbo.
 923:	 * used with:
 924:	 * - iomap_zero_range
 925:	 * - iomap_truncate_page
 926:	 * - iomap_dio_rw
 927:	 * - iomap_file_buffered_write
 928:	 * - iomap_bmap
 929:	 * - iomap_fiemap
 930:	 * - iomap_bio_read_folio
 931:	 * - iomap_bio_readahead
 932:	 */
 933:	static int ntfs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
 934:				    unsigned int flags, struct iomap *iomap,
 935:				    struct iomap *srcmap)
 936:	{
 937:		struct ntfs_inode *ni = ntfs_i(inode);
 938:		struct ntfs_sb_info *sbi = ni->mi.sbi;
 939:		u8 cluster_bits = sbi->cluster_bits;
 940:		CLST vcn = offset >> cluster_bits;
 941:		u32 off = offset & sbi->cluster_mask;
 942:		bool rw = flags & IOMAP_WRITE;
 943:		loff_t endbyte = offset + length;
 944:		void *res = NULL;
 945:		int err;
 946:		CLST lcn, clen, clen_max = 1;
 947:		bool new_clst = false;
 948:		bool no_da;
 949:		bool zero = false;
 950:		if (unlikely(ntfs3_forced_shutdown(sbi->sb)))
 951:			return -EIO;
 952:	
 953:		if (flags & IOMAP_REPORT) {
 954:			if (offset > ntfs_get_maxbytes(ni)) {
 955:				/* called from fiemap/bmap. */
 956:				return -EINVAL;
 957:			}
 958:	
 959:			if (offset >= inode->i_size) {
 960:				/* special code for report. */
 961:				return -ENOENT;
 962:			}
 963:		}
 964:	
 965:		if (IOMAP_ZERO == flags && (endbyte & sbi->cluster_mask)) {
 966:			rw = true;
 967:		} else if (rw) {
 968:			clen_max = bytes_to_cluster(sbi, endbyte) - vcn;
 969:		}
 970:	
 971:		/*
 972:		 * Force to allocate clusters if directIO(write) or writeback_range.
 973:		 * NOTE: attr_data_get_block allocates clusters only for sparse file.
 974:		 * Normal file allocates clusters in attr_set_size.
 975:		*/
 976:		no_da = flags == (IOMAP_DIRECT | IOMAP_WRITE) || srcmap == WB_NO_DA;
 977:	
 978:		err = attr_data_get_block(ni, vcn, clen_max, &lcn, &clen,
 979:					  rw ? &new_clst : NULL, zero, &res, no_da);
 980:	
 981:		if (err) {
 982:			return err;
 983:		}
 984:	
 985:		if (lcn == EOF_LCN) {
 986:			/* request out of file. */
 987:			if (flags & IOMAP_REPORT) {
 988:				/* special code for report. */
 989:				return -ENOENT;
 990:			}
 991:	
 992:			if (rw) {
 993:				/* should never be here. */
 994:				return -EINVAL;
 995:			}
 996:			lcn = SPARSE_LCN;
 997:		}
 998:	
 999:		iomap->flags = new_clst ? IOMAP_F_NEW : 0;
1000:	
1001:		if (lcn == RESIDENT_LCN) {
1002:			if (offset >= clen) {
1003:				if (res)
1004:					__free_page(virt_to_page(res));
1005:				if (flags & IOMAP_REPORT) {
1006:					/* special code for report. */
1007:					return -ENOENT;
1008:				}
1009:				return -EFAULT;
1010:			}
1011:	
1012:			iomap->private = iomap->inline_data = res;
1013:			iomap->type = IOMAP_INLINE;
1014:			iomap->offset = 0;
1015:			iomap->length = clen; /* resident size in bytes. */
1016:			return 0;
1017:		}
1018:	
1019:		if (!clen) {
1020:			/* broken file? */
1021:			return -EINVAL;
1022:		}
1023:	
1024:		iomap->bdev = inode->i_sb->s_bdev;
1025:		iomap->offset = offset;
1026:		iomap->length = ((loff_t)clen << cluster_bits) - off;
1027:	
1028:		if (lcn == COMPRESSED_LCN) {
1029:			/* should never be here. */
1030:			return -EOPNOTSUPP;
1031:		}
1032:	
1033:		if (lcn == DELALLOC_LCN) {
1034:			iomap->type = IOMAP_DELALLOC;
1035:			iomap->addr = IOMAP_NULL_ADDR;
1036:		} else {
1037:			/* Translate clusters into bytes. */
1038:			iomap->addr = ((loff_t)lcn << cluster_bits) + off;
1039:			if (length && iomap->length > length)
1040:				iomap->length = length;
1041:			else
1042:				endbyte = offset + iomap->length;
1043:	
1044:			if (lcn == SPARSE_LCN) {
1045:				iomap->addr = IOMAP_NULL_ADDR;
1046:				iomap->type = IOMAP_HOLE;
1047:				//			if (IOMAP_ZERO == flags && !off) {
1048:				//				iomap->length = (endbyte - offset) &
1049:				//						sbi->cluster_mask_inv;
1050:				//			}
1051:			} else if (endbyte <= ni->i_valid) {
1052:				iomap->type = IOMAP_MAPPED;
1053:			} else if (offset < ni->i_valid) {
1054:				iomap->type = IOMAP_MAPPED;
1055:				if (flags & IOMAP_REPORT)
1056:					iomap->length = ni->i_valid - offset;
1057:			} else if (rw || (flags & IOMAP_ZERO)) {
1058:				iomap->type = IOMAP_MAPPED;
1059:			} else {
1060:				iomap->type = IOMAP_UNWRITTEN;
1061:			}
1062:		}
1063:	
1064:		if ((flags & IOMAP_ZERO) &&
1065:		    (iomap->type == IOMAP_MAPPED || iomap->type == IOMAP_DELALLOC)) {
1066:			/* Avoid too large requests. */
1067:			u32 tail;
1068:			u32 off_a = offset & (PAGE_SIZE - 1);
1069:			if (off_a)
1070:				tail = PAGE_SIZE - off_a;
1071:			else
1072:				tail = PAGE_SIZE;
1073:	
1074:			if (iomap->length > tail)
1075:				iomap->length = tail;
1076:		}
1077:	
1078:		return 0;
1079:	}
 SourceFile:fs/ntfs3/inode.c]

140/4 2026/09/17 10:57 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 60223
							output: 34
							thoughts: 208
						

Thoughts:
**Analyzing NTFS Inline Data Handling**

Okay, let's break this down. I'm looking at the `ntfs_iomap_begin` function first. Specifically, I'm examining the scenario where `lcn` (logical cluster number) is equal to `RESIDENT_LCN`. This tells me we're dealing with inline data – data stored directly within the file's metadata.

The first check is crucial: `if (offset >= clen)`. If the requested `offset` into the data is beyond the resident `clen` (content length, in bytes), we have a problem. If we have a `res` variable, meaning resident data, we free the associated page. Then, the logic splits.  If the call has `IOMAP_REPORT` set, it's an error report. We return `-ENOENT`. Otherwise, we return `-EFAULT` because this means data requested exceeds what is resident.

If that check passes, we're in the happy path of accessing the inline data. The function sets `iomap->private` and `iomap->inline_data` to `res`. This means we're pointing to the resident data. The iomap's `type` is set to `IOMAP_INLINE`, and the offset and length are also set to correctly describe the inline data.  This seems straightforward – we're essentially creating a data descriptor for the inline data.

Now, I need to see how that inline data is actually read. That means turning to `iomap_read_inline_data` in `fs/iomap/buffered-io.c`. I expect to see how this `iomap` structure is used to retrieve the data. This will be the key to understanding how inline data is handled in the buffered I/O path.



141/4 2026/09/17 10:58 tool grepper
0m Args:
map[Expression:iomap_read_inline_data PathPrefix:fs/iomap]

Results:
map[Output:fs/iomap/buffered-io.c=382=static inline bool iomap_block_needs_zeroing(const struct iomap_iter *iter,
--
fs/iomap/buffered-io.c-409-/**
fs/iomap/buffered-io.c:410: * iomap_read_inline_data - copy inline data into the page cache
fs/iomap/buffered-io.c-411- * @iter: iteration structure
--
fs/iomap/buffered-io.c-417- */
fs/iomap/buffered-io.c:418:static int iomap_read_inline_data(const struct iomap_iter *iter,
fs/iomap/buffered-io.c-419-		struct folio *folio)
--
fs/iomap/buffered-io.c=557=static int iomap_read_folio_iter(struct iomap_iter *iter,
--
fs/iomap/buffered-io.c-570-	if (iomap->type == IOMAP_INLINE) {
fs/iomap/buffered-io.c:571:		ret = iomap_read_inline_data(iter, folio);
fs/iomap/buffered-io.c-572-		if (ret)
--
fs/iomap/buffered-io.c=1019=static int iomap_write_begin_inline(const struct iomap_iter *iter,
--
fs/iomap/buffered-io.c-1024-		return -EIO;
fs/iomap/buffered-io.c:1025:	return iomap_read_inline_data(iter, folio);
fs/iomap/buffered-io.c-1026-}
]

142/4 2026/09/17 10:58 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 61320
							output: 44
							thoughts: 15
						

Thoughts:
Okay, let's dive into `iomap_read_inline_data`. This function's name alone hints at a key optimization related to how we handle data directly within the inode or file system metadata, specifically during a read operation. It's about pulling data "inline," as opposed to having to fetch it from a separate block on disk. This likely means we're dealing with small files or very fragmented files where the data is small enough to fit within the inode itself or a closely associated data structure.

I need to understand the conditions triggering this path. When do we *choose* to read data in this way? What's the criteria? Is it file size, fragmentation, specific flags set on the inode, or perhaps a combination of these factors? I suspect there are thresholds involved.

Next, I'll need to look at what data structures are accessed and how they are handled. Is the data copied directly to the user's buffer, or are there intermediate buffers involved? Are we bypassing the standard page cache here or still using it in some fashion? I'll have to see if there's any cache invalidation or update logic.

I need to scrutinize any error handling. What happens if the data is corrupted or if there's a problem accessing the metadata? Does it fall back to a slower, more general read path? Are there any security considerations or potential race conditions that need careful examination, especially with concurrent reads?

Finally, how does this interact with other file system features? What about extended attributes or ACLs? Are there any performance implications when the "inline" data grows too large, requiring the file system to shift to a different data placement strategy? I'm expecting this to be an optimization for small files, but I need to fully understand its impact. Let's start reading...



143/4 2026/09/17 10:58 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/iomap/buffered-io.c Name:iomap_read_inline_data]

Results:
map[SourceCode: 409:	/**
 410:	 * iomap_read_inline_data - copy inline data into the page cache
 411:	 * @iter: iteration structure
 412:	 * @folio: folio to copy to
 413:	 *
 414:	 * Copy the inline data in @iter into @folio and zero out the rest of the folio.
 415:	 * Only a single IOMAP_INLINE extent is allowed at the end of each file.
 416:	 * Returns zero for success to complete the read, or the usual negative errno.
 417:	 */
 418:	static int iomap_read_inline_data(const struct iomap_iter *iter,
 419:			struct folio *folio)
 420:	{
 421:		const struct iomap *iomap = iomap_iter_srcmap(iter);
 422:		size_t size = i_size_read(iter->inode) - iomap->offset;
 423:		size_t offset = offset_in_folio(folio, iomap->offset);
 424:	
 425:		if (WARN_ON_ONCE(!iomap->inline_data))
 426:			return -EIO;
 427:	
 428:		if (folio_test_uptodate(folio))
 429:			return 0;
 430:	
 431:		if (WARN_ON_ONCE(size > iomap->length)) {
 432:			fserror_report_io(iter->inode, FSERR_BUFFERED_READ,
 433:					  iomap->offset, size, -EIO, GFP_NOFS);
 434:			return -EIO;
 435:		}
 436:		if (offset > 0)
 437:			ifs_alloc(iter->inode, folio, iter->flags);
 438:	
 439:		folio_fill_tail(folio, offset, iomap->inline_data, size);
 440:		iomap_set_range_uptodate(folio, offset, folio_size(folio) - offset);
 441:		return 0;
 442:	}
 SourceFile:fs/iomap/buffered-io.c]

144/4 2026/09/17 10:58 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 62380
							output: 34
							thoughts: 729
						

Thoughts:
**Analyzing a Potential Race Condition in NTFS File Extension**

Okay, so this is an interesting one. It appears we've got a potential race condition when extending an NTFS file's size in `ntfs_setattr`. The core issue, as I understand it, stems from the order of operations: `truncate_setsize` is called *before* the on-disk size is updated via `ntfs_set_size`. This timing opens a window for a concurrent page fault to cause a read of stale data.

Let me break down my understanding. `iomap_read_inline_data` is being called, and it's detecting an inconsistency: the file size reported by the inode (`i_size_read`) is greater than the expected inline data length. This discrepancy triggers a warning. The sequence is as follows: `truncate_setsize` increases the inode's `i_size`. A concurrent page fault then occurs, triggering a read that, via the iomap logic, checks the inline data. Because the on-disk size hasn't been updated yet via `ntfs_set_size`, we read the *old* value, resulting in `iomap->length` being smaller than the updated `i_size`.

The crucial question is, of course, whether the existing order of operations in `ntfs_setattr` is correct. The warning hints that it might not be, and the comparison to ext4 and xfs confirms this suspicion. Those filesystems either allocate blocks or update the on-disk size *before* calling `truncate_setsize`, or they use a lock to prevent concurrent reads. This suggests that the current NTFS approach is vulnerable.

Now, my line of inquiry is clear: First, I need to get a really good handle on what `truncate_setsize` actually does, and specifically, what the expected sequence of actions should be when extending (and shrinking) file size. I also need to find out *how* file size operations are supposed to be protected in general. The question explicitly mentions locking. That requires me to understand what locks are held during `setattr` and page faulting. I need to understand what locks `filemap_fault` takes, and whether that is relevant here.

The potential solutions are:

1.  **Reorder `truncate_setsize` and `ntfs_set_size`**: The simplest fix might be to call `ntfs_set_size` *before* `truncate_setsize`, ensuring the on-disk size is updated before the inode's `i_size` is increased. This is the simplest fix, but I need to make sure this doesn't create other issues.
2.  **Add a Lock**: Add a lock around the operations in `ntfs_setattr` to prevent concurrent reads during the file size extension. This is more robust, but introduces more overhead.
3.  **Refactor the Logic**: The underlying issue seems related to how we handle inline data and IOMAP in the context of file extension. Maybe the process of calling these methods can be reworked.

I need to dig into the relevant code, specifically the `filemap_fault` function, to confirm the locking assumptions and understand if there's an existing mechanism to prevent this race condition.



145/4 2026/09/17 10:59 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/filemap.c Name:filemap_fault]

Results:
map[SourceCode:3532:	/**
3533:	 * filemap_fault - read in file data for page fault handling
3534:	 * @vmf:	struct vm_fault containing details of the fault
3535:	 *
3536:	 * filemap_fault() is invoked via the vma operations vector for a
3537:	 * mapped memory region to read in file data during a page fault.
3538:	 *
3539:	 * The goto's are kind of ugly, but this streamlines the normal case of having
3540:	 * it in the page cache, and handles the special cases reasonably without
3541:	 * having a lot of duplicated code.
3542:	 *
3543:	 * vma->vm_mm->mmap_lock must be held on entry.
3544:	 *
3545:	 * If our return value has VM_FAULT_RETRY set, it's because the mmap_lock
3546:	 * may be dropped before doing I/O or by lock_folio_maybe_drop_mmap().
3547:	 *
3548:	 * If our return value does not have VM_FAULT_RETRY set, the mmap_lock
3549:	 * has not been released.
3550:	 *
3551:	 * We never return with VM_FAULT_RETRY and a bit from VM_FAULT_ERROR set.
3552:	 *
3553:	 * Return: bitwise-OR of %VM_FAULT_ codes.
3554:	 */
3555:	vm_fault_t filemap_fault(struct vm_fault *vmf)
3556:	{
3557:		int error;
3558:		struct file *file = vmf->vma->vm_file;
3559:		struct file *fpin = NULL;
3560:		struct address_space *mapping = file->f_mapping;
3561:		struct inode *inode = mapping->host;
3562:		pgoff_t max_idx, index = vmf->pgoff;
3563:		struct folio *folio;
3564:		vm_fault_t ret = 0;
3565:		bool mapping_locked = false;
3566:	
3567:		max_idx = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
3568:		if (unlikely(index >= max_idx))
3569:			return VM_FAULT_SIGBUS;
3570:	
3571:		trace_mm_filemap_fault(mapping, index);
3572:	
3573:		/*
3574:		 * Do we have something in the page cache already?
3575:		 */
3576:		folio = filemap_get_folio(mapping, index);
3577:		if (likely(!IS_ERR(folio))) {
3578:			/*
3579:			 * We found the page, so try async readahead before waiting for
3580:			 * the lock.
3581:			 */
3582:			if (!(vmf->flags & FAULT_FLAG_TRIED))
3583:				fpin = do_async_mmap_readahead(vmf, folio);
3584:			if (unlikely(!folio_test_uptodate(folio))) {
3585:				filemap_invalidate_lock_shared(mapping);
3586:				mapping_locked = true;
3587:			}
3588:		} else {
3589:			ret = filemap_fault_recheck_pte_none(vmf);
3590:			if (unlikely(ret))
3591:				return ret;
3592:	
3593:			/* No page in the page cache at all */
3594:			count_vm_event(PGMAJFAULT);
3595:			count_memcg_event_mm(vmf->vma->vm_mm, PGMAJFAULT);
3596:			ret = VM_FAULT_MAJOR;
3597:			fpin = do_sync_mmap_readahead(vmf);
3598:	retry_find:
3599:			/*
3600:			 * See comment in filemap_create_folio() why we need
3601:			 * invalidate_lock
3602:			 */
3603:			if (!mapping_locked) {
3604:				filemap_invalidate_lock_shared(mapping);
3605:				mapping_locked = true;
3606:			}
3607:			folio = __filemap_get_folio(mapping, index,
3608:						  FGP_CREAT|FGP_FOR_MMAP,
3609:						  vmf->gfp_mask);
3610:			if (IS_ERR(folio)) {
3611:				if (fpin)
3612:					goto out_retry;
3613:				filemap_invalidate_unlock_shared(mapping);
3614:				return VM_FAULT_OOM;
3615:			}
3616:		}
3617:	
3618:		if (!lock_folio_maybe_drop_mmap(vmf, folio, &fpin))
3619:			goto out_retry;
3620:	
3621:		/* Did it get truncated? */
3622:		if (unlikely(folio->mapping != mapping)) {
3623:			folio_unlock(folio);
3624:			folio_put(folio);
3625:			goto retry_find;
3626:		}
3627:		VM_BUG_ON_FOLIO(!folio_contains(folio, index), folio);
3628:	
3629:		/*
3630:		 * We have a locked folio in the page cache, now we need to check
3631:		 * that it's up-to-date. If not, it is going to be due to an error,
3632:		 * or because readahead was otherwise unable to retrieve it.
3633:		 */
3634:		if (unlikely(!folio_test_uptodate(folio))) {
3635:			/*
3636:			 * If the invalidate lock is not held, the folio was in cache
3637:			 * and uptodate and now it is not. Strange but possible since we
3638:			 * didn't hold the page lock all the time. Let's drop
3639:			 * everything, get the invalidate lock and try again.
3640:			 */
3641:			if (!mapping_locked) {
3642:				folio_unlock(folio);
3643:				folio_put(folio);
3644:				goto retry_find;
3645:			}
3646:	
3647:			/*
3648:			 * OK, the folio is really not uptodate. This can be because the
3649:			 * VMA has the VM_RAND_READ flag set, or because an error
3650:			 * arose. Let's read it in directly.
3651:			 */
3652:			goto page_not_uptodate;
3653:		}
3654:	
3655:		/*
3656:		 * We've made it this far and we had to drop our mmap_lock, now is the
3657:		 * time to return to the upper layer and have it re-find the vma and
3658:		 * redo the fault.
3659:		 */
3660:		if (fpin) {
3661:			folio_unlock(folio);
3662:			goto out_retry;
3663:		}
3664:		if (mapping_locked)
3665:			filemap_invalidate_unlock_shared(mapping);
3666:	
3667:		/*
3668:		 * Found the page and have a reference on it.
3669:		 * We must recheck i_size under page lock.
3670:		 */
3671:		max_idx = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
3672:		if (unlikely(index >= max_idx)) {
3673:			folio_unlock(folio);
3674:			folio_put(folio);
3675:			return VM_FAULT_SIGBUS;
3676:		}
3677:	
3678:		vmf->page = folio_file_page(folio, index);
3679:		return ret | VM_FAULT_LOCKED;
3680:	
3681:	page_not_uptodate:
3682:		/*
3683:		 * Umm, take care of errors if the page isn't up-to-date.
3684:		 * Try to re-read it _once_. We do this synchronously,
3685:		 * because there really aren't any performance issues here
3686:		 * and we need to check for errors.
3687:		 */
3688:		fpin = maybe_unlock_mmap_for_io(vmf, fpin);
3689:		error = filemap_read_folio(file, mapping->a_ops->read_folio, folio);
3690:		if (fpin)
3691:			goto out_retry;
3692:		folio_put(folio);
3693:	
3694:		if (!error || error == AOP_TRUNCATED_PAGE)
3695:			goto retry_find;
3696:		filemap_invalidate_unlock_shared(mapping);
3697:	
3698:		return VM_FAULT_SIGBUS;
3699:	
3700:	out_retry:
3701:		/*
3702:		 * We dropped the mmap_lock, we need to return to the fault handler to
3703:		 * re-find the vma and come back and find our hopefully still populated
3704:		 * page.
3705:		 */
3706:		if (!IS_ERR(folio))
3707:			folio_put(folio);
3708:		if (mapping_locked)
3709:			filemap_invalidate_unlock_shared(mapping);
3710:		if (fpin)
3711:			fput(fpin);
3712:		return ret | VM_FAULT_RETRY;
3713:	}
 SourceFile:mm/filemap.c]

146/4 2026/09/17 10:59 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 66624
							output: 30
							thoughts: 297
						

Thoughts:
**Analyzing `filemap_fault` and Invalidation Locks**

Okay, let's dive into this `filemap_fault` function. I see it handles situations where a folio isn't in the page cache or is out-of-date. Specifically, I'm focusing on this bit where `!mapping_locked` triggers `filemap_invalidate_lock_shared(mapping)`. That's a key observation.

Now, looking at `page_not_uptodate`, it seems that `mapping_locked` becomes `TRUE` by the time `filemap_read_folio` is called. That makes sense, because `filemap_invalidate_lock_shared(mapping)` is held while calling `read_folio` during the fault handling process. So, `filemap_read_folio` is protected by the shared lock. Good, good.

But wait a minute... what about `filemap_invalidate_lock(mapping)`? I'm thinking about its use in `setattr`. If someone calls `filemap_invalidate_lock(mapping)` in `setattr`, doesn't that mean `filemap_fault` will block on `filemap_invalidate_lock_shared(mapping)`? Yes, it seems so. This potential for contention is a critical point to consider.

Now, the question is, does `filemap_invalidate_lock` also cover truncate or extension operations? That's what I need to understand completely. The locking implications are potentially quite broad. I'll need to dig into the documentation and see how `filemap_invalidate_lock` is *actually* used. Comments, specifically, are what I need to be searching for.



147/4 2026/09/17 10:59 tool grepper
0m Args:
map[Expression:invalidate_lock PathPrefix:include/linux/fs.h]

Results:
map[Output:include/linux/fs.h=446=struct mapping_metadata_bhs {
--
include/linux/fs.h-455- * @i_pages: Cached pages.
include/linux/fs.h:456: * @invalidate_lock: Guards coherency between page cache contents and
include/linux/fs.h-457- *   file offset->disk block mappings in the filesystem during invalidates.
--
include/linux/fs.h=471=struct address_space {
--
include/linux/fs.h-473-	struct xarray		i_pages;
include/linux/fs.h:474:	struct rw_semaphore	invalidate_lock;
include/linux/fs.h-475-	gfp_t			gfp_mask;
--
include/linux/fs.h=1072=static inline void inode_lock_shared_nested(struct inode *inode, unsigned subclass)
--
include/linux/fs.h-1076-
include/linux/fs.h:1077:static inline void filemap_invalidate_lock(struct address_space *mapping)
include/linux/fs.h-1078-{
include/linux/fs.h:1079:	down_write(&mapping->invalidate_lock);
include/linux/fs.h-1080-}
--
include/linux/fs.h=1082=static inline void filemap_invalidate_unlock(struct address_space *mapping)
include/linux/fs.h-1083-{
include/linux/fs.h:1084:	up_write(&mapping->invalidate_lock);
include/linux/fs.h-1085-}
include/linux/fs.h-1086-
include/linux/fs.h:1087:static inline void filemap_invalidate_lock_shared(struct address_space *mapping)
include/linux/fs.h-1088-{
include/linux/fs.h:1089:	down_read(&mapping->invalidate_lock);
include/linux/fs.h-1090-}
--
include/linux/fs.h=1092=static inline int filemap_invalidate_trylock_shared(
--
include/linux/fs.h-1094-{
include/linux/fs.h:1095:	return down_read_trylock(&mapping->invalidate_lock);
include/linux/fs.h-1096-}
--
include/linux/fs.h=1098=static inline void filemap_invalidate_unlock_shared(
--
include/linux/fs.h-1100-{
include/linux/fs.h:1101:	up_read(&mapping->invalidate_lock);
include/linux/fs.h-1102-}
--
include/linux/fs.h=1105=void unlock_two_nondirectories(struct inode *, struct inode*);
include/linux/fs.h-1106-
include/linux/fs.h:1107:void filemap_invalidate_lock_two(struct address_space *mapping1,
include/linux/fs.h-1108-				 struct address_space *mapping2);
--
include/linux/fs.h=2285=struct file_system_type {
--
include/linux/fs.h-2313-	struct lock_class_key i_mutex_key;
include/linux/fs.h:2314:	struct lock_class_key invalidate_lock_key;
include/linux/fs.h-2315-	struct lock_class_key i_mutex_dir_key;
]

148/4 2026/09/17 10:59 llm codeexpert-compressor
0m Model:
gemini-3.8-flash

Reply:
### Workspace & Investigation State Summary

#### 1. Core Problem Statement & Context
- **Issue**: In `fs/ntfs3/file.c` within `ntfs_setattr`, when extending file size (`newsize > oldsize`), `truncate_setsize(inode, newsize)` is invoked *before* `ntfs_set_size(inode, newsize)`.
- `truncate_setsize()` updates `inode->i_size` immediately via `i_size_write(inode, newsize)`.
- A concurrent page fault path (`ntfs_read_folio` -> `iomap_read_folio` -> `ntfs_iomap_begin`) reads the old resident attribute size from disk metadata (e.g. 5 bytes) because `ntfs_set_size` has not yet updated it, setting `iomap->length = 5` and `iomap->offset = 0`.
- Subsequently, `iomap_read_inline_data` evaluates `size = i_size_read(iter->inode) - iomap->offset` which reads the newly updated `i_size` (20 bytes).
- This results in `size > iomap->length` (20 > 5), triggering the kernel warning:
  `WARN_ON_ONCE(size > iomap->length)`.
- **Questions Asked**:
  1. Is it correct to call `truncate_setsize` before `ntfs_set_size` when extending the file size?
  2. In ext4 and xfs, how do they order size updates and locking to prevent concurrent reads/faults from observing intermediate states?
  3. How should this be fixed in `ntfs_setattr`?

---

#### 2. Code Snippets & Key Findings

##### A. `fs/ntfs3/file.c`: `ntfs_setattr()` (lines 726-752)
```c
if (ia_valid & ATTR_SIZE) {
	loff_t newsize, oldsize;

	if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
		/* Should never be here, see ntfs_file_open(). */
		err = -EOPNOTSUPP;
		goto out;
	}
	inode_dio_wait(inode);
	oldsize = i_size_read(inode);
	newsize = attr->ia_size;

	if (newsize != oldsize) {
		truncate_setsize(inode, newsize);

		err = ntfs_set_size(inode, newsize);
		if (err) {
			i_size_write(inode, oldsize);
			goto out;
		}

		ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
		ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
		inode_set_mtime_to_ts(inode,
				      inode_set_ctime_current(inode));
	}
}
```

##### B. `fs/ntfs3/inode.c`: `ntfs_set_size()` (lines 883-915)
```c
int ntfs_set_size(struct inode *inode, u64 new_size)
{
	struct super_block *sb = inode->i_sb;
	struct ntfs_sb_info *sbi = sb->s_fs_info;
	struct ntfs_inode *ni = ntfs_i(inode);
	int err;

	/* Check for maximum file size. */
	if (is_sparsed(ni) || is_compressed(ni)) {
		if (new_size > sbi->maxbytes_sparse) {
			return -EFBIG;
		}
	} else if (new_size > sbi->maxbytes) {
		return -EFBIG;
	}

	/* Mark rw ntfs as dirty. It will be cleared at umount. */
	ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);

	ni_lock(ni);
	down_write(&ni->file.run_lock);
	if (new_size < ni->i_valid)
		ni->i_valid = new_size;

	/* last 'true' means keep preallocated. */
	err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
			    &ni->file.run, new_size, &ni->i_valid, true);

	up_write(&ni->file.run_lock);
	ni_unlock(ni);

	return err;
}
```

##### C. `mm/truncate.c`: `truncate_setsize()` (lines 816-824)
```c
void truncate_setsize(struct inode *inode, loff_t newsize)
{
	loff_t oldsize = inode->i_size;

	i_size_write(inode, newsize);
	if (newsize > oldsize)
		pagecache_isize_extended(inode, oldsize, newsize);
	truncate_pagecache(inode, newsize);
}
```
*Note from comment:*
`Must be called with a lock serializing truncates and writes (generally i_rwsem but e.g. xfs uses a different lock) and before all filesystem specific block truncation has been performed.`

##### D. Reference Patterns from Other Filesystems

1. **`fs/ext4/inode.c` (`ext4_setattr`)**:
   - Holds `filemap_invalidate_lock(inode->i_mapping)`.
   - If shrinking (`shrink`): waits for DIO, takes `down_write(&EXT4_I(inode)->i_data_sem)`, updates disk size and `i_size_write(inode, attr->ia_size)`.
   - If extending (`!shrink`): calls `ext4_block_zero_eof()`, updates disk size and `i_size_write()`, calls `pagecache_isize_extended(inode, oldsize, inode->i_size)`, then `truncate_pagecache(inode, inode->i_size)`.
   - In both cases, pagecache invalidation / faults are blocked by `filemap_invalidate_lock()`, and `i_size` is only written when `i_disksize` is safely updated under locks.

2. **`fs/xfs/xfs_iops.c` (`xfs_vn_setattr` / `xfs_vn_setattr_size`)**:
   - Acquires `xfs_ilock(ip, XFS_MMAPLOCK_EXCL)` in `xfs_vn_setattr()` before calling `xfs_vn_setattr_size()`.
   - Serializes out any concurrent faults (`filemap_fault` / mmap faults take `MMAPLOCK_SHARED` or `filemap_invalidate_lock_shared`).
   - Does zeroing of range on extension (`xfs_zero_range`), then calls `truncate_setsize(inode, newsize)`, writes on-disk metadata (`ip->i_disk_size = newsize`), commits transaction, and finally unlocks `XFS_MMAPLOCK_EXCL`.

3. **`fs/ntfs/file.c` (`ntfs_setattr_size`)**:
   - Explicitly serializes:
     ```c
     filemap_invalidate_lock(vi->i_mapping);
     if (attr->ia_size > old_size) {
         truncate_pagecache(vi, old_size);
         i_size_write(vi, attr->ia_size);
         pagecache_isize_extended(vi, old_size, attr->ia_size);
     } else {
         truncate_setsize(vi, attr->ia_size);
     }
     err = ntfs_truncate_vfs(vi, attr->ia_size, old_size);
     if (err)
         i_size_write(vi, old_size);
     filemap_invalidate_unlock(vi->i_mapping);
     ```

4. **`fs/ntfs3/file.c` (`ntfs_fallocate`)**:
   - Already uses `filemap_invalidate_lock(mapping)` for punch/collapse/insert range operations to serialize page faults and page cache operations.

---

#### 3. Investigation Approaches & Dead-Ends
- Grepped `truncate_setsize` across `fs/ext4` (found no direct calls; ext4 manually open-codes `i_size_write`, `pagecache_isize_extended`, and `truncate_pagecache` protected by `filemap_invalidate_lock` and `i_data_sem`).
- Grepped and reviewed `truncate_setsize` in `fs/xfs` (found `xfs_vn_setattr_size` uses `truncate_setsize`, protected by `XFS_MMAPLOCK_EXCL` which serializes page faults).
- Checked `filemap_invalidate_lock` usages across mm and fs:
  - `filemap_fault()` takes `filemap_invalidate_lock_shared(mapping)` when instantiating or checking non-uptodate folios.
  - `ntfs_setattr` currently does NOT take `filemap_invalidate_lock(inode->i_mapping)` around size modification.
- Checked commit `fd73f4a66598` on `fs/ntfs/file.c` (git blame revealed commit was simply a base commit / kernel release import; broad git-show dumped large diff of release tag - avoid full git-show on release tags).

---

#### 4. Hypotheses & Proposed Solutions to Evaluate

##### Why calling `truncate_setsize` before `ntfs_set_size` on file extension is problematic:
1. **Ordering issue**:
   - For truncation down (`newsize < oldsize`), `truncate_setsize()` is typically called before block freeing so that userspace cannot read past EOF or see unallocated blocks.
   - For file extension (`newsize > oldsize`), updating `i_size` in pagecache *before* metadata and disk allocation (or resident-to-nonresident transformation) causes concurrent readers/faults to observe inconsistent state where `i_size` > allocated size / attribute length.
2. **Missing Serialization / Locking**:
   - `i_rwsem` protects against concurrent writes/truncates, but `filemap_fault()` only takes `filemap_invalidate_lock_shared(inode->i_mapping)`. It does NOT hold `i_rwsem`.
   - Without `filemap_invalidate_lock(inode->i_mapping)` in `ntfs_setattr`, page faults can run concurrently with `ntfs_setattr`.
3. **Fix Strategy**:
   - **Option A (Ordering & Locking)**:
     - Wrap the size modification under `filemap_invalidate_lock(inode->i_mapping)` and `filemap_invalidate_unlock(inode->i_mapping)`.
     - When `newsize > oldsize`: call `ntfs_set_size(inode, newsize)` *first* to update the resident/nonresident attributes and allocate backing space. Once metadata is updated, update `i_size` via `truncate_setsize(inode, newsize)` (or `i_size_write` + `pagecache_isize_extended`).
     - When `newsize < oldsize`: `truncate_setsize(inode, newsize)` is called before `ntfs_set_size(inode, newsize)` to unmap/truncate page cache before deallocating clusters/shrinking attribute.
   - Check how other iomap-based filesystems structure this and verify exact error rollback handling if `ntfs_set_size` fails.

Tokens:
							input: 53502
							output: 2680
							thoughts: 0
						

149/4 2026/09/17 10:59 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 19713
							output: 37
							thoughts: 0
						

150/4 2026/09/17 10:59 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ext4/inode.c Name:ext4_setattr]

Results:
map[SourceCode:5985:	/*
5986:	 * ext4_setattr()
5987:	 *
5988:	 * Called from notify_change.
5989:	 *
5990:	 * We want to trap VFS attempts to truncate the file as soon as
5991:	 * possible.  In particular, we want to make sure that when the VFS
5992:	 * shrinks i_size, we put the inode on the orphan list and modify
5993:	 * i_disksize immediately, so that during the subsequent flushing of
5994:	 * dirty pages and freeing of disk blocks, we can guarantee that any
5995:	 * commit will leave the blocks being flushed in an unused state on
5996:	 * disk.  (On recovery, the inode will get truncated and the blocks will
5997:	 * be freed, so we have a strong guarantee that no future commit will
5998:	 * leave these blocks visible to the user.)
5999:	 *
6000:	 * Another thing we have to assure is that if we are in ordered mode
6001:	 * and inode is still attached to the committing transaction, we must
6002:	 * we start writeout of all the dirty pages which are being truncated.
6003:	 * This way we are sure that all the data written in the previous
6004:	 * transaction are already on disk (truncate waits for pages under
6005:	 * writeback).
6006:	 *
6007:	 * Called with inode->i_rwsem down.
6008:	 */
6009:	int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
6010:			 struct iattr *attr)
6011:	{
6012:		struct inode *inode = d_inode(dentry);
6013:		int error, rc = 0;
6014:		int orphan = 0;
6015:		const unsigned int ia_valid = attr->ia_valid;
6016:		bool inc_ivers = true;
6017:	
6018:		error = ext4_emergency_state(inode->i_sb);
6019:		if (unlikely(error))
6020:			return error;
6021:	
6022:		if (unlikely(IS_IMMUTABLE(inode)))
6023:			return -EPERM;
6024:	
6025:		if (unlikely(IS_APPEND(inode) &&
6026:			     (ia_valid & (ATTR_MODE | ATTR_UID |
6027:					  ATTR_GID | ATTR_TIMES_SET))))
6028:			return -EPERM;
6029:	
6030:		error = setattr_prepare(idmap, dentry, attr);
6031:		if (error)
6032:			return error;
6033:	
6034:		error = fscrypt_prepare_setattr(dentry, attr);
6035:		if (error)
6036:			return error;
6037:	
6038:		if (is_quota_modification(idmap, inode, attr)) {
6039:			error = dquot_initialize(inode);
6040:			if (error)
6041:				return error;
6042:		}
6043:	
6044:		if (i_uid_needs_update(idmap, attr, inode) ||
6045:		    i_gid_needs_update(idmap, attr, inode)) {
6046:			handle_t *handle;
6047:	
6048:			/* (user+group)*(old+new) structure, inode write (sb,
6049:			 * inode block, ? - but truncate inode update has it) */
6050:			handle = ext4_journal_start(inode, EXT4_HT_QUOTA,
6051:				(EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb) +
6052:				 EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb)) + 3);
6053:			if (IS_ERR(handle)) {
6054:				error = PTR_ERR(handle);
6055:				goto err_out;
6056:			}
6057:	
6058:			/* dquot_transfer() calls back ext4_get_inode_usage() which
6059:			 * counts xattr inode references.
6060:			 */
6061:			down_read(&EXT4_I(inode)->xattr_sem);
6062:			error = dquot_transfer(idmap, inode, attr);
6063:			up_read(&EXT4_I(inode)->xattr_sem);
6064:	
6065:			if (error) {
6066:				ext4_journal_stop(handle);
6067:				return error;
6068:			}
6069:			/* Update corresponding info in inode so that everything is in
6070:			 * one transaction */
6071:			i_uid_update(idmap, attr, inode);
6072:			i_gid_update(idmap, attr, inode);
6073:			error = ext4_mark_inode_dirty(handle, inode);
6074:			ext4_journal_stop(handle);
6075:			if (unlikely(error)) {
6076:				return error;
6077:			}
6078:		}
6079:	
6080:		if (attr->ia_valid & ATTR_SIZE) {
6081:			handle_t *handle;
6082:			loff_t oldsize = inode->i_size;
6083:			loff_t old_disksize;
6084:			int shrink = (attr->ia_size < inode->i_size);
6085:	
6086:			if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
6087:				struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
6088:	
6089:				if (attr->ia_size > sbi->s_bitmap_maxbytes) {
6090:					return -EFBIG;
6091:				}
6092:			}
6093:			if (!S_ISREG(inode->i_mode)) {
6094:				return -EINVAL;
6095:			}
6096:	
6097:			if (attr->ia_size == inode->i_size)
6098:				inc_ivers = false;
6099:	
6100:			/*
6101:			 * If file has inline data but new size exceeds inline capacity,
6102:			 * convert to extent-based storage first to prevent inconsistent
6103:			 * state (inline flag set but size exceeds inline capacity).
6104:			 */
6105:			if (ext4_has_inline_data(inode) &&
6106:			    attr->ia_size > EXT4_I(inode)->i_inline_size) {
6107:				error = ext4_convert_inline_data(inode);
6108:				if (error)
6109:					goto err_out;
6110:			}
6111:	
6112:			if (shrink) {
6113:				if (ext4_should_order_data(inode)) {
6114:					error = ext4_begin_ordered_truncate(inode,
6115:								    attr->ia_size);
6116:					if (error)
6117:						goto err_out;
6118:				}
6119:				/*
6120:				 * Blocks are going to be removed from the inode. Wait
6121:				 * for dio in flight.
6122:				 */
6123:				inode_dio_wait(inode);
6124:			}
6125:	
6126:			filemap_invalidate_lock(inode->i_mapping);
6127:	
6128:			rc = ext4_break_layouts(inode);
6129:			if (rc) {
6130:				filemap_invalidate_unlock(inode->i_mapping);
6131:				goto err_out;
6132:			}
6133:	
6134:			if (attr->ia_size != inode->i_size) {
6135:				/* attach jbd2 jinode for EOF folio tail zeroing */
6136:				if (attr->ia_size & (inode->i_sb->s_blocksize - 1) ||
6137:				    oldsize & (inode->i_sb->s_blocksize - 1)) {
6138:					error = ext4_inode_attach_jinode(inode);
6139:					if (error)
6140:						goto out_mmap_sem;
6141:				}
6142:	
6143:				/*
6144:				 * Update c/mtime and tail zero the EOF folio on
6145:				 * truncate up. ext4_truncate() handles the shrink case
6146:				 * below.
6147:				 */
6148:				if (!shrink) {
6149:					inode_set_mtime_to_ts(inode,
6150:							      inode_set_ctime_current(inode));
6151:					if (oldsize & (inode->i_sb->s_blocksize - 1)) {
6152:						error = ext4_block_zero_eof(inode,
6153:								oldsize, LLONG_MAX);
6154:						if (error)
6155:							goto out_mmap_sem;
6156:					}
6157:				}
6158:	
6159:				handle = ext4_journal_start(inode, EXT4_HT_INODE, 3);
6160:				if (IS_ERR(handle)) {
6161:					error = PTR_ERR(handle);
6162:					goto out_mmap_sem;
6163:				}
6164:				if (ext4_handle_valid(handle) && shrink) {
6165:					error = ext4_orphan_add(handle, inode);
6166:					orphan = 1;
6167:				}
6168:	
6169:				if (shrink)
6170:					ext4_fc_track_range(handle, inode,
6171:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6172:						inode->i_sb->s_blocksize_bits,
6173:						EXT_MAX_BLOCKS - 1);
6174:				else
6175:					ext4_fc_track_range(
6176:						handle, inode,
6177:						(oldsize > 0 ? oldsize - 1 : oldsize) >>
6178:						inode->i_sb->s_blocksize_bits,
6179:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6180:						inode->i_sb->s_blocksize_bits);
6181:	
6182:				down_write(&EXT4_I(inode)->i_data_sem);
6183:				old_disksize = EXT4_I(inode)->i_disksize;
6184:				EXT4_I(inode)->i_disksize = attr->ia_size;
6185:	
6186:				/*
6187:				 * We have to update i_size under i_data_sem together
6188:				 * with i_disksize to avoid races with writeback code
6189:				 * running ext4_wb_update_i_disksize().
6190:				 */
6191:				if (!error)
6192:					i_size_write(inode, attr->ia_size);
6193:				else
6194:					EXT4_I(inode)->i_disksize = old_disksize;
6195:				up_write(&EXT4_I(inode)->i_data_sem);
6196:				rc = ext4_mark_inode_dirty(handle, inode);
6197:				if (!error)
6198:					error = rc;
6199:				ext4_journal_stop(handle);
6200:				if (error)
6201:					goto out_mmap_sem;
6202:				if (!shrink) {
6203:					pagecache_isize_extended(inode, oldsize,
6204:								 inode->i_size);
6205:				} else if (ext4_should_journal_data(inode)) {
6206:					ext4_wait_for_tail_page_commit(inode);
6207:				}
6208:			}
6209:	
6210:			/*
6211:			 * Truncate pagecache after we've waited for commit
6212:			 * in data=journal mode to make pages freeable.
6213:			 */
6214:			truncate_pagecache(inode, inode->i_size);
6215:			/*
6216:			 * Call ext4_truncate() even if i_size didn't change to
6217:			 * truncate possible preallocated blocks.
6218:			 */
6219:			if (attr->ia_size <= oldsize) {
6220:				rc = ext4_truncate(inode);
6221:				if (rc)
6222:					error = rc;
6223:			}
6224:	out_mmap_sem:
6225:			filemap_invalidate_unlock(inode->i_mapping);
6226:		}
6227:	
6228:		if (!error) {
6229:			if (inc_ivers)
6230:				inode_inc_iversion(inode);
6231:			setattr_copy(idmap, inode, attr);
6232:			mark_inode_dirty(inode);
6233:		}
6234:	
6235:		/*
6236:		 * If the call to ext4_truncate failed to get a transaction handle at
6237:		 * all, we need to clean up the in-core orphan list manually.
6238:		 */
6239:		if (orphan && inode->i_nlink)
6240:			ext4_orphan_del(NULL, inode);
6241:	
6242:		if (!error && (ia_valid & ATTR_MODE))
6243:			rc = posix_acl_chmod(idmap, dentry, inode->i_mode);
6244:	
6245:	err_out:
6246:		if  (error)
6247:			ext4_std_error(inode->i_sb, error);
6248:		if (!error)
6249:			error = rc;
6250:		return error;
6251:	}
 SourceFile:fs/ext4/inode.c]

151/4 2026/09/17 10:59 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 23819
							output: 45
							thoughts: 0
						

152/4 2026/09/17 11:00 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/xfs/xfs_iops.c Name:xfs_vn_setattr_size]

Results:
map[SourceCode: 901:	/*
 902:	 * Truncate file.  Must have write permission and not be a directory.
 903:	 */
 904:	int
 905:	xfs_vn_setattr_size(
 906:		struct mnt_idmap	*idmap,
 907:		struct dentry		*dentry,
 908:		struct iattr		*iattr)
 909:	{
 910:		struct inode		*inode = d_inode(dentry);
 911:		struct xfs_inode	*ip = XFS_I(inode);
 912:		struct xfs_mount	*mp = ip->i_mount;
 913:		xfs_off_t		oldsize = inode->i_size;
 914:		xfs_off_t		newsize = iattr->ia_size;
 915:		struct xfs_trans	*tp;
 916:		int			error;
 917:		uint			lock_flags = 0;
 918:		uint			resblks = 0;
 919:		bool			did_zeroing = false;
 920:		struct xfs_zone_alloc_ctx ac = { };
 921:	
 922:		xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
 923:		ASSERT(S_ISREG(inode->i_mode));
 924:		ASSERT((iattr->ia_valid & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET|
 925:			ATTR_MTIME_SET|ATTR_TIMES_SET)) == 0);
 926:	
 927:		trace_xfs_setattr(ip);
 928:	
 929:		error = xfs_vn_change_ok(idmap, dentry, iattr);
 930:		if (error)
 931:			return error;
 932:	
 933:		/*
 934:		 * Short circuit the truncate case for zero length files.
 935:		 */
 936:		if (newsize == 0 && oldsize == 0 && ip->i_df.if_nextents == 0) {
 937:			if (!(iattr->ia_valid & (ATTR_CTIME|ATTR_MTIME)))
 938:				return 0;
 939:	
 940:			/*
 941:			 * Use the regular setattr path to update the timestamps.
 942:			 */
 943:			iattr->ia_valid &= ~ATTR_SIZE;
 944:			return xfs_setattr_nonsize(idmap, dentry, ip, iattr);
 945:		}
 946:	
 947:		/*
 948:		 * Make sure that the dquots are attached to the inode.
 949:		 */
 950:		error = xfs_qm_dqattach(ip);
 951:		if (error)
 952:			return error;
 953:	
 954:		/*
 955:		 * Wait for all direct I/O to complete.
 956:		 */
 957:		inode_dio_wait(inode);
 958:	
 959:		/*
 960:		 * Normally xfs_zoned_space_reserve is supposed to be called outside the
 961:		 * IOLOCK.  For truncate we can't do that since ->setattr is called with
 962:		 * it already held by the VFS.  So for now chicken out and try to
 963:		 * allocate space under it.
 964:		 *
 965:		 * To avoid deadlocks this means we can't block waiting for space, which
 966:		 * can lead to spurious -ENOSPC if there are no directly available
 967:		 * blocks.  We mitigate this a bit by allowing zeroing to dip into the
 968:		 * reserved pool, but eventually the VFS calling convention needs to
 969:		 * change.
 970:		 */
 971:		if (xfs_is_zoned_inode(ip)) {
 972:			error = xfs_zoned_space_reserve(mp, 1,
 973:					XFS_ZR_NOWAIT | XFS_ZR_RESERVED, &ac);
 974:			if (error) {
 975:				if (error == -EAGAIN)
 976:					return -ENOSPC;
 977:				return error;
 978:			}
 979:		}
 980:	
 981:		/*
 982:		 * File data changes must be complete before we start the transaction to
 983:		 * modify the inode.  This needs to be done before joining the inode to
 984:		 * the transaction because the inode cannot be unlocked once it is a
 985:		 * part of the transaction.
 986:		 *
 987:		 * Start with zeroing any data beyond EOF that we may expose on file
 988:		 * extension, or zeroing out the rest of the block on a downward
 989:		 * truncate.
 990:		 */
 991:		if (newsize > oldsize) {
 992:			trace_xfs_zero_eof(ip, oldsize, newsize - oldsize);
 993:			error = xfs_zero_range(ip, oldsize, newsize - oldsize,
 994:					&ac, &did_zeroing);
 995:		} else {
 996:			error = xfs_truncate_page(ip, newsize, &ac, &did_zeroing);
 997:		}
 998:	
 999:		if (xfs_is_zoned_inode(ip))
1000:			xfs_zoned_space_unreserve(mp, &ac);
1001:	
1002:		if (error)
1003:			return error;
1004:	
1005:		/*
1006:		 * We've already locked out new page faults, so now we can safely remove
1007:		 * pages from the page cache knowing they won't get refaulted until we
1008:		 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
1009:		 * complete. The truncate_setsize() call also cleans partial EOF page
1010:		 * PTEs on extending truncates and hence ensures sub-page block size
1011:		 * filesystems are correctly handled, too.
1012:		 *
1013:		 * We have to do all the page cache truncate work outside the
1014:		 * transaction context as the "lock" order is page lock->log space
1015:		 * reservation as defined by extent allocation in the writeback path.
1016:		 * Hence a truncate can fail with ENOMEM from xfs_trans_alloc(), but
1017:		 * having already truncated the in-memory version of the file (i.e. made
1018:		 * user visible changes). There's not much we can do about this, except
1019:		 * to hope that the caller sees ENOMEM and retries the truncate
1020:		 * operation.
1021:		 *
1022:		 * And we update in-core i_size and truncate page cache beyond newsize
1023:		 * before writeback the [i_disk_size, newsize] range, so we're
1024:		 * guaranteed not to write stale data past the new EOF on truncate down.
1025:		 */
1026:		truncate_setsize(inode, newsize);
1027:	
1028:		/*
1029:		 * We are going to log the inode size change in this transaction so
1030:		 * any previous writes that are beyond the on disk EOF and the new
1031:		 * EOF that have not been written out need to be written here.  If we
1032:		 * do not write the data out, we expose ourselves to the null files
1033:		 * problem. Note that this includes any block zeroing we did above;
1034:		 * otherwise those blocks may not be zeroed after a crash.
1035:		 */
1036:		if (did_zeroing ||
1037:		    (newsize > ip->i_disk_size && oldsize != ip->i_disk_size)) {
1038:			error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping,
1039:							ip->i_disk_size, newsize - 1);
1040:			if (error)
1041:				return error;
1042:		}
1043:	
1044:		/*
1045:		 * For realtime inode with more than one block rtextsize, we need the
1046:		 * block reservation for bmap btree block allocations/splits that can
1047:		 * happen since it could split the tail written extent and convert the
1048:		 * right beyond EOF one to unwritten.
1049:		 */
1050:		if (xfs_inode_has_bigrtalloc(ip))
1051:			resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);
1052:	
1053:		error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, resblks,
1054:					0, 0, &tp);
1055:		if (error)
1056:			return error;
1057:	
1058:		lock_flags |= XFS_ILOCK_EXCL;
1059:		xfs_ilock(ip, XFS_ILOCK_EXCL);
1060:		xfs_trans_ijoin(tp, ip, 0);
1061:	
1062:		/*
1063:		 * Only change the c/mtime if we are changing the size or we are
1064:		 * explicitly asked to change it.  This handles the semantic difference
1065:		 * between truncate() and ftruncate() as implemented in the VFS.
1066:		 *
1067:		 * The regular truncate() case without ATTR_CTIME and ATTR_MTIME is a
1068:		 * special case where we need to update the times despite not having
1069:		 * these flags set.  For all other operations the VFS set these flags
1070:		 * explicitly if it wants a timestamp update.
1071:		 */
1072:		if (newsize != oldsize &&
1073:		    !(iattr->ia_valid & (ATTR_CTIME | ATTR_MTIME))) {
1074:			iattr->ia_ctime = iattr->ia_mtime =
1075:				current_time(inode);
1076:			iattr->ia_valid |= ATTR_CTIME | ATTR_MTIME;
1077:		}
1078:	
1079:		/*
1080:		 * The first thing we do is set the size to new_size permanently on
1081:		 * disk.  This way we don't have to worry about anyone ever being able
1082:		 * to look at the data being freed even in the face of a crash.
1083:		 * What we're getting around here is the case where we free a block, it
1084:		 * is allocated to another file, it is written to, and then we crash.
1085:		 * If the new data gets written to the file but the log buffers
1086:		 * containing the free and reallocation don't, then we'd end up with
1087:		 * garbage in the blocks being freed.  As long as we make the new size
1088:		 * permanent before actually freeing any blocks it doesn't matter if
1089:		 * they get written to.
1090:		 */
1091:		ip->i_disk_size = newsize;
1092:		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
1093:	
1094:		if (newsize <= oldsize) {
1095:			error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, newsize);
1096:			if (error)
1097:				goto out_trans_cancel;
1098:	
1099:			/*
1100:			 * Truncated "down", so we're removing references to old data
1101:			 * here - if we delay flushing for a long time, we expose
1102:			 * ourselves unduly to the notorious NULL files problem.  So,
1103:			 * we mark this inode and flush it when the file is closed,
1104:			 * and do not wait the usual (long) time for writeout.
1105:			 */
1106:			xfs_iflags_set(ip, XFS_ITRUNCATED);
1107:	
1108:			/* A truncate down always removes post-EOF blocks. */
1109:			xfs_inode_clear_eofblocks_tag(ip);
1110:		}
1111:	
1112:		setattr_copy(idmap, inode, iattr);
1113:		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
1114:	
1115:		XFS_STATS_INC(mp, xs_ig_attrchg);
1116:	
1117:		if (xfs_has_wsync(mp))
1118:			xfs_trans_set_sync(tp);
1119:	
1120:		error = xfs_trans_commit(tp);
1121:	out_unlock:
1122:		if (lock_flags)
1123:			xfs_iunlock(ip, lock_flags);
1124:		return error;
1125:	
1126:	out_trans_cancel:
1127:		xfs_trans_cancel(tp);
1128:		goto out_unlock;
1129:	}
 SourceFile:fs/xfs/xfs_iops.c]

153/4 2026/09/17 11:00 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 27671
							output: 43
							thoughts: 0
						

154/4 2026/09/17 11:00 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/xfs/xfs_iops.c Name:xfs_vn_setattr]

Results:
map[SourceCode:1131:	STATIC int
1132:	xfs_vn_setattr(
1133:		struct mnt_idmap	*idmap,
1134:		struct dentry		*dentry,
1135:		struct iattr		*iattr)
1136:	{
1137:		struct inode		*inode = d_inode(dentry);
1138:		struct xfs_inode	*ip = XFS_I(inode);
1139:		int			error;
1140:	
1141:		if (iattr->ia_valid & ATTR_SIZE) {
1142:			uint			iolock;
1143:	
1144:			xfs_ilock(ip, XFS_MMAPLOCK_EXCL);
1145:			iolock = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
1146:	
1147:			error = xfs_break_layouts(inode, &iolock, BREAK_UNMAP);
1148:			if (error) {
1149:				xfs_iunlock(ip, XFS_MMAPLOCK_EXCL);
1150:				return error;
1151:			}
1152:	
1153:			error = xfs_vn_setattr_size(idmap, dentry, iattr);
1154:			xfs_iunlock(ip, XFS_MMAPLOCK_EXCL);
1155:		} else {
1156:			trace_xfs_setattr(ip);
1157:	
1158:			error = xfs_vn_change_ok(idmap, dentry, iattr);
1159:			if (!error)
1160:				error = xfs_setattr_nonsize(idmap, dentry, ip, iattr);
1161:		}
1162:	
1163:		return error;
1164:	}
 SourceFile:fs/xfs/xfs_iops.c]

155/4 2026/09/17 11:00 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 28269
							output: 42
							thoughts: 0
						

156/4 2026/09/17 11:00 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/xfs/xfs_file.c Name:xfs_filemap_fault]

Results:
map[SourceCode:2076:	static vm_fault_t
2077:	xfs_filemap_fault(
2078:		struct vm_fault		*vmf)
2079:	{
2080:		struct inode		*inode = file_inode(vmf->vma->vm_file);
2081:	
2082:		/* DAX can shortcut the normal fault path on write faults! */
2083:		if (IS_DAX(inode)) {
2084:			if (xfs_is_write_fault(vmf))
2085:				return xfs_write_fault(vmf, 0);
2086:			return xfs_dax_read_fault(vmf, 0);
2087:		}
2088:	
2089:		trace_xfs_read_fault(XFS_I(inode), 0);
2090:		return filemap_fault(vmf);
2091:	}
 SourceFile:fs/xfs/xfs_file.c]

157/4 2026/09/17 11:00 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 28600
							output: 45
							thoughts: 0
						

158/4 2026/09/17 11:00 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/xfs/xfs_file.c Name:xfs_filemap_page_mkwrite]

Results:
map[SourceCode:2107:	static vm_fault_t
2108:	xfs_filemap_page_mkwrite(
2109:		struct vm_fault		*vmf)
2110:	{
2111:		return xfs_write_fault(vmf, 0);
2112:	}
 SourceFile:fs/xfs/xfs_file.c]

159/4 2026/09/17 11:01 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 28763
							output: 41
							thoughts: 0
						

160/4 2026/09/17 11:01 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/xfs/xfs_file.c Name:xfs_write_fault]

Results:
map[SourceCode:2058:	static vm_fault_t
2059:	xfs_write_fault(
2060:		struct vm_fault		*vmf,
2061:		unsigned int		order)
2062:	{
2063:		if (xfs_is_zoned_inode(XFS_I(file_inode(vmf->vma->vm_file))))
2064:			return xfs_write_fault_zoned(vmf, order);
2065:		return __xfs_write_fault(vmf, order, NULL);
2066:	}
 SourceFile:fs/xfs/xfs_file.c]

161/4 2026/09/17 11:01 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 28991
							output: 42
							thoughts: 0
						

162/4 2026/09/17 11:01 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/xfs/xfs_file.c Name:__xfs_write_fault]

Results:
map[SourceCode:1983:	/*
1984:	 * Locking for serialisation of IO during page faults. This results in a lock
1985:	 * ordering of:
1986:	 *
1987:	 * mmap_lock (MM)
1988:	 *   sb_start_pagefault(vfs, freeze)
1989:	 *     invalidate_lock (vfs/XFS_MMAPLOCK - truncate serialisation)
1990:	 *       page_lock (MM)
1991:	 *         i_lock (XFS - extent map serialisation)
1992:	 */
1993:	static vm_fault_t
1994:	__xfs_write_fault(
1995:		struct vm_fault		*vmf,
1996:		unsigned int		order,
1997:		struct xfs_zone_alloc_ctx *ac)
1998:	{
1999:		struct inode		*inode = file_inode(vmf->vma->vm_file);
2000:		struct xfs_inode	*ip = XFS_I(inode);
2001:		unsigned int		lock_mode = XFS_MMAPLOCK_SHARED;
2002:		vm_fault_t		ret;
2003:	
2004:		trace_xfs_write_fault(ip, order);
2005:	
2006:		sb_start_pagefault(inode->i_sb);
2007:		file_update_time(vmf->vma->vm_file);
2008:	
2009:		/*
2010:		 * Normally we only need the shared mmaplock, but if a reflink remap is
2011:		 * in progress we take the exclusive lock to wait for the remap to
2012:		 * finish before taking a write fault.
2013:		 */
2014:		xfs_ilock(ip, XFS_MMAPLOCK_SHARED);
2015:		if (xfs_iflags_test(ip, XFS_IREMAPPING)) {
2016:			xfs_iunlock(ip, XFS_MMAPLOCK_SHARED);
2017:			xfs_ilock(ip, XFS_MMAPLOCK_EXCL);
2018:			lock_mode = XFS_MMAPLOCK_EXCL;
2019:		}
2020:	
2021:		if (IS_DAX(inode))
2022:			ret = xfs_dax_fault_locked(vmf, order, true);
2023:		else
2024:			ret = iomap_page_mkwrite(vmf, &xfs_buffered_write_iomap_ops,
2025:					ac);
2026:		xfs_iunlock(ip, lock_mode);
2027:	
2028:		sb_end_pagefault(inode->i_sb);
2029:		return ret;
2030:	}
 SourceFile:fs/xfs/xfs_file.c]

163/4 2026/09/17 11:01 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 29852
							output: 30
							thoughts: 0
						

164/4 2026/09/17 11:02 tool grepper
0m Args:
map[Expression:XFS_MMAPLOCK PathPrefix:fs/xfs]

Results:
map[Output:fs/xfs/scrub/bmap.c=34=xchk_setup_inode_bmap(
--
fs/xfs/scrub/bmap.c-57-
fs/xfs/scrub/bmap.c:58:		xchk_ilock(sc, XFS_MMAPLOCK_EXCL);
fs/xfs/scrub/bmap.c-59-
--
fs/xfs/scrub/quotacheck.c=392=xqcheck_collect_inode(
--
fs/xfs/scrub/quotacheck.c-417-	if (isreg)
fs/xfs/scrub/quotacheck.c:418:		xfs_ilock(ip, XFS_MMAPLOCK_SHARED);
fs/xfs/scrub/quotacheck.c-419-	if (XFS_IS_REALTIME_INODE(ip)) {
--
fs/xfs/scrub/quotacheck.c-478-	if (isreg)
fs/xfs/scrub/quotacheck.c:479:		xfs_iunlock(ip, XFS_MMAPLOCK_SHARED);
fs/xfs/scrub/quotacheck.c-480-	xfs_iunlock(ip, XFS_IOLOCK_SHARED);
--
fs/xfs/xfs_bmap_util.c=1015=xfs_collapse_file_space(
--
fs/xfs/xfs_bmap_util.c-1027-
fs/xfs/xfs_bmap_util.c:1028:	xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_bmap_util.c-1029-
--
fs/xfs/xfs_bmap_util.c=1084=xfs_insert_file_space(
--
fs/xfs/xfs_bmap_util.c-1096-
fs/xfs/xfs_bmap_util.c:1097:	xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_bmap_util.c-1098-
--
fs/xfs/xfs_exchrange.c=844=xfs_ioc_start_commit(
--
fs/xfs/xfs_exchrange.c-854-	const unsigned int		lockflags = XFS_IOLOCK_SHARED |
fs/xfs/xfs_exchrange.c:855:						    XFS_MMAPLOCK_SHARED |
fs/xfs/xfs_exchrange.c-856-						    XFS_ILOCK_SHARED;
--
fs/xfs/xfs_file.c=372=xfs_file_write_zero_eof(
--
fs/xfs/xfs_file.c-430-
fs/xfs/xfs_file.c:431:	xfs_ilock(ip, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_file.c-432-	error = xfs_zero_range(ip, isize, iocb->ki_pos - isize, ac, NULL);
fs/xfs/xfs_file.c:433:	xfs_iunlock(ip, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_file.c-434-
--
fs/xfs/xfs_file.c=1546=__xfs_file_fallocate(
--
fs/xfs/xfs_file.c-1555-	long			error;
fs/xfs/xfs_file.c:1556:	uint			iolock = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
fs/xfs/xfs_file.c-1557-
--
fs/xfs/xfs_file.c=1967=xfs_dax_read_fault(
--
fs/xfs/xfs_file.c-1975-
fs/xfs/xfs_file.c:1976:	xfs_ilock(ip, XFS_MMAPLOCK_SHARED);
fs/xfs/xfs_file.c-1977-	ret = xfs_dax_fault_locked(vmf, order, false);
fs/xfs/xfs_file.c:1978:	xfs_iunlock(ip, XFS_MMAPLOCK_SHARED);
fs/xfs/xfs_file.c-1979-
--
fs/xfs/xfs_file.c-1988- *   sb_start_pagefault(vfs, freeze)
fs/xfs/xfs_file.c:1989: *     invalidate_lock (vfs/XFS_MMAPLOCK - truncate serialisation)
fs/xfs/xfs_file.c-1990- *       page_lock (MM)
--
fs/xfs/xfs_file.c=1994=__xfs_write_fault(
--
fs/xfs/xfs_file.c-2000-	struct xfs_inode	*ip = XFS_I(inode);
fs/xfs/xfs_file.c:2001:	unsigned int		lock_mode = XFS_MMAPLOCK_SHARED;
fs/xfs/xfs_file.c-2002-	vm_fault_t		ret;
--
fs/xfs/xfs_file.c-2013-	 */
fs/xfs/xfs_file.c:2014:	xfs_ilock(ip, XFS_MMAPLOCK_SHARED);
fs/xfs/xfs_file.c-2015-	if (xfs_iflags_test(ip, XFS_IREMAPPING)) {
fs/xfs/xfs_file.c:2016:		xfs_iunlock(ip, XFS_MMAPLOCK_SHARED);
fs/xfs/xfs_file.c:2017:		xfs_ilock(ip, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_file.c:2018:		lock_mode = XFS_MMAPLOCK_EXCL;
fs/xfs/xfs_file.c-2019-	}
--
fs/xfs/xfs_icache.c=1398=xfs_inode_free_cowblocks(
--
fs/xfs/xfs_icache.c-1428-
fs/xfs/xfs_icache.c:1429:	if (!xfs_ilock_nowait(ip, XFS_MMAPLOCK_EXCL)) {
fs/xfs/xfs_icache.c-1430-		if (wait)
--
fs/xfs/xfs_icache.c-1433-	}
fs/xfs/xfs_icache.c:1434:	*lockflags |= XFS_MMAPLOCK_EXCL;
fs/xfs/xfs_icache.c-1435-
--
fs/xfs/xfs_inode.c=78=xfs_ilock_attr_map_shared(
--
fs/xfs/xfs_inode.c-90- * You can't set both SHARED and EXCL for the same lock,
fs/xfs/xfs_inode.c:91: * and only XFS_IOLOCK_SHARED, XFS_IOLOCK_EXCL, XFS_MMAPLOCK_SHARED,
fs/xfs/xfs_inode.c:92: * XFS_MMAPLOCK_EXCL, XFS_ILOCK_SHARED, XFS_ILOCK_EXCL are valid values
fs/xfs/xfs_inode.c-93- * to set in lock_flags.
--
fs/xfs/xfs_inode.c=96=xfs_lock_flags_assert(
--
fs/xfs/xfs_inode.c-100-		(XFS_IOLOCK_SHARED | XFS_IOLOCK_EXCL));
fs/xfs/xfs_inode.c:101:	ASSERT((lock_flags & (XFS_MMAPLOCK_SHARED | XFS_MMAPLOCK_EXCL)) !=
fs/xfs/xfs_inode.c:102:		(XFS_MMAPLOCK_SHARED | XFS_MMAPLOCK_EXCL));
fs/xfs/xfs_inode.c-103-	ASSERT((lock_flags & (XFS_ILOCK_SHARED | XFS_ILOCK_EXCL)) !=
--
fs/xfs/xfs_inode.c=140=xfs_ilock(
--
fs/xfs/xfs_inode.c-155-
fs/xfs/xfs_inode.c:156:	if (lock_flags & XFS_MMAPLOCK_EXCL) {
fs/xfs/xfs_inode.c-157-		down_write_nested(&VFS_I(ip)->i_mapping->invalidate_lock,
fs/xfs/xfs_inode.c:158:				  XFS_MMAPLOCK_DEP(lock_flags));
fs/xfs/xfs_inode.c:159:	} else if (lock_flags & XFS_MMAPLOCK_SHARED) {
fs/xfs/xfs_inode.c-160-		down_read_nested(&VFS_I(ip)->i_mapping->invalidate_lock,
fs/xfs/xfs_inode.c:161:				 XFS_MMAPLOCK_DEP(lock_flags));
fs/xfs/xfs_inode.c-162-	}
--
fs/xfs/xfs_inode.c=183=xfs_ilock_nowait(
--
fs/xfs/xfs_inode.c-198-
fs/xfs/xfs_inode.c:199:	if (lock_flags & XFS_MMAPLOCK_EXCL) {
fs/xfs/xfs_inode.c-200-		if (!down_write_trylock(&VFS_I(ip)->i_mapping->invalidate_lock))
fs/xfs/xfs_inode.c-201-			goto out_undo_iolock;
fs/xfs/xfs_inode.c:202:	} else if (lock_flags & XFS_MMAPLOCK_SHARED) {
fs/xfs/xfs_inode.c-203-		if (!down_read_trylock(&VFS_I(ip)->i_mapping->invalidate_lock))
--
fs/xfs/xfs_inode.c-216-out_undo_mmaplock:
fs/xfs/xfs_inode.c:217:	if (lock_flags & XFS_MMAPLOCK_EXCL)
fs/xfs/xfs_inode.c-218-		up_write(&VFS_I(ip)->i_mapping->invalidate_lock);
fs/xfs/xfs_inode.c:219:	else if (lock_flags & XFS_MMAPLOCK_SHARED)
fs/xfs/xfs_inode.c-220-		up_read(&VFS_I(ip)->i_mapping->invalidate_lock);
--
fs/xfs/xfs_inode.c=243=xfs_iunlock(
--
fs/xfs/xfs_inode.c-253-
fs/xfs/xfs_inode.c:254:	if (lock_flags & XFS_MMAPLOCK_EXCL)
fs/xfs/xfs_inode.c-255-		up_write(&VFS_I(ip)->i_mapping->invalidate_lock);
fs/xfs/xfs_inode.c:256:	else if (lock_flags & XFS_MMAPLOCK_SHARED)
fs/xfs/xfs_inode.c-257-		up_read(&VFS_I(ip)->i_mapping->invalidate_lock);
--
fs/xfs/xfs_inode.c=272=xfs_ilock_demote(
--
fs/xfs/xfs_inode.c-275-{
fs/xfs/xfs_inode.c:276:	ASSERT(lock_flags & (XFS_IOLOCK_EXCL|XFS_MMAPLOCK_EXCL|XFS_ILOCK_EXCL));
fs/xfs/xfs_inode.c-277-	ASSERT((lock_flags &
fs/xfs/xfs_inode.c:278:		~(XFS_IOLOCK_EXCL|XFS_MMAPLOCK_EXCL|XFS_ILOCK_EXCL)) == 0);
fs/xfs/xfs_inode.c-279-
--
fs/xfs/xfs_inode.c-281-		downgrade_write(&ip->i_lock);
fs/xfs/xfs_inode.c:282:	if (lock_flags & XFS_MMAPLOCK_EXCL)
fs/xfs/xfs_inode.c-283-		downgrade_write(&VFS_I(ip)->i_mapping->invalidate_lock);
--
fs/xfs/xfs_inode.c=291=xfs_assert_ilocked(
--
fs/xfs/xfs_inode.c-303-
fs/xfs/xfs_inode.c:304:	if (lock_flags & XFS_MMAPLOCK_SHARED)
fs/xfs/xfs_inode.c-305-		rwsem_assert_held(&VFS_I(ip)->i_mapping->invalidate_lock);
fs/xfs/xfs_inode.c:306:	else if (lock_flags & XFS_MMAPLOCK_EXCL)
fs/xfs/xfs_inode.c-307-		rwsem_assert_held_write(&VFS_I(ip)->i_mapping->invalidate_lock);
--
fs/xfs/xfs_inode.c=339=xfs_lock_inumorder(
--
fs/xfs/xfs_inode.c-352-
fs/xfs/xfs_inode.c:353:	if (lock_mode & (XFS_MMAPLOCK_SHARED|XFS_MMAPLOCK_EXCL)) {
fs/xfs/xfs_inode.c:354:		ASSERT(subclass <= XFS_MMAPLOCK_MAX_SUBCLASS);
fs/xfs/xfs_inode.c:355:		class += subclass << XFS_MMAPLOCK_SHIFT;
fs/xfs/xfs_inode.c-356-	}
--
fs/xfs/xfs_inode.c=382=xfs_lock_inodes(
--
fs/xfs/xfs_inode.c-400-	ASSERT(ips && inodes >= 2 && inodes <= 5);
fs/xfs/xfs_inode.c:401:	ASSERT(lock_mode & (XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL |
fs/xfs/xfs_inode.c-402-			    XFS_ILOCK_EXCL));
fs/xfs/xfs_inode.c:403:	ASSERT(!(lock_mode & (XFS_IOLOCK_SHARED | XFS_MMAPLOCK_SHARED |
fs/xfs/xfs_inode.c-404-			      XFS_ILOCK_SHARED)));
fs/xfs/xfs_inode.c:405:	ASSERT(!(lock_mode & XFS_MMAPLOCK_EXCL) ||
fs/xfs/xfs_inode.c:406:		inodes <= XFS_MMAPLOCK_MAX_SUBCLASS + 1);
fs/xfs/xfs_inode.c-407-	ASSERT(!(lock_mode & XFS_ILOCK_EXCL) ||
--
fs/xfs/xfs_inode.c-410-	if (lock_mode & XFS_IOLOCK_EXCL) {
fs/xfs/xfs_inode.c:411:		ASSERT(!(lock_mode & (XFS_MMAPLOCK_EXCL | XFS_ILOCK_EXCL)));
fs/xfs/xfs_inode.c:412:	} else if (lock_mode & XFS_MMAPLOCK_EXCL)
fs/xfs/xfs_inode.c-413-		ASSERT(!(lock_mode & XFS_ILOCK_EXCL));
--
fs/xfs/xfs_inode.c=483=xfs_lock_two_inodes(
--
fs/xfs/xfs_inode.c-495-	ASSERT(!(ip1_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)));
fs/xfs/xfs_inode.c:496:	ASSERT(!(ip0_mode & (XFS_MMAPLOCK_SHARED|XFS_MMAPLOCK_EXCL)));
fs/xfs/xfs_inode.c:497:	ASSERT(!(ip1_mode & (XFS_MMAPLOCK_SHARED|XFS_MMAPLOCK_EXCL)));
fs/xfs/xfs_inode.c-498-	ASSERT(I_INO(ip0) != I_INO(ip1));
--
fs/xfs/xfs_inode.c=2749=xfs_mmaplock_two_inodes_and_break_dax_layout(
--
fs/xfs/xfs_inode.c-2759-	/* Lock the first inode */
fs/xfs/xfs_inode.c:2760:	xfs_ilock(ip1, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_inode.c-2761-	error = xfs_break_dax_layouts(VFS_I(ip1));
fs/xfs/xfs_inode.c-2762-	if (error) {
fs/xfs/xfs_inode.c:2763:		xfs_iunlock(ip1, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_inode.c-2764-		return error;
--
fs/xfs/xfs_inode.c-2770-	/* Nested lock the second inode */
fs/xfs/xfs_inode.c:2771:	xfs_ilock(ip2, xfs_lock_inumorder(XFS_MMAPLOCK_EXCL, 1));
fs/xfs/xfs_inode.c-2772-	/*
fs/xfs/xfs_inode.c-2773-	 * We cannot use xfs_break_dax_layouts() directly here because it may
fs/xfs/xfs_inode.c:2774:	 * need to unlock & lock the XFS_MMAPLOCK_EXCL which is not suitable
fs/xfs/xfs_inode.c-2775-	 * for this nested lock case.
--
fs/xfs/xfs_inode.c-2778-	if (error) {
fs/xfs/xfs_inode.c:2779:		xfs_iunlock(ip2, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_inode.c:2780:		xfs_iunlock(ip1, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_inode.c-2781-		goto again;
--
fs/xfs/xfs_inode.c=2819=xfs_iunlock2_io_mmap(
--
fs/xfs/xfs_inode.c-2823-	if (IS_DAX(VFS_I(ip1)) && IS_DAX(VFS_I(ip2))) {
fs/xfs/xfs_inode.c:2824:		xfs_iunlock(ip2, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_inode.c-2825-		if (ip1 != ip2)
fs/xfs/xfs_inode.c:2826:			xfs_iunlock(ip1, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_inode.c-2827-	} else
--
fs/xfs/xfs_inode.c=2838=xfs_iunlock2_remapping(
--
fs/xfs/xfs_inode.c-2844-	if (ip1 != ip2)
fs/xfs/xfs_inode.c:2845:		xfs_iunlock(ip1, XFS_MMAPLOCK_SHARED);
fs/xfs/xfs_inode.c:2846:	xfs_iunlock(ip2, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_inode.c-2847-
--
fs/xfs/xfs_inode.c=3007=xfs_wait_dax_page(
--
fs/xfs/xfs_inode.c-3011-
fs/xfs/xfs_inode.c:3012:	xfs_iunlock(ip, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_inode.c-3013-	schedule();
fs/xfs/xfs_inode.c:3014:	xfs_ilock(ip, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_inode.c-3015-}
--
fs/xfs/xfs_inode.c=3018=xfs_break_dax_layouts(
--
fs/xfs/xfs_inode.c-3020-{
fs/xfs/xfs_inode.c:3021:	xfs_assert_ilocked(XFS_I(inode), XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_inode.c-3022-
--
fs/xfs/xfs_inode.h=371=static inline bool xfs_inode_can_sw_atomic_write(const struct xfs_inode *ip)
--
fs/xfs/xfs_inode.h-446-#define	XFS_ILOCK_SHARED	(1u << 3)
fs/xfs/xfs_inode.h:447:#define	XFS_MMAPLOCK_EXCL	(1u << 4)
fs/xfs/xfs_inode.h:448:#define	XFS_MMAPLOCK_SHARED	(1u << 5)
fs/xfs/xfs_inode.h-449-
--
fs/xfs/xfs_inode.h-451-				| XFS_ILOCK_EXCL | XFS_ILOCK_SHARED \
fs/xfs/xfs_inode.h:452:				| XFS_MMAPLOCK_EXCL | XFS_MMAPLOCK_SHARED)
fs/xfs/xfs_inode.h-453-
--
fs/xfs/xfs_inode.h-458-	{ XFS_ILOCK_SHARED,	"ILOCK_SHARED" }, \
fs/xfs/xfs_inode.h:459:	{ XFS_MMAPLOCK_EXCL,	"MMAPLOCK_EXCL" }, \
fs/xfs/xfs_inode.h:460:	{ XFS_MMAPLOCK_SHARED,	"MMAPLOCK_SHARED" }
fs/xfs/xfs_inode.h-461-
--
fs/xfs/xfs_inode.h-491- * 16-19	XFS_IOLOCK_SHIFT dependencies
fs/xfs/xfs_inode.h:492: * 20-23	XFS_MMAPLOCK_SHIFT dependencies
fs/xfs/xfs_inode.h-493- * 24-31	XFS_ILOCK_SHIFT dependencies
--
fs/xfs/xfs_inode.h-515-
fs/xfs/xfs_inode.h:516:#define XFS_MMAPLOCK_SHIFT		20
fs/xfs/xfs_inode.h:517:#define XFS_MMAPLOCK_NUMORDER		0
fs/xfs/xfs_inode.h:518:#define XFS_MMAPLOCK_MAX_SUBCLASS	3
fs/xfs/xfs_inode.h:519:#define XFS_MMAPLOCK_DEP_MASK		0x00f00000u
fs/xfs/xfs_inode.h-520-
--
fs/xfs/xfs_inode.h-527-#define XFS_LOCK_SUBCLASS_MASK	(XFS_IOLOCK_DEP_MASK | \
fs/xfs/xfs_inode.h:528:				 XFS_MMAPLOCK_DEP_MASK | \
fs/xfs/xfs_inode.h-529-				 XFS_ILOCK_DEP_MASK)
--
fs/xfs/xfs_inode.h-532-					>> XFS_IOLOCK_SHIFT)
fs/xfs/xfs_inode.h:533:#define XFS_MMAPLOCK_DEP(flags)	(((flags) & XFS_MMAPLOCK_DEP_MASK) \
fs/xfs/xfs_inode.h:534:					>> XFS_MMAPLOCK_SHIFT)
fs/xfs/xfs_inode.h-535-#define XFS_ILOCK_DEP(flags)	(((flags) & XFS_ILOCK_DEP_MASK) \
--
fs/xfs/xfs_iomap.c=2371=xfs_zero_range(
--
fs/xfs/xfs_iomap.c-2379-
fs/xfs/xfs_iomap.c:2380:	xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_iomap.c-2381-
--
fs/xfs/xfs_iops.c=905=xfs_vn_setattr_size(
--
fs/xfs/xfs_iops.c-921-
fs/xfs/xfs_iops.c:922:	xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_iops.c-923-	ASSERT(S_ISREG(inode->i_mode));
--
fs/xfs/xfs_iops.c=1132=xfs_vn_setattr(
--
fs/xfs/xfs_iops.c-1143-
fs/xfs/xfs_iops.c:1144:		xfs_ilock(ip, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_iops.c:1145:		iolock = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
fs/xfs/xfs_iops.c-1146-
--
fs/xfs/xfs_iops.c-1148-		if (error) {
fs/xfs/xfs_iops.c:1149:			xfs_iunlock(ip, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_iops.c-1150-			return error;
--
fs/xfs/xfs_iops.c-1153-		error = xfs_vn_setattr_size(idmap, dentry, iattr);
fs/xfs/xfs_iops.c:1154:		xfs_iunlock(ip, XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_iops.c-1155-	} else {
--
fs/xfs/xfs_reflink.c=1688=xfs_reflink_remap_prep(
--
fs/xfs/xfs_reflink.c-1759-	if (inode_in != inode_out)
fs/xfs/xfs_reflink.c:1760:		xfs_ilock_demote(src, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
fs/xfs/xfs_reflink.c-1761-
--
fs/xfs/xfs_zone_gc.c=884=xfs_zone_gc_finish_chunk(
--
fs/xfs/xfs_zone_gc.c-886-{
fs/xfs/xfs_zone_gc.c:887:	uint			iolock = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
fs/xfs/xfs_zone_gc.c-888-	struct xfs_zone_gc_data	*data = chunk->data;
]

165/4 2026/09/17 11:02 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 37245
							output: 27
							thoughts: 188
						

Thoughts:
**XFS's MMAPLOCK and VFS Integration**

Okay, so I'm digging into XFS's inode code, specifically lines 156-162 in `fs/xfs/xfs_inode.c`. And it's pretty clear - the `XFS_MMAPLOCK` is *directly* the VFS's `i_mapping->invalidate_lock`. `XFS_MMAPLOCK_EXCL` is just a `down_write_nested` on that lock, and `XFS_MMAPLOCK_SHARED` is a `down_read_nested` on it. That's actually quite elegant. It confirms what I suspected, the XFS team leveraged the existing VFS infrastructure for their locking mechanism around memory mapping.

Now, I need to understand how this interacts with truncate/setattr and other operations. I need to refresh my understanding of how other filesystems manage this. Let me pivot and compare XFS's approach to how generic filesystems and other iomap-based filesystems like btrfs, f2fs, zonefs, gfs2 handle the `truncate_setsize` and `filemap_invalidate_lock`. Specifically, the interplay between those and the memory mapping. Knowing those details should give me a more complete picture of XFS's design choices here.



166/4 2026/09/17 11:02 tool grepper
0m Args:
map[Expression:filemap_invalidate_lock PathPrefix:fs]

Results:
map[Output:fs/btrfs/volumes.c=1335=struct btrfs_super_block *btrfs_read_disk_super(struct block_device *bdev,
--
fs/btrfs/volumes.c-1366-
fs/btrfs/volumes.c:1367:	filemap_invalidate_lock_shared(mapping);
fs/btrfs/volumes.c-1368-	page = read_cache_page_gfp(mapping, bytenr >> PAGE_SHIFT, GFP_NOFS);
--
fs/btrfs/zoned.c=88=static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones,
--
fs/btrfs/zoned.c-133-
fs/btrfs/zoned.c:134:			filemap_invalidate_lock_shared(mapping);
fs/btrfs/zoned.c-135-			page[i] = read_cache_page_gfp(mapping,
--
fs/ceph/addr.c=1990=static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
--
fs/ceph/addr.c-2045-
fs/ceph/addr.c:2046:		filemap_invalidate_lock_shared(mapping);
fs/ceph/addr.c-2047-		page = find_or_create_page(mapping, 0,
--
fs/ceph/file.c=2784=static long ceph_fallocate(struct file *file, int mode,
--
fs/ceph/file.c-2841-
fs/ceph/file.c:2842:	filemap_invalidate_lock(inode->i_mapping);
fs/ceph/file.c-2843-	ceph_fscache_invalidate(inode, false);
--
fs/exfat/file.c=754=static int exfat_extend_valid_size(struct inode *inode, loff_t new_valid_size)
--
fs/exfat/file.c-779-		 */
fs/exfat/file.c:780:		filemap_invalidate_lock(inode->i_mapping);
fs/exfat/file.c-781-		if (gap_start < new_valid_size)
--
fs/exfat/file.c=943=static vm_fault_t exfat_page_mkwrite(struct vm_fault *vmf)
--
fs/exfat/file.c-987-
fs/exfat/file.c:988:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/exfat/file.c-989-	ret = iomap_page_mkwrite(vmf, &exfat_iomap_ops, NULL);
--
fs/ext2/inode.c=1224=static void ext2_truncate_blocks(struct inode *inode, loff_t offset)
--
fs/ext2/inode.c-1231-
fs/ext2/inode.c:1232:	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c-1233-	__ext2_truncate_blocks(inode, offset);
--
fs/ext2/inode.c=1237=static int ext2_setsize(struct inode *inode, loff_t newsize)
--
fs/ext2/inode.c-1254-
fs/ext2/inode.c:1255:	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c-1256-	truncate_setsize(inode, newsize);
--
fs/ext4/extents.c=4949=long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
--
fs/ext4/extents.c-4999-	 */
fs/ext4/extents.c:5000:	filemap_invalidate_lock(mapping);
fs/ext4/extents.c-5001-
--
fs/ext4/file.c=800=static vm_fault_t ext4_dax_huge_fault(struct vm_fault *vmf, unsigned int order)
--
fs/ext4/file.c-827-		file_update_time(vmf->vma->vm_file);
fs/ext4/file.c:828:		filemap_invalidate_lock_shared(mapping);
fs/ext4/file.c-829-retry:
--
fs/ext4/file.c-837-	} else {
fs/ext4/file.c:838:		filemap_invalidate_lock_shared(mapping);
fs/ext4/file.c-839-	}
--
fs/ext4/inode.c=4432=static void ext4_wait_dax_page(struct inode *inode)
--
fs/ext4/inode.c-4435-	schedule();
fs/ext4/inode.c:4436:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-4437-}
--
fs/ext4/inode.c=6009=int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ext4/inode.c-6125-
fs/ext4/inode.c:6126:		filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-6127-
--
fs/ext4/inode.c=6740=int ext4_change_inode_journal_flag(struct inode *inode, int val)
--
fs/ext4/inode.c-6773-	 */
fs/ext4/inode.c:6774:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-6775-	err = filemap_write_and_wait(inode->i_mapping);
--
fs/ext4/inode.c=6884=vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf)
--
fs/ext4/inode.c-6903-
fs/ext4/inode.c:6904:	filemap_invalidate_lock_shared(mapping);
fs/ext4/inode.c-6905-
--
fs/ext4/ioctl.c=375=static long swap_inode_boot_loader(struct super_block *sb,
--
fs/ext4/ioctl.c-411-
fs/ext4/ioctl.c:412:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/ioctl.c-413-	err = filemap_write_and_wait(inode->i_mapping);
--
fs/ext4/truncate.h=12=static inline void ext4_truncate_failed_write(struct inode *inode)
--
fs/ext4/truncate.h-19-	 */
fs/ext4/truncate.h:20:	filemap_invalidate_lock(mapping);
fs/ext4/truncate.h-21-	truncate_inode_pages(mapping, inode->i_size);
--
fs/f2fs/data.c=3646=void f2fs_write_failed(struct inode *inode, loff_t to)
--
fs/f2fs/data.c-3655-		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/data.c:3656:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/data.c-3657-
--
fs/f2fs/data.c=4187=static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk,
--
fs/f2fs/data.c-4202-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/data.c:4203:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/data.c-4204-
--
fs/f2fs/file.c=73=static int f2fs_zero_post_eof_page(struct inode *inode,
--
fs/f2fs/file.c-86-	if (lock)
fs/f2fs/file.c:87:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-88-	/* zero or drop pages only in range of [old_size, new_size] */
--
fs/f2fs/file.c=120=static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
--
fs/f2fs/file.c-186-	file_update_time(vmf->vma->vm_file);
fs/f2fs/file.c:187:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/f2fs/file.c-188-
--
fs/f2fs/file.c=637=static int finish_preallocate_blocks(struct inode *inode)
--
fs/f2fs/file.c-655-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:656:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-657-
--
fs/f2fs/file.c=1124=int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/f2fs/file.c-1227-		f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1228:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1229-
--
fs/f2fs/file.c=1346=static int f2fs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1394-			f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1395:			filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1396-
--
fs/f2fs/file.c=1630=static int f2fs_do_collapse(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1642-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1643:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1644-
--
fs/f2fs/file.c=1661=static int f2fs_collapse_range(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1686-	/* write out all moved pages, if possible */
fs/f2fs/file.c:1687:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1688-	ret = filemap_write_and_wait_range(inode->i_mapping, offset, LLONG_MAX);
--
fs/f2fs/file.c=1755=static int f2fs_zero_range(struct inode *inode, loff_t offset, loff_t len,
--
fs/f2fs/file.c-1811-			f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1812:			filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1813-
--
fs/f2fs/file.c=1868=static int f2fs_insert_range(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1893-
fs/f2fs/file.c:1894:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1895-	ret = f2fs_truncate_blocks(inode, i_size_read(inode), true);
--
fs/f2fs/file.c-1911-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1912:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1913-
--
fs/f2fs/file.c-1940-	/* write out all moved pages, if possible */
fs/f2fs/file.c:1941:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1942-	ret = filemap_write_and_wait_range(mapping, offset, LLONG_MAX);
--
fs/f2fs/file.c=3879=static int f2fs_ioc_release_dev_alias(struct file *filp)
--
fs/f2fs/file.c-3928-
fs/f2fs/file.c:3929:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-3930-	truncate_setsize(inode, 0);
--
fs/f2fs/file.c=4206=static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4257-	f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4258:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-4259-
--
fs/f2fs/file.c=4403=static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4435-	f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4436:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-4437-
--
fs/f2fs/file.c=4535=static int f2fs_sec_trim_file(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4600-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4601:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-4602-
--
fs/f2fs/file.c=4794=static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)
--
fs/f2fs/file.c-4801-
fs/f2fs/file.c:4802:	filemap_invalidate_lock_shared(mapping);
fs/f2fs/file.c-4803-	page_cache_ra_unbounded(&ractl, len, 0);
--
fs/f2fs/file.c=5631=static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/f2fs/file.c-5703-		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:5704:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-5705-		if (!f2fs_truncate(inode))
--
fs/fuse/dax.c=663=static void fuse_wait_dax_page(struct inode *inode)
--
fs/fuse/dax.c-666-	schedule();
fs/fuse/dax.c:667:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-668-}
--
fs/fuse/dax.c=755=static vm_fault_t __fuse_dax_fault(struct vm_fault *vmf, unsigned int order,
--
fs/fuse/dax.c-778-	 */
fs/fuse/dax.c:779:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/fuse/dax.c-780-	ret = dax_iomap_fault(vmf, order, &pfn, &error, &fuse_iomap_ops);
--
fs/fuse/dax.c=914=inode_inline_reclaim_one_dmap(struct fuse_conn_dax *fcd, struct inode *inode,
--
fs/fuse/dax.c-923-
fs/fuse/dax.c:924:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-925-
--
fs/fuse/dax.c=1076=static int lookup_and_reclaim_dmap(struct fuse_conn_dax *fcd,
--
fs/fuse/dax.c-1085-
fs/fuse/dax.c:1086:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-1087-	ret = fuse_dax_break_layouts(inode, dmap_start, dmap_end);
--
fs/fuse/dir.c=2145=int fuse_do_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/fuse/dir.c-2177-	if (FUSE_IS_DAX(inode) && is_truncate) {
fs/fuse/dir.c:2178:		filemap_invalidate_lock(mapping);
fs/fuse/dir.c-2179-		fault_blocked = true;
--
fs/fuse/file.c=250=static int fuse_open(struct inode *inode, struct file *file)
--
fs/fuse/file.c-271-	if (dax_truncate) {
fs/fuse/file.c:272:		filemap_invalidate_lock(inode->i_mapping);
fs/fuse/file.c-273-		err = fuse_dax_break_layouts(inode, 0, -1);
--
fs/fuse/file.c=2832=static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
--
fs/fuse/file.c-2859-	if (block_faults) {
fs/fuse/file.c:2860:		filemap_invalidate_lock(inode->i_mapping);
fs/fuse/file.c-2861-		err = fuse_dax_break_layouts(inode, 0, -1);
--
fs/ntfs/file.c=254=static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
--
fs/ntfs/file.c-278-	 */
fs/ntfs/file.c:279:	filemap_invalidate_lock(vi->i_mapping);
fs/ntfs/file.c-280-	if (attr->ia_size > old_size) {
--
fs/ntfs/file.c=676=static vm_fault_t ntfs_filemap_page_mkwrite(struct vm_fault *vmf)
--
fs/ntfs/file.c-691-	 */
fs/ntfs/file.c:692:	filemap_invalidate_lock_shared(mapping);
fs/ntfs/file.c-693-	ret = iomap_page_mkwrite(vmf, &ntfs_page_mkwrite_iomap_ops, NULL);
--
fs/ntfs/file.c=1127=static long ntfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
--
fs/ntfs/file.c-1170-	/* Take invalidate_lock for all fallocate operations to prevent races */
fs/ntfs/file.c:1171:	filemap_invalidate_lock(vi->i_mapping);
fs/ntfs/file.c-1172-
--
fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-519-		inode_dio_wait(inode);
fs/ntfs3/file.c:520:		filemap_invalidate_lock(mapping);
fs/ntfs3/file.c-521-		map_locked = true;
--
fs/smb/client/file.c=993=static int cifs_do_truncate(const unsigned int xid, struct dentry *dentry)
--
fs/smb/client/file.c-1005-
fs/smb/client/file.c:1006:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/file.c-1007-
--
fs/smb/client/smb2ops.c=3508=static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3531-
fs/smb/client/smb2ops.c:3532:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-3533-
--
fs/smb/client/smb2ops.c=3592=static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3610-
fs/smb/client/smb2ops.c:3611:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-3612-	/*
--
fs/smb/client/smb2ops.c=4014=static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4032-
fs/smb/client/smb2ops.c:4033:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-4034-	rc = filemap_write_and_wait_range(inode->i_mapping,
--
fs/smb/client/smb2ops.c=4078=static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4108-
fs/smb/client/smb2ops.c:4109:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-4110-	rc = filemap_write_and_wait_range(inode->i_mapping,
--
fs/udf/file.c=38=static vm_fault_t udf_page_mkwrite(struct vm_fault *vmf)
--
fs/udf/file.c-50-	file_update_time(vma->vm_file);
fs/udf/file.c:51:	filemap_invalidate_lock_shared(mapping);
fs/udf/file.c-52-	folio_lock(folio);
--
fs/udf/file.c=89=static ssize_t udf_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/udf/file.c-104-				 iocb->ki_pos + iov_iter_count(from))) {
fs/udf/file.c:105:		filemap_invalidate_lock(inode->i_mapping);
fs/udf/file.c-106-		retval = udf_expand_file_adinicb(inode);
--
fs/udf/file.c=215=static int udf_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/udf/file.c-236-	    attr->ia_size != i_size_read(inode)) {
fs/udf/file.c:237:		filemap_invalidate_lock(inode->i_mapping);
fs/udf/file.c-238-		error = udf_setsize(inode, attr->ia_size);
--
fs/verity/read_metadata.c=16=static int fsverity_read_merkle_tree(struct inode *inode,
--
fs/verity/read_metadata.c-38-	if (inode->i_sb->s_vop->readahead_merkle_tree) {
fs/verity/read_metadata.c:39:		filemap_invalidate_lock_shared(inode->i_mapping);
fs/verity/read_metadata.c-40-		inode->i_sb->s_vop->readahead_merkle_tree(
--
fs/xfs/xfs_bmap_util.c=1537=xfs_swap_extents(
--
fs/xfs/xfs_bmap_util.c-1558-	lock_two_nondirectories(VFS_I(ip), VFS_I(tip));
fs/xfs/xfs_bmap_util.c:1559:	filemap_invalidate_lock_two(VFS_I(ip)->i_mapping,
fs/xfs/xfs_bmap_util.c-1560-				    VFS_I(tip)->i_mapping);
--
fs/xfs/xfs_inode.c=2792=xfs_ilock2_io_mmap(
--
fs/xfs/xfs_inode.c-2810-	} else
fs/xfs/xfs_inode.c:2811:		filemap_invalidate_lock_two(VFS_I(ip1)->i_mapping,
fs/xfs/xfs_inode.c-2812-					    VFS_I(ip2)->i_mapping);
--
fs/xfs/xfs_iomap.c=2134=xfs_buffered_write_iomap_end(
--
fs/xfs/xfs_iomap.c-2167-	} else {
fs/xfs/xfs_iomap.c:2168:		filemap_invalidate_lock(inode->i_mapping);
fs/xfs/xfs_iomap.c-2169-		iomap_write_delalloc_release(inode, start_byte, end_byte, flags,
--
fs/zonefs/file.c=203=int zonefs_file_truncate(struct inode *inode, loff_t isize)
--
fs/zonefs/file.c-228-	/* Serialize against page faults */
fs/zonefs/file.c:229:	filemap_invalidate_lock(inode->i_mapping);
fs/zonefs/file.c-230-
--
fs/zonefs/file.c=297=static vm_fault_t zonefs_filemap_page_mkwrite(struct vm_fault *vmf)
--
fs/zonefs/file.c-315-	/* Serialize against truncates */
fs/zonefs/file.c:316:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/zonefs/file.c-317-	ret = iomap_page_mkwrite(vmf, &zonefs_write_iomap_ops, NULL);
]

167/4 2026/09/17 11:02 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 45065
							output: 38
							thoughts: 35
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Examining Truncate/SetSize Implementation**

Right, time to dig into the nitty-gritty. I want to see how the kernel handles `truncate` and `setsize` operations at the filesystem level, and the best way to do that is to look at some well-established, potentially different implementations. I'm thinking specifically about `fs/zonefs/file.c` and `fs/udf/file.c`. ZoneFS is interesting because of its block-oriented nature and inherent limitations with random access which could have an impact on these operations. UDF is a good contrast, given that it's a more traditional filesystem, it is interesting to see the trade-offs implemented. Seeing how both filesystems implement the same operations will give me a better understanding of the trade-offs made, and hopefully, I'll identify some best practices or potential areas for optimization across the board, or perhaps highlight subtle differences in design considerations. Let's see how they manage block allocation/deallocation, inode updates, and any potential locking strategies they employ. Analyzing these files will give me a clear picture of how they're handling these fundamental file operations.



168/4 2026/09/17 11:02 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/zonefs/file.c Name:zonefs_file_truncate]

Results:
map[SourceCode: 203:	int zonefs_file_truncate(struct inode *inode, loff_t isize)
 204:	{
 205:		struct zonefs_inode_info *zi = ZONEFS_I(inode);
 206:		struct zonefs_zone *z = zonefs_inode_zone(inode);
 207:		loff_t old_isize;
 208:		enum req_op op;
 209:		int ret = 0;
 210:	
 211:		/*
 212:		 * Only sequential zone files can be truncated and truncation is allowed
 213:		 * only down to a 0 size, which is equivalent to a zone reset, and to
 214:		 * the maximum file size, which is equivalent to a zone finish.
 215:		 */
 216:		if (!zonefs_zone_is_seq(z))
 217:			return -EPERM;
 218:	
 219:		if (!isize)
 220:			op = REQ_OP_ZONE_RESET;
 221:		else if (isize == z->z_capacity)
 222:			op = REQ_OP_ZONE_FINISH;
 223:		else
 224:			return -EPERM;
 225:	
 226:		inode_dio_wait(inode);
 227:	
 228:		/* Serialize against page faults */
 229:		filemap_invalidate_lock(inode->i_mapping);
 230:	
 231:		/* Serialize against zonefs_iomap_begin() */
 232:		mutex_lock(&zi->i_truncate_mutex);
 233:	
 234:		old_isize = i_size_read(inode);
 235:		if (isize == old_isize)
 236:			goto unlock;
 237:	
 238:		ret = zonefs_inode_zone_mgmt(inode, op);
 239:		if (ret)
 240:			goto unlock;
 241:	
 242:		/*
 243:		 * If the mount option ZONEFS_MNTOPT_EXPLICIT_OPEN is set,
 244:		 * take care of open zones.
 245:		 */
 246:		if (z->z_flags & ZONEFS_ZONE_OPEN) {
 247:			/*
 248:			 * Truncating a zone to EMPTY or FULL is the equivalent of
 249:			 * closing the zone. For a truncation to 0, we need to
 250:			 * re-open the zone to ensure new writes can be processed.
 251:			 * For a truncation to the maximum file size, the zone is
 252:			 * closed and writes cannot be accepted anymore, so clear
 253:			 * the open flag.
 254:			 */
 255:			if (!isize)
 256:				ret = zonefs_inode_zone_mgmt(inode, REQ_OP_ZONE_OPEN);
 257:			else
 258:				z->z_flags &= ~ZONEFS_ZONE_OPEN;
 259:		}
 260:	
 261:		zonefs_update_stats(inode, isize);
 262:		truncate_setsize(inode, isize);
 263:		z->z_wpoffset = isize;
 264:		zonefs_inode_account_active(inode);
 265:	
 266:	unlock:
 267:		mutex_unlock(&zi->i_truncate_mutex);
 268:		filemap_invalidate_unlock(inode->i_mapping);
 269:	
 270:		return ret;
 271:	}
 SourceFile:fs/zonefs/file.c]

169/4 2026/09/17 11:02 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 46552
							output: 1680
							thoughts: 1319
						

Thoughts:
**Summary of `ntfs_setattr` Size Change Handling**

Okay, here's my understanding of this issue and proposed fix, keeping in mind I need to use the information I've gathered so far. No additional research is possible.

First, it is absolutely incorrect to call `truncate_setsize` *before* `ntfs_set_size` when extending a file. This creates a critical window. Essentially, `truncate_setsize` immediately updates `inode->i_size` and signals the page cache about the change. However, `ntfs_set_size` is responsible for updating the *actual* on-disk metadata (file size in the MFT entry, possibly allocating clusters, or converting a resident attribute to non-resident).  Since `ntfs_setattr` only holds `inode->i_rwsem`, concurrent page faults that run under `mmap_lock` are *not* blocked and can happen simultaneously. So, if a page fault happens *after* `i_size` has been extended but *before* the filesystem metadata has been updated, it can lead to inconsistent reads. The `iomap` length might be an old size, while the `i_size` (from `inode->i_size`) is the new larger size. This triggers an `EIO` error due to an inconsistent size comparison.  Also, if `ntfs_set_size` fails, the inconsistency remains and needs rollback.

Now, let's look at how other filesystems deal with this. XFS uses `XFS_MMAPLOCK` which blocks any concurrent access. `xfs_vn_setattr` acquires this exclusive lock, and `filemap_fault` uses a shared lock. This guarantees no intermediate state is observable during the entire truncate or extend operation. Ext4 does something similar with `filemap_invalidate_lock`.  In `ext4_setattr`, the entire size modification code is protected by this lock. For file extension, Ext4 first zeroes EOF folios, acquires the inode's data semaphore, updates on-disk and in-core size atomically under that semaphore, marks the inode dirty, calls `pagecache_isize_extended()`, calls `truncate_pagecache()`, and finally unlocks the invalidate lock. `ext4_page_mkwrite` and `filemap_fault` also hold this same lock in shared mode.

So, the fix for `ntfs_setattr` is clear. The key is to serialize with page faults.

Here's my proposed fix:

1.  **Locking**:  `ntfs_setattr` *must* hold `filemap_invalidate_lock(inode->i_mapping)` across the *entire* size change operation. This is critical to prevent the race condition seen in the existing code. This parallels how other file systems and even the ntfs3 `ntfs_fallocate` implementation handle the same scenario.
2.  **Ordering**:
    *   **File Extension (`newsize > oldsize`)**:  First, call `ntfs_set_size(inode, newsize)` *before* updating `inode->i_size`. This step handles the on-disk metadata updates – allocating clusters or converting attributes. Then, *after* that, update the page cache and `i_size`: call `truncate_setsize(inode, newsize)` (or possibly `i_size_write(inode, newsize)` and `pagecache_isize_extended(inode, oldsize, newsize)`). This way, by the time `i_size` is visible, the attribute length and mappings reflect the new file size and eliminates the `size > iomap->length` issue.
    *   **File Shrink (`newsize < oldsize`)**:  Call `truncate_setsize(inode, newsize)` *first* (while holding the invalidate lock).  This ensures any pages beyond the new EOF are discarded before calling `ntfs_set_size(inode, newsize)` to free up disk clusters or update attribute sizes.
3.  **Caveat / Verification**:  We *must* explicitly note which parts of this fix are verified against the kernel source (ext4, XFS, etc.) and highlight any implementation specifics or nuances (like the preference between `truncate_setsize` vs `i_size_write` + `pagecache_isize_extended`, and ensuring that error paths restore the original `i_size` *under* the `filemap_invalidate_lock`).

That's my complete understanding based on the information provided, and the best-effort approach I can take with current restrictions.



170/4 2026/09/17 11:03 tool set-results
0m Args:
map[Answer:### 1. Is it correct to call `truncate_setsize` before `ntfs_set_size` when extending the file size?

**No, it is incorrect.**

- `truncate_setsize(inode, newsize)` immediately updates the in-memory `inode->i_size` via `i_size_write(inode, newsize)` and calls `pagecache_isize_extended()`.
- While `ntfs_setattr` holds `inode->i_rwsem`, page faults (`filemap_fault`) do **not** take `i_rwsem`. In `filemap_fault()`, folios are allocated and read holding only `filemap_invalidate_lock_shared(mapping)` (or under folio lock), not `i_rwsem`.
- If `truncate_setsize` is called before `ntfs_set_size`, a concurrent page fault can read the newly updated `inode->i_size` while the on-disk attribute length has not yet been modified by `ntfs_set_size`. When `ntfs_iomap_begin()` executes, it reads the old resident attribute length (e.g. 5 bytes) into `iomap->length`. Subsequently, `iomap_read_inline_data()` calculates `size = i_size_read(inode) - iomap->offset` (e.g. 20 bytes), which triggers `WARN_ON_ONCE(size > iomap->length)` and fails with `-EIO`.
- Furthermore, if `ntfs_set_size()` fails (e.g., due to `-EFBIG`, `-ENOSPC`, or disk I/O errors), the page cache has already been extended prematurely, requiring error rollback of `inode->i_size`.

---

### 2. How ext4 and XFS prevent concurrent reads/faults from observing intermediate states

Both filesystems serialize size modifications against page faults using `mapping->invalidate_lock` (or filesystem-specific lock abstractions mapping to it), and they sequence metadata updates appropriately:

1. **XFS (`xfs_vn_setattr` / `xfs_vn_setattr_size`)**:
   - `xfs_vn_setattr` acquires `xfs_ilock(ip, XFS_MMAPLOCK_EXCL)` before performing any size updates.
   - In XFS, `XFS_MMAPLOCK_EXCL` / `XFS_MMAPLOCK_SHARED` directly correspond to `down_write` / `down_read` of `inode->i_mapping->invalidate_lock`.
   - `filemap_fault()` takes `filemap_invalidate_lock_shared` when instantiating or reading non-uptodate folios. Holding `XFS_MMAPLOCK_EXCL` completely blocks concurrent page faults from running during truncate or file extension.
   - Under this lock, XFS zeroes beyond EOF (`xfs_zero_range`), updates page cache / size via `truncate_setsize`, logs the on-disk metadata (`ip->i_disk_size = newsize`), commits the transaction, and only then releases `XFS_MMAPLOCK_EXCL`.

2. **ext4 (`ext4_setattr`)**:
   - `ext4_setattr` holds `filemap_invalidate_lock(inode->i_mapping)` throughout the entire size change operation.
   - For file extension (`!shrink`), it first zeroes post-EOF folio tails (`ext4_block_zero_eof`), takes a journal handle, takes `down_write(&EXT4_I(inode)->i_data_sem)`, updates `EXT4_I(inode)->i_disksize` and calls `i_size_write(inode, attr->ia_size)` together under lock, and calls `pagecache_isize_extended(inode, oldsize, inode->i_size)`.
   - Concurrent faults are serialized because `ext4_page_mkwrite` and `filemap_fault` take `filemap_invalidate_lock_shared()`.

---

### 3. How this should be fixed in `ntfs_setattr`

To fix this issue in `fs/ntfs3/file.c`:

1. **Serialize page faults using `filemap_invalidate_lock`**:
   Surround the size modification block with `filemap_invalidate_lock(inode->i_mapping)` and `filemap_invalidate_unlock(inode->i_mapping)`. This blocks concurrent `filemap_fault()` calls from reading or populating folios while the size and attributes are changing.

2. **Order operations depending on whether extending or shrinking**:
   - **When extending (`newsize > oldsize`)**:
     Call `ntfs_set_size(inode, newsize)` **first** to resize/convert the attribute (including converting resident data to non-resident if necessary and allocating clusters). Once metadata and allocations succeed, call `truncate_setsize(inode, newsize)` (or `i_size_write(inode, newsize)` followed by `pagecache_isize_extended(inode, oldsize, newsize)`).
   - **When shrinking (`newsize < oldsize`)**:
     Call `truncate_setsize(inode, newsize)` first (to unmap and truncate folios beyond the new EOF so they are not written back to deallocated blocks), followed by `ntfs_set_size(inode, newsize)` to shrink the attribute and free unused clusters on disk.
   - **Error Handling**:
     If `ntfs_set_size` fails during shrinking, roll back `inode->i_size` under `filemap_invalidate_lock`.

**Example Patch Outline**:
```c
	if (newsize != oldsize) {
		filemap_invalidate_lock(inode->i_mapping);

		if (newsize > oldsize) {
			err = ntfs_set_size(inode, newsize);
			if (!err)
				truncate_setsize(inode, newsize);
		} else {
			truncate_setsize(inode, newsize);
			err = ntfs_set_size(inode, newsize);
			if (err)
				i_size_write(inode, oldsize);
		}

		filemap_invalidate_unlock(inode->i_mapping);

		if (err)
			goto out;

		ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
		ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
		inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
	}
```

---

### Limitations / Unverified Parts
- We verified the locking and ordering mechanisms in `ext4`, `xfs`, `ntfs`, `zonefs`, and `mm/filemap.c`.
- In `ntfs3`, `ntfs_set_size()` internally acquires `ni_lock(ni)` and `ni->file.run_lock`. The deadlock-freedom of locking `filemap_invalidate_lock` before `ni_lock` and `run_lock` was verified against other callers in `fs/ntfs3/file.c` (e.g., `ntfs_fallocate()`, which already takes `filemap_invalidate_lock` before acquiring internal NTFS locks).
- Exact post-EOF folio tail zeroing behavior (such as `iomap_zero_range` for extending beyond EOF cluster boundaries) should also be evaluated if sparse or unwritten extent semantics require zeroing intermediate page cache folios.]

Results:
map[Answer:### 1. Is it correct to call `truncate_setsize` before `ntfs_set_size` when extending the file size?

**No, it is incorrect.**

- `truncate_setsize(inode, newsize)` immediately updates the in-memory `inode->i_size` via `i_size_write(inode, newsize)` and calls `pagecache_isize_extended()`.
- While `ntfs_setattr` holds `inode->i_rwsem`, page faults (`filemap_fault`) do **not** take `i_rwsem`. In `filemap_fault()`, folios are allocated and read holding only `filemap_invalidate_lock_shared(mapping)` (or under folio lock), not `i_rwsem`.
- If `truncate_setsize` is called before `ntfs_set_size`, a concurrent page fault can read the newly updated `inode->i_size` while the on-disk attribute length has not yet been modified by `ntfs_set_size`. When `ntfs_iomap_begin()` executes, it reads the old resident attribute length (e.g. 5 bytes) into `iomap->length`. Subsequently, `iomap_read_inline_data()` calculates `size = i_size_read(inode) - iomap->offset` (e.g. 20 bytes), which triggers `WARN_ON_ONCE(size > iomap->length)` and fails with `-EIO`.
- Furthermore, if `ntfs_set_size()` fails (e.g., due to `-EFBIG`, `-ENOSPC`, or disk I/O errors), the page cache has already been extended prematurely, requiring error rollback of `inode->i_size`.

---

### 2. How ext4 and XFS prevent concurrent reads/faults from observing intermediate states

Both filesystems serialize size modifications against page faults using `mapping->invalidate_lock` (or filesystem-specific lock abstractions mapping to it), and they sequence metadata updates appropriately:

1. **XFS (`xfs_vn_setattr` / `xfs_vn_setattr_size`)**:
   - `xfs_vn_setattr` acquires `xfs_ilock(ip, XFS_MMAPLOCK_EXCL)` before performing any size updates.
   - In XFS, `XFS_MMAPLOCK_EXCL` / `XFS_MMAPLOCK_SHARED` directly correspond to `down_write` / `down_read` of `inode->i_mapping->invalidate_lock`.
   - `filemap_fault()` takes `filemap_invalidate_lock_shared` when instantiating or reading non-uptodate folios. Holding `XFS_MMAPLOCK_EXCL` completely blocks concurrent page faults from running during truncate or file extension.
   - Under this lock, XFS zeroes beyond EOF (`xfs_zero_range`), updates page cache / size via `truncate_setsize`, logs the on-disk metadata (`ip->i_disk_size = newsize`), commits the transaction, and only then releases `XFS_MMAPLOCK_EXCL`.

2. **ext4 (`ext4_setattr`)**:
   - `ext4_setattr` holds `filemap_invalidate_lock(inode->i_mapping)` throughout the entire size change operation.
   - For file extension (`!shrink`), it first zeroes post-EOF folio tails (`ext4_block_zero_eof`), takes a journal handle, takes `down_write(&EXT4_I(inode)->i_data_sem)`, updates `EXT4_I(inode)->i_disksize` and calls `i_size_write(inode, attr->ia_size)` together under lock, and calls `pagecache_isize_extended(inode, oldsize, inode->i_size)`.
   - Concurrent faults are serialized because `ext4_page_mkwrite` and `filemap_fault` take `filemap_invalidate_lock_shared()`.

---

### 3. How this should be fixed in `ntfs_setattr`

To fix this issue in `fs/ntfs3/file.c`:

1. **Serialize page faults using `filemap_invalidate_lock`**:
   Surround the size modification block with `filemap_invalidate_lock(inode->i_mapping)` and `filemap_invalidate_unlock(inode->i_mapping)`. This blocks concurrent `filemap_fault()` calls from reading or populating folios while the size and attributes are changing.

2. **Order operations depending on whether extending or shrinking**:
   - **When extending (`newsize > oldsize`)**:
     Call `ntfs_set_size(inode, newsize)` **first** to resize/convert the attribute (including converting resident data to non-resident if necessary and allocating clusters). Once metadata and allocations succeed, call `truncate_setsize(inode, newsize)` (or `i_size_write(inode, newsize)` followed by `pagecache_isize_extended(inode, oldsize, newsize)`).
   - **When shrinking (`newsize < oldsize`)**:
     Call `truncate_setsize(inode, newsize)` first (to unmap and truncate folios beyond the new EOF so they are not written back to deallocated blocks), followed by `ntfs_set_size(inode, newsize)` to shrink the attribute and free unused clusters on disk.
   - **Error Handling**:
     If `ntfs_set_size` fails during shrinking, roll back `inode->i_size` under `filemap_invalidate_lock`.

**Example Patch Outline**:
```c
	if (newsize != oldsize) {
		filemap_invalidate_lock(inode->i_mapping);

		if (newsize > oldsize) {
			err = ntfs_set_size(inode, newsize);
			if (!err)
				truncate_setsize(inode, newsize);
		} else {
			truncate_setsize(inode, newsize);
			err = ntfs_set_size(inode, newsize);
			if (err)
				i_size_write(inode, oldsize);
		}

		filemap_invalidate_unlock(inode->i_mapping);

		if (err)
			goto out;

		ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
		ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
		inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
	}
```

---

### Limitations / Unverified Parts
- We verified the locking and ordering mechanisms in `ext4`, `xfs`, `ntfs`, `zonefs`, and `mm/filemap.c`.
- In `ntfs3`, `ntfs_set_size()` internally acquires `ni_lock(ni)` and `ni->file.run_lock`. The deadlock-freedom of locking `filemap_invalidate_lock` before `ni_lock` and `run_lock` was verified against other callers in `fs/ntfs3/file.c` (e.g., `ntfs_fallocate()`, which already takes `filemap_invalidate_lock` before acquiring internal NTFS locks).
- Exact post-EOF folio tail zeroing behavior (such as `iomap_zero_range` for extending beyond EOF cluster boundaries) should also be evaluated if sparse or unwritten extent semantics require zeroing intermediate page cache folios.]

171/2 2026/09/17 11:03 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 57349
							output: 23
							thoughts: 0
						

172/2 2026/09/17 11:03 tool codesearch-definition-source
0m Args:
map[Name:ntfs_fallocate]

Results:
map[SourceCode: 457:	/*
 458:	 * ntfs_fallocate - file_operations::ntfs_fallocate
 459:	 *
 460:	 * Preallocate space for a file. This implements ntfs's fallocate file
 461:	 * operation, which gets called from sys_fallocate system call. User
 462:	 * space requests 'len' bytes at 'vbo'. If FALLOC_FL_KEEP_SIZE is set
 463:	 * we just allocate clusters without zeroing them out. Otherwise we
 464:	 * allocate and zero out clusters via an expanding truncate.
 465:	 */
 466:	static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
 467:	{
 468:		struct inode *inode = file_inode(file);
 469:		struct address_space *mapping = inode->i_mapping;
 470:		struct super_block *sb = inode->i_sb;
 471:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 472:		struct ntfs_inode *ni = ntfs_i(inode);
 473:		loff_t end = vbo + len;
 474:		loff_t vbo_down = round_down(vbo, max_t(unsigned long,
 475:							sbi->cluster_size, PAGE_SIZE));
 476:		bool is_supported_holes = is_sparsed(ni) || is_compressed(ni);
 477:		loff_t i_size, new_size;
 478:		bool map_locked;
 479:		int err;
 480:	
 481:		/* No support for dir. */
 482:		if (!S_ISREG(inode->i_mode))
 483:			return -EOPNOTSUPP;
 484:	
 485:		/*
 486:		 * vfs_fallocate checks all possible combinations of mode.
 487:		 * Do additional checks here before ntfs_set_state(dirty).
 488:		 */
 489:		if (mode & FALLOC_FL_PUNCH_HOLE) {
 490:			if (!is_supported_holes)
 491:				return -EOPNOTSUPP;
 492:		} else if (mode & FALLOC_FL_COLLAPSE_RANGE) {
 493:		} else if (mode & FALLOC_FL_INSERT_RANGE) {
 494:			if (!is_supported_holes)
 495:				return -EOPNOTSUPP;
 496:		} else if (mode &
 497:			   ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
 498:			     FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_INSERT_RANGE)) {
 499:			ntfs_inode_warn(inode, "fallocate(0x%x) is not supported",
 500:					mode);
 501:			return -EOPNOTSUPP;
 502:		}
 503:	
 504:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 505:	
 506:		inode_lock(inode);
 507:		i_size = inode->i_size;
 508:		new_size = max(end, i_size);
 509:		map_locked = false;
 510:	
 511:		if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 512:			/* Should never be here, see ntfs_file_open. */
 513:			err = -EOPNOTSUPP;
 514:			goto out;
 515:		}
 516:	
 517:		if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
 518:			    FALLOC_FL_INSERT_RANGE)) {
 519:			inode_dio_wait(inode);
 520:			filemap_invalidate_lock(mapping);
 521:			map_locked = true;
 522:		}
 523:	
 524:		if (mode & FALLOC_FL_PUNCH_HOLE) {
 525:			u32 frame_size;
 526:			loff_t mask, vbo_a, end_a, tmp, from;
 527:	
 528:			err = filemap_write_and_wait_range(mapping, vbo_down,
 529:							   LLONG_MAX);
 530:			if (err)
 531:				goto out;
 532:	
 533:			truncate_pagecache(inode, vbo_down);
 534:	
 535:			ni_lock(ni);
 536:			err = attr_punch_hole(ni, vbo, len, &frame_size);
 537:			ni_unlock(ni);
 538:			if (!err)
 539:				goto ok;
 540:	
 541:			if (err != E_NTFS_NOTALIGNED)
 542:				goto out;
 543:	
 544:			/* Process not aligned punch. */
 545:			err = 0;
 546:			if (end > i_size)
 547:				end = i_size;
 548:			mask = frame_size - 1;
 549:			vbo_a = (vbo + mask) & ~mask;
 550:			end_a = end & ~mask;
 551:	
 552:			tmp = min(vbo_a, end);
 553:			from = min_t(loff_t, ni->i_valid, vbo);
 554:			/* Zero head of punch. */
 555:			if (tmp > from) {
 556:				err = iomap_zero_range(inode, from, tmp - from, NULL,
 557:						       &ntfs_iomap_ops,
 558:						       &ntfs_iomap_folio_ops, NULL);
 559:				if (err)
 560:					goto out;
 561:			}
 562:	
 563:			/* Aligned punch_hole. Deallocate clusters. */
 564:			if (end_a > vbo_a) {
 565:				ni_lock(ni);
 566:				err = attr_punch_hole(ni, vbo_a, end_a - vbo_a, NULL);
 567:				ni_unlock(ni);
 568:				if (err)
 569:					goto out;
 570:			}
 571:	
 572:			/* Zero tail of punch. */
 573:			if (vbo < end_a && end_a < end) {
 574:				err = iomap_zero_range(inode, end_a, end - end_a, NULL,
 575:						       &ntfs_iomap_ops,
 576:						       &ntfs_iomap_folio_ops, NULL);
 577:				if (err)
 578:					goto out;
 579:			}
 580:		} else if (mode & FALLOC_FL_COLLAPSE_RANGE) {
 581:			/*
 582:			 * Write tail of the last page before removed range since
 583:			 * it will get removed from the page cache below.
 584:			 */
 585:			err = filemap_write_and_wait_range(mapping, vbo_down, vbo);
 586:			if (err)
 587:				goto out;
 588:	
 589:			/*
 590:			 * Write data that will be shifted to preserve them
 591:			 * when discarding page cache below.
 592:			 */
 593:			err = filemap_write_and_wait_range(mapping, end, LLONG_MAX);
 594:			if (err)
 595:				goto out;
 596:	
 597:			truncate_pagecache(inode, vbo_down);
 598:	
 599:			ni_lock(ni);
 600:			err = attr_collapse_range(ni, vbo, len);
 601:			ni_unlock(ni);
 602:			if (err)
 603:				goto out;
 604:		} else if (mode & FALLOC_FL_INSERT_RANGE) {
 605:			/* Check new size. */
 606:			err = inode_newsize_ok(inode, new_size);
 607:			if (err)
 608:				goto out;
 609:	
 610:			/* Write out all dirty pages. */
 611:			err = filemap_write_and_wait_range(mapping, vbo_down,
 612:							   LLONG_MAX);
 613:			if (err)
 614:				goto out;
 615:			truncate_pagecache(inode, vbo_down);
 616:	
 617:			ni_lock(ni);
 618:			err = attr_insert_range(ni, vbo, len);
 619:			ni_unlock(ni);
 620:			if (err)
 621:				goto out;
 622:		} else {
 623:			/* Check new size. */
 624:			u8 cluster_bits = sbi->cluster_bits;
 625:	
 626:			/* Be sure file is non resident. */
 627:			if (is_resident(ni)) {
 628:				ni_lock(ni);
 629:				err = attr_force_nonresident(ni);
 630:				ni_unlock(ni);
 631:				if (err)
 632:					goto out;
 633:			}
 634:	
 635:			/* generic/213: expected -ENOSPC instead of -EFBIG. */
 636:			if (!is_supported_holes) {
 637:				loff_t to_alloc = new_size - inode_get_bytes(inode);
 638:	
 639:				if (to_alloc > 0 &&
 640:				    (to_alloc >> cluster_bits) >
 641:					    wnd_zeroes(&sbi->used.bitmap)) {
 642:					err = -ENOSPC;
 643:					goto out;
 644:				}
 645:			}
 646:	
 647:			err = inode_newsize_ok(inode, new_size);
 648:			if (err)
 649:				goto out;
 650:	
 651:			if (new_size > i_size) {
 652:				/*
 653:				 * Allocate clusters, do not change 'valid' size.
 654:				 */
 655:				err = ntfs_set_size(inode, new_size);
 656:				if (err)
 657:					goto out;
 658:			}
 659:	
 660:			if (is_supported_holes) {
 661:				CLST vcn = vbo >> cluster_bits;
 662:				CLST cend = bytes_to_cluster(sbi, end);
 663:				CLST lcn, clen;
 664:				bool new;
 665:	
 666:				/*
 667:				 * Allocate and zero new clusters.
 668:				 */
 669:				for (; vcn < cend; vcn += clen) {
 670:					err = attr_data_get_block(ni, vcn, cend - vcn,
 671:								  &lcn, &clen, &new,
 672:								  true, NULL, false);
 673:					if (err)
 674:						goto out;
 675:				}
 676:			}
 677:	
 678:			if (mode & FALLOC_FL_KEEP_SIZE) {
 679:				err = ntfs_set_size(inode, i_size);
 680:				if (err)
 681:					goto out;
 682:			}
 683:		}
 684:	
 685:	ok:
 686:		err = file_modified(file);
 687:		if (err)
 688:			goto out;
 689:	
 690:	out:
 691:		if (map_locked)
 692:			filemap_invalidate_unlock(mapping);
 693:	
 694:		if (!err) {
 695:			inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
 696:			mark_inode_dirty(inode);
 697:		}
 698:	
 699:		inode_unlock(inode);
 700:		return err;
 701:	}
 SourceFile:fs/ntfs3/file.c]

173/2 2026/09/17 11:03 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 61006
							output: 24
							thoughts: 0
						

174/2 2026/09/17 11:03 tool codesearch-definition-source
0m Args:
map[Name:ntfs_set_size]

Results:
map[SourceCode: 883:	int ntfs_set_size(struct inode *inode, u64 new_size)
 884:	{
 885:		struct super_block *sb = inode->i_sb;
 886:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 887:		struct ntfs_inode *ni = ntfs_i(inode);
 888:		int err;
 889:	
 890:		/* Check for maximum file size. */
 891:		if (is_sparsed(ni) || is_compressed(ni)) {
 892:			if (new_size > sbi->maxbytes_sparse) {
 893:				return -EFBIG;
 894:			}
 895:		} else if (new_size > sbi->maxbytes) {
 896:			return -EFBIG;
 897:		}
 898:	
 899:		/* Mark rw ntfs as dirty. It will be cleared at umount. */
 900:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 901:	
 902:		ni_lock(ni);
 903:		down_write(&ni->file.run_lock);
 904:		if (new_size < ni->i_valid)
 905:			ni->i_valid = new_size;
 906:	
 907:		/* last 'true' means keep preallocated. */
 908:		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
 909:				    &ni->file.run, new_size, &ni->i_valid, true);
 910:	
 911:		up_write(&ni->file.run_lock);
 912:		ni_unlock(ni);
 913:	
 914:		return err;
 915:	}
 SourceFile:fs/ntfs3/inode.c]

175/2 2026/09/17 11:03 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 61591
							output: 23
							thoughts: 0
						

176/2 2026/09/17 11:04 tool codesearch-definition-source
0m Args:
map[Name:ntfs_setattr]

Results:
map[SourceCode: 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
 770:		if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE))
 771:			ntfs_save_wsl_perm(inode, NULL);
 772:		mark_inode_dirty(inode);
 773:	out:
 774:		return err;
 775:	}
 SourceFile:fs/ntfs3/file.c]

177/2 2026/09/17 11:04 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 62706
							output: 91
							thoughts: 0
						

178/2 2026/09/17 11:04 tool codeexpert
11m Args:
map[Question:In `ntfs_setattr`, does it need to call `filemap_invalidate_lock(inode->i_mapping)` before `truncate_setsize` and `ntfs_set_size`?
If so, what is the correct order of `truncate_setsize` and `ntfs_set_size` for extending and shrinking the file size?]

Results:
map[Answer:Based on analysis of the kernel source code (`fs/ntfs3`, `fs/ntfs`, `mm/filemap.c`, `include/linux/fs.h`, and comparable filesystems like UDF and ext4):

### 1. Does `ntfs_setattr` need to call `filemap_invalidate_lock(inode->i_mapping)`?

**Yes.**
`filemap_invalidate_lock(inode->i_mapping)` should be taken before truncating/extending the pagecache and disk size, and released with `filemap_invalidate_unlock(inode->i_mapping)` after.

**Reason:**
- The VFS holds `inode->i_rwsem` across `->setattr`, but page faults (`filemap_fault` / `page_mkwrite`) execute without `inode->i_rwsem`. Instead, page fault handlers acquire `mmap_lock` and shared `filemap_invalidate_lock_shared(mapping)`.
- Holding `filemap_invalidate_lock(mapping)` in exclusive mode serializes the truncation/expansion against concurrent page faults and readahead, preventing race conditions where folios are faulted in or brought uptodate after pagecache eviction but before disk block deallocation, or while the file mapping is inconsistent.

---

### 2. Correct order of `truncate_setsize` and `ntfs_set_size`

In `fs/ntfs3/file.c`, `ntfs_setattr` unconditionally calls `truncate_setsize(inode, newsize)` before `ntfs_set_size(inode, newsize)`. The correct ordering should distinguish between extension and shrinking:

- **When extending the file (`newsize > oldsize`)**:
  - **Correct order:** Call `ntfs_set_size` **first**, then `truncate_setsize`.
  - **Reason:** `ntfs_set_size` performs disk block allocation and updates the NTFS on-disk attribute size. If allocation fails (e.g., `-ENOSPC` or `-EFBIG`), it returns an error before the in-memory `inode->i_size` is expanded and before pagecache folios are extended/instantiated. If `truncate_setsize` were called first, `inode->i_size` would be extended and pagecache notified (`pagecache_isize_extended`), requiring difficult and race-prone rollbacks on error.

- **When shrinking the file (`newsize < oldsize`)**:
  - **Correct order:** Call `truncate_setsize` **first**, then `ntfs_set_size`.
  - **Reason:** `truncate_setsize` updates `inode->i_size` to the smaller size and invalidates/drops cached pages beyond the new EOF (`truncate_pagecache`). Disk blocks/clusters must only be freed on disk via `ntfs_set_size` after the corresponding cached folios have been removed from memory. If disk blocks were freed before truncating the page cache, writeback or concurrent operations could attempt to access or write dirty pages to disk blocks that were already returned to the free space allocator.

---

### Caveats and Unverified Parts:
- Git commit history in the checkout is restricted to a shallow repository, so commit logs and specific mailing list discussions introducing or addressing this in `fs/ntfs3` could not be traced through `git log`.
- The conclusions are derived from the locking semantics in `include/linux/fs.h` / `mm/filemap.c` and how other filesystems (such as `fs/udf/inode.c:udf_setsize`, `fs/ext4/inode.c:ext4_setattr`, and legacy `fs/ntfs/file.c`) implement extending vs. shrinking file truncation.]

179/3 2026/09/17 11:04 agent codeexpert
11m Model:
core

Results:
map[Answer:Based on analysis of the kernel source code (`fs/ntfs3`, `fs/ntfs`, `mm/filemap.c`, `include/linux/fs.h`, and comparable filesystems like UDF and ext4):

### 1. Does `ntfs_setattr` need to call `filemap_invalidate_lock(inode->i_mapping)`?

**Yes.**
`filemap_invalidate_lock(inode->i_mapping)` should be taken before truncating/extending the pagecache and disk size, and released with `filemap_invalidate_unlock(inode->i_mapping)` after.

**Reason:**
- The VFS holds `inode->i_rwsem` across `->setattr`, but page faults (`filemap_fault` / `page_mkwrite`) execute without `inode->i_rwsem`. Instead, page fault handlers acquire `mmap_lock` and shared `filemap_invalidate_lock_shared(mapping)`.
- Holding `filemap_invalidate_lock(mapping)` in exclusive mode serializes the truncation/expansion against concurrent page faults and readahead, preventing race conditions where folios are faulted in or brought uptodate after pagecache eviction but before disk block deallocation, or while the file mapping is inconsistent.

---

### 2. Correct order of `truncate_setsize` and `ntfs_set_size`

In `fs/ntfs3/file.c`, `ntfs_setattr` unconditionally calls `truncate_setsize(inode, newsize)` before `ntfs_set_size(inode, newsize)`. The correct ordering should distinguish between extension and shrinking:

- **When extending the file (`newsize > oldsize`)**:
  - **Correct order:** Call `ntfs_set_size` **first**, then `truncate_setsize`.
  - **Reason:** `ntfs_set_size` performs disk block allocation and updates the NTFS on-disk attribute size. If allocation fails (e.g., `-ENOSPC` or `-EFBIG`), it returns an error before the in-memory `inode->i_size` is expanded and before pagecache folios are extended/instantiated. If `truncate_setsize` were called first, `inode->i_size` would be extended and pagecache notified (`pagecache_isize_extended`), requiring difficult and race-prone rollbacks on error.

- **When shrinking the file (`newsize < oldsize`)**:
  - **Correct order:** Call `truncate_setsize` **first**, then `ntfs_set_size`.
  - **Reason:** `truncate_setsize` updates `inode->i_size` to the smaller size and invalidates/drops cached pages beyond the new EOF (`truncate_pagecache`). Disk blocks/clusters must only be freed on disk via `ntfs_set_size` after the corresponding cached folios have been removed from memory. If disk blocks were freed before truncating the page cache, writeback or concurrent operations could attempt to access or write dirty pages to disk blocks that were already returned to the free space allocator.

---

### Caveats and Unverified Parts:
- Git commit history in the checkout is restricted to a shallow repository, so commit logs and specific mailing list discussions introducing or addressing this in `fs/ntfs3` could not be traced through `git log`.
- The conclusions are derived from the locking semantics in `include/linux/fs.h` / `mm/filemap.c` and how other filesystems (such as `fs/udf/inode.c:udf_setsize`, `fs/ext4/inode.c:ext4_setattr`, and legacy `fs/ntfs/file.c`) implement extending vs. shrinking file truncation.]

Instruction:
You are a capable Linux kernel developer tasked with researching complex questions
about kernel source code. You will be given a concrete question, and need to provide
a concrete answer.
Research the question using targeted, efficient tool calls. Don't make assumptions,
or rely on your previous knowledge about the kernel source code, use available tools
to access the actual source code. Keep your tool calls focused and limited to the
scope of the question. Do not explore tangential code paths or perform unbounded searches.
Use all available sources of information:
 - kernel source code
 - documentation in the Documentation dir in the source tree
 - git commits descriptions, git blame

Do not guess file names or file paths and attempt to read them without
verifying their existence first using content search or directory listing tools.
If a file, symbol, or directory is not found via content search (grepper) or
directory listing (codesearch-dir-index), treat it as completely absent.
Do not attempt to guess alternative names, extensions, or directories.

Tool Selection Guidelines:
1. For C functions, structs, and variables: Prefer codesearch-definition-source
   or codesearch-struct-layout FIRST to retrieve clean, exact definitions
   without line-number guessing.
2. If symbol lookup fails (e.g., preprocessor macros, macro-generated code, or
   disabled #ifdef branches), fall back to read-file or grepper.
3. For file headers, #include directives, preprocessor macro definitions, and
   non-C files (Kconfig, Makefiles, docs): Use read-file or grepper directly.
4. Be concise and targeted. Answer the question as directly and concisely as possible
   once you have located the relevant code or definitions. If a symbol or function cannot
   be found after targeted searches, conclude with the best available information rather
   than continuing repetitive searches.
Do NOT use git-log to search for the presence or existence of files in the
repository. git-log is only for tracing commit history of files that are
already present in the current checkout. If a file does not exist in the
current checkout, it cannot be used for reproduction.

Avoid running broad git-log queries (such as searches on the entire repo)
without a specific 'PathPrefix' to restrict the scope, as these are very
expensive and will time out.
If a git-log tool call times out, do not retry the query with the same broad
scope. You must specify a tighter, narrower 'PathPrefix' for subsequent queries.

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:
In `ntfs_setattr`, does it need to call `filemap_invalidate_lock(inode->i_mapping)` before `truncate_setsize` and `ntfs_set_size`?
If so, what is the correct order of `truncate_setsize` and `ntfs_set_size` for extending and shrinking the file size?

180/4 2026/09/17 11:04 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 4223
							output: 19
							thoughts: 135
						

Thoughts:
**Analyzing the NTFS Attribute Setting Process**

Okay, so the question is about `ntfs_setattr` and its interaction with file size adjustments – specifically, whether we need to invalidate the file map before truncating and setting the size. My initial thought is to dive right into the code to clarify this. We're dealing with NTFS, or is it NTFS3? Let's assume it's `ntfs` for now, but we need to verify. My gut feeling is that the invalidation might be crucial for data integrity, but the specific ordering of operations – `truncate_setsize` versus `ntfs_set_size` – is what I need to pinpoint. 

So, I'll use `codesearch-definition-source` or `grepper` to locate the `ntfs_setattr` function in the codebase. From there, I can examine its implementation and see exactly how it handles size changes and memory mapping. The goal is to understand the control flow, look at any locking mechanisms, and definitively answer the question about the invalidation step and optimal operation order. I'm going to look for any clues about data consistency with these size alterations.



181/4 2026/09/17 11:04 tool grepper
0m Args:
map[Expression:ntfs_setattr]

Results:
map[Output:fs/ntfs/file.c=158=static int ntfs_file_fsync(struct file *filp, loff_t start, loff_t end,
--
fs/ntfs/file.c-253-
fs/ntfs/file.c:254:static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
fs/ntfs/file.c-255-{
--
fs/ntfs/file.c-296-/*
fs/ntfs/file.c:297: * ntfs_setattr
fs/ntfs/file.c-298- *
--
fs/ntfs/file.c-303- */
fs/ntfs/file.c:304:int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/ntfs/file.c-305-		 struct iattr *attr)
--
fs/ntfs/file.c-330-	if (ia_valid & ATTR_SIZE) {
fs/ntfs/file.c:331:		err = ntfs_setattr_size(vi, attr);
fs/ntfs/file.c-332-		if (err)
--
fs/ntfs/file.c=1232=const struct inode_operations ntfs_file_inode_ops = {
fs/ntfs/file.c:1233:	.setattr	= ntfs_setattr,
fs/ntfs/file.c-1234-	.getattr	= ntfs_getattr,
--
fs/ntfs/file.c=1241=const struct inode_operations ntfs_symlink_inode_operations = {
fs/ntfs/file.c-1242-	.get_link	= ntfs_get_link,
fs/ntfs/file.c:1243:	.setattr	= ntfs_setattr,
fs/ntfs/file.c-1244-	.listxattr	= ntfs_listxattr,
--
fs/ntfs/file.c=1247=const struct inode_operations ntfs_special_inode_operations = {
fs/ntfs/file.c:1248:	.setattr	= ntfs_setattr,
fs/ntfs/file.c-1249-	.getattr	= ntfs_getattr,
--
fs/ntfs/inode.h=331=int ntfs_truncate_vfs(struct inode *vi, loff_t new_size, loff_t i_size);
fs/ntfs/inode.h-332-
fs/ntfs/inode.h:333:int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/ntfs/inode.h-334-		 struct iattr *attr);
--
fs/ntfs/namei.c=1558=const struct inode_operations ntfs_dir_inode_ops = {
--
fs/ntfs/namei.c-1567-	.listxattr	= ntfs_listxattr,
fs/ntfs/namei.c:1568:	.setattr	= ntfs_setattr,
fs/ntfs/namei.c-1569-	.getattr	= ntfs_getattr,
--
fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-703-/*
fs/ntfs3/file.c:704: * ntfs_setattr - inode_operations::setattr
fs/ntfs3/file.c-705- */
fs/ntfs3/file.c:706:int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/ntfs3/file.c-707-		 struct iattr *attr)
--
fs/ntfs3/file.c=1575=const struct inode_operations ntfs_file_inode_operations = {
fs/ntfs3/file.c-1576-	.getattr	= ntfs_getattr,
fs/ntfs3/file.c:1577:	.setattr	= ntfs_setattr,
fs/ntfs3/file.c-1578-	.listxattr	= ntfs_listxattr,
--
fs/ntfs3/inode.c=2293=const struct inode_operations ntfs_link_inode_operations = {
fs/ntfs3/inode.c-2294-	.get_link	= ntfs_get_link,
fs/ntfs3/inode.c:2295:	.setattr	= ntfs_setattr,
fs/ntfs3/inode.c-2296-	.listxattr	= ntfs_listxattr,
--
fs/ntfs3/namei.c=529=const struct inode_operations ntfs_dir_inode_operations = {
--
fs/ntfs3/namei.c-540-	.set_acl	= ntfs_set_acl,
fs/ntfs3/namei.c:541:	.setattr	= ntfs_setattr,
fs/ntfs3/namei.c-542-	.getattr	= ntfs_getattr,
--
fs/ntfs3/namei.c=549=const struct inode_operations ntfs_special_inode_operations = {
fs/ntfs3/namei.c:550:	.setattr	= ntfs_setattr,
fs/ntfs3/namei.c-551-	.getattr	= ntfs_getattr,
--
fs/ntfs3/ntfs_fs.h=556=int ntfs_getattr(struct mnt_idmap *idmap, const struct path *path,
fs/ntfs3/ntfs_fs.h-557-		 struct kstat *stat, u32 request_mask, u32 flags);
fs/ntfs3/ntfs_fs.h:558:int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/ntfs3/ntfs_fs.h-559-		 struct iattr *attr);
--
fs/ntfs3/xattr.c=691=int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode,
--
fs/ntfs3/xattr.c-722-/*
fs/ntfs3/xattr.c:723: * ntfs_acl_chmod - Helper for ntfs_setattr().
fs/ntfs3/xattr.c-724- */
]

182/4 2026/09/17 11:05 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 6338
							output: 20
							thoughts: 66
						

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

**Investigating NTFS Attribute Handling**

Okay, so I see something interesting here – both the legacy NTFS implementation (`fs/ntfs/file.c`) and the newer NTFS3 version (`fs/ntfs3/file.c`) *both* define `ntfs_setattr`. That's not entirely unexpected, given the core file system responsibilities.

Now, I'm getting curious about how file sizing is handled. Let me quickly double-check where the `ntfs_set_size` function actually lives. My intuition is telling me it's in the more recent code, `fs/ntfs3`, but it's always best to verify. I'll need to go look.



183/4 2026/09/17 11:05 tool grepper
0m Args:
map[Expression:ntfs_set_size]

Results:
map[Output:fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-654-			 */
fs/ntfs3/file.c:655:			err = ntfs_set_size(inode, new_size);
fs/ntfs3/file.c-656-			if (err)
--
fs/ntfs3/file.c-678-		if (mode & FALLOC_FL_KEEP_SIZE) {
fs/ntfs3/file.c:679:			err = ntfs_set_size(inode, i_size);
fs/ntfs3/file.c-680-			if (err)
--
fs/ntfs3/file.c=706=int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ntfs3/file.c-740-
fs/ntfs3/file.c:741:			err = ntfs_set_size(inode, newsize);
fs/ntfs3/file.c-742-			if (err) {
--
fs/ntfs3/file.c=1239=static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/ntfs3/file.c-1286-		 */
fs/ntfs3/file.c:1287:		ret = ntfs_set_size(inode, endbyte);
fs/ntfs3/file.c-1288-		if (ret)
--
fs/ntfs3/inode.c=860=static void ntfs_readahead(struct readahead_control *rac)
--
fs/ntfs3/inode.c-882-
fs/ntfs3/inode.c:883:int ntfs_set_size(struct inode *inode, u64 new_size)
fs/ntfs3/inode.c-884-{
--
fs/ntfs3/ntfs_fs.h=796=static inline struct inode *ntfs_iget5(struct super_block *sb,
--
fs/ntfs3/ntfs_fs.h-801-}
fs/ntfs3/ntfs_fs.h:802:int ntfs_set_size(struct inode *inode, u64 new_size);
fs/ntfs3/ntfs_fs.h-803-int ntfs3_write_inode(struct inode *inode, struct writeback_control *wbc);
]

184/4 2026/09/17 11:05 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 7259
							output: 37
							thoughts: 81
						

Thoughts:
Here's my analysis of that snippet, from my perspective as an expert:

**Locating the Relevant Code**

Alright, so the core of this seems to revolve around `ntfs_setattr` within the NTFS3 filesystem. I need to be precise here. The initial context points me directly to `fs/ntfs3/file.c`. Specifically, I recall `ntfs_set_size` being defined within that file, which narrows down the scope of inquiry to `fs/ntfs3/file.c` (or at least the broader `ntfs3` module) regarding `ntfs_setattr`.

Now, my next step is focused investigation. I think line 700 of `fs/ntfs3/file.c` might be a useful starting point for the investigation. I will check the `read-file` context around that area to gain more insight into `ntfs_setattr`.



185/4 2026/09/17 11:05 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:700 LineCount:80]

Results:
map[Contents: 700:		return err;
 701:	}
 702:	
 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
 770:		if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE))
 771:			ntfs_save_wsl_perm(inode, NULL);
 772:		mark_inode_dirty(inode);
 773:	out:
 774:		return err;
 775:	}
 776:	
 777:	/*
 778:	 * check_read_restriction:
 779:	 * common code for ntfs_file_read_iter and ntfs_file_splice_read
]

186/4 2026/09/17 11:06 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 8729
							output: 30
							thoughts: 304
						

Thoughts:
**Analyzing NTFS3 File Truncation in `ntfs_setattr`**

Okay, so I'm looking at this code snippet, specifically lines 738-745 in `fs/ntfs3/file.c`. This is where the file size is adjusted, and I need to figure out the proper sequence and whether a `filemap_invalidate_lock` call is needed in `ntfs_setattr` before those.

The questions are pretty straightforward: Should we invalidate the filemap before setting the new size via `truncate_setsize` and `ntfs_set_size`, and if so, does the order matter for expanding or shrinking the file?

My immediate thought is to avoid reinventing the wheel. Let's start with a systematic approach. Instead of randomly poking around, I'll go straight to the source. I'm going to start with git to search the commit logs. First, I'll search for commits that touch `fs/ntfs3/file.c` or recent commits that modify `ntfs_setattr` or, more importantly, `filemap_invalidate_lock`. I can also search for commits that touch both `filemap_invalidate_lock` and `truncate_setsize`.

If that doesn't provide the answer directly, I'll widen the search and look for patterns, specifically how *other* filesystems handle `setattr` and the interaction with `filemap_invalidate_lock`. I'll review commit messages for anything related to these concepts in the git log or research how different filesystems implement this. I’m thinking there might be useful information from the perspective of how a bug was introduced, or addressed in the past.



187/4 2026/09/17 11:06 tool git-log
0m Args:
map[Count:20 PathPrefix:fs/ntfs3/file.c]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

188/4 2026/09/17 11:06 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 9457
							output: 37
							thoughts: 69
						

Thoughts:
Here's the summary, framed as your internal monologue:

**Investigating a Git-Log Anomaly**

Okay, hold on a minute. Why did `git log` just spit back only Linux 7.3-rc3? My initial thought was that there's some sort of default message regex or filtering at play, but no, the raw `Count: 20` result clearly showed that wasn't the issue. That makes it more confusing. Why just one commit then? Perhaps, and this is highly probable, `git log` without a specified `Since` argument *defaults* to looking at the `HEAD` commit, or a very narrow range. Let's confirm this suspicion. Time to verify the impact of including `Since`...I'll need to test that to confirm the current behavior.



189/4 2026/09/17 11:06 tool git-log
0m Args:
map[Count:20 PathPrefix:fs/ntfs3/file.c Since:3 years]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

190/4 2026/09/17 11:06 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 9768
							output: 34
							thoughts: 45
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own:

**Investigating a Limited Git Response**

Hmm, that's odd. I expected a more comprehensive result from that git command. Why did it only return the commit hash `fd73f4a66598`? That doesn't seem right. It feels like there should be more information. Alright, time to dig deeper. I'll need to explore the git history to understand what's happening. I'll probably employ `grepper`, or perhaps the standard `git log` command. To narrow down the search and extract the relevant information, I'll leverage CodeRegexp or MessageRegexps to refine the output and pinpoint what I'm looking for in the commit messages or code changes. Let's get to the bottom of this.



191/4 2026/09/17 11:07 tool git-log
0m Args:
map[CodeRegexp:filemap_invalidate_lock PathPrefix:fs/ntfs3]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

192/4 2026/09/17 11:07 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 10057
							output: 26
							thoughts: 44
						

Thoughts:
Okay, let's break this down.

**Investigating the Git Log Discrepancy**

Hmm, so `git-log` is only showing me results up to Linux 7.3-rc3. That's not right; there should be more commits visible. Let me check the specifics of that commit in the `git-log` output, to see if anything is amiss. Right, the commit hash is `fd73f4a66598`. Let's use `git show fd73f4a66598` to take a look at *that* specific commit and see what it reveals. This should tell me about the changes introduced by that commit and hopefully provide some clues as to why `git-log` is behaving like this. I need to understand this to have any sort of idea on the discrepancy.



193/4 2026/09/17 11:07 tool git-show
0m Args:
map[Commit:fd73f4a66598]

Results:
map[Output:commit fd73f4a6659897191fa0d40695fe370925dd3780
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Sep 13 14:38:02 2026 -0700

    Linux 7.3-rc3

diff --git a/.clang-format b/.clang-format
new file mode 100644
index 000000000..5ef5743b7
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,808 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# clang-format configuration file. Intended for clang-format >= 11.
+#
+# For more information, see:
+#
+#   Documentation/dev-tools/clang-format.rst
+#   https://clang.llvm.org/docs/ClangFormat.html
+#   https://clang.llvm.org/docs/ClangFormatStyleOptions.html
+#
+---
+AccessModifierOffset: -4
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Left
+AlignOperands: true
+AlignTrailingComments: false
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: false
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+  AfterClass: false
+  AfterControlStatement: false
+  AfterEnum: false
+  AfterFunction: true
+  AfterNamespace: true
+  AfterObjCDeclaration: false
+  AfterStruct: false
+  AfterUnion: false
+  AfterExternBlock: false
+  BeforeCatch: false
+  BeforeElse: false
+  IndentBraces: false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Custom
+BreakBeforeInheritanceComma: false
+BreakBeforeTernaryOperators: false
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeComma
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: false
+ColumnLimit: 80
+CommentPragmas: '^ IWYU pragma:'
+CompactNamespaces: false
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 8
+ContinuationIndentWidth: 8
+Cpp11BracedListStyle: false
+DerivePointerAlignment: false
+DisableFormat: false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: false
+
+# Taken from:
+#   git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ tools/ \
+#   | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$,  - '\1'," \
+#   | LC_ALL=C sort -u
+ForEachMacros:
+  - '__ata_qc_for_each'
+  - '__bio_for_each_bvec'
+  - '__bio_for_each_segment'
+  - '__evlist__for_each_entry'
+  - '__evlist__for_each_entry_continue'
+  - '__evlist__for_each_entry_from'
+  - '__evlist__for_each_entry_reverse'
+  - '__evlist__for_each_entry_safe'
+  - '__for_each_mem_range'
+  - '__for_each_mem_range_rev'
+  - '__for_each_thread'
+  - '__hlist_for_each_rcu'
+  - '__map__for_each_symbol_by_name'
+  - '__pci_bus_for_each_res0'
+  - '__pci_bus_for_each_res1'
+  - '__pci_dev_for_each_res0'
+  - '__pci_dev_for_each_res1'
+  - '__perf_evlist__for_each_entry'
+  - '__perf_evlist__for_each_entry_reverse'
+  - '__perf_evlist__for_each_entry_safe'
+  - '__rq_for_each_bio'
+  - '__shost_for_each_device'
+  - '__sym_for_each'
+  - '_for_each_counter'
+  - 'apei_estatus_for_each_section'
+  - 'ata_for_each_dev'
+  - 'ata_for_each_link'
+  - 'ata_qc_for_each'
+  - 'ata_qc_for_each_raw'
+  - 'ata_qc_for_each_with_internal'
+  - 'ax25_for_each'
+  - 'ax25_uid_for_each'
+  - 'bio_for_each_bvec'
+  - 'bio_for_each_bvec_all'
+  - 'bio_for_each_folio_all'
+  - 'bio_for_each_integrity_vec'
+  - 'bio_for_each_segment'
+  - 'bio_for_each_segment_all'
+  - 'bio_list_for_each'
+  - 'bip_for_each_vec'
+  - 'bond_for_each_slave'
+  - 'bond_for_each_slave_rcu'
+  - 'bpf_for_each'
+  - 'bpf_for_each_reg_in_vstate'
+  - 'bpf_for_each_reg_in_vstate_mask'
+  - 'bpf_for_each_spilled_reg'
+  - 'bpf_object__for_each_map'
+  - 'bpf_object__for_each_program'
+  - 'btree_for_each_safe128'
+  - 'btree_for_each_safe32'
+  - 'btree_for_each_safe64'
+  - 'btree_for_each_safel'
+  - 'card_for_each_dev'
+  - 'cgroup_taskset_for_each'
+  - 'cgroup_taskset_for_each_leader'
+  - 'cpu_aggr_map__for_each_idx'
+  - 'cpufreq_for_each_efficient_entry_idx'
+  - 'cpufreq_for_each_entry'
+  - 'cpufreq_for_each_entry_idx'
+  - 'cpufreq_for_each_valid_entry'
+  - 'cpufreq_for_each_valid_entry_idx'
+  - 'css_for_each_child'
+  - 'css_for_each_descendant_post'
+  - 'css_for_each_descendant_pre'
+  - 'damon_for_each_region'
+  - 'damon_for_each_region_from'
+  - 'damon_for_each_region_safe'
+  - 'damon_for_each_scheme'
+  - 'damon_for_each_scheme_safe'
+  - 'damon_for_each_target'
+  - 'damon_for_each_target_safe'
+  - 'damos_for_each_core_filter'
+  - 'damos_for_each_core_filter_safe'
+  - 'damos_for_each_ops_filter'
+  - 'damos_for_each_ops_filter_safe'
+  - 'damos_for_each_quota_goal'
+  - 'damos_for_each_quota_goal_safe'
+  - 'data__for_each_file'
+  - 'data__for_each_file_new'
+  - 'data__for_each_file_start'
+  - 'def_for_each_cpu'
+  - 'device_for_each_child_node'
+  - 'device_for_each_child_node_scoped'
+  - 'dma_fence_array_for_each'
+  - 'dma_fence_chain_for_each'
+  - 'dma_fence_unwrap_for_each'
+  - 'dma_resv_for_each_fence'
+  - 'dma_resv_for_each_fence_unlocked'
+  - 'do_for_each_ftrace_op'
+  - 'drm_atomic_crtc_for_each_plane'
+  - 'drm_atomic_crtc_state_for_each_plane'
+  - 'drm_atomic_crtc_state_for_each_plane_state'
+  - 'drm_atomic_for_each_plane_damage'
+  - 'drm_client_for_each_connector_iter'
+  - 'drm_client_for_each_modeset'
+  - 'drm_connector_for_each_possible_encoder'
+  - 'drm_exec_for_each_locked_object'
+  - 'drm_exec_for_each_locked_object_reverse'
+  - 'drm_for_each_bridge_in_chain'
+  - 'drm_for_each_connector_iter'
+  - 'drm_for_each_crtc'
+  - 'drm_for_each_crtc_reverse'
+  - 'drm_for_each_encoder'
+  - 'drm_for_each_encoder_mask'
+  - 'drm_for_each_fb'
+  - 'drm_for_each_legacy_plane'
+  - 'drm_for_each_plane'
+  - 'drm_for_each_plane_mask'
+  - 'drm_for_each_privobj'
+  - 'drm_gem_for_each_gpuvm_bo'
+  - 'drm_gem_for_each_gpuvm_bo_safe'
+  - 'drm_gpusvm_for_each_range'
+  - 'drm_gpuva_for_each_op'
+  - 'drm_gpuva_for_each_op_from_reverse'
+  - 'drm_gpuva_for_each_op_reverse'
+  - 'drm_gpuva_for_each_op_safe'
+  - 'drm_gpuvm_bo_for_each_va'
+  - 'drm_gpuvm_bo_for_each_va_safe'
+  - 'drm_gpuvm_for_each_va'
+  - 'drm_gpuvm_for_each_va_range'
+  - 'drm_gpuvm_for_each_va_range_safe'
+  - 'drm_gpuvm_for_each_va_safe'
+  - 'drm_mm_for_each_hole'
+  - 'drm_mm_for_each_node'
+  - 'drm_mm_for_each_node_in_range'
+  - 'drm_mm_for_each_node_safe'
+  - 'dsa_switch_for_each_available_port'
+  - 'dsa_switch_for_each_cpu_port'
+  - 'dsa_switch_for_each_cpu_port_continue_reverse'
+  - 'dsa_switch_for_each_port'
+  - 'dsa_switch_for_each_port_continue_reverse'
+  - 'dsa_switch_for_each_port_safe'
+  - 'dsa_switch_for_each_user_port'
+  - 'dsa_switch_for_each_user_port_continue_reverse'
+  - 'dsa_tree_for_each_cpu_port'
+  - 'dsa_tree_for_each_user_port'
+  - 'dsa_tree_for_each_user_port_continue_reverse'
+  - 'dso__for_each_symbol'
+  - 'elf_hash_for_each_possible'
+  - 'elf_symtab__for_each_symbol'
+  - 'evlist__for_each_cpu'
+  - 'evlist__for_each_entry'
+  - 'evlist__for_each_entry_continue'
+  - 'evlist__for_each_entry_from'
+  - 'evlist__for_each_entry_reverse'
+  - 'evlist__for_each_entry_safe'
+  - 'flow_action_for_each'
+  - 'for_each_acpi_consumer_dev'
+  - 'for_each_acpi_dev_match'
+  - 'for_each_active_dev_scope'
+  - 'for_each_active_drhd_unit'
+  - 'for_each_active_iommu'
+  - 'for_each_active_irq'
+  - 'for_each_active_route'
+  - 'for_each_aggr_pgid'
+  - 'for_each_alloc_capable_rdt_resource'
+  - 'for_each_and_bit'
+  - 'for_each_andnot_bit'
+  - 'for_each_available_child_of_node'
+  - 'for_each_available_child_of_node_scoped'
+  - 'for_each_bench'
+  - 'for_each_bio'
+  - 'for_each_board_func_rsrc'
+  - 'for_each_btf_ext_rec'
+  - 'for_each_btf_ext_sec'
+  - 'for_each_bvec'
+  - 'for_each_capable_rdt_resource'
+  - 'for_each_card_auxs'
+  - 'for_each_card_auxs_safe'
+  - 'for_each_card_components'
+  - 'for_each_card_dapms'
+  - 'for_each_card_pre_auxs'
+  - 'for_each_card_prelinks'
+  - 'for_each_card_rtds'
+  - 'for_each_card_rtds_safe'
+  - 'for_each_card_widgets'
+  - 'for_each_card_widgets_safe'
+  - 'for_each_cgroup_storage_type'
+  - 'for_each_child_of_node'
+  - 'for_each_child_of_node_scoped'
+  - 'for_each_child_of_node_with_prefix'
+  - 'for_each_clear_bit'
+  - 'for_each_clear_bit_from'
+  - 'for_each_clear_bitrange'
+  - 'for_each_clear_bitrange_from'
+  - 'for_each_cmd'
+  - 'for_each_cmsghdr'
+  - 'for_each_collection'
+  - 'for_each_comp_order'
+  - 'for_each_compatible_node'
+  - 'for_each_compatible_node_scoped'
+  - 'for_each_component_dais'
+  - 'for_each_component_dais_safe'
+  - 'for_each_conduit'
+  - 'for_each_console'
+  - 'for_each_console_srcu'
+  - 'for_each_cpu'
+  - 'for_each_cpu_and'
+  - 'for_each_cpu_andnot'
+  - 'for_each_cpu_from'
+  - 'for_each_cpu_or'
+  - 'for_each_cpu_wrap'
+  - 'for_each_dapm_widgets'
+  - 'for_each_dedup_cand'
+  - 'for_each_dev_addr'
+  - 'for_each_dev_scope'
+  - 'for_each_dma_cap_mask'
+  - 'for_each_dpcm_be'
+  - 'for_each_dpcm_be_rollback'
+  - 'for_each_dpcm_be_safe'
+  - 'for_each_dpcm_fe'
+  - 'for_each_drhd_unit'
+  - 'for_each_dss_dev'
+  - 'for_each_efi_memory_desc'
+  - 'for_each_efi_memory_desc_in_map'
+  - 'for_each_element'
+  - 'for_each_element_extid'
+  - 'for_each_element_id'
+  - 'for_each_enabled_cpu'
+  - 'for_each_endpoint_of_node'
+  - 'for_each_event'
+  - 'for_each_event_tps'
+  - 'for_each_evictable_lru'
+  - 'for_each_fib6_node_rt_rcu'
+  - 'for_each_fib6_walker_rt'
+  - 'for_each_file_lock'
+  - 'for_each_free_mem_range'
+  - 'for_each_free_mem_range_reverse'
+  - 'for_each_func_rsrc'
+  - 'for_each_gpiochip_node'
+  - 'for_each_group_evsel'
+  - 'for_each_group_evsel_head'
+  - 'for_each_group_member'
+  - 'for_each_group_member_head'
+  - 'for_each_hstate'
+  - 'for_each_hwgpio'
+  - 'for_each_hwgpio_in_range'
+  - 'for_each_if'
+  - 'for_each_inject_fn'
+  - 'for_each_insn'
+  - 'for_each_insn_op_loc'
+  - 'for_each_insn_prefix'
+  - 'for_each_intid'
+  - 'for_each_iommu'
+  - 'for_each_ip_tunnel_rcu'
+  - 'for_each_irq_desc'
+  - 'for_each_irq_nr'
+  - 'for_each_lang'
+  - 'for_each_link_ch_maps'
+  - 'for_each_link_codecs'
+  - 'for_each_link_cpus'
+  - 'for_each_link_platforms'
+  - 'for_each_lru'
+  - 'for_each_matching_node'
+  - 'for_each_matching_node_and_match'
+  - 'for_each_media_entity_data_link'
+  - 'for_each_mem_pfn_range'
+  - 'for_each_mem_range'
+  - 'for_each_mem_range_rev'
+  - 'for_each_mem_region'
+  - 'for_each_member'
+  - 'for_each_memory'
+  - 'for_each_migratetype_order'
+  - 'for_each_missing_reg'
+  - 'for_each_mle_subelement'
+  - 'for_each_mod_mem_type'
+  - 'for_each_mon_capable_rdt_resource'
+  - 'for_each_mp_bvec'
+  - 'for_each_net'
+  - 'for_each_net_continue_reverse'
+  - 'for_each_net_rcu'
+  - 'for_each_netdev'
+  - 'for_each_netdev_continue'
+  - 'for_each_netdev_continue_rcu'
+  - 'for_each_netdev_continue_reverse'
+  - 'for_each_netdev_dump'
+  - 'for_each_netdev_feature'
+  - 'for_each_netdev_in_bond_rcu'
+  - 'for_each_netdev_rcu'
+  - 'for_each_netdev_reverse'
+  - 'for_each_netdev_safe'
+  - 'for_each_new_connector_in_state'
+  - 'for_each_new_crtc_in_state'
+  - 'for_each_new_mst_mgr_in_state'
+  - 'for_each_new_plane_in_state'
+  - 'for_each_new_plane_in_state_reverse'
+  - 'for_each_new_private_obj_in_state'
+  - 'for_each_new_reg'
+  - 'for_each_nhlt_endpoint'
+  - 'for_each_nhlt_endpoint_fmtcfg'
+  - 'for_each_nhlt_fmtcfg'
+  - 'for_each_node'
+  - 'for_each_node_by_name'
+  - 'for_each_node_by_type'
+  - 'for_each_node_mask'
+  - 'for_each_node_numadist'
+  - 'for_each_node_state'
+  - 'for_each_node_with_cpus'
+  - 'for_each_node_with_property'
+  - 'for_each_nonreserved_multicast_dest_pgid'
+  - 'for_each_numa_hop_mask'
+  - 'for_each_of_allnodes'
+  - 'for_each_of_allnodes_from'
+  - 'for_each_of_cpu_node'
+  - 'for_each_of_graph_port'
+  - 'for_each_of_graph_port_endpoint'
+  - 'for_each_of_pci_range'
+  - 'for_each_old_connector_in_state'
+  - 'for_each_old_crtc_in_state'
+  - 'for_each_old_mst_mgr_in_state'
+  - 'for_each_old_plane_in_state'
+  - 'for_each_old_private_obj_in_state'
+  - 'for_each_oldnew_connector_in_state'
+  - 'for_each_oldnew_crtc_in_state'
+  - 'for_each_oldnew_mst_mgr_in_state'
+  - 'for_each_oldnew_plane_in_state'
+  - 'for_each_oldnew_plane_in_state_reverse'
+  - 'for_each_oldnew_private_obj_in_state'
+  - 'for_each_online_cpu'
+  - 'for_each_online_cpu_wrap'
+  - 'for_each_online_node'
+  - 'for_each_online_pgdat'
+  - 'for_each_or_bit'
+  - 'for_each_page_ext'
+  - 'for_each_path'
+  - 'for_each_pci_bridge'
+  - 'for_each_pci_dev'
+  - 'for_each_pcm_streams'
+  - 'for_each_physmem_range'
+  - 'for_each_populated_zone'
+  - 'for_each_possible_cpu'
+  - 'for_each_possible_cpu_wrap'
+  - 'for_each_present_blessed_reg'
+  - 'for_each_present_cpu'
+  - 'for_each_present_section_nr'
+  - 'for_each_prime_number'
+  - 'for_each_prime_number_from'
+  - 'for_each_probe_cache_entry'
+  - 'for_each_process'
+  - 'for_each_process_thread'
+  - 'for_each_prop_codec_conf'
+  - 'for_each_prop_dai_codec'
+  - 'for_each_prop_dai_cpu'
+  - 'for_each_prop_dlc_codecs'
+  - 'for_each_prop_dlc_cpus'
+  - 'for_each_prop_dlc_platforms'
+  - 'for_each_property_of_node'
+  - 'for_each_pt_level_entry'
+  - 'for_each_rdt_resource'
+  - 'for_each_reg'
+  - 'for_each_reg_filtered'
+  - 'for_each_reloc'
+  - 'for_each_reloc_from'
+  - 'for_each_requested_gpio'
+  - 'for_each_requested_gpio_in_range'
+  - 'for_each_reserved_child_of_node'
+  - 'for_each_reserved_mem_range'
+  - 'for_each_reserved_mem_region'
+  - 'for_each_rtd_ch_maps'
+  - 'for_each_rtd_codec_dais'
+  - 'for_each_rtd_components'
+  - 'for_each_rtd_cpu_dais'
+  - 'for_each_rtd_dais'
+  - 'for_each_rtd_dais_reverse'
+  - 'for_each_sband_iftype_data'
+  - 'for_each_script'
+  - 'for_each_sec'
+  - 'for_each_set_bit'
+  - 'for_each_set_bit_from'
+  - 'for_each_set_bit_wrap'
+  - 'for_each_set_bitrange'
+  - 'for_each_set_bitrange_from'
+  - 'for_each_set_clump8'
+  - 'for_each_sg'
+  - 'for_each_sg_dma_page'
+  - 'for_each_sg_page'
+  - 'for_each_sgtable_dma_page'
+  - 'for_each_sgtable_dma_sg'
+  - 'for_each_sgtable_page'
+  - 'for_each_sgtable_sg'
+  - 'for_each_sibling_event'
+  - 'for_each_sta_active_link'
+  - 'for_each_subelement'
+  - 'for_each_subelement_extid'
+  - 'for_each_subelement_id'
+  - 'for_each_sublist'
+  - 'for_each_subsystem'
+  - 'for_each_suite'
+  - 'for_each_supported_activate_fn'
+  - 'for_each_supported_inject_fn'
+  - 'for_each_sym'
+  - 'for_each_thread'
+  - 'for_each_token'
+  - 'for_each_unicast_dest_pgid'
+  - 'for_each_valid_link'
+  - 'for_each_vif_active_link'
+  - 'for_each_vma'
+  - 'for_each_vma_range'
+  - 'for_each_vsi'
+  - 'for_each_wakeup_source'
+  - 'for_each_zone'
+  - 'for_each_zone_zonelist'
+  - 'for_each_zone_zonelist_nodemask'
+  - 'func_for_each_insn'
+  - 'fwnode_for_each_available_child_node'
+  - 'fwnode_for_each_child_node'
+  - 'fwnode_for_each_parent_node'
+  - 'fwnode_graph_for_each_endpoint'
+  - 'gadget_for_each_ep'
+  - 'genradix_for_each'
+  - 'genradix_for_each_from'
+  - 'genradix_for_each_reverse'
+  - 'guard'
+  - 'hash_for_each'
+  - 'hash_for_each_possible'
+  - 'hash_for_each_possible_rcu'
+  - 'hash_for_each_possible_rcu_notrace'
+  - 'hash_for_each_possible_safe'
+  - 'hash_for_each_rcu'
+  - 'hash_for_each_safe'
+  - 'hashmap__for_each_entry'
+  - 'hashmap__for_each_entry_safe'
+  - 'hashmap__for_each_key_entry'
+  - 'hashmap__for_each_key_entry_safe'
+  - 'hctx_for_each_ctx'
+  - 'hists__for_each_format'
+  - 'hists__for_each_sort_list'
+  - 'hlist_bl_for_each_entry'
+  - 'hlist_bl_for_each_entry_rcu'
+  - 'hlist_bl_for_each_entry_safe'
+  - 'hlist_for_each'
+  - 'hlist_for_each_entry'
+  - 'hlist_for_each_entry_continue'
+  - 'hlist_for_each_entry_continue_rcu'
+  - 'hlist_for_each_entry_continue_rcu_bh'
+  - 'hlist_for_each_entry_from'
+  - 'hlist_for_each_entry_from_rcu'
+  - 'hlist_for_each_entry_rcu'
+  - 'hlist_for_each_entry_rcu_bh'
+  - 'hlist_for_each_entry_rcu_notrace'
+  - 'hlist_for_each_entry_safe'
+  - 'hlist_for_each_entry_srcu'
+  - 'hlist_for_each_safe'
+  - 'hlist_nulls_for_each_entry'
+  - 'hlist_nulls_for_each_entry_from'
+  - 'hlist_nulls_for_each_entry_rcu'
+  - 'hlist_nulls_for_each_entry_safe'
+  - 'i3c_bus_for_each_i2cdev'
+  - 'i3c_bus_for_each_i3cdev'
+  - 'idr_for_each_entry'
+  - 'idr_for_each_entry_continue'
+  - 'idr_for_each_entry_continue_ul'
+  - 'idr_for_each_entry_ul'
+  - 'iio_for_each_active_channel'
+  - 'in_dev_for_each_ifa_rcu'
+  - 'in_dev_for_each_ifa_rtnl'
+  - 'in_dev_for_each_ifa_rtnl_net'
+  - 'inet_bind_bucket_for_each'
+  - 'interval_tree_for_each_span'
+  - 'intlist__for_each_entry'
+  - 'intlist__for_each_entry_safe'
+  - 'kcore_copy__for_each_phdr'
+  - 'key_for_each'
+  - 'key_for_each_safe'
+  - 'klp_for_each_func'
+  - 'klp_for_each_func_safe'
+  - 'klp_for_each_func_static'
+  - 'klp_for_each_object'
+  - 'klp_for_each_object_safe'
+  - 'klp_for_each_object_static'
+  - 'kunit_suite_for_each_test_case'
+  - 'kvm_for_each_memslot'
+  - 'kvm_for_each_memslot_in_gfn_range'
+  - 'kvm_for_each_vcpu'
+  - 'libbpf_nla_for_each_attr'
+  - 'list_for_each'
+  - 'list_for_each_codec'
+  - 'list_for_each_codec_safe'
+  - 'list_for_each_continue'
+  - 'list_for_each_entry'
+  - 'list_for_each_entry_continue'
+  - 'list_for_each_entry_continue_rcu'
+  - 'list_for_each_entry_continue_reverse'
+  - 'list_for_each_entry_from'
+  - 'list_for_each_entry_from_rcu'
+  - 'list_for_each_entry_from_reverse'
+  - 'list_for_each_entry_lockless'
+  - 'list_for_each_entry_rcu'
+  - 'list_for_each_entry_reverse'
+  - 'list_for_each_entry_safe'
+  - 'list_for_each_entry_safe_continue'
+  - 'list_for_each_entry_safe_from'
+  - 'list_for_each_entry_safe_reverse'
+  - 'list_for_each_entry_srcu'
+  - 'list_for_each_from'
+  - 'list_for_each_prev'
+  - 'list_for_each_prev_safe'
+  - 'list_for_each_rcu'
+  - 'list_for_each_safe'
+  - 'llist_for_each'
+  - 'llist_for_each_entry'
+  - 'llist_for_each_entry_safe'
+  - 'llist_for_each_safe'
+  - 'lwq_for_each_safe'
+  - 'map__for_each_symbol'
+  - 'map__for_each_symbol_by_name'
+  - 'mas_for_each'
+  - 'mas_for_each_rev'
+  - 'mci_for_each_dimm'
+  - 'media_device_for_each_entity'
+  - 'media_device_for_each_intf'
+  - 'media_device_for_each_link'
+  - 'media_device_for_each_pad'
+  - 'media_entity_for_each_pad'
+  - 'media_pipeline_for_each_entity'
+  - 'media_pipeline_for_each_pad'
+  - 'mlx5_lag_for_each_peer_mdev'
+  - 'mptcp_for_each_subflow'
+  - 'msi_domain_for_each_desc'
+  - 'msi_for_each_desc'
+  - 'mt_for_each'
+  - 'nanddev_io_for_each_block'
+  - 'nanddev_io_for_each_page'
+  - 'neigh_for_each_in_bucket'
+  - 'neigh_for_each_in_bucket_rcu'
+  - 'neigh_for_each_in_bucket_safe'
+  - 'netdev_for_each_lower_dev'
+  - 'netdev_for_each_lower_private'
+  - 'netdev_for_each_lower_private_rcu'
+  - 'netdev_for_each_mc_addr'
+  - 'netdev_for_each_synced_mc_addr'
+  - 'netdev_for_each_synced_uc_addr'
+  - 'netdev_for_each_uc_addr'
+  - 'netdev_for_each_upper_dev_rcu'
+  - 'netdev_hw_addr_list_for_each'
+  - 'nft_rule_for_each_expr'
+  - 'nla_for_each_attr'
+  - 'nla_for_each_attr_type'
+  - 'nla_for_each_nested'
+  - 'nla_for_each_nested_type'
+  - 'nlmsg_for_each_attr'
+  - 'nlmsg_for_each_msg'
+  - 'nr_neigh_for_each'
+  - 'nr_neigh_for_each_safe'
+  - 'nr_node_for_each'
+  - 'nr_node_for_each_safe'
+  - 'of_for_each_phandle'
+  - 'of_property_for_each_string'
+  - 'of_property_for_each_u32'
+  - 'pci_bus_for_each_resource'
+  - 'pci_dev_for_each_resource'
+  - 'pcl_for_each_chunk'
+  - 'pcl_for_each_segment'
+  - 'pcm_for_each_format'
+  - 'perf_config_items__for_each_entry'
+  - 'perf_config_sections__for_each_entry'
+  - 'perf_config_set__for_each_entry'
+  - 'perf_cpu_map__for_each_cpu'
+  - 'perf_cpu_map__for_each_cpu_skip_any'
+  - 'perf_cpu_map__for_each_idx'
+  - 'perf_evlist__for_each_entry'
+  - 'perf_evlist__for_each_entry_reverse'
+  - 'perf_evlist__for_each_entry_safe'
+  - 'perf_evlist__for_each_evsel'
+  - 'perf_evlist__for_each_mmap'
+  - 'perf_evsel_for_each_per_thread_period_safe'
+  - 'perf_hpp_list__for_each_format'
+  - 'perf_hpp_list__for_each_format_safe'
+  - 'perf_hpp_list__for_each_sort_list'
+  - 'perf_hpp_list__for_each_sort_list_safe'
+  - 'plist_for_each'
+  - 'plist_for_each_continue'
+  - 'plist_for_each_entry'
+  - 'plist_for_each_entry_continue'
+  - 'plist_for_each_entry_safe'
+  - 'plist_for_each_safe'
+  - 'pnp_for_each_card'
+  - 'pnp_for_each_dev'
+  - 'protocol_for_each_card'
+  - 'protocol_for_each_dev'
+  - 'queue_for_each_hw_ctx'
+  - 'radix_tree_for_each_slot'
+  - 'radix_tree_for_each_tagged'
+  - 'rb_for_each'
+  - 'rbtree_postorder_for_each_entry_safe'
+  - 'rdma_for_each_block'
+  - 'rdma_for_each_port'
+  - 'rdma_umem_for_each_dma_block'
+  - 'resource_list_for_each_entry'
+  - 'resource_list_for_each_entry_safe'
+  - 'rhl_for_each_entry_rcu'
+  - 'rhl_for_each_rcu'
+  - 'rht_for_each'
+  - 'rht_for_each_entry'
+  - 'rht_for_each_entry_from'
+  - 'rht_for_each_entry_rcu'
+  - 'rht_for_each_entry_rcu_from'
+  - 'rht_for_each_entry_safe'
+  - 'rht_for_each_from'
+  - 'rht_for_each_rcu'
+  - 'rht_for_each_rcu_from'
+  - 'rq_for_each_bvec'
+  - 'rq_for_each_segment'
+  - 'rq_list_for_each'
+  - 'rq_list_for_each_safe'
+  - 'sample_read_group__for_each'
+  - 'scoped_guard'
+  - 'scsi_for_each_prot_sg'
+  - 'scsi_for_each_sg'
+  - 'sctp_for_each_hentry'
+  - 'sctp_skb_for_each'
+  - 'sec_for_each_insn'
+  - 'sec_for_each_insn_continue'
+  - 'sec_for_each_insn_from'
+  - 'sec_for_each_sym'
+  - 'shdma_for_each_chan'
+  - 'shost_for_each_device'
+  - 'sk_for_each'
+  - 'sk_for_each_bound'
+  - 'sk_for_each_bound_safe'
+  - 'sk_for_each_entry_offset_rcu'
+  - 'sk_for_each_from'
+  - 'sk_for_each_rcu'
+  - 'sk_for_each_safe'
+  - 'sk_nulls_for_each'
+  - 'sk_nulls_for_each_from'
+  - 'sk_nulls_for_each_rcu'
+  - 'snd_array_for_each'
+  - 'snd_pcm_group_for_each_entry'
+  - 'snd_soc_dapm_widget_for_each_path'
+  - 'snd_soc_dapm_widget_for_each_path_safe'
+  - 'snd_soc_dapm_widget_for_each_sink_path'
+  - 'snd_soc_dapm_widget_for_each_source_path'
+  - 'sparsebit_for_each_set_range'
+  - 'strlist__for_each_entry'
+  - 'strlist__for_each_entry_safe'
+  - 'sym_for_each_insn'
+  - 'sym_for_each_insn_continue_reverse'
+  - 'symbols__for_each_entry'
+  - 'tb_property_for_each'
+  - 'tcf_act_for_each_action'
+  - 'tcf_exts_for_each_action'
+  - 'test_suite__for_each_test_case'
+  - 'tool_pmu__for_each_event'
+  - 'ttm_bo_lru_for_each_reserved_guarded'
+  - 'ttm_resource_manager_for_each_res'
+  - 'udp_lrpa_for_each_entry_rcu'
+  - 'udp_portaddr_for_each_entry'
+  - 'udp_portaddr_for_each_entry_rcu'
+  - 'usb_hub_for_each_child'
+  - 'v4l2_device_for_each_subdev'
+  - 'v4l2_m2m_for_each_dst_buf'
+  - 'v4l2_m2m_for_each_dst_buf_safe'
+  - 'v4l2_m2m_for_each_src_buf'
+  - 'v4l2_m2m_for_each_src_buf_safe'
+  - 'virtio_device_for_each_vq'
+  - 'vkms_config_for_each_connector'
+  - 'vkms_config_for_each_crtc'
+  - 'vkms_config_for_each_encoder'
+  - 'vkms_config_for_each_plane'
+  - 'vkms_config_connector_for_each_possible_encoder'
+  - 'vkms_config_encoder_for_each_possible_crtc'
+  - 'vkms_config_plane_for_each_possible_crtc'
+  - 'while_for_each_ftrace_op'
+  - 'workloads__for_each'
+  - 'xa_for_each'
+  - 'xa_for_each_marked'
+  - 'xa_for_each_range'
+  - 'xa_for_each_start'
+  - 'xas_for_each'
+  - 'xas_for_each_conflict'
+  - 'xas_for_each_marked'
+  - 'xbc_array_for_each_value'
+  - 'xbc_for_each_key_value'
+  - 'xbc_node_for_each_array_value'
+  - 'xbc_node_for_each_child'
+  - 'xbc_node_for_each_key_value'
+  - 'xbc_node_for_each_subkey'
+  - 'ynl_attr_for_each'
+  - 'ynl_attr_for_each_nested'
+  - 'ynl_attr_for_each_payload'
+  - 'zorro_for_each_dev'
+  - 'zpci_bus_for_each'
+
+IncludeBlocks: Preserve
+IncludeCategories:
+  - Regex: '.*'
+    Priority: 1
+IncludeIsMainRegex: '(Test)?$'
+IndentCaseLabels: false
+IndentGotoLabels: false
+IndentPPDirectives: None
+IndentWidth: 8
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: ''
+MacroBlockEnd: ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBinPackProtocolList: Auto
+ObjCBlockIndentWidth: 8
+ObjCSpaceAfterProperty: true
+ObjCSpaceBeforeProtocolList: true
+
+# Taken from git's rules
+PenaltyBreakAssignment: 10
+PenaltyBreakBeforeFirstCallParameter: 30
+PenaltyBreakComment: 10
+PenaltyBreakFirstLessLess: 0
+PenaltyBreakString: 10
+PenaltyExcessCharacter: 100
+PenaltyReturnTypeOnItsOwnLine: 60
+
+PointerAlignment: Right
+ReflowComments: false
+SortIncludes: false
+SortUsingDeclarations: false
+SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: ControlStatementsExceptForEachMacros
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles: false
+SpacesInContainerLiterals: false
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard: Cpp03
+TabWidth: 8
+UseTab: Always
+...
diff --git a/.clippy.toml b/.clippy.toml
new file mode 100644
index 000000000..b0a78cc8b
--- /dev/null
+++ b/.clippy.toml
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0
+
+msrv = "1.85.0"
+
+check-private-items = true
+
+disallowed-macros = [
+    # The `clippy::dbg_macro` lint only works with `std::dbg!`, thus we simulate
+    # it here, see: https://github.com/rust-lang/rust-clippy/issues/11303.
+    { path = "kernel::dbg", reason = "the `dbg!` macro is intended as a debugging tool", allow-invalid = true },
+]
+
+[[disallowed-methods]]
+path = "core::ffi::CStr::as_ptr"
+replacement = "kernel::prelude::CStrExt::as_char_ptr"
+reason = "kernel's `char` is always unsigned, use `as_char_ptr` instead"
+
+[[disallowed-methods]]
+path = "core::ffi::CStr::from_ptr"
+replacement = "kernel::prelude::CStrExt::from_char_ptr"
+reason = "kernel's `char` is always unsigned, use `from_char_ptr` instead"
diff --git a/.cocciconfig b/.cocciconfig
new file mode 100644
index 000000000..43967c6b2
--- /dev/null
+++ b/.cocciconfig
@@ -0,0 +1,3 @@
+[spatch]
+	options = --timeout 200
+	options = --use-gitgrep
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..69718ac91
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+[{*.{awk,c,dts,dtsi,dtso,h,mk,rst,s,S},Kconfig,Makefile,Makefile.*}]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = tab
+indent_size = 8
+
+[*.{json,py,rs}]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = space
+indent_size = 4
+
+# this must be below the general *.py to overwrite it
+[tools/{perf,power,rcu,testing/kunit}/**.py,]
+indent_style = tab
+indent_size = 8
+
+[*.yaml]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = space
+indent_size = 2
diff --git a/.get_maintainer.ignore b/.get_maintainer.ignore
new file mode 100644
index 000000000..5ad082b4d
--- /dev/null
+++ b/.get_maintainer.ignore
@@ -0,0 +1,9 @@
+Alan Cox <alan@lxorguk.ukuu.org.uk>
+Alan Cox <root@hraefn.swansea.linux.org.uk>
+Alyssa Rosenzweig <alyssa@rosenzweig.io>
+Askar Safin <safinaskar@gmail.com>
+Christoph Hellwig <hch@lst.de>
+Jeff Kirsher <jeffrey.t.kirsher@intel.com>
+Marc Gonzalez <marc.w.gonzalez@free.fr>
+Nathan Chancellor <nathan@kernel.org>
+Ralf Baechle <ralf@linux-mips.org>
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..2325c529e
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0-only
+*.[ch] diff=cpp
+*.dts diff=dts
+*.dts[io] diff=dts
+*.rs diff=rust
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..9875120ea
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,196 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# NOTE! Don't add files that are generated in specific
+# subdirectories here. Add them in the ".gitignore" file
+# in that subdirectory instead.
+#
+# NOTE! Please use 'git ls-files -i -c --exclude-per-directory=.gitignore'
+# command after changing this file, to see if there are
+# any tracked files which get ignored after the change.
+#
+# Normal rules (sorted alphabetically)
+#
+.*
+*.a
+*.asn1.[ch]
+*.bc
+*.bin
+*.bz2
+*.c.[012]*.*
+*.dt.yaml
+*.dtb
+*.dtbo
+*.dtb.S
+*.dtbo.S
+*.dwo
+*.dylib
+*.elf
+*.gcno
+*.gcda
+*.gz
+*.i
+*.ko
+*.lex.c
+*.ll
+*.lst
+*.lz4
+*.lzma
+*.lzo
+*.mod
+*.mod.c
+*.o
+*.o.*
+*.patch
+*.pyc
+*.rlib
+*.rmeta
+*.rpm
+*.rsi
+*.s
+*.so
+*.so.dbg
+*.spdx.json
+*.su
+*.symtypes
+*.tab.[ch]
+*.tar
+*.xz
+*.zst
+Module.symvers
+dtbs-list
+builtin.order
+modules.order
+
+#
+# Top-level generic files
+#
+/linux
+/modules-only.symvers
+/vmlinux
+/vmlinux.32
+/vmlinux.map
+/vmlinux.symvers
+/vmlinux.thinlto-index
+/vmlinux.unstripped
+/vmlinux-gdb.py
+/vmlinuz
+/System.map
+/Module.markers
+/modules.builtin
[Output truncated: showing 1000 of 44398434 lines]]

194/4 2026/09/17 11:07 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 23776
							output: 27
							thoughts: 196
						

Thoughts:
**Analyzing the NTFS Attribute Setting Process**

Okay, so this git repository is either brand new or a very shallow clone, basically just one commit. That means all the code I need is right here in the working tree – good to know. Now, let’s dig into these questions. The core of it all is about `ntfs_setattr` and whether `filemap_invalidate_lock(inode->i_mapping)` needs to be called *before* `truncate_setsize` and `ntfs_set_size`. And, if so, we need to know the correct sequence for file size extension or reduction.

Given the code is all available, my next step is clear: I'm going to search the kernel tree. I'll need to understand how `filemap_invalidate_lock` is being used within similar functions in other filesystems in the context of `setattr` and `truncate`. Let's get to the grep command; I'll search for `filemap_invalidate_lock` within the `fs/` directory. That should give me a solid view on patterns and best practices, and help me confidently answer those questions.



195/4 2026/09/17 11:07 tool grepper
0m Args:
map[Expression:filemap_invalidate_lock PathPrefix:fs]

Results:
map[Output:fs/btrfs/volumes.c=1335=struct btrfs_super_block *btrfs_read_disk_super(struct block_device *bdev,
--
fs/btrfs/volumes.c-1366-
fs/btrfs/volumes.c:1367:	filemap_invalidate_lock_shared(mapping);
fs/btrfs/volumes.c-1368-	page = read_cache_page_gfp(mapping, bytenr >> PAGE_SHIFT, GFP_NOFS);
--
fs/btrfs/zoned.c=88=static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones,
--
fs/btrfs/zoned.c-133-
fs/btrfs/zoned.c:134:			filemap_invalidate_lock_shared(mapping);
fs/btrfs/zoned.c-135-			page[i] = read_cache_page_gfp(mapping,
--
fs/ceph/addr.c=1990=static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
--
fs/ceph/addr.c-2045-
fs/ceph/addr.c:2046:		filemap_invalidate_lock_shared(mapping);
fs/ceph/addr.c-2047-		page = find_or_create_page(mapping, 0,
--
fs/ceph/file.c=2784=static long ceph_fallocate(struct file *file, int mode,
--
fs/ceph/file.c-2841-
fs/ceph/file.c:2842:	filemap_invalidate_lock(inode->i_mapping);
fs/ceph/file.c-2843-	ceph_fscache_invalidate(inode, false);
--
fs/exfat/file.c=754=static int exfat_extend_valid_size(struct inode *inode, loff_t new_valid_size)
--
fs/exfat/file.c-779-		 */
fs/exfat/file.c:780:		filemap_invalidate_lock(inode->i_mapping);
fs/exfat/file.c-781-		if (gap_start < new_valid_size)
--
fs/exfat/file.c=943=static vm_fault_t exfat_page_mkwrite(struct vm_fault *vmf)
--
fs/exfat/file.c-987-
fs/exfat/file.c:988:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/exfat/file.c-989-	ret = iomap_page_mkwrite(vmf, &exfat_iomap_ops, NULL);
--
fs/ext2/inode.c=1224=static void ext2_truncate_blocks(struct inode *inode, loff_t offset)
--
fs/ext2/inode.c-1231-
fs/ext2/inode.c:1232:	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c-1233-	__ext2_truncate_blocks(inode, offset);
--
fs/ext2/inode.c=1237=static int ext2_setsize(struct inode *inode, loff_t newsize)
--
fs/ext2/inode.c-1254-
fs/ext2/inode.c:1255:	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c-1256-	truncate_setsize(inode, newsize);
--
fs/ext4/extents.c=4949=long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
--
fs/ext4/extents.c-4999-	 */
fs/ext4/extents.c:5000:	filemap_invalidate_lock(mapping);
fs/ext4/extents.c-5001-
--
fs/ext4/file.c=800=static vm_fault_t ext4_dax_huge_fault(struct vm_fault *vmf, unsigned int order)
--
fs/ext4/file.c-827-		file_update_time(vmf->vma->vm_file);
fs/ext4/file.c:828:		filemap_invalidate_lock_shared(mapping);
fs/ext4/file.c-829-retry:
--
fs/ext4/file.c-837-	} else {
fs/ext4/file.c:838:		filemap_invalidate_lock_shared(mapping);
fs/ext4/file.c-839-	}
--
fs/ext4/inode.c=4432=static void ext4_wait_dax_page(struct inode *inode)
--
fs/ext4/inode.c-4435-	schedule();
fs/ext4/inode.c:4436:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-4437-}
--
fs/ext4/inode.c=6009=int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ext4/inode.c-6125-
fs/ext4/inode.c:6126:		filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-6127-
--
fs/ext4/inode.c=6740=int ext4_change_inode_journal_flag(struct inode *inode, int val)
--
fs/ext4/inode.c-6773-	 */
fs/ext4/inode.c:6774:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-6775-	err = filemap_write_and_wait(inode->i_mapping);
--
fs/ext4/inode.c=6884=vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf)
--
fs/ext4/inode.c-6903-
fs/ext4/inode.c:6904:	filemap_invalidate_lock_shared(mapping);
fs/ext4/inode.c-6905-
--
fs/ext4/ioctl.c=375=static long swap_inode_boot_loader(struct super_block *sb,
--
fs/ext4/ioctl.c-411-
fs/ext4/ioctl.c:412:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/ioctl.c-413-	err = filemap_write_and_wait(inode->i_mapping);
--
fs/ext4/truncate.h=12=static inline void ext4_truncate_failed_write(struct inode *inode)
--
fs/ext4/truncate.h-19-	 */
fs/ext4/truncate.h:20:	filemap_invalidate_lock(mapping);
fs/ext4/truncate.h-21-	truncate_inode_pages(mapping, inode->i_size);
--
fs/f2fs/data.c=3646=void f2fs_write_failed(struct inode *inode, loff_t to)
--
fs/f2fs/data.c-3655-		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/data.c:3656:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/data.c-3657-
--
fs/f2fs/data.c=4187=static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk,
--
fs/f2fs/data.c-4202-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/data.c:4203:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/data.c-4204-
--
fs/f2fs/file.c=73=static int f2fs_zero_post_eof_page(struct inode *inode,
--
fs/f2fs/file.c-86-	if (lock)
fs/f2fs/file.c:87:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-88-	/* zero or drop pages only in range of [old_size, new_size] */
--
fs/f2fs/file.c=120=static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
--
fs/f2fs/file.c-186-	file_update_time(vmf->vma->vm_file);
fs/f2fs/file.c:187:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/f2fs/file.c-188-
--
fs/f2fs/file.c=637=static int finish_preallocate_blocks(struct inode *inode)
--
fs/f2fs/file.c-655-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:656:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-657-
--
fs/f2fs/file.c=1124=int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/f2fs/file.c-1227-		f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1228:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1229-
--
fs/f2fs/file.c=1346=static int f2fs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1394-			f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1395:			filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1396-
--
fs/f2fs/file.c=1630=static int f2fs_do_collapse(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1642-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1643:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1644-
--
fs/f2fs/file.c=1661=static int f2fs_collapse_range(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1686-	/* write out all moved pages, if possible */
fs/f2fs/file.c:1687:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1688-	ret = filemap_write_and_wait_range(inode->i_mapping, offset, LLONG_MAX);
--
fs/f2fs/file.c=1755=static int f2fs_zero_range(struct inode *inode, loff_t offset, loff_t len,
--
fs/f2fs/file.c-1811-			f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1812:			filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1813-
--
fs/f2fs/file.c=1868=static int f2fs_insert_range(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1893-
fs/f2fs/file.c:1894:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1895-	ret = f2fs_truncate_blocks(inode, i_size_read(inode), true);
--
fs/f2fs/file.c-1911-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1912:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1913-
--
fs/f2fs/file.c-1940-	/* write out all moved pages, if possible */
fs/f2fs/file.c:1941:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1942-	ret = filemap_write_and_wait_range(mapping, offset, LLONG_MAX);
--
fs/f2fs/file.c=3879=static int f2fs_ioc_release_dev_alias(struct file *filp)
--
fs/f2fs/file.c-3928-
fs/f2fs/file.c:3929:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-3930-	truncate_setsize(inode, 0);
--
fs/f2fs/file.c=4206=static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4257-	f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4258:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-4259-
--
fs/f2fs/file.c=4403=static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4435-	f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4436:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-4437-
--
fs/f2fs/file.c=4535=static int f2fs_sec_trim_file(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4600-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4601:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-4602-
--
fs/f2fs/file.c=4794=static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)
--
fs/f2fs/file.c-4801-
fs/f2fs/file.c:4802:	filemap_invalidate_lock_shared(mapping);
fs/f2fs/file.c-4803-	page_cache_ra_unbounded(&ractl, len, 0);
--
fs/f2fs/file.c=5631=static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/f2fs/file.c-5703-		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:5704:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-5705-		if (!f2fs_truncate(inode))
--
fs/fuse/dax.c=663=static void fuse_wait_dax_page(struct inode *inode)
--
fs/fuse/dax.c-666-	schedule();
fs/fuse/dax.c:667:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-668-}
--
fs/fuse/dax.c=755=static vm_fault_t __fuse_dax_fault(struct vm_fault *vmf, unsigned int order,
--
fs/fuse/dax.c-778-	 */
fs/fuse/dax.c:779:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/fuse/dax.c-780-	ret = dax_iomap_fault(vmf, order, &pfn, &error, &fuse_iomap_ops);
--
fs/fuse/dax.c=914=inode_inline_reclaim_one_dmap(struct fuse_conn_dax *fcd, struct inode *inode,
--
fs/fuse/dax.c-923-
fs/fuse/dax.c:924:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-925-
--
fs/fuse/dax.c=1076=static int lookup_and_reclaim_dmap(struct fuse_conn_dax *fcd,
--
fs/fuse/dax.c-1085-
fs/fuse/dax.c:1086:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-1087-	ret = fuse_dax_break_layouts(inode, dmap_start, dmap_end);
--
fs/fuse/dir.c=2145=int fuse_do_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/fuse/dir.c-2177-	if (FUSE_IS_DAX(inode) && is_truncate) {
fs/fuse/dir.c:2178:		filemap_invalidate_lock(mapping);
fs/fuse/dir.c-2179-		fault_blocked = true;
--
fs/fuse/file.c=250=static int fuse_open(struct inode *inode, struct file *file)
--
fs/fuse/file.c-271-	if (dax_truncate) {
fs/fuse/file.c:272:		filemap_invalidate_lock(inode->i_mapping);
fs/fuse/file.c-273-		err = fuse_dax_break_layouts(inode, 0, -1);
--
fs/fuse/file.c=2832=static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
--
fs/fuse/file.c-2859-	if (block_faults) {
fs/fuse/file.c:2860:		filemap_invalidate_lock(inode->i_mapping);
fs/fuse/file.c-2861-		err = fuse_dax_break_layouts(inode, 0, -1);
--
fs/ntfs/file.c=254=static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
--
fs/ntfs/file.c-278-	 */
fs/ntfs/file.c:279:	filemap_invalidate_lock(vi->i_mapping);
fs/ntfs/file.c-280-	if (attr->ia_size > old_size) {
--
fs/ntfs/file.c=676=static vm_fault_t ntfs_filemap_page_mkwrite(struct vm_fault *vmf)
--
fs/ntfs/file.c-691-	 */
fs/ntfs/file.c:692:	filemap_invalidate_lock_shared(mapping);
fs/ntfs/file.c-693-	ret = iomap_page_mkwrite(vmf, &ntfs_page_mkwrite_iomap_ops, NULL);
--
fs/ntfs/file.c=1127=static long ntfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
--
fs/ntfs/file.c-1170-	/* Take invalidate_lock for all fallocate operations to prevent races */
fs/ntfs/file.c:1171:	filemap_invalidate_lock(vi->i_mapping);
fs/ntfs/file.c-1172-
--
fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-519-		inode_dio_wait(inode);
fs/ntfs3/file.c:520:		filemap_invalidate_lock(mapping);
fs/ntfs3/file.c-521-		map_locked = true;
--
fs/smb/client/file.c=993=static int cifs_do_truncate(const unsigned int xid, struct dentry *dentry)
--
fs/smb/client/file.c-1005-
fs/smb/client/file.c:1006:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/file.c-1007-
--
fs/smb/client/smb2ops.c=3508=static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3531-
fs/smb/client/smb2ops.c:3532:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-3533-
--
fs/smb/client/smb2ops.c=3592=static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3610-
fs/smb/client/smb2ops.c:3611:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-3612-	/*
--
fs/smb/client/smb2ops.c=4014=static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4032-
fs/smb/client/smb2ops.c:4033:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-4034-	rc = filemap_write_and_wait_range(inode->i_mapping,
--
fs/smb/client/smb2ops.c=4078=static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4108-
fs/smb/client/smb2ops.c:4109:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-4110-	rc = filemap_write_and_wait_range(inode->i_mapping,
--
fs/udf/file.c=38=static vm_fault_t udf_page_mkwrite(struct vm_fault *vmf)
--
fs/udf/file.c-50-	file_update_time(vma->vm_file);
fs/udf/file.c:51:	filemap_invalidate_lock_shared(mapping);
fs/udf/file.c-52-	folio_lock(folio);
--
fs/udf/file.c=89=static ssize_t udf_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/udf/file.c-104-				 iocb->ki_pos + iov_iter_count(from))) {
fs/udf/file.c:105:		filemap_invalidate_lock(inode->i_mapping);
fs/udf/file.c-106-		retval = udf_expand_file_adinicb(inode);
--
fs/udf/file.c=215=static int udf_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/udf/file.c-236-	    attr->ia_size != i_size_read(inode)) {
fs/udf/file.c:237:		filemap_invalidate_lock(inode->i_mapping);
fs/udf/file.c-238-		error = udf_setsize(inode, attr->ia_size);
--
fs/verity/read_metadata.c=16=static int fsverity_read_merkle_tree(struct inode *inode,
--
fs/verity/read_metadata.c-38-	if (inode->i_sb->s_vop->readahead_merkle_tree) {
fs/verity/read_metadata.c:39:		filemap_invalidate_lock_shared(inode->i_mapping);
fs/verity/read_metadata.c-40-		inode->i_sb->s_vop->readahead_merkle_tree(
--
fs/xfs/xfs_bmap_util.c=1537=xfs_swap_extents(
--
fs/xfs/xfs_bmap_util.c-1558-	lock_two_nondirectories(VFS_I(ip), VFS_I(tip));
fs/xfs/xfs_bmap_util.c:1559:	filemap_invalidate_lock_two(VFS_I(ip)->i_mapping,
fs/xfs/xfs_bmap_util.c-1560-				    VFS_I(tip)->i_mapping);
--
fs/xfs/xfs_inode.c=2792=xfs_ilock2_io_mmap(
--
fs/xfs/xfs_inode.c-2810-	} else
fs/xfs/xfs_inode.c:2811:		filemap_invalidate_lock_two(VFS_I(ip1)->i_mapping,
fs/xfs/xfs_inode.c-2812-					    VFS_I(ip2)->i_mapping);
--
fs/xfs/xfs_iomap.c=2134=xfs_buffered_write_iomap_end(
--
fs/xfs/xfs_iomap.c-2167-	} else {
fs/xfs/xfs_iomap.c:2168:		filemap_invalidate_lock(inode->i_mapping);
fs/xfs/xfs_iomap.c-2169-		iomap_write_delalloc_release(inode, start_byte, end_byte, flags,
--
fs/zonefs/file.c=203=int zonefs_file_truncate(struct inode *inode, loff_t isize)
--
fs/zonefs/file.c-228-	/* Serialize against page faults */
fs/zonefs/file.c:229:	filemap_invalidate_lock(inode->i_mapping);
fs/zonefs/file.c-230-
--
fs/zonefs/file.c=297=static vm_fault_t zonefs_filemap_page_mkwrite(struct vm_fault *vmf)
--
fs/zonefs/file.c-315-	/* Serialize against truncates */
fs/zonefs/file.c:316:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/zonefs/file.c-317-	ret = iomap_page_mkwrite(vmf, &zonefs_write_iomap_ops, NULL);
]

196/4 2026/09/17 11:08 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 31561
							output: 36
							thoughts: 104
						

Thoughts:
**Diving Deep into the NTFS Implementation**

Okay, here we go. My initial thought is to compare the older NTFS implementation, `fs/ntfs/file.c`, with the newer `fs/ntfs3/file.c`. I have a feeling there are some interesting architectural changes, or perhaps optimizations, that need to be understood.

Wait a second, before I get carried away with the broad strokes, I want to zero in on a specific section. Let's start by examining lines 254 through 290 of `fs/ntfs/file.c` and how it is implemented in the newer `fs/ntfs3/file.c`. Then compare how it's implemented.

Actually, to get a better understanding of that functionality, let's take a look at a slightly larger section, lines 250 through 295 of `fs/ntfs/file.c` instead. This should give me enough context. I need to understand this functionality fully before proceeding.



197/4 2026/09/17 11:08 tool read-file
0m Args:
map[File:fs/ntfs/file.c FirstLine:250 LineCount:45]

Results:
map[Contents: 250:			blkdev_issue_flush(vi->i_sb->s_bdev);
 251:		return ret;
 252:	}
 253:	
 254:	static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
 255:	{
 256:		struct ntfs_inode *ni = NTFS_I(vi);
 257:		int err;
 258:		loff_t old_size = vi->i_size;
 259:	
 260:		if (NInoCompressed(ni) || NInoEncrypted(ni) || NInoWofCompressed(ni)) {
 261:			ntfs_warning(
 262:				vi->i_sb,
 263:				"Changes in inode size are not supported yet for %s files.",
 264:				NInoEncrypted(ni) ? "encrypted" : "compressed");
 265:			return -EOPNOTSUPP;
 266:		}
 267:	
 268:		err = inode_newsize_ok(vi, attr->ia_size);
 269:		if (err)
 270:			return err;
 271:	
 272:		inode_dio_wait(vi);
 273:	
 274:		/*
 275:		 * Serialize with page faults and pagecache instantiation so that
 276:		 * readers cannot observe the size change until the attribute
 277:		 * updates below have completed.
 278:		 */
 279:		filemap_invalidate_lock(vi->i_mapping);
 280:		if (attr->ia_size > old_size) {
 281:			truncate_pagecache(vi, old_size);
 282:			i_size_write(vi, attr->ia_size);
 283:			pagecache_isize_extended(vi, old_size, attr->ia_size);
 284:		} else {
 285:			truncate_setsize(vi, attr->ia_size);
 286:		}
 287:	
 288:		err = ntfs_truncate_vfs(vi, attr->ia_size, old_size);
 289:		if (err)
 290:			i_size_write(vi, old_size);
 291:		filemap_invalidate_unlock(vi->i_mapping);
 292:	
 293:		return err;
 294:	}
]

198/4 2026/09/17 11:08 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 32602
							output: 37
							thoughts: 568
						

Thoughts:
**Analyzing NTFS Truncation and Attribute Setting**

Okay, here's what's running through my mind. This question about `ntfs_setattr` and the call order of `filemap_invalidate_lock`, `truncate_setsize`, and `ntfs_set_size` is intriguing. The critical question: when setting file attributes, is `filemap_invalidate_lock` necessary before adjusting the file size?

First, I need to understand the existing implementation to make a good determination. I started by looking at `fs/ntfs/file.c` to see how it handles truncation because that's what the question references. Ah, yes, it calls `ntfs_truncate_vfs`, good to know. Now, let's turn to `fs/ntfs3/file.c` which, I assume, is a newer implementation.

Bingo! The question specifically mentions `ntfs_set_size` along with `truncate_setsize`. Let's examine `fs/ntfs3/file.c`'s implementation of `ntfs_setattr`. Examining the code reveals this snippet:

```c
		if (ia_valid & ATTR_SIZE) {
			loff_t newsize, oldsize;

			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
				/* Should never be here, see ntfs_file_open(). */
				err = -EOPNOTSUPP;
				goto out;
			}
			inode_dio_wait(inode);
			oldsize = i_size_read(inode);
			newsize = attr->ia_size;

			if (newsize != oldsize) {
				truncate_setsize(inode, newsize);

				err = ntfs_set_size(inode, newsize);
				if (err) {
					i_size_write(inode, oldsize);
					goto out;
				}

				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
				inode_set_mtime_to_ts(inode,
						      inode_set_ctime_current(inode));
			}
		}
```

Wait a minute, where's the call to `filemap_invalidate_lock`? That's the core of the question! It looks like `ntfs3` doesn't include it. This is a potential red flag, or perhaps an optimization. I need to understand the rationale here.

Okay, time to widen the scope. I'll need to check how other filesystems handle this, and see if there are common patterns or explanations for the placement of `filemap_invalidate_lock`. Let's look at `fs/ext4/inode.c`, the `ext4_setattr` function. A comparative analysis should reveal more about the correct approach.



199/4 2026/09/17 11:08 tool read-file
0m Args:
map[File:fs/ext4/inode.c FirstLine:6120 LineCount:40]

Results:
map[Contents:6120:				 * Blocks are going to be removed from the inode. Wait
6121:				 * for dio in flight.
6122:				 */
6123:				inode_dio_wait(inode);
6124:			}
6125:	
6126:			filemap_invalidate_lock(inode->i_mapping);
6127:	
6128:			rc = ext4_break_layouts(inode);
6129:			if (rc) {
6130:				filemap_invalidate_unlock(inode->i_mapping);
6131:				goto err_out;
6132:			}
6133:	
6134:			if (attr->ia_size != inode->i_size) {
6135:				/* attach jbd2 jinode for EOF folio tail zeroing */
6136:				if (attr->ia_size & (inode->i_sb->s_blocksize - 1) ||
6137:				    oldsize & (inode->i_sb->s_blocksize - 1)) {
6138:					error = ext4_inode_attach_jinode(inode);
6139:					if (error)
6140:						goto out_mmap_sem;
6141:				}
6142:	
6143:				/*
6144:				 * Update c/mtime and tail zero the EOF folio on
6145:				 * truncate up. ext4_truncate() handles the shrink case
6146:				 * below.
6147:				 */
6148:				if (!shrink) {
6149:					inode_set_mtime_to_ts(inode,
6150:							      inode_set_ctime_current(inode));
6151:					if (oldsize & (inode->i_sb->s_blocksize - 1)) {
6152:						error = ext4_block_zero_eof(inode,
6153:								oldsize, LLONG_MAX);
6154:						if (error)
6155:							goto out_mmap_sem;
6156:					}
6157:				}
6158:	
6159:				handle = ext4_journal_start(inode, EXT4_HT_INODE, 3);
]

200/4 2026/09/17 11:08 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 34453
							output: 37
							thoughts: 15
						

Thoughts:
Okay, here's my interpretation of those thoughts, crafted with the understanding that I'm speaking to a fellow expert:

**Diving Deeper into ext4_setattr**

Right, so we're focusing on `ext4_setattr`, and naturally, my mind immediately jumps to the surrounding context. It's like, "Where *else* in the code can we see this being implemented or referenced?" I want to trace the implications of that function call, understand its place in the broader file system design. "Let's also see further down in `ext4_setattr`." This means that I'm planning to scan the code, looking at the implementations of this functions, and how they relate to related objects. I know `ext4_setattr` is a key component, but I need to fully understand all of its interactions. This goes beyond a surface-level understanding; I'm trying to map the relationships between `ext4_setattr` and its surrounding components.



201/4 2026/09/17 11:09 tool read-file
0m Args:
map[File:fs/ext4/inode.c FirstLine:6160 LineCount:50]

Results:
map[Contents:6160:				if (IS_ERR(handle)) {
6161:					error = PTR_ERR(handle);
6162:					goto out_mmap_sem;
6163:				}
6164:				if (ext4_handle_valid(handle) && shrink) {
6165:					error = ext4_orphan_add(handle, inode);
6166:					orphan = 1;
6167:				}
6168:	
6169:				if (shrink)
6170:					ext4_fc_track_range(handle, inode,
6171:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6172:						inode->i_sb->s_blocksize_bits,
6173:						EXT_MAX_BLOCKS - 1);
6174:				else
6175:					ext4_fc_track_range(
6176:						handle, inode,
6177:						(oldsize > 0 ? oldsize - 1 : oldsize) >>
6178:						inode->i_sb->s_blocksize_bits,
6179:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6180:						inode->i_sb->s_blocksize_bits);
6181:	
6182:				down_write(&EXT4_I(inode)->i_data_sem);
6183:				old_disksize = EXT4_I(inode)->i_disksize;
6184:				EXT4_I(inode)->i_disksize = attr->ia_size;
6185:	
6186:				/*
6187:				 * We have to update i_size under i_data_sem together
6188:				 * with i_disksize to avoid races with writeback code
6189:				 * running ext4_wb_update_i_disksize().
6190:				 */
6191:				if (!error)
6192:					i_size_write(inode, attr->ia_size);
6193:				else
6194:					EXT4_I(inode)->i_disksize = old_disksize;
6195:				up_write(&EXT4_I(inode)->i_data_sem);
6196:				rc = ext4_mark_inode_dirty(handle, inode);
6197:				if (!error)
6198:					error = rc;
6199:				ext4_journal_stop(handle);
6200:				if (error)
6201:					goto out_mmap_sem;
6202:				if (!shrink) {
6203:					pagecache_isize_extended(inode, oldsize,
6204:								 inode->i_size);
6205:				} else if (ext4_should_journal_data(inode)) {
6206:					ext4_wait_for_tail_page_commit(inode);
6207:				}
6208:			}
6209:	
]

202/4 2026/09/17 11:09 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 35531
							output: 37
							thoughts: 26
						

Thoughts:
Okay, here's my summary, taking on the persona you requested:

**Ext4 Shrink Investigation: Delving into `ext4_setattr`**

Alright, time to get to work. I need to understand what's happening with shrinking in ext4. First, let me navigate to `ext4_setattr` and see what that function does. It seems like it's the place to start digging for details. I need to see if the shrinking logic is called inside the function `ext4_setattr`.



203/4 2026/09/17 11:09 tool read-file
0m Args:
map[File:fs/ext4/inode.c FirstLine:6210 LineCount:40]

Results:
map[Contents:6210:			/*
6211:			 * Truncate pagecache after we've waited for commit
6212:			 * in data=journal mode to make pages freeable.
6213:			 */
6214:			truncate_pagecache(inode, inode->i_size);
6215:			/*
6216:			 * Call ext4_truncate() even if i_size didn't change to
6217:			 * truncate possible preallocated blocks.
6218:			 */
6219:			if (attr->ia_size <= oldsize) {
6220:				rc = ext4_truncate(inode);
6221:				if (rc)
6222:					error = rc;
6223:			}
6224:	out_mmap_sem:
6225:			filemap_invalidate_unlock(inode->i_mapping);
6226:		}
6227:	
6228:		if (!error) {
6229:			if (inc_ivers)
6230:				inode_inc_iversion(inode);
6231:			setattr_copy(idmap, inode, attr);
6232:			mark_inode_dirty(inode);
6233:		}
6234:	
6235:		/*
6236:		 * If the call to ext4_truncate failed to get a transaction handle at
6237:		 * all, we need to clean up the in-core orphan list manually.
6238:		 */
6239:		if (orphan && inode->i_nlink)
6240:			ext4_orphan_del(NULL, inode);
6241:	
6242:		if (!error && (ia_valid & ATTR_MODE))
6243:			rc = posix_acl_chmod(idmap, dentry, inode->i_mode);
6244:	
6245:	err_out:
6246:		if  (error)
6247:			ext4_std_error(inode->i_sb, error);
6248:		if (!error)
6249:			error = rc;
]

204/4 2026/09/17 11:09 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 36280
							output: 37
							thoughts: 41
						

Thoughts:
Here's my thinking process:

**Diving Deeper into `truncate_setsize`**

Okay, before I proceed further, I need to make absolutely sure I have a solid understanding of how `truncate_setsize` functions. Let's not just assume I remember it correctly. I'll take a quick scan for implementations and related comments in *other* filesystems, to broaden my context and see if there are any subtle nuances or caveats I'm missing. The goal is to solidify the definition and clarify any potential gotchas. I need to refresh the definition and any accompanying documentation regarding `truncate_setsize`.



205/4 2026/09/17 11:09 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:truncate_setsize]

Results:
map[SourceCode: 803:	/**
 804:	 * truncate_setsize - update inode and pagecache for a new file size
 805:	 * @inode: inode
 806:	 * @newsize: new file size
 807:	 *
 808:	 * truncate_setsize updates i_size and performs pagecache truncation (if
 809:	 * necessary) to @newsize. It will be typically be called from the filesystem's
 810:	 * setattr function when ATTR_SIZE is passed in.
 811:	 *
 812:	 * Must be called with a lock serializing truncates and writes (generally
 813:	 * i_rwsem but e.g. xfs uses a different lock) and before all filesystem
 814:	 * specific block truncation has been performed.
 815:	 */
 816:	void truncate_setsize(struct inode *inode, loff_t newsize)
 817:	{
 818:		loff_t oldsize = inode->i_size;
 819:	
 820:		i_size_write(inode, newsize);
 821:		if (newsize > oldsize)
 822:			pagecache_isize_extended(inode, oldsize, newsize);
 823:		truncate_pagecache(inode, newsize);
 824:	}
 SourceFile:mm/truncate.c]

206/4 2026/09/17 11:09 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 36872
							output: 39
							thoughts: 111
						

Thoughts:
**Analyzing Filesystem Truncation in NTFS3**

Okay, so I'm looking at this `truncate_setsize` function, and the comment is pretty specific. It's reminding me that this needs to be called with a lock that serializes both truncates *and* writes. It even throws in that little note about different filesystems potentially using different locks – like XFS, for example. Good to keep that in mind. But now, my mind's wandering and I'm wondering about the NTFS3 implementation. Specifically, what's `ntfs_set_size` doing over there in `fs/ntfs3`? I need to check the `ntfs_set_size` definition in `fs/ntfs3/inode.c`. That's where I should find the answer to my question.



207/4 2026/09/17 11:10 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/inode.c Name:ntfs_set_size]

Results:
map[SourceCode: 883:	int ntfs_set_size(struct inode *inode, u64 new_size)
 884:	{
 885:		struct super_block *sb = inode->i_sb;
 886:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 887:		struct ntfs_inode *ni = ntfs_i(inode);
 888:		int err;
 889:	
 890:		/* Check for maximum file size. */
 891:		if (is_sparsed(ni) || is_compressed(ni)) {
 892:			if (new_size > sbi->maxbytes_sparse) {
 893:				return -EFBIG;
 894:			}
 895:		} else if (new_size > sbi->maxbytes) {
 896:			return -EFBIG;
 897:		}
 898:	
 899:		/* Mark rw ntfs as dirty. It will be cleared at umount. */
 900:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 901:	
 902:		ni_lock(ni);
 903:		down_write(&ni->file.run_lock);
 904:		if (new_size < ni->i_valid)
 905:			ni->i_valid = new_size;
 906:	
 907:		/* last 'true' means keep preallocated. */
 908:		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
 909:				    &ni->file.run, new_size, &ni->i_valid, true);
 910:	
 911:		up_write(&ni->file.run_lock);
 912:		ni_unlock(ni);
 913:	
 914:		return err;
 915:	}
 SourceFile:fs/ntfs3/inode.c]

208/4 2026/09/17 11:10 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 37758
							output: 25
							thoughts: 495
						

Thoughts:
**Analyzing File Size Modification in NTFS**

Okay, so I'm diving into this `ntfs_setattr` question, specifically the interplay between `filemap_invalidate_lock`, `truncate_setsize`, and `ntfs_set_size`. The core of the issue seems to be the order and potential race conditions when modifying a file's size, both extending and shrinking it.

My first thought is to understand the core functions involved. `ntfs_set_size` is the key function that calls `attr_set_size`, which, crucially, performs the actual on-disk block allocation or truncation, this happens by calling `truncate_setsize` which call `i_size_write` and also deals with the page cache. So, it looks like `ntfs_set_size` is responsible for the actual *physical* on-disk changes, while `truncate_setsize` handles the *logical* inode size update and page cache management.

The initial question is whether `filemap_invalidate_lock` is needed and, if so, the correct order of these calls when *extending* or *shrinking* the file. The key here is to think about the consequences of each operation.

If we extend the file, and `ntfs_set_size` fails (say, due to -ENOSPC), what if `truncate_setsize` was called first? That's the critical piece. The `inode->i_size` might be updated, and pages could be faulted in or zeroed prematurely, which is a major concern.

Therefore, I need to check how these operations are handled in other filesystems, to get a broader view of common practices, I'll need to check how `truncate_setsize` is implemented in, for example, ext4, xfs, btrfs, f2fs, zonefs, udf, ocfs2, and others. I need to grep for `truncate_setsize` across `fs/` to figure out best practices. The goal is to identify common patterns, particularly in the order of operations and the safeguards employed. The best way to understand this is a direct comparison across the main file systems.



209/4 2026/09/17 11:10 tool grepper
0m Args:
map[Expression:truncate_setsize PathPrefix:fs]

Results:
map[Output:fs/9p/vfs_inode.c=1017=static int v9fs_vfs_setattr(struct mnt_idmap *idmap,
--
fs/9p/vfs_inode.c-1081-		 iattr->ia_size != i_size_read(inode)) {
fs/9p/vfs_inode.c:1082:		truncate_setsize(inode, iattr->ia_size);
fs/9p/vfs_inode.c-1083-		netfs_resize_file(netfs_inode(inode), iattr->ia_size, true);
--
fs/9p/vfs_inode_dotl.c=511=int v9fs_vfs_setattr_dotl(struct mnt_idmap *idmap,
--
fs/9p/vfs_inode_dotl.c-576-		 i_size_read(inode)) {
fs/9p/vfs_inode_dotl.c:577:		truncate_setsize(inode, iattr->ia_size);
fs/9p/vfs_inode_dotl.c-578-		netfs_resize_file(netfs_inode(inode), iattr->ia_size, true);
--
fs/adfs/inode.c=302=adfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
--
fs/adfs/inode.c-323-	if (ia_valid & ATTR_SIZE)
fs/adfs/inode.c:324:		truncate_setsize(inode, attr->ia_size);
fs/adfs/inode.c-325-
--
fs/affs/inode.c=216=affs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
--
fs/affs/inode.c-244-
fs/affs/inode.c:245:		truncate_setsize(inode, attr->ia_size);
fs/affs/inode.c-246-		affs_truncate(inode);
--
fs/afs/inode.c=762=int afs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/afs/inode.c-816-		    attr->ia_size > netfs_read_remote_i_size(inode)) {
fs/afs/inode.c:817:			truncate_setsize(inode, attr->ia_size);
fs/afs/inode.c-818-			netfs_resize_file(&vnode->netfs, size, false);
--
fs/aio.c=360=static void put_aio_ring_file(struct kioctx *ctx)
--
fs/aio.c-366-
fs/aio.c:367:		truncate_setsize(inode, 0);
fs/aio.c-368-
--
fs/btrfs/file.c=1526=int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
--
fs/btrfs/file.c-1809- * protect against truncate races as the page could now be beyond EOF.  Because
fs/btrfs/file.c:1810: * truncate_setsize() writes the inode size before removing pages, once we have
fs/btrfs/file.c-1811- * the page lock we can determine safely if the page is beyond EOF. If it is not
--
fs/btrfs/inode.c=5391=static int btrfs_setsize(struct inode *inode, struct iattr *attr)
--
fs/btrfs/inode.c-5460-
fs/btrfs/inode.c:5461:		truncate_setsize(inode, newsize);
fs/btrfs/inode.c-5462-
--
fs/ecryptfs/inode.c=733=static int __ecryptfs_truncate(struct dentry *dentry, const struct iattr *ia)
--
fs/ecryptfs/inode.c-784-	if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) {
fs/ecryptfs/inode.c:785:		truncate_setsize(inode, ia->ia_size);
fs/ecryptfs/inode.c-786-		lower_ia.ia_size = ia->ia_size;
--
fs/ecryptfs/inode.c-804-	}
fs/ecryptfs/inode.c:805:	truncate_setsize(inode, ia->ia_size);
fs/ecryptfs/inode.c-806-	rc = ecryptfs_write_inode_size_to_metadata(inode);
--
fs/exfat/file.c=350=int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/exfat/file.c-415-		inode_dio_wait(inode);
fs/exfat/file.c:416:		truncate_setsize(inode, attr->ia_size);
fs/exfat/file.c-417-
--
fs/exfat/file.c=754=static int exfat_extend_valid_size(struct inode *inode, loff_t new_valid_size)
--
fs/exfat/file.c-786-		if (ret) {
fs/exfat/file.c:787:			truncate_setsize(inode, old_valid_size);
fs/exfat/file.c-788-			exfat_truncate(inode);
--
fs/ext2/inode.c=1237=static int ext2_setsize(struct inode *inode, loff_t newsize)
--
fs/ext2/inode.c-1255-	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c:1256:	truncate_setsize(inode, newsize);
fs/ext2/inode.c-1257-	__ext2_truncate_blocks(inode, newsize);
--
fs/f2fs/file.c=637=static int finish_preallocate_blocks(struct inode *inode)
--
fs/f2fs/file.c-657-
fs/f2fs/file.c:658:	truncate_setsize(inode, i_size_read(inode));
fs/f2fs/file.c-659-	ret = f2fs_truncate(inode);
--
fs/f2fs/file.c=1124=int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/f2fs/file.c-1235-		}
fs/f2fs/file.c:1236:		truncate_setsize(inode, attr->ia_size);
fs/f2fs/file.c-1237-
--
fs/f2fs/file.c=3879=static int f2fs_ioc_release_dev_alias(struct file *filp)
--
fs/f2fs/file.c-3929-	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c:3930:	truncate_setsize(inode, 0);
fs/f2fs/file.c-3931-
--
fs/fat/file.c=517=int fat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/fat/file.c-586-		down_write(&MSDOS_I(inode)->truncate_lock);
fs/fat/file.c:587:		truncate_setsize(inode, attr->ia_size);
fs/fat/file.c-588-		fat_truncate_blocks(inode, attr->ia_size);
--
fs/gfs2/bmap.c=2095=static int do_grow(struct inode *inode, u64 size)
--
fs/gfs2/bmap.c-2138-
fs/gfs2/bmap.c:2139:	truncate_setsize(inode, size);
fs/gfs2/bmap.c-2140-	inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_current(&ip->i_inode));
--
fs/hfs/inode.c=646=int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/hfs/inode.c-686-
fs/hfs/inode.c:687:		truncate_setsize(inode, attr->ia_size);
fs/hfs/inode.c-688-		hfs_file_truncate(inode);
--
fs/hfsplus/inode.c=308=static int hfsplus_setattr(struct mnt_idmap *idmap,
--
fs/hfsplus/inode.c-326-		}
fs/hfsplus/inode.c:327:		truncate_setsize(inode, attr->ia_size);
fs/hfsplus/inode.c-328-		hfsplus_file_truncate(inode);
--
fs/hostfs/hostfs_kern.c=804=static int hostfs_setattr(struct mnt_idmap *idmap,
--
fs/hostfs/hostfs_kern.c-868-	    attr->ia_size != i_size_read(inode))
fs/hostfs/hostfs_kern.c:869:		truncate_setsize(inode, attr->ia_size);
fs/hostfs/hostfs_kern.c-870-
--
fs/hpfs/inode.c=260=int hpfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/hpfs/inode.c-287-
fs/hpfs/inode.c:288:		truncate_setsize(inode, attr->ia_size);
fs/hpfs/inode.c-289-		hpfs_truncate(inode);
--
fs/jffs2/fs.c=32=int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
--
fs/jffs2/fs.c-179-
fs/jffs2/fs.c:180:	/* We have to do the truncate_setsize() without f->sem held, since
fs/jffs2/fs.c-181-	   some pages may be locked and waiting for it in read_folio().
--
fs/jffs2/fs.c-185-	if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) {
fs/jffs2/fs.c:186:		truncate_setsize(inode, iattr->ia_size);
fs/jffs2/fs.c-187-		inode->i_blocks = (inode->i_size + 511) >> 9;
--
fs/jfs/file.c=92=int jfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/jfs/file.c-121-
fs/jfs/file.c:122:		truncate_setsize(inode, iattr->ia_size);
fs/jfs/file.c-123-		jfs_truncate(inode);
--
fs/libfs.c=916=int simple_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/libfs.c-926-	if (iattr->ia_valid & ATTR_SIZE)
fs/libfs.c:927:		truncate_setsize(inode, iattr->ia_size);
fs/libfs.c-928-	setattr_copy(idmap, inode, iattr);
--
fs/minix/file.c=26=static int minix_setattr(struct mnt_idmap *idmap,
--
fs/minix/file.c-41-
fs/minix/file.c:42:		truncate_setsize(inode, attr->ia_size);
fs/minix/file.c-43-		minix_truncate(inode);
--
fs/nilfs2/inode.c=907=int nilfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/nilfs2/inode.c-925-		inode_dio_wait(inode);
fs/nilfs2/inode.c:926:		truncate_setsize(inode, iattr->ia_size);
fs/nilfs2/inode.c-927-		nilfs_truncate(inode);
--
fs/ntfs/file.c=254=static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
--
fs/ntfs/file.c-284-	} else {
fs/ntfs/file.c:285:		truncate_setsize(vi, attr->ia_size);
fs/ntfs/file.c-286-	}
--
fs/ntfs/file.c=579=static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/ntfs/file.c-664-		if (ni->data_size != old_data_size) {
fs/ntfs/file.c:665:			truncate_setsize(vi, old_data_size);
fs/ntfs/file.c-666-			ntfs_attr_truncate(ni, old_data_size);
--
fs/ntfs/inode.c=375=int ntfs_drop_big_inode(struct inode *inode)
--
fs/ntfs/inode.c-390-
fs/ntfs/inode.c:391:				truncate_setsize(VFS_I(ni), 0);
fs/ntfs/inode.c-392-				ntfs_truncate_vfs(VFS_I(ni), 0, 1);
--
fs/ntfs/inode.c=2410=int ntfs_extend_initialized_size(struct inode *vi, const loff_t offset,
--
fs/ntfs/inode.c-2444-	if (err)
fs/ntfs/inode.c:2445:		truncate_setsize(vi, old_init_size);
fs/ntfs/inode.c-2446-	return err;
--
fs/ntfs3/attrib.c=2009=int attr_collapse_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
--
fs/ntfs3/attrib.c-2057-		/* Simple truncate file at 'vbo'. */
fs/ntfs3/attrib.c:2058:		truncate_setsize(&ni->vfs_inode, vbo);
fs/ntfs3/attrib.c-2059-		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name,
--
fs/ntfs3/file.c=706=int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ntfs3/file.c-738-		if (newsize != oldsize) {
fs/ntfs3/file.c:739:			truncate_setsize(inode, newsize);
fs/ntfs3/file.c-740-
--
fs/omfs/file.c=341=static int omfs_setattr(struct mnt_idmap *idmap,
--
fs/omfs/file.c-355-			return error;
fs/omfs/file.c:356:		truncate_setsize(inode, attr->ia_size);
fs/omfs/file.c-357-		omfs_truncate(inode);
--
fs/orangefs/inode.c=697=static int orangefs_setattr_size(struct inode *inode, struct iattr *iattr)
--
fs/orangefs/inode.c-722-
fs/orangefs/inode.c:723:	/* This is truncate_setsize in a different order. */
fs/orangefs/inode.c-724-	truncate_pagecache(inode, iattr->ia_size);
--
fs/ramfs/file-nommu.c=135=static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size)
--
fs/ramfs/file-nommu.c-154-
fs/ramfs/file-nommu.c:155:	truncate_setsize(inode, newsize);
fs/ramfs/file-nommu.c-156-	return 0;
--
fs/smb/client/cifsfs.c=1519=ssize_t cifs_file_copychunk_range(unsigned int xid,
--
fs/smb/client/cifsfs.c-1596-		if (rc > 0 && destoff + rc > i_size_read(target_inode)) {
fs/smb/client/cifsfs.c:1597:			truncate_setsize(target_inode, destoff + rc);
fs/smb/client/cifsfs.c-1598-			netfs_resize_file(&target_cifsi->netfs,
--
fs/smb/client/smb2ops.c=3508=static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3568-		if (rc >= 0) {
fs/smb/client/smb2ops.c:3569:			truncate_setsize(inode, new_size);
fs/smb/client/smb2ops.c-3570-			spin_lock(&inode->i_lock);
--
fs/smb/client/smb2ops.c=4014=static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4064-
fs/smb/client/smb2ops.c:4065:	truncate_setsize(inode, new_eof);
fs/smb/client/smb2ops.c-4066-	spin_lock(&inode->i_lock);
--
fs/smb/client/smb2ops.c=4078=static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4127-
fs/smb/client/smb2ops.c:4128:	truncate_setsize(inode, new_eof);
fs/smb/client/smb2ops.c-4129-	spin_lock(&inode->i_lock);
--
fs/ubifs/file.c=883=static int do_writepage(struct folio *folio, size_t len)
--
fs/ubifs/file.c-958- * same time. And the problematic one is truncation to smaller size, from where
fs/ubifs/file.c:959: * we have to call 'truncate_setsize()', which first changes @inode->i_size,
fs/ubifs/file.c-960- * then drops the truncated pages. And while dropping the pages, it takes the
fs/ubifs/file.c:961: * page lock. This means that 'do_truncation()' cannot call 'truncate_setsize()'
fs/ubifs/file.c-962- * with @ui_mutex locked, because it would deadlock with 'ubifs_writepage()'.
--
fs/ubifs/file.c-965- * XXX(truncate): with the new truncate sequence this is not true anymore,
fs/ubifs/file.c:966: * and the calls to truncate_setsize can be move around freely.  They should
fs/ubifs/file.c-967- * be moved to the very end of the truncate sequence.
--
fs/ubifs/file.c=1100=static int do_truncation(struct ubifs_info *c, struct inode *inode,
--
fs/ubifs/file.c-1133-
fs/ubifs/file.c:1134:	truncate_setsize(inode, new_size);
fs/ubifs/file.c-1135-
--
fs/ubifs/file.c=1208=static int do_setattr(struct ubifs_info *c, struct inode *inode,
--
fs/ubifs/file.c-1222-		dbg_gen("size %lld -> %lld", inode->i_size, new_size);
fs/ubifs/file.c:1223:		truncate_setsize(inode, new_size);
fs/ubifs/file.c-1224-	}
--
fs/ubifs/file.c-1229-		inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
fs/ubifs/file.c:1230:		/* 'truncate_setsize()' changed @i_size, update @ui_size */
fs/ubifs/file.c-1231-		ui->ui_size = inode->i_size;
--
fs/ubifs/ubifs.h=334=struct ubifs_gced_idx_leb {
--
fs/ubifs/ubifs.h-393- * make sure @inode->i_size is always changed under @ui_mutex, because it
fs/ubifs/ubifs.h:394: * cannot call 'truncate_setsize()' with @ui_mutex locked, because it would
fs/ubifs/ubifs.h-395- * deadlock with 'ubifs_writepage()' (see file.c). All the other inode fields
--
fs/udf/inode.c=1280=int udf_setsize(struct inode *inode, loff_t newsize)
--
fs/udf/inode.c-1307-set_size:
fs/udf/inode.c:1308:		truncate_setsize(inode, newsize);
fs/udf/inode.c-1309-	} else {
--
fs/udf/inode.c-1316-			iinfo->i_lenAlloc = newsize;
fs/udf/inode.c:1317:			truncate_setsize(inode, newsize);
fs/udf/inode.c-1318-			up_write(&iinfo->i_data_sem);
--
fs/udf/inode.c-1324-			return err;
fs/udf/inode.c:1325:		truncate_setsize(inode, newsize);
fs/udf/inode.c-1326-		down_write(&iinfo->i_data_sem);
--
fs/ufs/inode.c=1167=static int ufs_truncate(struct inode *inode, loff_t size)
--
fs/ufs/inode.c-1187-
fs/ufs/inode.c:1188:	truncate_setsize(inode, size);
fs/ufs/inode.c-1189-
--
fs/xfs/xfs_iops.c=905=xfs_vn_setattr_size(
--
fs/xfs/xfs_iops.c-1008-	 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
fs/xfs/xfs_iops.c:1009:	 * complete. The truncate_setsize() call also cleans partial EOF page
fs/xfs/xfs_iops.c-1010-	 * PTEs on extending truncates and hence ensures sub-page block size
--
fs/xfs/xfs_iops.c-1025-	 */
fs/xfs/xfs_iops.c:1026:	truncate_setsize(inode, newsize);
fs/xfs/xfs_iops.c-1027-
--
fs/zonefs/file.c=203=int zonefs_file_truncate(struct inode *inode, loff_t isize)
--
fs/zonefs/file.c-261-	zonefs_update_stats(inode, isize);
fs/zonefs/file.c:262:	truncate_setsize(inode, isize);
fs/zonefs/file.c-263-	z->z_wpoffset = isize;
]

210/4 2026/09/17 11:10 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 45037
							output: 37
							thoughts: 41
						

Thoughts:
Here's my summary, as though I'm thinking through this process:

**Diving into the UDF Filesystem's Size Setting**

Okay, so I need to understand how the UDF filesystem handles setting file sizes. Let's see... a quick mental search brings me to the potential function: `udf_setsize`. That seems like the right place to start. Now, where is that in the kernel source? Ah, it's in `fs/udf/inode.c`. Alright, let's navigate there. I'll open up that file and jump to around line 1280. That's usually a good starting point for a function definition. I'll take a look at the code there and see how it works. I'll be looking for things like how it interacts with the underlying block device, any potential error conditions, and how it handles the metadata updates. Let's get to it!



211/4 2026/09/17 11:10 tool read-file
0m Args:
map[File:fs/udf/inode.c FirstLine:1280 LineCount:55]

Results:
map[Contents:1280:	int udf_setsize(struct inode *inode, loff_t newsize)
1281:	{
1282:		int err = 0;
1283:		struct udf_inode_info *iinfo;
1284:		unsigned int bsize = i_blocksize(inode);
1285:	
1286:		if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
1287:		      S_ISLNK(inode->i_mode)))
1288:			return -EINVAL;
1289:	
1290:		iinfo = UDF_I(inode);
1291:		if (newsize > inode->i_size) {
1292:			if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
1293:				if (bsize >=
1294:				    (udf_file_entry_alloc_offset(inode) + newsize)) {
1295:					down_write(&iinfo->i_data_sem);
1296:					iinfo->i_lenAlloc = newsize;
1297:					up_write(&iinfo->i_data_sem);
1298:					goto set_size;
1299:				}
1300:				err = udf_expand_file_adinicb(inode);
1301:				if (err)
1302:					return err;
1303:			}
1304:			err = udf_extend_file(inode, newsize);
1305:			if (err)
1306:				return err;
1307:	set_size:
1308:			truncate_setsize(inode, newsize);
1309:		} else {
1310:			if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
1311:				down_write(&iinfo->i_data_sem);
1312:				udf_clear_extent_cache(inode);
1313:				memset(iinfo->i_data + iinfo->i_lenEAttr + newsize,
1314:				       0x00, bsize - newsize -
1315:				       udf_file_entry_alloc_offset(inode));
1316:				iinfo->i_lenAlloc = newsize;
1317:				truncate_setsize(inode, newsize);
1318:				up_write(&iinfo->i_data_sem);
1319:				goto update_time;
1320:			}
1321:			err = block_truncate_page(inode->i_mapping, newsize,
1322:						  udf_get_block);
1323:			if (err)
1324:				return err;
1325:			truncate_setsize(inode, newsize);
1326:			down_write(&iinfo->i_data_sem);
1327:			udf_clear_extent_cache(inode);
1328:			err = udf_truncate_extents(inode);
1329:			up_write(&iinfo->i_data_sem);
1330:			if (err)
1331:				return err;
1332:		}
1333:	update_time:
1334:		inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
]

212/4 2026/09/17 11:10 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 46239
							output: 25
							thoughts: 299
						

Thoughts:
**My Analysis of the UDF Filesystem Truncate Logic**

Okay, so I'm looking at this code snippet in `fs/udf/inode.c`, specifically the `if (newsize > inode->i_size)` block. Interesting. It's essentially handling file extension and shrinking within the UDF filesystem, and the order of operations here is actually quite clever.

When I'm *extending* the file (`newsize > inode->i_size`), it first calls `udf_extend_file(inode, newsize)`. This makes perfect sense; allocate or extend the disk space *before* updating the file size with `truncate_setsize(inode, newsize)`. This way, if the disk allocation fails, the file size remains unchanged – a critical consistency measure. We don't want partial writes or inconsistent metadata, right?

But *shrinking* is handled differently. Here, it calls `truncate_setsize(inode, newsize)` *first*, and then `udf_truncate_extents(inode)`. This makes equally good sense! I suspect this is because `truncate_setsize` modifies the pagecache and the `i_size`. We want to ensure that readers or mmap'd regions don't see or write beyond the new, truncated size. So that has to happen *before* we actually trim the on-disk blocks, reducing the file size. Protect the data!

Now, I'm getting curious. Is this *just* a UDF thing, or is this a general VFS/Linux filesystem rule? I really need to check other filesystems and the documentation for this. Let me quickly scan through `Documentation/filesystems/` and run a quick `grep` for `truncate_setsize` across the documentation. This could be a crucial best practice, or a pattern I can apply in my own work... let's dig deeper!



213/4 2026/09/17 11:11 tool grepper
0m Args:
map[Expression:truncate_setsize PathPrefix:Documentation]

Results:
map[Output:Documentation/filesystems/iomap/operations.rst=297=operation.
Documentation/filesystems/iomap/operations.rst:298:``truncate_setsize`` or ``truncate_pagecache`` will take care of
Documentation/filesystems/iomap/operations.rst-299-everything after the EOF block.
]

214/4 2026/09/17 11:11 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 47059
							output: 27
							thoughts: 20
						

Thoughts:
Here's my thought process, summarized as you requested:

**Navigating the Filesystem Documentation**

Okay, so I need to understand how `filemap_invalidate_lock` works. Given my background, I immediately think, "Where would I find the most authoritative and detailed information?" Naturally, the kernel documentation is the first port of call. Specifically, for filesystem-related details, the logical place to look is the `Documentation/filesystems/` directory within the kernel source. That seems like the most likely place to either find a full explanation of the function, or at least a reference to the relevant section that would explain its purpose, use, and interaction with other components. Let's start there.



215/4 2026/09/17 11:11 tool grepper
0m Error:
log-in to see details

Args:
map[Expression:filemap_invalidate_lock PathPrefix:Documentation]

Results:
map[Output:]

216/4 2026/09/17 11:11 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 47267
							output: 27
							thoughts: 24
						

Thoughts:
Here's my summary, as if I were thinking these thoughts:

**Investigating `filemap_invalidate_lock`**

Okay, so I need to understand this `filemap_invalidate_lock` function a bit better. Instead of guessing, let's cut straight to the source. Time to open up the `include/` directory and use `grep` to quickly locate the documentation comment for this thing. Hopefully, there's a good explanation in there that will shed some light on its purpose and usage. No point in wasting time digging through unrelated code when I can find the definitive answer directly within the header file itself. Let's see what we can find.



217/4 2026/09/17 11:11 tool grepper
0m Args:
map[Expression:filemap_invalidate_lock PathPrefix:include]

Results:
map[Output:include/linux/fs.h=1072=static inline void inode_lock_shared_nested(struct inode *inode, unsigned subclass)
--
include/linux/fs.h-1076-
include/linux/fs.h:1077:static inline void filemap_invalidate_lock(struct address_space *mapping)
include/linux/fs.h-1078-{
--
include/linux/fs.h=1082=static inline void filemap_invalidate_unlock(struct address_space *mapping)
--
include/linux/fs.h-1086-
include/linux/fs.h:1087:static inline void filemap_invalidate_lock_shared(struct address_space *mapping)
include/linux/fs.h-1088-{
--
include/linux/fs.h=1105=void unlock_two_nondirectories(struct inode *, struct inode*);
include/linux/fs.h-1106-
include/linux/fs.h:1107:void filemap_invalidate_lock_two(struct address_space *mapping1,
include/linux/fs.h-1108-				 struct address_space *mapping2);
]

218/4 2026/09/17 11:11 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 47763
							output: 36
							thoughts: 21
						

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

**Diving into the Filesystem Structure**

Alright, I need to get a better handle on how this filesystem is structured. I'm going to jump into the `include/linux/fs.h` header file. Specifically, I'm aiming for around line 1070. That's usually where the core data structures for file system operations, like `struct file_operations` are defined or referenced, along with things like `struct inode` and `struct super_block`. I'm hoping to refresh my understanding of where the low-level functions tie into the virtual filesystem layer, or maybe I'm looking to track down a specific VFS call. Let's see what we can find there.



219/4 2026/09/17 11:11 tool read-file
0m Args:
map[File:include/linux/fs.h FirstLine:1050 LineCount:50]

Results:
map[Contents:1050:	}
1051:	
1052:	static inline int inode_trylock(struct inode *inode)
1053:	{
1054:		return down_write_trylock(&inode->i_rwsem);
1055:	}
1056:	
1057:	static inline int inode_trylock_shared(struct inode *inode)
1058:	{
1059:		return down_read_trylock(&inode->i_rwsem);
1060:	}
1061:	
1062:	static inline int inode_is_locked(struct inode *inode)
1063:	{
1064:		return rwsem_is_locked(&inode->i_rwsem);
1065:	}
1066:	
1067:	static inline void inode_lock_nested(struct inode *inode, unsigned subclass)
1068:	{
1069:		down_write_nested(&inode->i_rwsem, subclass);
1070:	}
1071:	
1072:	static inline void inode_lock_shared_nested(struct inode *inode, unsigned subclass)
1073:	{
1074:		down_read_nested(&inode->i_rwsem, subclass);
1075:	}
1076:	
1077:	static inline void filemap_invalidate_lock(struct address_space *mapping)
1078:	{
1079:		down_write(&mapping->invalidate_lock);
1080:	}
1081:	
1082:	static inline void filemap_invalidate_unlock(struct address_space *mapping)
1083:	{
1084:		up_write(&mapping->invalidate_lock);
1085:	}
1086:	
1087:	static inline void filemap_invalidate_lock_shared(struct address_space *mapping)
1088:	{
1089:		down_read(&mapping->invalidate_lock);
1090:	}
1091:	
1092:	static inline int filemap_invalidate_trylock_shared(
1093:						struct address_space *mapping)
1094:	{
1095:		return down_read_trylock(&mapping->invalidate_lock);
1096:	}
1097:	
1098:	static inline void filemap_invalidate_unlock_shared(
1099:						struct address_space *mapping)
]

220/4 2026/09/17 11:11 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 48655
							output: 30
							thoughts: 41
						

Thoughts:
**Investigating the `invalidate_lock` within `address_space`**

Okay, so I'm trying to figure out where `mapping->invalidate_lock` is actually defined, which is something I need to understand for this particular problem I'm tackling. Since it's part of the `address_space` structure, the logical first step is to dig into the `struct address_space` definition. Then, I need to pinpoint the `invalidate_lock` field.

I'll start by searching the relevant headers, so I will start with `include/linux/fs.h`. That's where a lot of the fundamental filesystem structures are typically defined, and `address_space` is almost certainly there. I'll search that file for anything related to `invalidate_lock` to find its type and context within the `address_space` definition.



221/4 2026/09/17 11:12 tool grepper
0m Args:
map[Expression:invalidate_lock PathPrefix:include/linux/fs.h]

Results:
map[Output:include/linux/fs.h=446=struct mapping_metadata_bhs {
--
include/linux/fs.h-455- * @i_pages: Cached pages.
include/linux/fs.h:456: * @invalidate_lock: Guards coherency between page cache contents and
include/linux/fs.h-457- *   file offset->disk block mappings in the filesystem during invalidates.
--
include/linux/fs.h=471=struct address_space {
--
include/linux/fs.h-473-	struct xarray		i_pages;
include/linux/fs.h:474:	struct rw_semaphore	invalidate_lock;
include/linux/fs.h-475-	gfp_t			gfp_mask;
--
include/linux/fs.h=1072=static inline void inode_lock_shared_nested(struct inode *inode, unsigned subclass)
--
include/linux/fs.h-1076-
include/linux/fs.h:1077:static inline void filemap_invalidate_lock(struct address_space *mapping)
include/linux/fs.h-1078-{
include/linux/fs.h:1079:	down_write(&mapping->invalidate_lock);
include/linux/fs.h-1080-}
--
include/linux/fs.h=1082=static inline void filemap_invalidate_unlock(struct address_space *mapping)
include/linux/fs.h-1083-{
include/linux/fs.h:1084:	up_write(&mapping->invalidate_lock);
include/linux/fs.h-1085-}
include/linux/fs.h-1086-
include/linux/fs.h:1087:static inline void filemap_invalidate_lock_shared(struct address_space *mapping)
include/linux/fs.h-1088-{
include/linux/fs.h:1089:	down_read(&mapping->invalidate_lock);
include/linux/fs.h-1090-}
--
include/linux/fs.h=1092=static inline int filemap_invalidate_trylock_shared(
--
include/linux/fs.h-1094-{
include/linux/fs.h:1095:	return down_read_trylock(&mapping->invalidate_lock);
include/linux/fs.h-1096-}
--
include/linux/fs.h=1098=static inline void filemap_invalidate_unlock_shared(
--
include/linux/fs.h-1100-{
include/linux/fs.h:1101:	up_read(&mapping->invalidate_lock);
include/linux/fs.h-1102-}
--
include/linux/fs.h=1105=void unlock_two_nondirectories(struct inode *, struct inode*);
include/linux/fs.h-1106-
include/linux/fs.h:1107:void filemap_invalidate_lock_two(struct address_space *mapping1,
include/linux/fs.h-1108-				 struct address_space *mapping2);
--
include/linux/fs.h=2285=struct file_system_type {
--
include/linux/fs.h-2313-	struct lock_class_key i_mutex_key;
include/linux/fs.h:2314:	struct lock_class_key invalidate_lock_key;
include/linux/fs.h-2315-	struct lock_class_key i_mutex_dir_key;
]

222/4 2026/09/17 11:12 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 49813
							output: 29
							thoughts: 91
						

Thoughts:
Here's my thought process, as it stands:

**Examining File System Coherency**

Okay, so I'm looking at this definition in `include/linux/fs.h`, specifically `@invalidate_lock`. It's pretty clear: this lock is all about ensuring the page cache and the file offset-to-disk block mappings stay consistent, especially during invalidation processes. That's key for data integrity, right? I want to dig deeper into a specific file system and see how this actually plays out in practice.

Since I'm interested in how it's implemented, I'll go straight to `fs/ntfs3`. My aim here is to see where and how `invalidate_lock` is being used, or if a similar function is being used. A quick grep for both `invalidate_lock` and `filemap_invalidate` should give me a good picture of its role within the NTFS3 implementation. I want to understand the mechanics here to assess any performance impacts or potential areas of concern. Let's see what comes up...



223/4 2026/09/17 11:12 tool grepper
0m Args:
map[Expression:filemap_invalidate PathPrefix:fs/ntfs3]

Results:
map[Output:fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-519-		inode_dio_wait(inode);
fs/ntfs3/file.c:520:		filemap_invalidate_lock(mapping);
fs/ntfs3/file.c-521-		map_locked = true;
--
fs/ntfs3/file.c-691-	if (map_locked)
fs/ntfs3/file.c:692:		filemap_invalidate_unlock(mapping);
fs/ntfs3/file.c-693-
]

224/4 2026/09/17 11:12 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 50350
							output: 29
							thoughts: 20
						

Thoughts:
Here's my thought process, as if I were considering this issue:

**Investigating `page_mkwrite` in NTFS3**

Okay, so we're diving into the `fs/ntfs3` code, and I need to see how the writeback process interacts with page faults. My immediate thought is to look for any instances of `page_mkwrite` within that directory. This function is the key to understanding how the file system handles creating writable pages from read-only ones, so it's a critical point for understanding write paths, potential copy-on-write behavior, and synchronization. Grepping for this within `fs/ntfs3` is a good starting point to quickly identify how NTFS3's write handling functions. It'll give me a list of entry points to investigate further. Let's see what that yields!



225/4 2026/09/17 11:13 tool grepper
0m Args:
map[Expression:page_mkwrite PathPrefix:fs/ntfs3]

Results:
map[Output:fs/ntfs3/file.c=371=static const struct vm_operations_struct ntfs_file_vm_ops = {
--
fs/ntfs3/file.c-374-	.map_pages = filemap_map_pages,
fs/ntfs3/file.c:375:	.page_mkwrite = filemap_page_mkwrite,
fs/ntfs3/file.c-376-};
]

226/4 2026/09/17 11:13 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 50699
							output: 40
							thoughts: 57
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Investigating the NTFS File Write Operations**

Alright, let's see... *ntfs\_file\_vm\_ops* is pointing to *.page\_mkwrite = filemap\_page\_mkwrite*. Ah, that's interesting, but not entirely unexpected. Now, I need to jog my memory (or confirm my assumptions) about what *filemap\_page\_mkwrite* actually *does* in this context. It's the key to understanding the file write operation at that level of the VFS interface for NTFS, so let's quickly check what's going on behind that function call. I need to refresh my understanding of the data flow.



227/4 2026/09/17 11:13 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:filemap_page_mkwrite]

Results:
map[SourceCode:4006:	vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf)
4007:	{
4008:		struct address_space *mapping = vmf->vma->vm_file->f_mapping;
4009:		struct folio *folio = page_folio(vmf->page);
4010:		vm_fault_t ret = VM_FAULT_LOCKED;
4011:	
4012:		sb_start_pagefault(mapping->host->i_sb);
4013:		file_update_time(vmf->vma->vm_file);
4014:		folio_lock(folio);
4015:		if (folio->mapping != mapping) {
4016:			folio_unlock(folio);
4017:			ret = VM_FAULT_NOPAGE;
4018:			goto out;
4019:		}
4020:		/*
4021:		 * We mark the folio dirty already here so that when freeze is in
4022:		 * progress, we are guaranteed that writeback during freezing will
4023:		 * see the dirty folio and writeprotect it again.
4024:		 */
4025:		folio_mark_dirty(folio);
4026:		folio_wait_stable(folio);
4027:	out:
4028:		sb_end_pagefault(mapping->host->i_sb);
4029:		return ret;
4030:	}
 SourceFile:mm/filemap.c]

228/4 2026/09/17 11:13 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 51372
							output: 37
							thoughts: 40
						

Thoughts:
Okay, here's my interpretation of that thought process, from an expert's perspective:

**Diving into the NTFS Filesystem Implementation**

Hmm, `ntfs_file_fault`... I need to refresh my memory on that. Specifically, I'm trying to understand the nitty-gritty of what happens when a file fault occurs in the NTFS3 filesystem. Okay, I know where to start looking. Let's go straight to the source. Time to crack open `fs/ntfs3/file.c` and specifically, I'll be looking at the `ntfs_file_vm_ops` structure. That’s the most logical place to find the relevant function pointer, or better yet the function itself, responsible for handling that specific virtual memory operation. I know that's where the critical file operations are registered, and that should give me the context I need.



229/4 2026/09/17 11:13 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:365 LineCount:25]

Results:
map[Contents: 365:			mark_inode_dirty(inode);
 366:		}
 367:		ntfs_zero_tail(inode->i_mapping, ni->i_valid);
 368:	}
 369:	
 370:	/* Copy of generic_file_vm_ops. */
 371:	static const struct vm_operations_struct ntfs_file_vm_ops = {
 372:		.close = ntfs_filemap_close,
 373:		.fault = filemap_fault,
 374:		.map_pages = filemap_map_pages,
 375:		.page_mkwrite = filemap_page_mkwrite,
 376:	};
 377:	
 378:	/*
 379:	 * ntfs_file_mmap_prepare - file_operations::mmap_prepare
 380:	 */
 381:	static int ntfs_file_mmap_prepare(struct vm_area_desc *desc)
 382:	{
 383:		struct file *file = desc->file;
 384:		struct inode *inode = file_inode(file);
 385:		struct ntfs_inode *ni = ntfs_i(inode);
 386:		const bool rw = vma_desc_test(desc, VMA_WRITE_BIT);
 387:		int err;
 388:	
 389:		/* Avoid any operation if inode is bad. */
]

230/4 2026/09/17 11:13 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 52041
							output: 37
							thoughts: 31
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Investigating a Potential Locking Issue in the Filemap Code**

Hmm, now that I'm looking at this code, a question pops into my head. I'm wondering if `filemap_fault` actually acquires the `filemap_invalidate_lock_shared` lock. It's a key detail to understand the locking behavior here, and I need to be absolutely sure about that. The implications are significant if there's a missed lock. Time to jump straight into the code for `filemap_fault` and verify. Gotta check that function call and its interaction with the lock. Let's see...



231/4 2026/09/17 11:14 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:filemap_fault]

Results:
map[SourceCode:3532:	/**
3533:	 * filemap_fault - read in file data for page fault handling
3534:	 * @vmf:	struct vm_fault containing details of the fault
3535:	 *
3536:	 * filemap_fault() is invoked via the vma operations vector for a
3537:	 * mapped memory region to read in file data during a page fault.
3538:	 *
3539:	 * The goto's are kind of ugly, but this streamlines the normal case of having
3540:	 * it in the page cache, and handles the special cases reasonably without
3541:	 * having a lot of duplicated code.
3542:	 *
3543:	 * vma->vm_mm->mmap_lock must be held on entry.
3544:	 *
3545:	 * If our return value has VM_FAULT_RETRY set, it's because the mmap_lock
3546:	 * may be dropped before doing I/O or by lock_folio_maybe_drop_mmap().
3547:	 *
3548:	 * If our return value does not have VM_FAULT_RETRY set, the mmap_lock
3549:	 * has not been released.
3550:	 *
3551:	 * We never return with VM_FAULT_RETRY and a bit from VM_FAULT_ERROR set.
3552:	 *
3553:	 * Return: bitwise-OR of %VM_FAULT_ codes.
3554:	 */
3555:	vm_fault_t filemap_fault(struct vm_fault *vmf)
3556:	{
3557:		int error;
3558:		struct file *file = vmf->vma->vm_file;
3559:		struct file *fpin = NULL;
3560:		struct address_space *mapping = file->f_mapping;
3561:		struct inode *inode = mapping->host;
3562:		pgoff_t max_idx, index = vmf->pgoff;
3563:		struct folio *folio;
3564:		vm_fault_t ret = 0;
3565:		bool mapping_locked = false;
3566:	
3567:		max_idx = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
3568:		if (unlikely(index >= max_idx))
3569:			return VM_FAULT_SIGBUS;
3570:	
3571:		trace_mm_filemap_fault(mapping, index);
3572:	
3573:		/*
3574:		 * Do we have something in the page cache already?
3575:		 */
3576:		folio = filemap_get_folio(mapping, index);
3577:		if (likely(!IS_ERR(folio))) {
3578:			/*
3579:			 * We found the page, so try async readahead before waiting for
3580:			 * the lock.
3581:			 */
3582:			if (!(vmf->flags & FAULT_FLAG_TRIED))
3583:				fpin = do_async_mmap_readahead(vmf, folio);
3584:			if (unlikely(!folio_test_uptodate(folio))) {
3585:				filemap_invalidate_lock_shared(mapping);
3586:				mapping_locked = true;
3587:			}
3588:		} else {
3589:			ret = filemap_fault_recheck_pte_none(vmf);
3590:			if (unlikely(ret))
3591:				return ret;
3592:	
3593:			/* No page in the page cache at all */
3594:			count_vm_event(PGMAJFAULT);
3595:			count_memcg_event_mm(vmf->vma->vm_mm, PGMAJFAULT);
3596:			ret = VM_FAULT_MAJOR;
3597:			fpin = do_sync_mmap_readahead(vmf);
3598:	retry_find:
3599:			/*
3600:			 * See comment in filemap_create_folio() why we need
3601:			 * invalidate_lock
3602:			 */
3603:			if (!mapping_locked) {
3604:				filemap_invalidate_lock_shared(mapping);
3605:				mapping_locked = true;
3606:			}
3607:			folio = __filemap_get_folio(mapping, index,
3608:						  FGP_CREAT|FGP_FOR_MMAP,
3609:						  vmf->gfp_mask);
3610:			if (IS_ERR(folio)) {
3611:				if (fpin)
3612:					goto out_retry;
3613:				filemap_invalidate_unlock_shared(mapping);
3614:				return VM_FAULT_OOM;
3615:			}
3616:		}
3617:	
3618:		if (!lock_folio_maybe_drop_mmap(vmf, folio, &fpin))
3619:			goto out_retry;
3620:	
3621:		/* Did it get truncated? */
3622:		if (unlikely(folio->mapping != mapping)) {
3623:			folio_unlock(folio);
3624:			folio_put(folio);
3625:			goto retry_find;
3626:		}
3627:		VM_BUG_ON_FOLIO(!folio_contains(folio, index), folio);
3628:	
3629:		/*
3630:		 * We have a locked folio in the page cache, now we need to check
3631:		 * that it's up-to-date. If not, it is going to be due to an error,
3632:		 * or because readahead was otherwise unable to retrieve it.
3633:		 */
3634:		if (unlikely(!folio_test_uptodate(folio))) {
3635:			/*
3636:			 * If the invalidate lock is not held, the folio was in cache
3637:			 * and uptodate and now it is not. Strange but possible since we
3638:			 * didn't hold the page lock all the time. Let's drop
3639:			 * everything, get the invalidate lock and try again.
3640:			 */
3641:			if (!mapping_locked) {
3642:				folio_unlock(folio);
3643:				folio_put(folio);
3644:				goto retry_find;
3645:			}
3646:	
3647:			/*
3648:			 * OK, the folio is really not uptodate. This can be because the
3649:			 * VMA has the VM_RAND_READ flag set, or because an error
3650:			 * arose. Let's read it in directly.
3651:			 */
3652:			goto page_not_uptodate;
3653:		}
3654:	
3655:		/*
3656:		 * We've made it this far and we had to drop our mmap_lock, now is the
3657:		 * time to return to the upper layer and have it re-find the vma and
3658:		 * redo the fault.
3659:		 */
3660:		if (fpin) {
3661:			folio_unlock(folio);
3662:			goto out_retry;
3663:		}
3664:		if (mapping_locked)
3665:			filemap_invalidate_unlock_shared(mapping);
3666:	
3667:		/*
3668:		 * Found the page and have a reference on it.
3669:		 * We must recheck i_size under page lock.
3670:		 */
3671:		max_idx = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
3672:		if (unlikely(index >= max_idx)) {
3673:			folio_unlock(folio);
3674:			folio_put(folio);
3675:			return VM_FAULT_SIGBUS;
3676:		}
3677:	
3678:		vmf->page = folio_file_page(folio, index);
3679:		return ret | VM_FAULT_LOCKED;
3680:	
3681:	page_not_uptodate:
3682:		/*
3683:		 * Umm, take care of errors if the page isn't up-to-date.
3684:		 * Try to re-read it _once_. We do this synchronously,
3685:		 * because there really aren't any performance issues here
3686:		 * and we need to check for errors.
3687:		 */
3688:		fpin = maybe_unlock_mmap_for_io(vmf, fpin);
3689:		error = filemap_read_folio(file, mapping->a_ops->read_folio, folio);
3690:		if (fpin)
3691:			goto out_retry;
3692:		folio_put(folio);
3693:	
3694:		if (!error || error == AOP_TRUNCATED_PAGE)
3695:			goto retry_find;
3696:		filemap_invalidate_unlock_shared(mapping);
3697:	
3698:		return VM_FAULT_SIGBUS;
3699:	
3700:	out_retry:
3701:		/*
3702:		 * We dropped the mmap_lock, we need to return to the fault handler to
3703:		 * re-find the vma and come back and find our hopefully still populated
3704:		 * page.
3705:		 */
3706:		if (!IS_ERR(folio))
3707:			folio_put(folio);
3708:		if (mapping_locked)
3709:			filemap_invalidate_unlock_shared(mapping);
3710:		if (fpin)
3711:			fput(fpin);
3712:		return ret | VM_FAULT_RETRY;
3713:	}
 SourceFile:mm/filemap.c]

232/4 2026/09/17 11:14 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 55049
							output: 36
							thoughts: 119
						

Thoughts:
**Analyzing `filemap_fault` and `filemap_invalidate_lock_shared`**

Okay, so I'm looking at `filemap_fault` and I see it acquires `filemap_invalidate_lock_shared(mapping)`. Standard stuff, but let's dig a bit deeper. Specifically, I'm focusing on lines 3600-3606.

Ah, there it is! They're explicitly checking if the mapping is already locked. If not, they call `filemap_invalidate_lock_shared(mapping)` and set `mapping_locked` to true. This feels familiar, this pattern of locking. The comment they've included is interesting, it mentions something about why they need `invalidate_lock`. That's where the real detail lives, let's go read the comment in `filemap_create_folio()` to jog my memory, I suspect it is about memory management in a multi-threaded system. I need the full picture here. I can tell you're very familiar with these methods, so I won't patronize you with details you already know. Let's see what the fine print says.



233/4 2026/09/17 11:14 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/filemap.c Name:filemap_create_folio]

Results:
map[SourceCode:2619:	static int filemap_create_folio(struct kiocb *iocb, struct folio_batch *fbatch)
2620:	{
2621:		struct address_space *mapping = iocb->ki_filp->f_mapping;
2622:		struct folio *folio;
2623:		int error;
2624:		unsigned int min_order = mapping_min_folio_order(mapping);
2625:		pgoff_t index;
2626:	
2627:		if (iocb->ki_flags & (IOCB_NOWAIT | IOCB_WAITQ))
2628:			return -EAGAIN;
2629:	
2630:		folio = filemap_alloc_folio(mapping_gfp_mask(mapping), min_order, NULL);
2631:		if (!folio)
2632:			return -ENOMEM;
2633:		if (iocb->ki_flags & IOCB_DONTCACHE)
2634:			__folio_set_dropbehind(folio);
2635:	
2636:		/*
2637:		 * Protect against truncate / hole punch. Grabbing invalidate_lock
2638:		 * here assures we cannot instantiate and bring uptodate new
2639:		 * pagecache folios after evicting page cache during truncate
2640:		 * and before actually freeing blocks.	Note that we could
2641:		 * release invalidate_lock after inserting the folio into
2642:		 * the page cache as the locked folio would then be enough to
2643:		 * synchronize with hole punching. But there are code paths
2644:		 * such as filemap_update_page() filling in partially uptodate
2645:		 * pages or ->readahead() that need to hold invalidate_lock
2646:		 * while mapping blocks for IO so let's hold the lock here as
2647:		 * well to keep locking rules simple.
2648:		 */
2649:		filemap_invalidate_lock_shared(mapping);
2650:		index = (iocb->ki_pos >> (PAGE_SHIFT + min_order)) << min_order;
2651:		error = filemap_add_folio(mapping, folio, index,
2652:				mapping_gfp_constraint(mapping, GFP_KERNEL));
2653:		if (error == -EEXIST)
2654:			error = AOP_TRUNCATED_PAGE;
2655:		if (error)
2656:			goto error;
2657:	
2658:		error = filemap_read_folio(iocb->ki_filp, mapping->a_ops->read_folio,
2659:						folio);
2660:		if (error)
2661:			goto error;
2662:	
2663:		filemap_invalidate_unlock_shared(mapping);
2664:		folio_batch_add(fbatch, folio);
2665:		return 0;
2666:	error:
2667:		filemap_invalidate_unlock_shared(mapping);
2668:		folio_put(folio);
2669:		return error;
2670:	}
 SourceFile:mm/filemap.c]

234/4 2026/09/17 11:14 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 56323
							output: 37
							thoughts: 503
						

Thoughts:
**Analyzing NTFS Truncation and Fallocate Implementation**

Okay, so I'm digging into how NTFS handles file truncation and allocation, specifically looking at potential synchronization issues and lock usage. My initial focus was on the general approach, and I had a specific section in `fs/ntfs/file.c` in mind to examine the implications of `filemap_invalidate_lock()` and the related size updates. The text in the earlier `fs/ntfs` code clearly outlines the need to serialize with page faults and pagecache instantiation, as well as the actions taken with `truncate_pagecache`, `i_size_write`, and `pagecache_isize_extended`.

The comment in that first code block about protecting against truncate/hole punch and the use of `invalidate_lock` is key here to synchronize page cache eviction during truncation before freeing blocks. It suggests that while the lock could technically be released earlier, it's held throughout to simplify the locking rules, which makes perfect sense given the other operations.

But then, a thought struck me: let's not assume it's the same across all NTFS implementations. I needed to cross-reference to the updated NTFS3 filesystem. I had to investigate to see if any similar comments, history, discussions or commit messages exist in that newer version of the code.

I'm now checking `fs/ntfs3/file.c`, specifically `ntfs_fallocate` and the relevant section, lines 510-530. I want to see how these operations interact. Perhaps there's a difference in how it's handled there, or maybe a more refined approach that provides more insight. This is where the real nuance lies, so I'm going to carefully read this section and try to determine whether there are any differences, improvements, or subtle shifts in logic that I can learn from.



235/4 2026/09/17 11:14 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:510 LineCount:40]

Results:
map[Contents: 510:	
 511:		if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 512:			/* Should never be here, see ntfs_file_open. */
 513:			err = -EOPNOTSUPP;
 514:			goto out;
 515:		}
 516:	
 517:		if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
 518:			    FALLOC_FL_INSERT_RANGE)) {
 519:			inode_dio_wait(inode);
 520:			filemap_invalidate_lock(mapping);
 521:			map_locked = true;
 522:		}
 523:	
 524:		if (mode & FALLOC_FL_PUNCH_HOLE) {
 525:			u32 frame_size;
 526:			loff_t mask, vbo_a, end_a, tmp, from;
 527:	
 528:			err = filemap_write_and_wait_range(mapping, vbo_down,
 529:							   LLONG_MAX);
 530:			if (err)
 531:				goto out;
 532:	
 533:			truncate_pagecache(inode, vbo_down);
 534:	
 535:			ni_lock(ni);
 536:			err = attr_punch_hole(ni, vbo, len, &frame_size);
 537:			ni_unlock(ni);
 538:			if (!err)
 539:				goto ok;
 540:	
 541:			if (err != E_NTFS_NOTALIGNED)
 542:				goto out;
 543:	
 544:			/* Process not aligned punch. */
 545:			err = 0;
 546:			if (end > i_size)
 547:				end = i_size;
 548:			mask = frame_size - 1;
 549:			vbo_a = (vbo + mask) & ~mask;
]

236/4 2026/09/17 11:14 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 57850
							output: 37
							thoughts: 26
						

Thoughts:
Here's my take on the `ntfs_fallocate` function, pulling from what I'm seeing in `fs/ntfs3/file.c`:

**Dissecting `ntfs_fallocate` in `fs/ntfs3/file.c`**

Alright, let's dive into the rest of `ntfs_fallocate`. I'm already anticipating the typical challenges here: how the NTFS file system handles this operation, especially with its specific metadata structures and allocation strategies. I need to understand how they're handling sparse files, how they're updating the attribute list if we're extending or pre-allocating clusters, and what locking mechanisms are in place to ensure consistency during this process. I'll need to pay close attention to the error handling and how they manage potential disk I/O failures during allocation or metadata updates. Is there any fragmentation avoidance strategy in place, or any checks to determine if the allocation is contiguous? And, of course, I want to see how they integrate with the underlying block device layer. I expect to find some interesting logic related to extent mapping, and how they interact with the journal to maintain integrity. There may be some optimizations related to how they handle zeroing data.



237/4 2026/09/17 11:15 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:645 LineCount:55]

Results:
map[Contents: 645:			}
 646:	
 647:			err = inode_newsize_ok(inode, new_size);
 648:			if (err)
 649:				goto out;
 650:	
 651:			if (new_size > i_size) {
 652:				/*
 653:				 * Allocate clusters, do not change 'valid' size.
 654:				 */
 655:				err = ntfs_set_size(inode, new_size);
 656:				if (err)
 657:					goto out;
 658:			}
 659:	
 660:			if (is_supported_holes) {
 661:				CLST vcn = vbo >> cluster_bits;
 662:				CLST cend = bytes_to_cluster(sbi, end);
 663:				CLST lcn, clen;
 664:				bool new;
 665:	
 666:				/*
 667:				 * Allocate and zero new clusters.
 668:				 */
 669:				for (; vcn < cend; vcn += clen) {
 670:					err = attr_data_get_block(ni, vcn, cend - vcn,
 671:								  &lcn, &clen, &new,
 672:								  true, NULL, false);
 673:					if (err)
 674:						goto out;
 675:				}
 676:			}
 677:	
 678:			if (mode & FALLOC_FL_KEEP_SIZE) {
 679:				err = ntfs_set_size(inode, i_size);
 680:				if (err)
 681:					goto out;
 682:			}
 683:		}
 684:	
 685:	ok:
 686:		err = file_modified(file);
 687:		if (err)
 688:			goto out;
 689:	
 690:	out:
 691:		if (map_locked)
 692:			filemap_invalidate_unlock(mapping);
 693:	
 694:		if (!err) {
 695:			inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
 696:			mark_inode_dirty(inode);
 697:		}
 698:	
 699:		inode_unlock(inode);
]

238/4 2026/09/17 11:15 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 58872
							output: 38
							thoughts: 2749
						

Thoughts:
**Analyzing NTFS File Size Management and Concurrency**

Okay, here's the breakdown of my thought process. I need to figure out the correct order and potential race conditions when resizing files in NTFS, specifically within the `ntfs_setattr` function. My initial focus is on `fs/ntfs3/file.c` and how it handles file truncation and size extension.

First, I see the core code block in `ntfs_setattr` that deals with changing the file size. I note the use of `truncate_setsize` and `ntfs_set_size`. The `inode_lock` is held, but I need to understand if this is enough to protect against all potential races. This is where my questions start to form: Does `ntfs_setattr` need to call `filemap_invalidate_lock` before these operations? And if so, how does that influence the order of `truncate_setsize` and `ntfs_set_size`?

The absence of `filemap_invalidate_lock` is immediately a red flag. I know from experience that this lock guards against races with page faults and write operations on the page cache. Truncating a file, whether shrinking or extending, has to deal with the page cache.

I'm thinking about the implications of the page cache. If I shrink a file, I need to make sure that the page cache is truncated *before* deallocating the disk blocks to avoid concurrent access to freed blocks. Conversely, when extending, if I increase the `i_size` *before* allocating the disk space, page faults could happen in the unallocated range. A failure in `ntfs_set_size` then leaves me with an inconsistent state: `i_size` is too big but no data on the disk.

This leads me to the critical question: What's the correct order for extending and shrinking file sizes? I have to analyze the page cache eviction and allocation logic. Specifically, `filemap_fault` acquires `invalidate_lock_shared` and not `inode_lock`, highlighting the potential race. What is `filemap_create_folio` doing in terms of truncate and hole punch? I have to check the comment. I remember the comment says it needs `invalidate_lock` to protect the filesystem after evicting the pagecache, because a concurrent truncate process might be in action.

Now, I'm forming a hypothesis, that I need to call `filemap_invalidate_lock` to protect from a page fault. Then the correct order of operations will be different for extending and shrinking the file.

I go back and re-read the code for `truncate_setsize`. It calls `pagecache_isize_extended` if the file is being extended and `truncate_pagecache`.

Next, I need to verify what `ntfs_set_size` actually does. My concern is that while `truncate_setsize` modifies `i_size`, `ntfs_set_size` might not be modifying it, and there might be a race. I check the implementation of `ntfs_set_size`, specifically how it interacts with the inode size and the disk. It turns out that `ntfs_set_size` *doesn't* directly modify `inode->i_size`. It updates on-disk metadata and a separate internal `ni->i_valid` value. Crucially, the NTFS on-disk size and its internal view of the valid data are managed separately from `inode->i_size`. `ntfs_set_size` does not directly modify `inode->i_size`.

This means the sequence and how the pagecache eviction should happen is key.

My conclusion is:
*   **Shrinking:** Call `truncate_setsize` *before* calling `ntfs_set_size`. This truncates the page cache *before* freeing disk blocks, preventing data corruption.
*   **Extending:** Call `ntfs_set_size` *before* calling `truncate_setsize`. This allocates disk space first. If allocation fails, no inconsistent state is created because we haven't touched `inode->i_size`.

This rule should be verified by checking the call sites of `ntfs_set_size`.



239/4 2026/09/17 11:15 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:1270 LineCount:40]

Results:
map[Contents:1270:			goto out;
1271:		}
1272:	
1273:		if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
1274:			/* Should never be here, see ntfs_file_open(). */
1275:			ret = -EOPNOTSUPP;
1276:			goto out;
1277:		}
1278:	
1279:		vbo = iocb->ki_pos;
1280:		endbyte = vbo + ret;
1281:	
1282:		if (endbyte > inode->i_size) {
1283:			/*
1284:			 * Normal files: increase file size, allocate space.
1285:			 * Sparse/Compressed: increase file size. No space allocated.
1286:			 */
1287:			ret = ntfs_set_size(inode, endbyte);
1288:			if (ret)
1289:				goto out;
1290:		}
1291:	
1292:		if (is_compressed(ni)) {
1293:			ret = ntfs_compress_write(iocb, from);
1294:			goto out;
1295:		}
1296:	
1297:		if (vbo > ni->i_valid) {
1298:			ret = ntfs_extend_initialized_size(file, ni, vbo);
1299:			if (ret)
1300:				goto out;
1301:		}
1302:	
1303:		/* Fallback to buffered I/O if the inode does not support direct I/O. */
1304:		if (!(iocb->ki_flags & IOCB_DIRECT) ||
1305:		    !ntfs_should_use_dio(iocb, from)) {
1306:			iocb->ki_flags &= ~IOCB_DIRECT;
1307:	
1308:			ret = iomap_file_buffered_write(iocb, from, &ntfs_iomap_ops,
1309:							&ntfs_iomap_folio_ops, NULL);
]

240/4 2026/09/17 11:15 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 63271
							output: 830
							thoughts: 1396
						

Thoughts:
**Analysis of `ntfs_setattr` and File Size Manipulation**

Okay, here's the deal, based on my understanding and the information at hand. I've got a pretty good grasp on this, but I'm operating with the limitations of the current data availability. I haven't done any external research to check myself.

First, regarding the need for `filemap_invalidate_lock(inode->i_mapping)` in `ntfs_setattr`: it's clear to me that it's *absolutely* necessary. Right now, it's missing from `fs/ntfs3/file.c` (`ntfs_setattr`), unlike other filesystems I've looked at (and `ntfs_fallocate`, or the legacy `fs/ntfs/file.c:ntfs_setattr_size`). Why? Because that `invalidate_lock` is what serializes the invalidation and truncation of the page cache against page faults and readahead operations. Without it, we risk races. Concurrent page faults could bring data into the cache in regions that are *about* to be deallocated, or worse, have already been freed on disk. This is a potential recipe for corruption. `inode_lock` alone isn't enough; page faults get by with just `mmap_lock` and `filemap_invalidate_lock_shared`. We need the write mode.

Next, the order of `truncate_setsize` and `ntfs_set_size` is crucial. The current code in `ntfs_setattr` doesn't differentiate by the direction of size change, which is a problem. Let's break it down:

*   **Extending the file (newsize > oldsize)**: `ntfs_set_size` *must* come before `truncate_setsize`. This is essential because `ntfs_set_size` is responsible for allocating and committing disk space/extents. If we run into an error like `-ENOSPC` or `-EFBIG` during allocation, we want the operation to fail cleanly *before* the in-memory inode size (`i_size`) and the page cache get changed. If `truncate_setsize` were called first and then allocation failed, we'd have an inconsistent state with the inode size increased, the page cache potentially extended, and no backing storage. It's a mess.

*   **Shrinking the file (newsize < oldsize)**: `truncate_setsize` *must* be called *before* `ntfs_set_size`. Here, `truncate_setsize` updates the inode's size and, more importantly, invalidates and frees cached pages beyond the new EOF. Disk blocks/clusters should only be deallocated *after* the page cache folios beyond the new EOF have been discarded. If we freed disk blocks first, then the subsequent page cache truncation could try to write to freed blocks, which leads to corruption or data loss.

**Caveats:**

*   My analysis is based on code inspection of `ntfs3/file.c` (`ntfs_setattr`, `ntfs_fallocate`), `ntfs3/inode.c` (`ntfs_set_size`), `mm/filemap.c`, and comparison to `udf_setsize`, `ext4_setattr`, and the legacy ntfs code.
*   The Git commit history is limited because of the shallow repository. I couldn't verify specifics about past discussions or patches related to this missing lock in `ntfs_setattr`.

I'm ready to call the `set-results` tool now.



241/4 2026/09/17 11:15 tool set-results
0m Args:
map[Answer:Based on analysis of the kernel source code (`fs/ntfs3`, `fs/ntfs`, `mm/filemap.c`, `include/linux/fs.h`, and comparable filesystems like UDF and ext4):

### 1. Does `ntfs_setattr` need to call `filemap_invalidate_lock(inode->i_mapping)`?

**Yes.**
`filemap_invalidate_lock(inode->i_mapping)` should be taken before truncating/extending the pagecache and disk size, and released with `filemap_invalidate_unlock(inode->i_mapping)` after.

**Reason:**
- The VFS holds `inode->i_rwsem` across `->setattr`, but page faults (`filemap_fault` / `page_mkwrite`) execute without `inode->i_rwsem`. Instead, page fault handlers acquire `mmap_lock` and shared `filemap_invalidate_lock_shared(mapping)`.
- Holding `filemap_invalidate_lock(mapping)` in exclusive mode serializes the truncation/expansion against concurrent page faults and readahead, preventing race conditions where folios are faulted in or brought uptodate after pagecache eviction but before disk block deallocation, or while the file mapping is inconsistent.

---

### 2. Correct order of `truncate_setsize` and `ntfs_set_size`

In `fs/ntfs3/file.c`, `ntfs_setattr` unconditionally calls `truncate_setsize(inode, newsize)` before `ntfs_set_size(inode, newsize)`. The correct ordering should distinguish between extension and shrinking:

- **When extending the file (`newsize > oldsize`)**:
  - **Correct order:** Call `ntfs_set_size` **first**, then `truncate_setsize`.
  - **Reason:** `ntfs_set_size` performs disk block allocation and updates the NTFS on-disk attribute size. If allocation fails (e.g., `-ENOSPC` or `-EFBIG`), it returns an error before the in-memory `inode->i_size` is expanded and before pagecache folios are extended/instantiated. If `truncate_setsize` were called first, `inode->i_size` would be extended and pagecache notified (`pagecache_isize_extended`), requiring difficult and race-prone rollbacks on error.

- **When shrinking the file (`newsize < oldsize`)**:
  - **Correct order:** Call `truncate_setsize` **first**, then `ntfs_set_size`.
  - **Reason:** `truncate_setsize` updates `inode->i_size` to the smaller size and invalidates/drops cached pages beyond the new EOF (`truncate_pagecache`). Disk blocks/clusters must only be freed on disk via `ntfs_set_size` after the corresponding cached folios have been removed from memory. If disk blocks were freed before truncating the page cache, writeback or concurrent operations could attempt to access or write dirty pages to disk blocks that were already returned to the free space allocator.

---

### Caveats and Unverified Parts:
- Git commit history in the checkout is restricted to a shallow repository, so commit logs and specific mailing list discussions introducing or addressing this in `fs/ntfs3` could not be traced through `git log`.
- The conclusions are derived from the locking semantics in `include/linux/fs.h` / `mm/filemap.c` and how other filesystems (such as `fs/udf/inode.c:udf_setsize`, `fs/ext4/inode.c:ext4_setattr`, and legacy `fs/ntfs/file.c`) implement extending vs. shrinking file truncation.]

Results:
map[Answer:Based on analysis of the kernel source code (`fs/ntfs3`, `fs/ntfs`, `mm/filemap.c`, `include/linux/fs.h`, and comparable filesystems like UDF and ext4):

### 1. Does `ntfs_setattr` need to call `filemap_invalidate_lock(inode->i_mapping)`?

**Yes.**
`filemap_invalidate_lock(inode->i_mapping)` should be taken before truncating/extending the pagecache and disk size, and released with `filemap_invalidate_unlock(inode->i_mapping)` after.

**Reason:**
- The VFS holds `inode->i_rwsem` across `->setattr`, but page faults (`filemap_fault` / `page_mkwrite`) execute without `inode->i_rwsem`. Instead, page fault handlers acquire `mmap_lock` and shared `filemap_invalidate_lock_shared(mapping)`.
- Holding `filemap_invalidate_lock(mapping)` in exclusive mode serializes the truncation/expansion against concurrent page faults and readahead, preventing race conditions where folios are faulted in or brought uptodate after pagecache eviction but before disk block deallocation, or while the file mapping is inconsistent.

---

### 2. Correct order of `truncate_setsize` and `ntfs_set_size`

In `fs/ntfs3/file.c`, `ntfs_setattr` unconditionally calls `truncate_setsize(inode, newsize)` before `ntfs_set_size(inode, newsize)`. The correct ordering should distinguish between extension and shrinking:

- **When extending the file (`newsize > oldsize`)**:
  - **Correct order:** Call `ntfs_set_size` **first**, then `truncate_setsize`.
  - **Reason:** `ntfs_set_size` performs disk block allocation and updates the NTFS on-disk attribute size. If allocation fails (e.g., `-ENOSPC` or `-EFBIG`), it returns an error before the in-memory `inode->i_size` is expanded and before pagecache folios are extended/instantiated. If `truncate_setsize` were called first, `inode->i_size` would be extended and pagecache notified (`pagecache_isize_extended`), requiring difficult and race-prone rollbacks on error.

- **When shrinking the file (`newsize < oldsize`)**:
  - **Correct order:** Call `truncate_setsize` **first**, then `ntfs_set_size`.
  - **Reason:** `truncate_setsize` updates `inode->i_size` to the smaller size and invalidates/drops cached pages beyond the new EOF (`truncate_pagecache`). Disk blocks/clusters must only be freed on disk via `ntfs_set_size` after the corresponding cached folios have been removed from memory. If disk blocks were freed before truncating the page cache, writeback or concurrent operations could attempt to access or write dirty pages to disk blocks that were already returned to the free space allocator.

---

### Caveats and Unverified Parts:
- Git commit history in the checkout is restricted to a shallow repository, so commit logs and specific mailing list discussions introducing or addressing this in `fs/ntfs3` could not be traced through `git log`.
- The conclusions are derived from the locking semantics in `include/linux/fs.h` / `mm/filemap.c` and how other filesystems (such as `fs/udf/inode.c:udf_setsize`, `fs/ext4/inode.c:ext4_setattr`, and legacy `fs/ntfs/file.c`) implement extending vs. shrinking file truncation.]

242/2 2026/09/17 11:15 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 63624
							output: 23
							thoughts: 0
						

243/2 2026/09/17 11:16 tool codesearch-definition-source
0m Args:
map[Name:ntfs_setattr]

Results:
map[SourceCode: 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
 770:		if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE))
 771:			ntfs_save_wsl_perm(inode, NULL);
 772:		mark_inode_dirty(inode);
 773:	out:
 774:		return err;
 775:	}
 SourceFile:fs/ntfs3/file.c]

244/2 2026/09/17 11:16 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 64739
							output: 23
							thoughts: 0
						

245/2 2026/09/17 11:16 tool codesearch-definition-source
0m Args:
map[Name:ntfs_fallocate]

Results:
map[SourceCode: 457:	/*
 458:	 * ntfs_fallocate - file_operations::ntfs_fallocate
 459:	 *
 460:	 * Preallocate space for a file. This implements ntfs's fallocate file
 461:	 * operation, which gets called from sys_fallocate system call. User
 462:	 * space requests 'len' bytes at 'vbo'. If FALLOC_FL_KEEP_SIZE is set
 463:	 * we just allocate clusters without zeroing them out. Otherwise we
 464:	 * allocate and zero out clusters via an expanding truncate.
 465:	 */
 466:	static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
 467:	{
 468:		struct inode *inode = file_inode(file);
 469:		struct address_space *mapping = inode->i_mapping;
 470:		struct super_block *sb = inode->i_sb;
 471:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 472:		struct ntfs_inode *ni = ntfs_i(inode);
 473:		loff_t end = vbo + len;
 474:		loff_t vbo_down = round_down(vbo, max_t(unsigned long,
 475:							sbi->cluster_size, PAGE_SIZE));
 476:		bool is_supported_holes = is_sparsed(ni) || is_compressed(ni);
 477:		loff_t i_size, new_size;
 478:		bool map_locked;
 479:		int err;
 480:	
 481:		/* No support for dir. */
 482:		if (!S_ISREG(inode->i_mode))
 483:			return -EOPNOTSUPP;
 484:	
 485:		/*
 486:		 * vfs_fallocate checks all possible combinations of mode.
 487:		 * Do additional checks here before ntfs_set_state(dirty).
 488:		 */
 489:		if (mode & FALLOC_FL_PUNCH_HOLE) {
 490:			if (!is_supported_holes)
 491:				return -EOPNOTSUPP;
 492:		} else if (mode & FALLOC_FL_COLLAPSE_RANGE) {
 493:		} else if (mode & FALLOC_FL_INSERT_RANGE) {
 494:			if (!is_supported_holes)
 495:				return -EOPNOTSUPP;
 496:		} else if (mode &
 497:			   ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
 498:			     FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_INSERT_RANGE)) {
 499:			ntfs_inode_warn(inode, "fallocate(0x%x) is not supported",
 500:					mode);
 501:			return -EOPNOTSUPP;
 502:		}
 503:	
 504:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 505:	
 506:		inode_lock(inode);
 507:		i_size = inode->i_size;
 508:		new_size = max(end, i_size);
 509:		map_locked = false;
 510:	
 511:		if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 512:			/* Should never be here, see ntfs_file_open. */
 513:			err = -EOPNOTSUPP;
 514:			goto out;
 515:		}
 516:	
 517:		if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
 518:			    FALLOC_FL_INSERT_RANGE)) {
 519:			inode_dio_wait(inode);
 520:			filemap_invalidate_lock(mapping);
 521:			map_locked = true;
 522:		}
 523:	
 524:		if (mode & FALLOC_FL_PUNCH_HOLE) {
 525:			u32 frame_size;
 526:			loff_t mask, vbo_a, end_a, tmp, from;
 527:	
 528:			err = filemap_write_and_wait_range(mapping, vbo_down,
 529:							   LLONG_MAX);
 530:			if (err)
 531:				goto out;
 532:	
 533:			truncate_pagecache(inode, vbo_down);
 534:	
 535:			ni_lock(ni);
 536:			err = attr_punch_hole(ni, vbo, len, &frame_size);
 537:			ni_unlock(ni);
 538:			if (!err)
 539:				goto ok;
 540:	
 541:			if (err != E_NTFS_NOTALIGNED)
 542:				goto out;
 543:	
 544:			/* Process not aligned punch. */
 545:			err = 0;
 546:			if (end > i_size)
 547:				end = i_size;
 548:			mask = frame_size - 1;
 549:			vbo_a = (vbo + mask) & ~mask;
 550:			end_a = end & ~mask;
 551:	
 552:			tmp = min(vbo_a, end);
 553:			from = min_t(loff_t, ni->i_valid, vbo);
 554:			/* Zero head of punch. */
 555:			if (tmp > from) {
 556:				err = iomap_zero_range(inode, from, tmp - from, NULL,
 557:						       &ntfs_iomap_ops,
 558:						       &ntfs_iomap_folio_ops, NULL);
 559:				if (err)
 560:					goto out;
 561:			}
 562:	
 563:			/* Aligned punch_hole. Deallocate clusters. */
 564:			if (end_a > vbo_a) {
 565:				ni_lock(ni);
 566:				err = attr_punch_hole(ni, vbo_a, end_a - vbo_a, NULL);
 567:				ni_unlock(ni);
 568:				if (err)
 569:					goto out;
 570:			}
 571:	
 572:			/* Zero tail of punch. */
 573:			if (vbo < end_a && end_a < end) {
 574:				err = iomap_zero_range(inode, end_a, end - end_a, NULL,
 575:						       &ntfs_iomap_ops,
 576:						       &ntfs_iomap_folio_ops, NULL);
 577:				if (err)
 578:					goto out;
 579:			}
 580:		} else if (mode & FALLOC_FL_COLLAPSE_RANGE) {
 581:			/*
 582:			 * Write tail of the last page before removed range since
 583:			 * it will get removed from the page cache below.
 584:			 */
 585:			err = filemap_write_and_wait_range(mapping, vbo_down, vbo);
 586:			if (err)
 587:				goto out;
 588:	
 589:			/*
 590:			 * Write data that will be shifted to preserve them
 591:			 * when discarding page cache below.
 592:			 */
 593:			err = filemap_write_and_wait_range(mapping, end, LLONG_MAX);
 594:			if (err)
 595:				goto out;
 596:	
 597:			truncate_pagecache(inode, vbo_down);
 598:	
 599:			ni_lock(ni);
 600:			err = attr_collapse_range(ni, vbo, len);
 601:			ni_unlock(ni);
 602:			if (err)
 603:				goto out;
 604:		} else if (mode & FALLOC_FL_INSERT_RANGE) {
 605:			/* Check new size. */
 606:			err = inode_newsize_ok(inode, new_size);
 607:			if (err)
 608:				goto out;
 609:	
 610:			/* Write out all dirty pages. */
 611:			err = filemap_write_and_wait_range(mapping, vbo_down,
 612:							   LLONG_MAX);
 613:			if (err)
 614:				goto out;
 615:			truncate_pagecache(inode, vbo_down);
 616:	
 617:			ni_lock(ni);
 618:			err = attr_insert_range(ni, vbo, len);
 619:			ni_unlock(ni);
 620:			if (err)
 621:				goto out;
 622:		} else {
 623:			/* Check new size. */
 624:			u8 cluster_bits = sbi->cluster_bits;
 625:	
 626:			/* Be sure file is non resident. */
 627:			if (is_resident(ni)) {
 628:				ni_lock(ni);
 629:				err = attr_force_nonresident(ni);
 630:				ni_unlock(ni);
 631:				if (err)
 632:					goto out;
 633:			}
 634:	
 635:			/* generic/213: expected -ENOSPC instead of -EFBIG. */
 636:			if (!is_supported_holes) {
 637:				loff_t to_alloc = new_size - inode_get_bytes(inode);
 638:	
 639:				if (to_alloc > 0 &&
 640:				    (to_alloc >> cluster_bits) >
 641:					    wnd_zeroes(&sbi->used.bitmap)) {
 642:					err = -ENOSPC;
 643:					goto out;
 644:				}
 645:			}
 646:	
 647:			err = inode_newsize_ok(inode, new_size);
 648:			if (err)
 649:				goto out;
 650:	
 651:			if (new_size > i_size) {
 652:				/*
 653:				 * Allocate clusters, do not change 'valid' size.
 654:				 */
 655:				err = ntfs_set_size(inode, new_size);
 656:				if (err)
 657:					goto out;
 658:			}
 659:	
 660:			if (is_supported_holes) {
 661:				CLST vcn = vbo >> cluster_bits;
 662:				CLST cend = bytes_to_cluster(sbi, end);
 663:				CLST lcn, clen;
 664:				bool new;
 665:	
 666:				/*
 667:				 * Allocate and zero new clusters.
 668:				 */
 669:				for (; vcn < cend; vcn += clen) {
 670:					err = attr_data_get_block(ni, vcn, cend - vcn,
 671:								  &lcn, &clen, &new,
 672:								  true, NULL, false);
 673:					if (err)
 674:						goto out;
 675:				}
 676:			}
 677:	
 678:			if (mode & FALLOC_FL_KEEP_SIZE) {
 679:				err = ntfs_set_size(inode, i_size);
 680:				if (err)
 681:					goto out;
 682:			}
 683:		}
 684:	
 685:	ok:
 686:		err = file_modified(file);
 687:		if (err)
 688:			goto out;
 689:	
 690:	out:
 691:		if (map_locked)
 692:			filemap_invalidate_unlock(mapping);
 693:	
 694:		if (!err) {
 695:			inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
 696:			mark_inode_dirty(inode);
 697:		}
 698:	
 699:		inode_unlock(inode);
 700:		return err;
 701:	}
 SourceFile:fs/ntfs3/file.c]

246/2 2026/09/17 11:16 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 68396
							output: 94
							thoughts: 0
						

247/2 2026/09/17 11:17 tool codeexpert
11m Args:
map[Question:Write a patch for `ntfs_setattr` in `fs/ntfs3/file.c` to fix the race condition between `truncate_setsize` and `ntfs_set_size` by using `filemap_invalidate_lock(inode->i_mapping)` and reordering `truncate_setsize` and `ntfs_set_size` correctly.]

Results:
map[Answer:To fix the race condition between `truncate_setsize` and `ntfs_set_size`, `ntfs_setattr` must:
1. Acquire `filemap_invalidate_lock(inode->i_mapping)` to protect against concurrent page faults and page cache invalidation/filling during truncation.
2. Call `ntfs_set_size(inode, newsize)` first so that underlying on-disk attribute and allocation changes are performed before mutating in-memory `i_size` and discarding page cache pages. If `ntfs_set_size` fails, the error can be returned without having corrupted the page cache or needing to roll back `i_size` with `i_size_write(inode, oldsize)`.
3. Call `truncate_setsize(inode, newsize)` only upon success of `ntfs_set_size`, while still holding `filemap_invalidate_lock(inode->i_mapping)`.
4. Release `filemap_invalidate_unlock(inode->i_mapping)`.

### Patch

```diff
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -736,13 +736,14 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		newsize = attr->ia_size;

 		if (newsize != oldsize) {
-			truncate_setsize(inode, newsize);
-
+			filemap_invalidate_lock(inode->i_mapping);
 			err = ntfs_set_size(inode, newsize);
-			if (err) {
-				i_size_write(inode, oldsize);
+			if (!err)
+				truncate_setsize(inode, newsize);
+			filemap_invalidate_unlock(inode->i_mapping);
+
+			if (err)
 				goto out;
-			}

 			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
```

### Caveats and Unverified Aspects
- The local git repository history contains only a single commit (HEAD at Linux 7.3-rc3), so earlier commit messages, developer discussion, or mailing list revisions for this exact bug fix could not be verified against the git log.
- Testing the patch via kernel compilation and running ntfs3 xfstests was not performed since dynamic execution tools are not available.]

248/3 2026/09/17 11:17 agent codeexpert
11m Model:
core

Results:
map[Answer:To fix the race condition between `truncate_setsize` and `ntfs_set_size`, `ntfs_setattr` must:
1. Acquire `filemap_invalidate_lock(inode->i_mapping)` to protect against concurrent page faults and page cache invalidation/filling during truncation.
2. Call `ntfs_set_size(inode, newsize)` first so that underlying on-disk attribute and allocation changes are performed before mutating in-memory `i_size` and discarding page cache pages. If `ntfs_set_size` fails, the error can be returned without having corrupted the page cache or needing to roll back `i_size` with `i_size_write(inode, oldsize)`.
3. Call `truncate_setsize(inode, newsize)` only upon success of `ntfs_set_size`, while still holding `filemap_invalidate_lock(inode->i_mapping)`.
4. Release `filemap_invalidate_unlock(inode->i_mapping)`.

### Patch

```diff
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -736,13 +736,14 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		newsize = attr->ia_size;

 		if (newsize != oldsize) {
-			truncate_setsize(inode, newsize);
-
+			filemap_invalidate_lock(inode->i_mapping);
 			err = ntfs_set_size(inode, newsize);
-			if (err) {
-				i_size_write(inode, oldsize);
+			if (!err)
+				truncate_setsize(inode, newsize);
+			filemap_invalidate_unlock(inode->i_mapping);
+
+			if (err)
 				goto out;
-			}

 			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
```

### Caveats and Unverified Aspects
- The local git repository history contains only a single commit (HEAD at Linux 7.3-rc3), so earlier commit messages, developer discussion, or mailing list revisions for this exact bug fix could not be verified against the git log.
- Testing the patch via kernel compilation and running ntfs3 xfstests was not performed since dynamic execution tools are not available.]

Instruction:
You are a capable Linux kernel developer tasked with researching complex questions
about kernel source code. You will be given a concrete question, and need to provide
a concrete answer.
Research the question using targeted, efficient tool calls. Don't make assumptions,
or rely on your previous knowledge about the kernel source code, use available tools
to access the actual source code. Keep your tool calls focused and limited to the
scope of the question. Do not explore tangential code paths or perform unbounded searches.
Use all available sources of information:
 - kernel source code
 - documentation in the Documentation dir in the source tree
 - git commits descriptions, git blame

Do not guess file names or file paths and attempt to read them without
verifying their existence first using content search or directory listing tools.
If a file, symbol, or directory is not found via content search (grepper) or
directory listing (codesearch-dir-index), treat it as completely absent.
Do not attempt to guess alternative names, extensions, or directories.

Tool Selection Guidelines:
1. For C functions, structs, and variables: Prefer codesearch-definition-source
   or codesearch-struct-layout FIRST to retrieve clean, exact definitions
   without line-number guessing.
2. If symbol lookup fails (e.g., preprocessor macros, macro-generated code, or
   disabled #ifdef branches), fall back to read-file or grepper.
3. For file headers, #include directives, preprocessor macro definitions, and
   non-C files (Kconfig, Makefiles, docs): Use read-file or grepper directly.
4. Be concise and targeted. Answer the question as directly and concisely as possible
   once you have located the relevant code or definitions. If a symbol or function cannot
   be found after targeted searches, conclude with the best available information rather
   than continuing repetitive searches.
Do NOT use git-log to search for the presence or existence of files in the
repository. git-log is only for tracing commit history of files that are
already present in the current checkout. If a file does not exist in the
current checkout, it cannot be used for reproduction.

Avoid running broad git-log queries (such as searches on the entire repo)
without a specific 'PathPrefix' to restrict the scope, as these are very
expensive and will time out.
If a git-log tool call times out, do not retry the query with the same broad
scope. You must specify a tighter, narrower 'PathPrefix' for subsequent queries.

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:
Write a patch for `ntfs_setattr` in `fs/ntfs3/file.c` to fix the race condition between `truncate_setsize` and `ntfs_set_size` by using `filemap_invalidate_lock(inode->i_mapping)` and reordering `truncate_setsize` and `ntfs_set_size` correctly.

249/4 2026/09/17 11:17 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 4226
							output: 38
							thoughts: 134
						

Thoughts:
**Analyzing the NTFS Attribute Setting Race Condition**

Okay, so I need to address this race condition in `ntfs_setattr` within `fs/ntfs3/file.c`. The goal is to synchronize `truncate_setsize` and `ntfs_set_size` properly. Right, the current implementation seems to be vulnerable, and we need a reliable fix. The suggested approach involves `filemap_invalidate_lock(inode->i_mapping)` – which makes sense; a good way to ensure a clean slate, particularly around file size changes – and then reordering the calls to those functions.

My immediate action will be to delve into `fs/ntfs3/file.c` and specifically examine `ntfs_setattr`. I'll want to trace the code path and understand the exact sequence in question. I'll probably start with a quick search for the function definition using `codesearch-definition-source` or maybe `read-file` to get a good overview of the function and its calls. And if that's not enough, `grepper` should reveal all the relevant calls and interactions. I'll need to clearly pinpoint where the race exists and then verify the proposed solution will effectively eliminate it, ensuring data integrity and consistency. This sounds like it should be a pretty straightforward modification.



250/4 2026/09/17 11:17 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:ntfs_setattr]

Results:
map[SourceCode: 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
 770:		if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE))
 771:			ntfs_save_wsl_perm(inode, NULL);
 772:		mark_inode_dirty(inode);
 773:	out:
 774:		return err;
 775:	}
 SourceFile:fs/ntfs3/file.c]

251/4 2026/09/17 11:17 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 5766
							output: 32
							thoughts: 380
						

Thoughts:
**My Analysis of the `ntfs_setattr` Implementation**

Okay, let's break this down. My initial thought is about how `ntfs_setattr` handles size changes, specifically the truncation aspect. The code snippet flags a concern when dealing with compressed files, which is interesting - that's a good place to start digging. The critical part is around the `truncate_setsize` and `ntfs_set_size` calls. I'm immediately wondering about the interaction with the filemap, and how this relates to cache coherency and data consistency.

Given my experience, I'm thinking about typical practices across different filesystems. I need to understand how other filesystems, like ext4, xfs, btrfs, f2fs, and even zonefs, handle similar `setattr` operations. I need to compare their strategies for handling `truncate_setsize` (or its equivalents) and what impact this has on the filemap.

The question of how they utilize `filemap_invalidate_lock` is key, I'll need to figure out when and how it's used during truncation. Are they using it *before* truncation to synchronize or *after* to invalidate? And most importantly, is this the right strategy for NTFS?

My next step is to dive into git history, both within the `fs/ntfs3/` directory and in other filesystems, searching for occurrences of `filemap_invalidate_lock` and `truncate_setsize`. I'll analyze how other filesystems perform this work and compare their methods to what's happening here. That should give me a good sense of whether this is the best approach, or if there might be opportunities for improvement or optimization.



252/4 2026/09/17 11:17 tool grepper
0m Args:
map[Expression:filemap_invalidate_lock.*i_mapping PathPrefix:fs/]

Results:
map[Output:fs/ceph/file.c=2784=static long ceph_fallocate(struct file *file, int mode,
--
fs/ceph/file.c-2841-
fs/ceph/file.c:2842:	filemap_invalidate_lock(inode->i_mapping);
fs/ceph/file.c-2843-	ceph_fscache_invalidate(inode, false);
--
fs/exfat/file.c=754=static int exfat_extend_valid_size(struct inode *inode, loff_t new_valid_size)
--
fs/exfat/file.c-779-		 */
fs/exfat/file.c:780:		filemap_invalidate_lock(inode->i_mapping);
fs/exfat/file.c-781-		if (gap_start < new_valid_size)
--
fs/exfat/file.c=943=static vm_fault_t exfat_page_mkwrite(struct vm_fault *vmf)
--
fs/exfat/file.c-987-
fs/exfat/file.c:988:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/exfat/file.c-989-	ret = iomap_page_mkwrite(vmf, &exfat_iomap_ops, NULL);
--
fs/ext2/inode.c=1224=static void ext2_truncate_blocks(struct inode *inode, loff_t offset)
--
fs/ext2/inode.c-1231-
fs/ext2/inode.c:1232:	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c-1233-	__ext2_truncate_blocks(inode, offset);
--
fs/ext2/inode.c=1237=static int ext2_setsize(struct inode *inode, loff_t newsize)
--
fs/ext2/inode.c-1254-
fs/ext2/inode.c:1255:	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c-1256-	truncate_setsize(inode, newsize);
--
fs/ext4/inode.c=4432=static void ext4_wait_dax_page(struct inode *inode)
--
fs/ext4/inode.c-4435-	schedule();
fs/ext4/inode.c:4436:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-4437-}
--
fs/ext4/inode.c=6009=int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ext4/inode.c-6125-
fs/ext4/inode.c:6126:		filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-6127-
--
fs/ext4/inode.c=6740=int ext4_change_inode_journal_flag(struct inode *inode, int val)
--
fs/ext4/inode.c-6773-	 */
fs/ext4/inode.c:6774:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-6775-	err = filemap_write_and_wait(inode->i_mapping);
--
fs/ext4/ioctl.c=375=static long swap_inode_boot_loader(struct super_block *sb,
--
fs/ext4/ioctl.c-411-
fs/ext4/ioctl.c:412:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/ioctl.c-413-	err = filemap_write_and_wait(inode->i_mapping);
--
fs/f2fs/data.c=3646=void f2fs_write_failed(struct inode *inode, loff_t to)
--
fs/f2fs/data.c-3655-		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/data.c:3656:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/data.c-3657-
--
fs/f2fs/data.c=4187=static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk,
--
fs/f2fs/data.c-4202-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/data.c:4203:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/data.c-4204-
--
fs/f2fs/file.c=73=static int f2fs_zero_post_eof_page(struct inode *inode,
--
fs/f2fs/file.c-86-	if (lock)
fs/f2fs/file.c:87:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-88-	/* zero or drop pages only in range of [old_size, new_size] */
--
fs/f2fs/file.c=120=static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
--
fs/f2fs/file.c-186-	file_update_time(vmf->vma->vm_file);
fs/f2fs/file.c:187:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/f2fs/file.c-188-
--
fs/f2fs/file.c=637=static int finish_preallocate_blocks(struct inode *inode)
--
fs/f2fs/file.c-655-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:656:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-657-
--
fs/f2fs/file.c=1124=int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/f2fs/file.c-1227-		f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1228:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1229-
--
fs/f2fs/file.c=1346=static int f2fs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1394-			f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1395:			filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1396-
--
fs/f2fs/file.c=1630=static int f2fs_do_collapse(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1642-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1643:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1644-
--
fs/f2fs/file.c=1661=static int f2fs_collapse_range(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1686-	/* write out all moved pages, if possible */
fs/f2fs/file.c:1687:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1688-	ret = filemap_write_and_wait_range(inode->i_mapping, offset, LLONG_MAX);
--
fs/f2fs/file.c=3879=static int f2fs_ioc_release_dev_alias(struct file *filp)
--
fs/f2fs/file.c-3928-
fs/f2fs/file.c:3929:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-3930-	truncate_setsize(inode, 0);
--
fs/f2fs/file.c=4206=static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4257-	f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4258:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-4259-
--
fs/f2fs/file.c=4403=static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4435-	f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4436:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-4437-
--
fs/f2fs/file.c=5631=static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/f2fs/file.c-5703-		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:5704:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-5705-		if (!f2fs_truncate(inode))
--
fs/fuse/dax.c=663=static void fuse_wait_dax_page(struct inode *inode)
--
fs/fuse/dax.c-666-	schedule();
fs/fuse/dax.c:667:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-668-}
--
fs/fuse/dax.c=755=static vm_fault_t __fuse_dax_fault(struct vm_fault *vmf, unsigned int order,
--
fs/fuse/dax.c-778-	 */
fs/fuse/dax.c:779:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/fuse/dax.c-780-	ret = dax_iomap_fault(vmf, order, &pfn, &error, &fuse_iomap_ops);
--
fs/fuse/dax.c=914=inode_inline_reclaim_one_dmap(struct fuse_conn_dax *fcd, struct inode *inode,
--
fs/fuse/dax.c-923-
fs/fuse/dax.c:924:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-925-
--
fs/fuse/dax.c=1076=static int lookup_and_reclaim_dmap(struct fuse_conn_dax *fcd,
--
fs/fuse/dax.c-1085-
fs/fuse/dax.c:1086:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-1087-	ret = fuse_dax_break_layouts(inode, dmap_start, dmap_end);
--
fs/fuse/file.c=250=static int fuse_open(struct inode *inode, struct file *file)
--
fs/fuse/file.c-271-	if (dax_truncate) {
fs/fuse/file.c:272:		filemap_invalidate_lock(inode->i_mapping);
fs/fuse/file.c-273-		err = fuse_dax_break_layouts(inode, 0, -1);
--
fs/fuse/file.c=2832=static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
--
fs/fuse/file.c-2859-	if (block_faults) {
fs/fuse/file.c:2860:		filemap_invalidate_lock(inode->i_mapping);
fs/fuse/file.c-2861-		err = fuse_dax_break_layouts(inode, 0, -1);
--
fs/ntfs/file.c=254=static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
--
fs/ntfs/file.c-278-	 */
fs/ntfs/file.c:279:	filemap_invalidate_lock(vi->i_mapping);
fs/ntfs/file.c-280-	if (attr->ia_size > old_size) {
--
fs/ntfs/file.c=1127=static long ntfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
--
fs/ntfs/file.c-1170-	/* Take invalidate_lock for all fallocate operations to prevent races */
fs/ntfs/file.c:1171:	filemap_invalidate_lock(vi->i_mapping);
fs/ntfs/file.c-1172-
--
fs/smb/client/file.c=993=static int cifs_do_truncate(const unsigned int xid, struct dentry *dentry)
--
fs/smb/client/file.c-1005-
fs/smb/client/file.c:1006:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/file.c-1007-
--
fs/smb/client/smb2ops.c=3508=static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3531-
fs/smb/client/smb2ops.c:3532:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-3533-
--
fs/smb/client/smb2ops.c=3592=static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3610-
fs/smb/client/smb2ops.c:3611:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-3612-	/*
--
fs/smb/client/smb2ops.c=4014=static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4032-
fs/smb/client/smb2ops.c:4033:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-4034-	rc = filemap_write_and_wait_range(inode->i_mapping,
--
fs/smb/client/smb2ops.c=4078=static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4108-
fs/smb/client/smb2ops.c:4109:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-4110-	rc = filemap_write_and_wait_range(inode->i_mapping,
--
fs/udf/file.c=89=static ssize_t udf_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/udf/file.c-104-				 iocb->ki_pos + iov_iter_count(from))) {
fs/udf/file.c:105:		filemap_invalidate_lock(inode->i_mapping);
fs/udf/file.c-106-		retval = udf_expand_file_adinicb(inode);
--
fs/udf/file.c=215=static int udf_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/udf/file.c-236-	    attr->ia_size != i_size_read(inode)) {
fs/udf/file.c:237:		filemap_invalidate_lock(inode->i_mapping);
fs/udf/file.c-238-		error = udf_setsize(inode, attr->ia_size);
--
fs/verity/read_metadata.c=16=static int fsverity_read_merkle_tree(struct inode *inode,
--
fs/verity/read_metadata.c-38-	if (inode->i_sb->s_vop->readahead_merkle_tree) {
fs/verity/read_metadata.c:39:		filemap_invalidate_lock_shared(inode->i_mapping);
fs/verity/read_metadata.c-40-		inode->i_sb->s_vop->readahead_merkle_tree(
--
fs/xfs/xfs_bmap_util.c=1537=xfs_swap_extents(
--
fs/xfs/xfs_bmap_util.c-1558-	lock_two_nondirectories(VFS_I(ip), VFS_I(tip));
fs/xfs/xfs_bmap_util.c:1559:	filemap_invalidate_lock_two(VFS_I(ip)->i_mapping,
fs/xfs/xfs_bmap_util.c-1560-				    VFS_I(tip)->i_mapping);
--
fs/xfs/xfs_inode.c=2792=xfs_ilock2_io_mmap(
--
fs/xfs/xfs_inode.c-2810-	} else
fs/xfs/xfs_inode.c:2811:		filemap_invalidate_lock_two(VFS_I(ip1)->i_mapping,
fs/xfs/xfs_inode.c-2812-					    VFS_I(ip2)->i_mapping);
--
fs/xfs/xfs_iomap.c=2134=xfs_buffered_write_iomap_end(
--
fs/xfs/xfs_iomap.c-2167-	} else {
fs/xfs/xfs_iomap.c:2168:		filemap_invalidate_lock(inode->i_mapping);
fs/xfs/xfs_iomap.c-2169-		iomap_write_delalloc_release(inode, start_byte, end_byte, flags,
--
fs/zonefs/file.c=203=int zonefs_file_truncate(struct inode *inode, loff_t isize)
--
fs/zonefs/file.c-228-	/* Serialize against page faults */
fs/zonefs/file.c:229:	filemap_invalidate_lock(inode->i_mapping);
fs/zonefs/file.c-230-
--
fs/zonefs/file.c=297=static vm_fault_t zonefs_filemap_page_mkwrite(struct vm_fault *vmf)
--
fs/zonefs/file.c-315-	/* Serialize against truncates */
fs/zonefs/file.c:316:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/zonefs/file.c-317-	ret = iomap_page_mkwrite(vmf, &zonefs_write_iomap_ops, NULL);
]

253/4 2026/09/17 11:17 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 11848
							output: 32
							thoughts: 100
						

Thoughts:
**Investigating NTFS3 File Size Invalidation**

Okay, so I need to figure out the right approach for handling file size invalidation in this NTFS3 context. My initial instinct was to check out the existing practices in `fs/ntfs/file.c` or perhaps other filesystems as a general reference, but actually, `fs/ntfs3` is *the* place to focus.

Now, the crucial question is, how does `fs/ntfs3` currently interact with the `filemap_invalidate_lock` mechanism, if at all? I'm also curious about the behavior of `ntfs_set_size` within that module, as it likely plays a pivotal role.

My next step is to perform a targeted grep search within `fs/ntfs3`. I'll look specifically for instances of `filemap_invalidate_lock` and, more broadly, `invalidate_lock` to quickly identify relevant code sections and understand the existing implementation details. This should provide the key insights needed to proceed.



254/4 2026/09/17 11:17 tool grepper
0m Args:
map[Expression:filemap_invalidate_.*lock PathPrefix:fs/ntfs3]

Results:
map[Output:fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-519-		inode_dio_wait(inode);
fs/ntfs3/file.c:520:		filemap_invalidate_lock(mapping);
fs/ntfs3/file.c-521-		map_locked = true;
--
fs/ntfs3/file.c-691-	if (map_locked)
fs/ntfs3/file.c:692:		filemap_invalidate_unlock(mapping);
fs/ntfs3/file.c-693-
]

255/4 2026/09/17 11:18 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 12389
							output: 37
							thoughts: 54
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Analyzing `ntfs_fallocate` in `fs/ntfs3/file.c`**

Alright, let's dive into `ntfs_fallocate` within the NTFS3 implementation. My initial focus is going to be on the regions around lines 510-530 and then again around 680-700 within `file.c`. I'm expecting to see the core logic for how fallocate is handled, specifically within this specific filesystem. I want to see what steps are taken to pre-allocate blocks, potentially extending the file size, and the error handling for what can go wrong during this process. I'm also interested to see how it potentially interacts with the metadata of the NTFS file system, particularly the MFT. I'll need to observe any interactions with the journal or other concurrency control. I'm hoping to quickly identify any potential performance bottlenecks or edge cases.



256/4 2026/09/17 11:18 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:500 LineCount:40]

Results:
map[Contents: 500:					mode);
 501:			return -EOPNOTSUPP;
 502:		}
 503:	
 504:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 505:	
 506:		inode_lock(inode);
 507:		i_size = inode->i_size;
 508:		new_size = max(end, i_size);
 509:		map_locked = false;
 510:	
 511:		if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 512:			/* Should never be here, see ntfs_file_open. */
 513:			err = -EOPNOTSUPP;
 514:			goto out;
 515:		}
 516:	
 517:		if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
 518:			    FALLOC_FL_INSERT_RANGE)) {
 519:			inode_dio_wait(inode);
 520:			filemap_invalidate_lock(mapping);
 521:			map_locked = true;
 522:		}
 523:	
 524:		if (mode & FALLOC_FL_PUNCH_HOLE) {
 525:			u32 frame_size;
 526:			loff_t mask, vbo_a, end_a, tmp, from;
 527:	
 528:			err = filemap_write_and_wait_range(mapping, vbo_down,
 529:							   LLONG_MAX);
 530:			if (err)
 531:				goto out;
 532:	
 533:			truncate_pagecache(inode, vbo_down);
 534:	
 535:			ni_lock(ni);
 536:			err = attr_punch_hole(ni, vbo, len, &frame_size);
 537:			ni_unlock(ni);
 538:			if (!err)
 539:				goto ok;
]

257/4 2026/09/17 11:18 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 13285
							output: 37
							thoughts: 25
						

Thoughts:
Okay, here's my summary, taking on the persona you requested:

**Peeking into `ntfs_fallocate`'s Inner Workings**

Alright, let's dive back into `ntfs_fallocate`. Specifically, I'm going to revisit lines 680 to 705 to refresh my memory on the critical operations in this function. I'm especially interested in how it handles space allocation and deallocation within the NTFS file system. I need to keep the high-level picture in my head as I review the code.



258/4 2026/09/17 11:18 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:680 LineCount:35]

Results:
map[Contents: 680:				if (err)
 681:					goto out;
 682:			}
 683:		}
 684:	
 685:	ok:
 686:		err = file_modified(file);
 687:		if (err)
 688:			goto out;
 689:	
 690:	out:
 691:		if (map_locked)
 692:			filemap_invalidate_unlock(mapping);
 693:	
 694:		if (!err) {
 695:			inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
 696:			mark_inode_dirty(inode);
 697:		}
 698:	
 699:		inode_unlock(inode);
 700:		return err;
 701:	}
 702:	
 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
]

259/4 2026/09/17 11:18 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 13914
							output: 39
							thoughts: 28
						

Thoughts:
Here's my analysis of the provided context, expressed as a first-person expert summary:

**Diving into `ntfs_set_size` and Related Functionality**

Okay, so we're focusing in on `ntfs_set_size`. My initial thought is that we need to examine this function, its implementation, and most importantly, *all* of its call sites. As a seasoned professional, I know that just looking at the function in isolation is rarely enough. I need to understand the larger context. Are we talking about resizing the volume itself? Adjusting file sizes within the NTFS file system? What are the potential impacts of this size adjustment? Is this a core NTFS function, or is it abstracted by layers of code?

I need to understand what other functions interact with `ntfs_set_size` and why, so I can see what its implications are in a variety of situations. I want to see if there are any potential race conditions or locking issues involved when making the changes. Are there any error handling subtleties that require my scrutiny? What edge cases might not be covered, causing unexpected behavior? Essentially, I need a holistic view of its usage and consequences within the larger NTFS ecosystem.



260/4 2026/09/17 11:18 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:ntfs_set_size]

Results:
map[SourceCode: 883:	int ntfs_set_size(struct inode *inode, u64 new_size)
 884:	{
 885:		struct super_block *sb = inode->i_sb;
 886:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 887:		struct ntfs_inode *ni = ntfs_i(inode);
 888:		int err;
 889:	
 890:		/* Check for maximum file size. */
 891:		if (is_sparsed(ni) || is_compressed(ni)) {
 892:			if (new_size > sbi->maxbytes_sparse) {
 893:				return -EFBIG;
 894:			}
 895:		} else if (new_size > sbi->maxbytes) {
 896:			return -EFBIG;
 897:		}
 898:	
 899:		/* Mark rw ntfs as dirty. It will be cleared at umount. */
 900:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 901:	
 902:		ni_lock(ni);
 903:		down_write(&ni->file.run_lock);
 904:		if (new_size < ni->i_valid)
 905:			ni->i_valid = new_size;
 906:	
 907:		/* last 'true' means keep preallocated. */
 908:		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
 909:				    &ni->file.run, new_size, &ni->i_valid, true);
 910:	
 911:		up_write(&ni->file.run_lock);
 912:		ni_unlock(ni);
 913:	
 914:		return err;
 915:	}
 SourceFile:fs/ntfs3/inode.c]

261/4 2026/09/17 11:18 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 14793
							output: 30
							thoughts: 92
						

Thoughts:
Okay, here's my thought process on this, distilled into a first-person summary as you requested, presented for a fellow expert:

**Investigating `ntfs_set_size` Functionality**

Right, let's break this down. My understanding is `ntfs_set_size` is responsible for setting the attribute size on disk within the NTFS filesystem, handling the underlying metadata changes. But before I dive deeper, I always try to see if there's been any prior art or similar issues handled in the codebase. Let me quickly check the history: I should search git commits, specifically in `fs/ntfs3` or maybe even other filesystems as a comparison to see how similar functions have been handled in the past. Specifically, I'll be looking for patches touching `ntfs_setattr`, `truncate_setsize`, or even `filemap_invalidate_lock`. That could give me some clues about potential concurrency issues, edge cases, or optimizations that have already been considered. To focus it a bit more, I should generate a list of the commits that relate to the file. I will use `git log` with the file path `fs/ntfs3/file.c` to see what changes have been made to this file and if there is any interesting information related to size. That should be a good starting point to build a mental model of the relevant code.



262/4 2026/09/17 11:19 tool git-log
0m Args:
map[Count:20 PathPrefix:fs/ntfs3/file.c]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

263/4 2026/09/17 11:19 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 15239
							output: 22
							thoughts: 36
						

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

**Debugging a Git History Snag**

Hmm, that's odd. `git-log` is only showing me Linux 7.3-rc3? That's definitely not the full picture. My gut tells me something is limiting the output. Is the command using a `Count` parameter that’s artificially truncating the history? Or, even worse, has the history been shallowly cloned, meaning I don't have the entire repository history locally?

Let's start by ruling out the obvious. I need to re-run the `git-log` command, but this time, I'll strip out any `Count` argument that might be in play. That's the first test. I need to make sure I'm getting the complete history.

If that doesn't fix it, and I still get a limited result, I can try running it without `MessageRegexps` to see if there is some filter interfering.



264/4 2026/09/17 11:19 tool git-log
0m Args:
map[MessageRegexps:[ntfs_setattr]]

Results:
map[Output:]

265/4 2026/09/17 11:19 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 15532
							output: 31
							thoughts: 39
						

Thoughts:
Okay, here's my interpretation of those thoughts, framed as a first-person summary, keeping in mind my expertise:

**Investigating Potential Issues in NTFS File Truncation**

Right, let's dive in. I need to get a handle on the history related to potential problems around `truncate_setsize` and `filemap_invalidate_lock`, specifically within the NTFS filesystem's file handling. I'm thinking a deep dive into the `git log` is the best starting point. I'll focus my query on commits that touched `fs/ntfs/file.c` or other files that would be closely related to file truncation logic. The goal here is to identify recent changes, potential regressions, or any significant modifications that might have introduced or exacerbated whatever issue I'm investigating. I'll be looking for changes that might have subtly altered the behavior of those specific functions, or how they interact. A targeted `git log` search is the most efficient way to isolate those specific commits from the whole codebase and start to build a chronology of potential culprits.



266/4 2026/09/17 11:19 tool git-log
0m Args:
map[CodeRegexp:filemap_invalidate_lock PathPrefix:fs/]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

267/4 2026/09/17 11:19 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 15858
							output: 20
							thoughts: 35
						

Thoughts:
Here's my take:

**Investigating a Git HEAD Mystery**

Okay, so HEAD is pointing at Linux 7.3-rc3, but is this a full repository, or is it a shallow clone, or maybe even just a single commit? I need to figure this out quickly. I can't start work on this until I understand the scope of the clone. Let's start by running `git show` on HEAD. That should give me the information I need: the commit details, but also hopefully some clues about its origin and whether this is a full repository or a partial one.



268/4 2026/09/17 11:19 tool git-show
0m Args:
map[Commit:HEAD Stat:true]

Results:
map[Output:commit fd73f4a6659897191fa0d40695fe370925dd3780
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Sep 13 14:38:02 2026 -0700

    Linux 7.3-rc3

 .clang-format                                      |    808 +
 .clippy.toml                                       |     21 +
 .cocciconfig                                       |      3 +
 .editorconfig                                      |     27 +
 .get_maintainer.ignore                             |      9 +
 .gitattributes                                     |      5 +
 .gitignore                                         |    196 +
 .mailmap                                           |    996 +
 .pylintrc                                          |      2 +
 .rustfmt.toml                                      |     12 +
 COPYING                                            |     20 +
 CREDITS                                            |   4651 +
 Documentation/.gitignore                           |      3 +
 Documentation/.renames.txt                         |   1185 +
 Documentation/ABI/README                           |     98 +
 .../ABI/obsolete/automount-tracefs-debugfs         |     20 +
 Documentation/ABI/obsolete/o2cb                    |     11 +
 Documentation/ABI/obsolete/procfs-i8k              |     10 +
 Documentation/ABI/obsolete/sysfs-bus-iio           |    174 +
 Documentation/ABI/obsolete/sysfs-bus-usb           |     31 +
 Documentation/ABI/obsolete/sysfs-class-typec       |     48 +
 Documentation/ABI/obsolete/sysfs-cpuidle           |      9 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-arvo      |     53 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-isku      |    153 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-koneplus  |    145 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-konepure  |    105 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-kovaplus  |    116 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-lua       |      7 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-pyra      |    126 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-ryos      |    178 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-savu      |     77 +
 .../ABI/obsolete/sysfs-driver-intel_pmc_bxt        |     22 +
 Documentation/ABI/obsolete/sysfs-driver-ivpu       |     30 +
 .../ABI/obsolete/sysfs-driver-samsung-laptop       |     10 +
 Documentation/ABI/obsolete/sysfs-firmware-acpi     |      8 +
 Documentation/ABI/obsolete/sysfs-gpio              |     40 +
 .../ABI/obsolete/sysfs-kernel-fadump_enabled       |      9 +
 .../ABI/obsolete/sysfs-kernel-fadump_registered    |     10 +
 .../ABI/obsolete/sysfs-kernel-fadump_release_mem   |     10 +
 .../ABI/obsolete/sysfs-kernel-kexec-kdump          |     71 +
 .../ABI/obsolete/sysfs-platform-ideapad-laptop     |      8 +
 Documentation/ABI/removed/devfs                    |     13 +
 Documentation/ABI/removed/dv1394                   |     14 +
 Documentation/ABI/removed/ip_queue                 |      9 +
 Documentation/ABI/removed/net_dma                  |      8 +
 Documentation/ABI/removed/o2cb                     |     10 +
 Documentation/ABI/removed/raw1394                  |     16 +
 Documentation/ABI/removed/sysfs-bus-nfit           |     17 +
 Documentation/ABI/removed/sysfs-class-cxl          |    272 +
 Documentation/ABI/removed/sysfs-class-rfkill       |     13 +
 Documentation/ABI/removed/sysfs-firmware-efi-vars  |     12 +
 .../removed/sysfs-kernel-fadump_release_opalcore   |      9 +
 Documentation/ABI/removed/sysfs-kernel-uids        |     14 +
 Documentation/ABI/removed/sysfs-mce                |     37 +
 .../ABI/removed/sysfs-selinux-checkreqprot         |     26 +
 Documentation/ABI/removed/sysfs-selinux-disable    |     29 +
 Documentation/ABI/removed/sysfs-selinux-user       |     12 +
 Documentation/ABI/removed/video1394                |     17 +
 Documentation/ABI/stable/configfs-nvmet            |    352 +
 Documentation/ABI/stable/firewire-cdev             |    111 +
 Documentation/ABI/stable/o2cb                      |     10 +
 Documentation/ABI/stable/procfs-audit_loginuid     |     27 +
 Documentation/ABI/stable/syscalls                  |     10 +
 Documentation/ABI/stable/sysfs-acpi-pmprofile      |     28 +
 Documentation/ABI/stable/sysfs-block               |    941 +
 Documentation/ABI/stable/sysfs-bus-firewire        |    136 +
 Documentation/ABI/stable/sysfs-bus-fsl-mc          |     19 +
 Documentation/ABI/stable/sysfs-bus-mhi             |     44 +
 Documentation/ABI/stable/sysfs-bus-nvmem           |     50 +
 Documentation/ABI/stable/sysfs-bus-usb             |    142 +
 Documentation/ABI/stable/sysfs-bus-vmbus           |    187 +
 Documentation/ABI/stable/sysfs-bus-w1              |     12 +
 Documentation/ABI/stable/sysfs-bus-xen-backend     |     84 +
 Documentation/ABI/stable/sysfs-class-backlight     |     63 +
 Documentation/ABI/stable/sysfs-class-bluetooth     |      9 +
 Documentation/ABI/stable/sysfs-class-infiniband    |    784 +
 Documentation/ABI/stable/sysfs-class-rfkill        |     93 +
 Documentation/ABI/stable/sysfs-class-tpm           |    210 +
 Documentation/ABI/stable/sysfs-class-ubi           |    221 +
 Documentation/ABI/stable/sysfs-class-udc           |     93 +
 Documentation/ABI/stable/sysfs-devices             |     32 +
 Documentation/ABI/stable/sysfs-devices-node        |    238 +
 Documentation/ABI/stable/sysfs-devices-system-cpu  |    117 +
 .../ABI/stable/sysfs-devices-system-xen_memory     |     86 +
 Documentation/ABI/stable/sysfs-driver-aspeed-vuart |     24 +
 Documentation/ABI/stable/sysfs-driver-dma-idxd     |    376 +
 Documentation/ABI/stable/sysfs-driver-dma-ioatdma  |     30 +
 .../ABI/stable/sysfs-driver-firmware-zynqmp        |    256 +
 Documentation/ABI/stable/sysfs-driver-ib_srp       |    192 +
 Documentation/ABI/stable/sysfs-driver-misc-cp500   |     25 +
 Documentation/ABI/stable/sysfs-driver-mlxreg-io    |    815 +
 Documentation/ABI/stable/sysfs-driver-qaic         |     19 +
 Documentation/ABI/stable/sysfs-driver-qla2xxx      |      8 +
 Documentation/ABI/stable/sysfs-driver-speakup      |    394 +
 Documentation/ABI/stable/sysfs-driver-usb-usbtmc   |     27 +
 Documentation/ABI/stable/sysfs-driver-w1_ds2438    |     13 +
 Documentation/ABI/stable/sysfs-driver-w1_ds28e04   |     15 +
 Documentation/ABI/stable/sysfs-driver-w1_ds28ea00  |      6 +
 Documentation/ABI/stable/sysfs-firmware-opal-dump  |     46 +
 Documentation/ABI/stable/sysfs-firmware-opal-elog  |     62 +
 Documentation/ABI/stable/sysfs-fs-orangefs         |     87 +
 Documentation/ABI/stable/sysfs-hypervisor-xen      |    135 +
 Documentation/ABI/stable/sysfs-kernel-notes        |      5 +
 .../ABI/stable/sysfs-kernel-time-aux-clocks        |      5 +
 Documentation/ABI/stable/sysfs-module              |     47 +
 Documentation/ABI/stable/sysfs-nvme                |    453 +
 Documentation/ABI/stable/sysfs-platform-wmi-bmof   |      7 +
 Documentation/ABI/stable/sysfs-transport-srp       |     58 +
 Documentation/ABI/stable/thermal-notification      |      4 +
 Documentation/ABI/stable/vdso                      |     37 +
 Documentation/ABI/testing/amdpmf-interface         |     73 +
 Documentation/ABI/testing/configfs-acpi            |     52 +
 Documentation/ABI/testing/configfs-iio             |     34 +
 Documentation/ABI/testing/configfs-most            |    241 +
 Documentation/ABI/testing/configfs-rdma_cm         |     34 +
 .../ABI/testing/configfs-spear-pcie-gadget         |     33 +
 Documentation/ABI/testing/configfs-stp-policy      |     48 +
 .../ABI/testing/configfs-stp-policy-p_sys-t        |     41 +
 .../ABI/testing/configfs-thunderbolt_stream        |     98 +
 Documentation/ABI/testing/configfs-tsm-report      |    161 +
 Documentation/ABI/testing/configfs-usb-gadget      |    158 +
 Documentation/ABI/testing/configfs-usb-gadget-acm  |     15 +
 Documentation/ABI/testing/configfs-usb-gadget-ecm  |     20 +
 Documentation/ABI/testing/configfs-usb-gadget-eem  |     16 +
 Documentation/ABI/testing/configfs-usb-gadget-ffs  |     17 +
 Documentation/ABI/testing/configfs-usb-gadget-hid  |     13 +
 .../ABI/testing/configfs-usb-gadget-loopback       |     10 +
 .../ABI/testing/configfs-usb-gadget-mass-storage   |     41 +
 Documentation/ABI/testing/configfs-usb-gadget-midi |     15 +
 .../ABI/testing/configfs-usb-gadget-midi2          |     54 +
 Documentation/ABI/testing/configfs-usb-gadget-ncm  |     15 +
 Documentation/ABI/testing/configfs-usb-gadget-obex |      9 +
 .../ABI/testing/configfs-usb-gadget-phonet         |      8 +
 .../ABI/testing/configfs-usb-gadget-printer        |     11 +
 .../ABI/testing/configfs-usb-gadget-rndis          |     19 +
 .../ABI/testing/configfs-usb-gadget-serial         |      9 +
 .../ABI/testing/configfs-usb-gadget-sourcesink     |     16 +
 .../ABI/testing/configfs-usb-gadget-subset         |     16 +
 Documentation/ABI/testing/configfs-usb-gadget-tcm  |      6 +
 Documentation/ABI/testing/configfs-usb-gadget-uac1 |     41 +
 .../ABI/testing/configfs-usb-gadget-uac1_legacy    |      9 +
 Documentation/ABI/testing/configfs-usb-gadget-uac2 |     51 +
 Documentation/ABI/testing/configfs-usb-gadget-uvc  |    438 +
 Documentation/ABI/testing/debugfs-alienware-wmi    |     64 +
 Documentation/ABI/testing/debugfs-amd-iommu        |    131 +
 Documentation/ABI/testing/debugfs-cdns-pcie        |      5 +
 Documentation/ABI/testing/debugfs-cec-error-inj    |     40 +
 Documentation/ABI/testing/debugfs-cros-ec          |     78 +
 Documentation/ABI/testing/debugfs-cxl              |    157 +
 Documentation/ABI/testing/debugfs-dell-wmi-ddv     |     34 +
 Documentation/ABI/testing/debugfs-driver-dcc       |    127 +
 Documentation/ABI/testing/debugfs-driver-genwqe    |     91 +
 .../ABI/testing/debugfs-driver-habanalabs          |    323 +
 Documentation/ABI/testing/debugfs-driver-qat       |    109 +
 .../ABI/testing/debugfs-driver-qat_telemetry       |    259 +
 Documentation/ABI/testing/debugfs-dwc-pcie         |    157 +
 Documentation/ABI/testing/debugfs-ec               |     21 +
 Documentation/ABI/testing/debugfs-hisi-hpre        |    200 +
 Documentation/ABI/testing/debugfs-hisi-migration   |     25 +
 Documentation/ABI/testing/debugfs-hisi-sec         |    173 +
 Documentation/ABI/testing/debugfs-hisi-zip         |    174 +
 Documentation/ABI/testing/debugfs-hyperv           |     23 +
 Documentation/ABI/testing/debugfs-ideapad          |     19 +
 Documentation/ABI/testing/debugfs-iio-ad9467       |     39 +
 Documentation/ABI/testing/debugfs-iio-backend      |     20 +
 Documentation/ABI/testing/debugfs-intel-iommu      |    276 +
 Documentation/ABI/testing/debugfs-moxtet           |     35 +
 Documentation/ABI/testing/debugfs-msi-wmi-platform |     14 +
 Documentation/ABI/testing/debugfs-olpc             |     16 +
 Documentation/ABI/testing/debugfs-pcie-ptm         |     70 +
 Documentation/ABI/testing/debugfs-pfo-nx-crypto    |     45 +
 Documentation/ABI/testing/debugfs-scmi             |     70 +
 Documentation/ABI/testing/debugfs-scmi-raw         |    208 +
 Documentation/ABI/testing/debugfs-tpmi             |     40 +
 Documentation/ABI/testing/debugfs-vfio             |     57 +
 Documentation/ABI/testing/debugfs-wilco-ec         |     45 +
 Documentation/ABI/testing/dell-smbios-wmi          |     41 +
 Documentation/ABI/testing/dev-kmsg                 |    127 +
 Documentation/ABI/testing/devlink-resource-mlxsw   |     33 +
 Documentation/ABI/testing/evm                      |    109 +
 Documentation/ABI/testing/gpio-cdev                |     28 +
 Documentation/ABI/testing/ima_policy               |    196 +
 Documentation/ABI/testing/ppc-memtrace             |     46 +
 Documentation/ABI/testing/procfs-attr-current      |     20 +
 Documentation/ABI/testing/procfs-attr-exec         |     20 +
 Documentation/ABI/testing/procfs-attr-prev         |     19 +
 Documentation/ABI/testing/procfs-diskstats         |     43 +
 .../ABI/testing/procfs-nfsd-reply_cache_stats      |     38 +
 Documentation/ABI/testing/procfs-smaps_rollup      |     42 +
 Documentation/ABI/testing/pstore                   |     47 +
 Documentation/ABI/testing/rtc-cdev                 |     50 +
 Documentation/ABI/testing/securityfs-secrets-coco  |     51 +
 Documentation/ABI/testing/sysfs-amd-pmc            |     13 +
 Documentation/ABI/testing/sysfs-amd-pmf            |     13 +
 Documentation/ABI/testing/sysfs-ata                |    140 +
 .../ABI/testing/sysfs-auxdisplay-linedisp          |     90 +
 Documentation/ABI/testing/sysfs-block-aoe          |     45 +
 Documentation/ABI/testing/sysfs-block-bcache       |    149 +
 Documentation/ABI/testing/sysfs-block-device       |    119 +
 Documentation/ABI/testing/sysfs-block-dm           |     47 +
 Documentation/ABI/testing/sysfs-block-loop         |     50 +
 Documentation/ABI/testing/sysfs-block-rnbd         |     64 +
 Documentation/ABI/testing/sysfs-block-rssd         |      5 +
 Documentation/ABI/testing/sysfs-block-zram         |    166 +
 Documentation/ABI/testing/sysfs-bus-acpi           |     98 +
 Documentation/ABI/testing/sysfs-bus-amba           |     20 +
 Documentation/ABI/testing/sysfs-bus-auxiliary      |      9 +
 Documentation/ABI/testing/sysfs-bus-bcma           |     31 +
 Documentation/ABI/testing/sysfs-bus-cdx            |    121 +
 Documentation/ABI/testing/sysfs-bus-coreboot       |     45 +
 .../ABI/testing/sysfs-bus-coresight-devices-cti    |    247 +
 .../sysfs-bus-coresight-devices-dummy-source       |     21 +
 .../ABI/testing/sysfs-bus-coresight-devices-etb10  |     88 +
 .../ABI/testing/sysfs-bus-coresight-devices-etm3x  |    328 +
 .../ABI/testing/sysfs-bus-coresight-devices-etm4x  |    532 +
 .../ABI/testing/sysfs-bus-coresight-devices-funnel |     18 +
 .../ABI/testing/sysfs-bus-coresight-devices-stm    |     59 +
 .../ABI/testing/sysfs-bus-coresight-devices-tmc    |    115 +
 .../ABI/testing/sysfs-bus-coresight-devices-tpda   |     69 +
 .../ABI/testing/sysfs-bus-coresight-devices-tpdm   |    290 +
 .../ABI/testing/sysfs-bus-coresight-devices-trbe   |     20 +
 .../testing/sysfs-bus-coresight-devices-ultra_smb  |     31 +
 Documentation/ABI/testing/sysfs-bus-counter        |    477 +
 Documentation/ABI/testing/sysfs-bus-css            |     56 +
 Documentation/ABI/testing/sysfs-bus-cxl            |    646 +
 Documentation/ABI/testing/sysfs-bus-dax            |    177 +
 Documentation/ABI/testing/sysfs-bus-dfl            |     17 +
 .../ABI/testing/sysfs-bus-dfl-devices-emif         |     25 +
 .../ABI/testing/sysfs-bus-dfl-devices-n3000-nios   |     47 +
 .../ABI/testing/sysfs-bus-event_source-devices     |     24 +
 .../testing/sysfs-bus-event_source-devices-caps    |     24 +
 .../testing/sysfs-bus-event_source-devices-dfl_fme |    104 +
 .../ABI/testing/sysfs-bus-event_source-devices-dsa |     30 +
 .../testing/sysfs-bus-event_source-devices-events  |    102 +
 .../testing/sysfs-bus-event_source-devices-format  |     21 +
 .../sysfs-bus-event_source-devices-hisi_ptt        |    113 +
 .../testing/sysfs-bus-event_source-devices-hv_24x7 |     98 +
 .../testing/sysfs-bus-event_source-devices-hv_gpci |    242 +
 .../testing/sysfs-bus-event_source-devices-iommu   |     37 +
 .../testing/sysfs-bus-event_source-devices-rdpmc   |     44 +
 .../testing/sysfs-bus-event_source-devices-uncore  |     13 +
 .../testing/sysfs-bus-event_source-devices-vpa-dtl |     25 +
 .../testing/sysfs-bus-event_source-devices-vpa-pmu |     25 +
 Documentation/ABI/testing/sysfs-bus-fcoe           |    138 +
 Documentation/ABI/testing/sysfs-bus-fsi            |     46 +
 .../ABI/testing/sysfs-bus-fsi-devices-sbefifo      |     10 +
 Documentation/ABI/testing/sysfs-bus-fsl-mc         |     25 +
 Documentation/ABI/testing/sysfs-bus-hsi            |     19 +
 .../ABI/testing/sysfs-bus-i2c-devices-bq32k        |      7 +
 .../ABI/testing/sysfs-bus-i2c-devices-fsa9480      |     27 +
 .../ABI/testing/sysfs-bus-i2c-devices-hm6352       |     21 +
 .../ABI/testing/sysfs-bus-i2c-devices-lm3533       |     15 +
 .../ABI/testing/sysfs-bus-i2c-devices-m24lr        |    100 +
 .../ABI/testing/sysfs-bus-i2c-devices-pca954x      |     23 +
 .../testing/sysfs-bus-i2c-devices-turris-omnia-mcu |    113 +
 Documentation/ABI/testing/sysfs-bus-i3c            |    194 +
 Documentation/ABI/testing/sysfs-bus-iio            |   2511 +
 .../ABI/testing/sysfs-bus-iio-accel-adxl372        |      7 +
 .../ABI/testing/sysfs-bus-iio-accel-bmc150         |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-ad9739a    |     19 +
 .../ABI/testing/sysfs-bus-iio-adc-ad-sigma-delta   |     23 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130 |     20 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 |     27 +
 .../ABI/testing/sysfs-bus-iio-adc-ad7280a          |     13 +
 .../testing/sysfs-bus-iio-adc-envelope-detector    |     39 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-hi8435 |     48 +
 .../ABI/testing/sysfs-bus-iio-adc-max11410         |     13 +
 .../ABI/testing/sysfs-bus-iio-adc-mcp3564          |     53 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-mt6360 |     78 +
 .../ABI/testing/sysfs-bus-iio-adc-pac1934          |      9 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-stm32  |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-bno055     |     81 +
 Documentation/ABI/testing/sysfs-bus-iio-cdc-ad7746 |     11 +
 .../ABI/testing/sysfs-bus-iio-chemical-sgp40       |     17 +
 .../ABI/testing/sysfs-bus-iio-chemical-sunrise-co2 |     38 +
 .../ABI/testing/sysfs-bus-iio-chemical-vz89x       |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-cros-ec    |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-dac        |     61 +
 Documentation/ABI/testing/sysfs-bus-iio-dac-ad5766 |     31 +
 .../ABI/testing/sysfs-bus-iio-dac-dpot-dac         |      8 +
 .../ABI/testing/sysfs-bus-iio-dac-ltc2688          |     55 +
 .../ABI/testing/sysfs-bus-iio-dfsdm-adc-stm32      |     22 +
 .../ABI/testing/sysfs-bus-iio-distance-srf08       |     17 +
 Documentation/ABI/testing/sysfs-bus-iio-dma-buffer |     19 +
 .../ABI/testing/sysfs-bus-iio-filter-admv8818      |     18 +
 Documentation/ABI/testing/sysfs-bus-iio-flow       |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-frequency  |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-ad9523     |     31 +
 .../ABI/testing/sysfs-bus-iio-frequency-adf4350    |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-adf4371    |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-admv1013   |     38 +
 .../ABI/testing/sysfs-bus-iio-frequency-admv1014   |     23 +
 .../ABI/testing/sysfs-bus-iio-gyro-bmg160          |      7 +
 .../ABI/testing/sysfs-bus-iio-health-afe440x       |     39 +
 Documentation/ABI/testing/sysfs-bus-iio-humidity   |     10 +
 .../sysfs-bus-iio-impedance-analyzer-ad5933        |     35 +
 Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc |     15 +
 .../ABI/testing/sysfs-bus-iio-inv_icm42600         |     18 +
 Documentation/ABI/testing/sysfs-bus-iio-isl29501   |     47 +
 .../ABI/testing/sysfs-bus-iio-light-isl29018       |     21 +
 .../ABI/testing/sysfs-bus-iio-light-lm3533-als     |     56 +
 .../ABI/testing/sysfs-bus-iio-light-si1133         |     22 +
 .../ABI/testing/sysfs-bus-iio-light-tsl2583        |     20 +
 .../ABI/testing/sysfs-bus-iio-light-tsl2772        |     13 +
 .../ABI/testing/sysfs-bus-iio-magnetometer-hmc5843 |     20 +
 Documentation/ABI/testing/sysfs-bus-iio-meas-spec  |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-mpu6050    |     13 +
 .../testing/sysfs-bus-iio-potentiometer-mcp4531    |      8 +
 Documentation/ABI/testing/sysfs-bus-iio-proximity  |     24 +
 .../ABI/testing/sysfs-bus-iio-proximity-as3935     |     15 +
 .../ABI/testing/sysfs-bus-iio-resolver-ad2s1210    |     27 +
 Documentation/ABI/testing/sysfs-bus-iio-sps30      |     28 +
 Documentation/ABI/testing/sysfs-bus-iio-sx9310     |     10 +
 Documentation/ABI/testing/sysfs-bus-iio-sx9324     |     29 +
 .../ABI/testing/sysfs-bus-iio-thermocouple         |     18 +
 .../ABI/testing/sysfs-bus-iio-timer-stm32          |    143 +
 .../ABI/testing/sysfs-bus-iio-trigger-sysfs        |     42 +
 Documentation/ABI/testing/sysfs-bus-iio-vf610      |     16 +
 .../ABI/testing/sysfs-bus-intel_th-devices-gth     |     52 +
 .../ABI/testing/sysfs-bus-intel_th-devices-msc     |     54 +
 .../ABI/testing/sysfs-bus-intel_th-devices-pti     |     24 +
 .../ABI/testing/sysfs-bus-intel_th-output-devices  |     15 +
 Documentation/ABI/testing/sysfs-bus-mcb            |     29 +
 Documentation/ABI/testing/sysfs-bus-mdio           |     72 +
 Documentation/ABI/testing/sysfs-bus-media          |      6 +
 Documentation/ABI/testing/sysfs-bus-mei            |     56 +
 Documentation/ABI/testing/sysfs-bus-mmc            |      4 +
 Documentation/ABI/testing/sysfs-bus-most           |    299 +
 Documentation/ABI/testing/sysfs-bus-moxtet-devices |     17 +
 Documentation/ABI/testing/sysfs-bus-nfit           |    233 +
 Documentation/ABI/testing/sysfs-bus-nvdimm         |     60 +
 Documentation/ABI/testing/sysfs-bus-optee-devices  |     17 +
 Documentation/ABI/testing/sysfs-bus-papr-pmem      |     75 +
 Documentation/ABI/testing/sysfs-bus-pci            |    704 +
 .../ABI/testing/sysfs-bus-pci-devices-aer          |    163 +
 .../ABI/testing/sysfs-bus-pci-devices-avs          |      8 +
 .../ABI/testing/sysfs-bus-pci-devices-catpt        |     17 +
 .../ABI/testing/sysfs-bus-pci-devices-cciss        |     80 +
 .../ABI/testing/sysfs-bus-pci-devices-pvpanic      |     26 +
 .../ABI/testing/sysfs-bus-pci-drivers-btintel_pcie |     15 +
 .../ABI/testing/sysfs-bus-pci-drivers-ehci_hcd     |     46 +
 .../ABI/testing/sysfs-bus-pci-drivers-janz-cmodio  |      8 +
 .../ABI/testing/sysfs-bus-pci-drivers-xhci_hcd     |    129 +
 Documentation/ABI/testing/sysfs-bus-peci           |     16 +
 Documentation/ABI/testing/sysfs-bus-platform       |     56 +
 .../sysfs-bus-platform-devices-ampere-smpro        |    325 +
 .../testing/sysfs-bus-platform-devices-occ-hwmon   |     13 +
 .../sysfs-bus-platform-drivers-amd_x3d_vcache      |     12 +
 .../ABI/testing/sysfs-bus-platform-onboard-usb-dev |      9 +
 Documentation/ABI/testing/sysfs-bus-rapidio        |    201 +
 Documentation/ABI/testing/sysfs-bus-rbd            |    173 +
 Documentation/ABI/testing/sysfs-bus-rpmsg          |     95 +
 Documentation/ABI/testing/sysfs-bus-siox           |     90 +
 .../ABI/testing/sysfs-bus-soundwire-master         |     23 +
 .../ABI/testing/sysfs-bus-soundwire-slave          |    109 +
 .../ABI/testing/sysfs-bus-spi-devices-spi-nor      |     40 +
 .../testing/sysfs-bus-surface_aggregator-tabletsw  |     57 +
 Documentation/ABI/testing/sysfs-bus-thunderbolt    |    370 +
 Documentation/ABI/testing/sysfs-bus-typec          |     51 +
 Documentation/ABI/testing/sysfs-bus-usb            |    607 +
 .../ABI/testing/sysfs-bus-usb-devices-usbsevseg    |     46 +
 Documentation/ABI/testing/sysfs-bus-usb-lvstest    |     60 +
 Documentation/ABI/testing/sysfs-bus-vdpa           |     57 +
 Documentation/ABI/testing/sysfs-bus-vfio-mdev      |    113 +
 Documentation/ABI/testing/sysfs-bus-vmbus          |     21 +
 Documentation/ABI/testing/sysfs-bus-wmi            |     81 +
 Documentation/ABI/testing/sysfs-c2port             |     81 +
 Documentation/ABI/testing/sysfs-cfq-target-latency |      8 +
 Documentation/ABI/testing/sysfs-class              |     16 +
 Documentation/ABI/testing/sysfs-class-backlight    |    186 +
 .../testing/sysfs-class-backlight-driver-lm3533    |     54 +
 .../ABI/testing/sysfs-class-backlight-lm3639       |     11 +
 Documentation/ABI/testing/sysfs-class-bdi          |    134 +
 Documentation/ABI/testing/sysfs-class-bsr          |     25 +
 Documentation/ABI/testing/sysfs-class-chromeos     |     53 +
 .../sysfs-class-chromeos-driver-cros-ec-lightbar   |     74 +
 .../sysfs-class-chromeos-driver-cros-ec-vbc        |      6 +
 Documentation/ABI/testing/sysfs-class-devfreq      |    143 +
 .../ABI/testing/sysfs-class-devfreq-event          |     25 +
 Documentation/ABI/testing/sysfs-class-devlink      |    130 +
 Documentation/ABI/testing/sysfs-class-drm          |      8 +
 Documentation/ABI/testing/sysfs-class-extcon       |    101 +
 Documentation/ABI/testing/sysfs-class-fc           |     27 +
 Documentation/ABI/testing/sysfs-class-fc_host      |     23 +
 .../ABI/testing/sysfs-class-fc_remote_ports        |     23 +
 Documentation/ABI/testing/sysfs-class-firmware     |     77 +
 .../ABI/testing/sysfs-class-firmware-attributes    |    494 +
 Documentation/ABI/testing/sysfs-class-fpga-bridge  |     11 +
 Documentation/ABI/testing/sysfs-class-fpga-manager |     60 +
 Documentation/ABI/testing/sysfs-class-fpga-region  |      9 +
 Documentation/ABI/testing/sysfs-class-gnss         |     17 +
 Documentation/ABI/testing/sysfs-class-hwmon        |   1089 +
 .../ABI/testing/sysfs-class-ieee80211-rtw89        |     24 +
 Documentation/ABI/testing/sysfs-class-intel_pmt    |    119 +
 .../ABI/testing/sysfs-class-intel_pmt-features     |    134 +
 Documentation/ABI/testing/sysfs-class-iommu        |     17 +
 .../ABI/testing/sysfs-class-iommu-amd-iommu        |     14 +
 .../ABI/testing/sysfs-class-iommu-intel-iommu      |     32 +
 Documentation/ABI/testing/sysfs-class-issei        |     73 +
 Documentation/ABI/testing/sysfs-class-lcd          |     23 +
 Documentation/ABI/testing/sysfs-class-led          |     89 +
 .../ABI/testing/sysfs-class-led-driver-aw200xx     |      5 +
 .../ABI/testing/sysfs-class-led-driver-lm3533      |     73 +
 .../testing/sysfs-class-led-driver-turris-omnia    |     28 +
 Documentation/ABI/testing/sysfs-class-led-flash    |     89 +
 .../ABI/testing/sysfs-class-led-multicolor         |     37 +
 .../ABI/testing/sysfs-class-led-trigger-netdev     |    192 +
 .../ABI/testing/sysfs-class-led-trigger-oneshot    |     36 +
 .../ABI/testing/sysfs-class-led-trigger-pattern    |     50 +
 .../ABI/testing/sysfs-class-led-trigger-tty        |     62 +
 .../ABI/testing/sysfs-class-led-trigger-usbport    |     13 +
 Documentation/ABI/testing/sysfs-class-leds-gt683r  |     18 +
 Documentation/ABI/testing/sysfs-class-mei          |    105 +
 Documentation/ABI/testing/sysfs-class-mic          |    178 +
 Documentation/ABI/testing/sysfs-class-mtd          |    242 +
 Documentation/ABI/testing/sysfs-class-mux          |     16 +
 Documentation/ABI/testing/sysfs-class-net          |    354 +
 Documentation/ABI/testing/sysfs-class-net-cdc_ncm  |    168 +
 Documentation/ABI/testing/sysfs-class-net-dsa      |     14 +
 Documentation/ABI/testing/sysfs-class-net-grcan    |     35 +
 .../ABI/testing/sysfs-class-net-janz-ican3         |     19 +
 Documentation/ABI/testing/sysfs-class-net-peak_usb |     19 +
 Documentation/ABI/testing/sysfs-class-net-phydev   |     75 +
 Documentation/ABI/testing/sysfs-class-net-qmi      |     76 +
 Documentation/ABI/testing/sysfs-class-net-queues   |    121 +
 .../ABI/testing/sysfs-class-net-statistics         |    217 +
 Documentation/ABI/testing/sysfs-class-ocxl         |     51 +
 .../ABI/testing/sysfs-class-platform-profile       |     50 +
 Documentation/ABI/testing/sysfs-class-power        |    906 +
 .../ABI/testing/sysfs-class-power-bd71828          |     13 +
 Documentation/ABI/testing/sysfs-class-power-gaokun |     27 +
 .../ABI/testing/sysfs-class-power-ltc4162l         |     82 +
 .../ABI/testing/sysfs-class-power-max1720x         |     32 +
 Documentation/ABI/testing/sysfs-class-power-mp2629 |      9 +
 Documentation/ABI/testing/sysfs-class-power-rt9467 |     19 +
 Documentation/ABI/testing/sysfs-class-power-rt9471 |     32 +
 Documentation/ABI/testing/sysfs-class-power-rt9756 |     30 +
 .../ABI/testing/sysfs-class-power-surface          |     15 +
 .../ABI/testing/sysfs-class-power-twl4030          |     33 +
 Documentation/ABI/testing/sysfs-class-power-wilco  |     40 +
 Documentation/ABI/testing/sysfs-class-powercap     |    152 +
 Documentation/ABI/testing/sysfs-class-pwm          |     88 +
 Documentation/ABI/testing/sysfs-class-rapidio      |     59 +
 Documentation/ABI/testing/sysfs-class-rc           |    137 +
 Documentation/ABI/testing/sysfs-class-rc-nuvoton   |     15 +
 .../testing/sysfs-class-reboot-mode-reboot_modes   |     39 +
 Documentation/ABI/testing/sysfs-class-regulator    |    453 +
 Documentation/ABI/testing/sysfs-class-remoteproc   |    104 +
 Documentation/ABI/testing/sysfs-class-rnbd-client  |    133 +
 Documentation/ABI/testing/sysfs-class-rnbd-server  |     58 +
 Documentation/ABI/testing/sysfs-class-rtc          |     91 +
 .../sysfs-class-rtc-rtc0-device-rtc_calibration    |     14 +
 Documentation/ABI/testing/sysfs-class-rtrs-client  |    146 +
 Documentation/ABI/testing/sysfs-class-rtrs-server  |     53 +
 Documentation/ABI/testing/sysfs-class-scsi_host    |    119 +
 Documentation/ABI/testing/sysfs-class-scsi_tape    |    109 +
 Documentation/ABI/testing/sysfs-class-spi-eeprom   |     30 +
 Documentation/ABI/testing/sysfs-class-spi-master   |     34 +
 Documentation/ABI/testing/sysfs-class-stm          |     24 +
 Documentation/ABI/testing/sysfs-class-stm_source   |     11 +
 Documentation/ABI/testing/sysfs-class-switchtec    |     96 +
 Documentation/ABI/testing/sysfs-class-tee          |     25 +
 Documentation/ABI/testing/sysfs-class-thermal      |    259 +
 Documentation/ABI/testing/sysfs-class-tsm          |      9 +
 Documentation/ABI/testing/sysfs-class-typec        |    386 +
 .../ABI/testing/sysfs-class-usb_power_delivery     |    284 +
 Documentation/ABI/testing/sysfs-class-usb_role     |     27 +
 Documentation/ABI/testing/sysfs-class-vduse        |     33 +
 Documentation/ABI/testing/sysfs-class-wakeup       |     76 +
 Documentation/ABI/testing/sysfs-class-watchdog     |    129 +
 Documentation/ABI/testing/sysfs-class-zram         |     24 +
 Documentation/ABI/testing/sysfs-dev                |     21 +
 Documentation/ABI/testing/sysfs-devices            |     25 +
 Documentation/ABI/testing/sysfs-devices-consumer   |      9 +
 Documentation/ABI/testing/sysfs-devices-coredump   |     10 +
 Documentation/ABI/testing/sysfs-devices-edac       |    157 +
 .../ABI/testing/sysfs-devices-faux-tdx-host        |     26 +
 .../ABI/testing/sysfs-devices-firmware_node        |     17 +
 Documentation/ABI/testing/sysfs-devices-lpss_ltr   |     44 +
 Documentation/ABI/testing/sysfs-devices-mapping    |     62 +
 Documentation/ABI/testing/sysfs-devices-memory     |    120 +
 Documentation/ABI/testing/sysfs-devices-mmc        |     21 +
 Documentation/ABI/testing/sysfs-devices-online     |     20 +
 .../ABI/testing/sysfs-devices-pci-host-bridge      |     45 +
 .../ABI/testing/sysfs-devices-physical_location    |     42 +
 .../ABI/testing/sysfs-devices-platform-ACPI-TAD    |    117 +
 .../testing/sysfs-devices-platform-_UDC_-gadget    |     23 +
 .../ABI/testing/sysfs-devices-platform-docg3       |     40 +
 .../ABI/testing/sysfs-devices-platform-dock        |     39 +
 .../ABI/testing/sysfs-devices-platform-ipmi        |    242 +
 .../testing/sysfs-devices-platform-kunpeng_hccs    |    126 +
 .../sysfs-devices-platform-sh_mobile_lcdc_fb       |     44 +
 .../ABI/testing/sysfs-devices-platform-soc-ipa     |    114 +
 .../testing/sysfs-devices-platform-stratix10-rsu   |    232 +
 .../ABI/testing/sysfs-devices-platform-trackpoint  |    115 +
 Documentation/ABI/testing/sysfs-devices-power      |    307 +
 .../ABI/testing/sysfs-devices-power_resources_D0   |     13 +
 .../ABI/testing/sysfs-devices-power_resources_D1   |     14 +
 .../ABI/testing/sysfs-devices-power_resources_D2   |     14 +
 .../testing/sysfs-devices-power_resources_D3hot    |     14 +
 .../testing/sysfs-devices-power_resources_wakeup   |     13 +
 .../ABI/testing/sysfs-devices-power_state          |     20 +
 .../ABI/testing/sysfs-devices-real_power_state     |     23 +
 Documentation/ABI/testing/sysfs-devices-removable  |     20 +
 .../ABI/testing/sysfs-devices-resource_in_use      |     12 +
 Documentation/ABI/testing/sysfs-devices-soc        |     95 +
 .../ABI/testing/sysfs-devices-software_node        |     10 +
 .../ABI/testing/sysfs-devices-state_synced         |     29 +
 Documentation/ABI/testing/sysfs-devices-sun        |     14 +
 Documentation/ABI/testing/sysfs-devices-supplier   |      9 +
 Documentation/ABI/testing/sysfs-devices-system-cpu |    808 +
 .../ABI/testing/sysfs-devices-system-ibm-rtl       |     24 +
 .../ABI/testing/sysfs-devices-system-xen_cpu       |     20 +
 Documentation/ABI/testing/sysfs-devices-vfio-dev   |      8 +
 .../testing/sysfs-devices-virtual-misc-tdx_guest   |     63 +
 .../ABI/testing/sysfs-devices-waiting_for_supplier |     17 +
 Documentation/ABI/testing/sysfs-devices-xenbus     |     41 +
 Documentation/ABI/testing/sysfs-driver-altera-cvp  |      8 +
 Documentation/ABI/testing/sysfs-driver-amd-sfh     |     13 +
 .../ABI/testing/sysfs-driver-aspeed-uart-routing   |     27 +
 .../ABI/testing/sysfs-driver-bd9571mwv-regulator   |     31 +
 Documentation/ABI/testing/sysfs-driver-ccp         |    120 +
 .../ABI/testing/sysfs-driver-chromeos-acpi         |    152 +
 .../ABI/testing/sysfs-driver-dell-dw5826e-reset    |      9 +
 Documentation/ABI/testing/sysfs-driver-eud         |      9 +
 .../ABI/testing/sysfs-driver-framer-pef2256        |      8 +
 .../ABI/testing/sysfs-driver-fsi-master-gpio       |     10 +
 Documentation/ABI/testing/sysfs-driver-ge-achc     |     15 +
 Documentation/ABI/testing/sysfs-driver-genwqe      |     78 +
 Documentation/ABI/testing/sysfs-driver-habanalabs  |    265 +
 Documentation/ABI/testing/sysfs-driver-hid         |     20 +
 .../ABI/testing/sysfs-driver-hid-appletb-kbd       |     13 +
 Documentation/ABI/testing/sysfs-driver-hid-corsair |     15 +
 .../ABI/testing/sysfs-driver-hid-corsair-void      |     38 +
 Documentation/ABI/testing/sysfs-driver-hid-lenovo  |     60 +
 .../ABI/testing/sysfs-driver-hid-lenovo-go         |    724 +
 .../ABI/testing/sysfs-driver-hid-lenovo-go-s       |    304 +
 .../ABI/testing/sysfs-driver-hid-logitech-hidpp    |     19 +
 .../ABI/testing/sysfs-driver-hid-logitech-lg4ff    |     75 +
 .../ABI/testing/sysfs-driver-hid-multitouch        |      9 +
 Documentation/ABI/testing/sysfs-driver-hid-ntrig   |     73 +
 Documentation/ABI/testing/sysfs-driver-hid-picolcd |     43 +
 .../ABI/testing/sysfs-driver-hid-prodikeys         |     29 +
 .../ABI/testing/sysfs-driver-hid-roccat-kone       |    125 +
 Documentation/ABI/testing/sysfs-driver-hid-srws1   |     21 +
 Documentation/ABI/testing/sysfs-driver-hid-wiimote |     85 +
 .../ABI/testing/sysfs-driver-input-axp-pek         |     11 +
 .../ABI/testing/sysfs-driver-input-cros-ec-keyb    |      6 +
 .../ABI/testing/sysfs-driver-input-exc3000         |     26 +
 Documentation/ABI/testing/sysfs-driver-intc_sar    |     54 +
 .../ABI/testing/sysfs-driver-intel-i915-hwmon      |     93 +
 .../ABI/testing/sysfs-driver-intel-m10-bmc         |     36 +
 .../testing/sysfs-driver-intel-m10-bmc-sec-update  |     61 +
 .../ABI/testing/sysfs-driver-intel-rapid-start     |     21 +
 .../ABI/testing/sysfs-driver-intel-xe-hwmon        |    315 +
 .../ABI/testing/sysfs-driver-intel-xe-ras          |     30 +
 .../ABI/testing/sysfs-driver-intel-xe-sriov        |    190 +
 Documentation/ABI/testing/sysfs-driver-intel_sdsi  |     90 +
 Documentation/ABI/testing/sysfs-driver-ivpu        |     65 +
 .../ABI/testing/sysfs-driver-jz4780-efuse          |     20 +
 .../ABI/testing/sysfs-driver-lenovo-yb9-kbdock     |     19 +
 .../ABI/testing/sysfs-driver-panfrost-profiling    |     10 +
 .../ABI/testing/sysfs-driver-panthor-profiling     |     10 +
 Documentation/ABI/testing/sysfs-driver-pciback     |     28 +
 Documentation/ABI/testing/sysfs-driver-ppi         |     75 +
 Documentation/ABI/testing/sysfs-driver-qaic        |     18 +
 Documentation/ABI/testing/sysfs-driver-qat         |    167 +
 Documentation/ABI/testing/sysfs-driver-qat_kpt     |     97 +
 Documentation/ABI/testing/sysfs-driver-qat_ras     |     41 +
 Documentation/ABI/testing/sysfs-driver-qat_rl      |    226 +
 Documentation/ABI/testing/sysfs-driver-qat_svn     |    114 +
 .../ABI/testing/sysfs-driver-samsung-laptop        |     37 +
 Documentation/ABI/testing/sysfs-driver-spi-intel   |     20 +
 Documentation/ABI/testing/sysfs-driver-st          |     12 +
 Documentation/ABI/testing/sysfs-driver-tegra-fuse  |     11 +
 .../ABI/testing/sysfs-driver-toshiba_acpi          |    223 +
 .../ABI/testing/sysfs-driver-toshiba_haps          |     22 +
 .../ABI/testing/sysfs-driver-typec-displayport     |     74 +
 Documentation/ABI/testing/sysfs-driver-uacce       |     57 +
 Documentation/ABI/testing/sysfs-driver-ucsi-ccg    |      6 +
 Documentation/ABI/testing/sysfs-driver-ufs         |   1793 +
 .../ABI/testing/sysfs-driver-uio_pci_sva-pasid     |     29 +
 .../ABI/testing/sysfs-driver-uniwill-laptop        |    105 +
 Documentation/ABI/testing/sysfs-driver-w1_ds28e17  |     24 +
 Documentation/ABI/testing/sysfs-driver-w1_therm    |    190 +
 Documentation/ABI/testing/sysfs-driver-wacom       |    105 +
 Documentation/ABI/testing/sysfs-driver-xdata       |     49 +
 Documentation/ABI/testing/sysfs-driver-xen-blkback |     46 +
 .../ABI/testing/sysfs-driver-xen-blkfront          |     19 +
 .../ABI/testing/sysfs-driver-xilinx-tmr-manager    |     16 +
 Documentation/ABI/testing/sysfs-driver-zynqmp-fpga |     73 +
 Documentation/ABI/testing/sysfs-edac-ecs           |     74 +
 Documentation/ABI/testing/sysfs-edac-memory-repair |    206 +
 Documentation/ABI/testing/sysfs-edac-scrub         |     85 +
 Documentation/ABI/testing/sysfs-firmware-acpi      |    277 +
 .../ABI/testing/sysfs-firmware-dmi-entries         |    114 +
 .../ABI/testing/sysfs-firmware-dmi-tables          |     22 +
 Documentation/ABI/testing/sysfs-firmware-efi       |     45 +
 Documentation/ABI/testing/sysfs-firmware-efi-esrt  |     87 +
 .../ABI/testing/sysfs-firmware-efi-runtime-map     |     36 +
 Documentation/ABI/testing/sysfs-firmware-gsmi      |     58 +
 Documentation/ABI/testing/sysfs-firmware-initrd    |      8 +
 .../ABI/testing/sysfs-firmware-lefi-boardinfo      |     35 +
 Documentation/ABI/testing/sysfs-firmware-log       |      7 +
 Documentation/ABI/testing/sysfs-firmware-memmap    |     75 +
 Documentation/ABI/testing/sysfs-firmware-ofw       |     52 +
 .../ABI/testing/sysfs-firmware-opal-powercap       |     31 +
 Documentation/ABI/testing/sysfs-firmware-opal-psr  |     18 +
 .../ABI/testing/sysfs-firmware-opal-sensor-groups  |     21 +
 .../testing/sysfs-firmware-papr-energy-scale-info  |     29 +
 Documentation/ABI/testing/sysfs-firmware-plpks     |     58 +
 .../ABI/testing/sysfs-firmware-qemu_fw_cfg         |    103 +
 .../ABI/testing/sysfs-firmware-sev-vulnerabilities |     19 +
 Documentation/ABI/testing/sysfs-firmware-sgi_uv    |    159 +
 .../ABI/testing/sysfs-firmware-turris-mox-rwtm     |     28 +
 Documentation/ABI/testing/sysfs-fs-erofs           |     49 +
 Documentation/ABI/testing/sysfs-fs-ext4            |    118 +
 Documentation/ABI/testing/sysfs-fs-f2fs            |   1022 +
 Documentation/ABI/testing/sysfs-fs-nilfs2          |    269 +
 Documentation/ABI/testing/sysfs-fs-ubifs           |     35 +
 Documentation/ABI/testing/sysfs-fs-virtiofs        |     11 +
 Documentation/ABI/testing/sysfs-fs-xfs             |     37 +
 Documentation/ABI/testing/sysfs-hypervisor-xen     |     46 +
 Documentation/ABI/testing/sysfs-ibft               |     33 +
 .../ABI/testing/sysfs-kernel-address_bits          |     10 +
 Documentation/ABI/testing/sysfs-kernel-boot_params |     39 +
 Documentation/ABI/testing/sysfs-kernel-btf         |     25 +
 .../ABI/testing/sysfs-kernel-cpu_byteorder         |     12 +
 Documentation/ABI/testing/sysfs-kernel-fadump      |     59 +
 Documentation/ABI/testing/sysfs-kernel-fscaps      |      8 +
 .../ABI/testing/sysfs-kernel-hardlockup_count      |      7 +
 .../ABI/testing/sysfs-kernel-iommu_groups          |     64 +
 Documentation/ABI/testing/sysfs-kernel-irq         |     60 +
 Documentation/ABI/testing/sysfs-kernel-kexec-kdump |     61 +
 Documentation/ABI/testing/sysfs-kernel-livepatch   |     95 +
 Documentation/ABI/testing/sysfs-kernel-mm          |      6 +
 Documentation/ABI/testing/sysfs-kernel-mm-cma      |     44 +
 Documentation/ABI/testing/sysfs-kernel-mm-damon    |    664 +
 .../ABI/testing/sysfs-kernel-mm-hugepages          |     17 +
 Documentation/ABI/testing/sysfs-kernel-mm-ksm      |     61 +
 .../ABI/testing/sysfs-kernel-mm-memory-tiers       |     25 +
 .../ABI/testing/sysfs-kernel-mm-mempolicy          |      4 +
 .../sysfs-kernel-mm-mempolicy-weighted-interleave  |     54 +
 Documentation/ABI/testing/sysfs-kernel-mm-numa     |     28 +
 Documentation/ABI/testing/sysfs-kernel-mm-swap     |     16 +
 .../testing/sysfs-kernel-mm-transparent-hugepage   |     18 +
 Documentation/ABI/testing/sysfs-kernel-oops_count  |      6 +
 .../ABI/testing/sysfs-kernel-rcu_stall_count       |      6 +
 Documentation/ABI/testing/sysfs-kernel-reboot      |     40 +
 Documentation/ABI/testing/sysfs-kernel-slab        |    526 +
 .../ABI/testing/sysfs-kernel-softlockup_count      |      7 +
 Documentation/ABI/testing/sysfs-kernel-vmcoreinfo  |     14 +
 Documentation/ABI/testing/sysfs-kernel-warn_count  |      6 +
 Documentation/ABI/testing/sysfs-mce                |     97 +
 .../ABI/testing/sysfs-memory-page-offline          |     44 +
 Documentation/ABI/testing/sysfs-module             |     84 +
 Documentation/ABI/testing/sysfs-nvmem-cells        |     21 +
 Documentation/ABI/testing/sysfs-ocfs2              |     89 +
 .../ABI/testing/sysfs-platform-alienware-wmi       |     14 +
 .../ABI/testing/sysfs-platform-asus-laptop         |     71 +
 Documentation/ABI/testing/sysfs-platform-asus-wmi  |    240 +
 Documentation/ABI/testing/sysfs-platform-at91      |     27 +
 Documentation/ABI/testing/sysfs-platform-ayaneo-ec |     19 +
 .../ABI/testing/sysfs-platform-brcmstb-gisb-arb    |      8 +
 .../ABI/testing/sysfs-platform-brcmstb-memc        |     15 +
 .../ABI/testing/sysfs-platform-chipidea-usb-otg    |     56 +
 .../ABI/testing/sysfs-platform-chipidea-usb2       |      9 +
 .../ABI/testing/sysfs-platform-dell-laptop         |     73 +
 .../ABI/testing/sysfs-platform-dell-privacy-wmi    |     71 +
 .../ABI/testing/sysfs-platform-dell-smbios         |     21 +
 .../ABI/testing/sysfs-platform-dell-wmi-ddv        |      9 +
 Documentation/ABI/testing/sysfs-platform-dfl-fme   |    246 +
 Documentation/ABI/testing/sysfs-platform-dfl-port  |    101 +
 Documentation/ABI/testing/sysfs-platform-dptf      |    157 +
 .../ABI/testing/sysfs-platform-eeepc-laptop        |     56 +
 Documentation/ABI/testing/sysfs-platform-hidma     |      9 +
 .../ABI/testing/sysfs-platform-hidma-mgmt          |     97 +
 .../ABI/testing/sysfs-platform-i2c-demux-pinctrl   |     18 +
 .../ABI/testing/sysfs-platform-ideapad-laptop      |     52 +
 Documentation/ABI/testing/sysfs-platform-intel-ifs |     52 +
 Documentation/ABI/testing/sysfs-platform-intel-pmc |     22 +
 .../testing/sysfs-platform-intel-wmi-sbl-fw-update |     13 +
 .../testing/sysfs-platform-intel-wmi-thunderbolt   |     12 +
 Documentation/ABI/testing/sysfs-platform-kim       |     49 +
 Documentation/ABI/testing/sysfs-platform-lg-laptop |     36 +
 .../ABI/testing/sysfs-platform-mellanox-bootctl    |    162 +
 .../ABI/testing/sysfs-platform-mellanox-pmc        |     64 +
 .../ABI/testing/sysfs-platform-msi-laptop          |     83 +
 Documentation/ABI/testing/sysfs-platform-oxp       |     25 +
 .../ABI/testing/sysfs-platform-phy-rcar-gen3-usb2  |     17 +
 .../ABI/testing/sysfs-platform-power-on-reason     |     12 +
 .../ABI/testing/sysfs-platform-renesas_usb3        |     17 +
 Documentation/ABI/testing/sysfs-platform-silicom   |     30 +
 Documentation/ABI/testing/sysfs-platform-sst-atom  |     26 +
 Documentation/ABI/testing/sysfs-platform-tahvo-usb |     16 +
 Documentation/ABI/testing/sysfs-platform-ts5500    |     54 +
 .../ABI/testing/sysfs-platform-twl4030-usb         |      8 +
 .../ABI/testing/sysfs-platform-usbip-vudc          |     38 +
 Documentation/ABI/testing/sysfs-platform-wilco-ec  |     58 +
 Documentation/ABI/testing/sysfs-platform_profile   |     40 +
 Documentation/ABI/testing/sysfs-power              |    472 +
 Documentation/ABI/testing/sysfs-pps                |     73 +
 Documentation/ABI/testing/sysfs-pps-gen            |     43 +
 Documentation/ABI/testing/sysfs-pps-gen-tio        |      6 +
 Documentation/ABI/testing/sysfs-profiling          |     13 +
 Documentation/ABI/testing/sysfs-ptp                |    142 +
 Documentation/ABI/testing/sysfs-secvar             |     65 +
 Documentation/ABI/testing/sysfs-timecard           |    293 +
 Documentation/ABI/testing/sysfs-tty                |    166 +
 Documentation/ABI/testing/sysfs-uevent             |     51 +
 Documentation/ABI/testing/usb-charger-uevent       |     54 +
 Documentation/ABI/testing/usb-uevent               |     27 +
 Documentation/Changes                              |      1 +
 Documentation/CodingStyle                          |      1 +
 Documentation/Kconfig                              |     28 +
 Documentation/Makefile                             |    115 +
 Documentation/PCI/acpi-info.rst                    |    192 +
 Documentation/PCI/boot-interrupts.rst              |    159 +
 Documentation/PCI/controller/index.rst             |     11 +
 .../PCI/controller/pci-controller-drivers.rst      |    402 +
 .../PCI/controller/rcar-pcie-firmware.rst          |     32 +
 .../PCI/endpoint/function/binding/pci-ntb.rst      |     38 +
 .../PCI/endpoint/function/binding/pci-test.rst     |     26 +
 Documentation/PCI/endpoint/index.rst               |     21 +
 Documentation/PCI/endpoint/pci-endpoint-cfs.rst    |    138 +
 Documentation/PCI/endpoint/pci-endpoint.rst        |    283 +
 Documentation/PCI/endpoint/pci-ntb-function.rst    |    348 +
 Documentation/PCI/endpoint/pci-ntb-howto.rst       |    158 +
 Documentation/PCI/endpoint/pci-nvme-function.rst   |     13 +
 Documentation/PCI/endpoint/pci-test-function.rst   |    103 +
 Documentation/PCI/endpoint/pci-test-howto.rst      |    239 +
 Documentation/PCI/endpoint/pci-vntb-function.rst   |    129 +
 Documentation/PCI/endpoint/pci-vntb-howto.rst      |    169 +
 Documentation/PCI/index.rst                        |     22 +
 Documentation/PCI/msi-howto.rst                    |    300 +
 Documentation/PCI/pci-error-recovery.rst           |    471 +
 Documentation/PCI/pci-iov-howto.rst                |    171 +
 Documentation/PCI/pci.rst                          |    578 +
 Documentation/PCI/pcieaer-howto.rst                |    267 +
 Documentation/PCI/pciebus-howto.rst                |    228 +
 Documentation/PCI/sysfs-pci.rst                    |    138 +
 Documentation/PCI/tph.rst                          |    132 +
 .../Design/Data-Structures/BigTreeClassicRCU.svg   |    474 +
 .../BigTreePreemptRCUBHdyntickCB.svg               |    662 +
 .../RCU/Design/Data-Structures/Data-Structures.rst |   1196 +
 .../Design/Data-Structures/HugeTreeClassicRCU.svg  |    939 +
 .../RCU/Design/Data-Structures/TreeLevel.svg       |    828 +
 .../RCU/Design/Data-Structures/TreeMapping.svg     |    305 +
 .../Design/Data-Structures/TreeMappingLevel.svg    |    380 +
 .../RCU/Design/Data-Structures/blkd_task.svg       |    631 +
 .../RCU/Design/Data-Structures/nxtlist.svg         |    386 +
 .../Design/Expedited-Grace-Periods/ExpRCUFlow.svg  |    830 +
 .../Expedited-Grace-Periods/ExpSchedFlow.svg       |    830 +
 .../Expedited-Grace-Periods.rst                    |    521 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel0.svg |    275 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel1.svg |    275 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel2.svg |    287 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel3.svg |    323 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel4.svg |    323 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel5.svg |    335 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel6.svg |    335 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel7.svg |    347 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel8.svg |    311 +
 .../Memory-Ordering/Tree-RCU-Memory-Ordering.rst   |    648 +
 .../TreeRCU-callback-invocation.svg                |    486 +
 .../Memory-Ordering/TreeRCU-callback-registry.svg  |    646 +
 .../RCU/Design/Memory-Ordering/TreeRCU-dyntick.svg |    700 +
 .../Design/Memory-Ordering/TreeRCU-gp-cleanup.svg  |   1133 +
 .../RCU/Design/Memory-Ordering/TreeRCU-gp-fqs.svg  |   1309 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-1.svg   |    658 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-2.svg   |    656 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-3.svg   |    636 +
 .../RCU/Design/Memory-Ordering/TreeRCU-gp.svg      |   5135 +
 .../RCU/Design/Memory-Ordering/TreeRCU-hotplug.svg |    775 +
 .../RCU/Design/Memory-Ordering/TreeRCU-qs.svg      |   1095 +
 .../RCU/Design/Memory-Ordering/rcu_node-lock.svg   |    229 +
 .../Design/Requirements/GPpartitionReaders1.svg    |    374 +
 .../Design/Requirements/ReadersPartitionGP1.svg    |    639 +
 .../RCU/Design/Requirements/Requirements.rst       |   2873 +
 Documentation/RCU/NMI-RCU.rst                      |    123 +
 Documentation/RCU/RTFP.txt                         |   2812 +
 Documentation/RCU/UP.rst                           |    152 +
 Documentation/RCU/checklist.rst                    |    556 +
 Documentation/RCU/index.rst                        |     30 +
 Documentation/RCU/listRCU.rst                      |    511 +
 Documentation/RCU/lockdep-splat.rst                |    115 +
 Documentation/RCU/lockdep.rst                      |    119 +
 Documentation/RCU/rcu.rst                          |     93 +
 Documentation/RCU/rcu_dereference.rst              |    502 +
 Documentation/RCU/rcubarrier.rst                   |    377 +
 Documentation/RCU/rculist_nulls.rst                |    215 +
 Documentation/RCU/rcuref.rst                       |    158 +
 Documentation/RCU/stallwarn.rst                    |    491 +
 Documentation/RCU/torture.rst                      |    374 +
 Documentation/RCU/whatisRCU.rst                    |   1415 +
 Documentation/SubmittingPatches                    |      1 +
 Documentation/accel/amdxdna/amdnpu.rst             |    306 +
 Documentation/accel/amdxdna/index.rst              |     11 +
 Documentation/accel/index.rst                      |     13 +
 Documentation/accel/introduction.rst               |    110 +
 Documentation/accel/qaic/aic080.rst                |     14 +
 Documentation/accel/qaic/aic100.rst                |    538 +
 Documentation/accel/qaic/index.rst                 |     14 +
 Documentation/accel/qaic/qaic.rst                  |    209 +
 Documentation/accel/rocket/index.rst               |     19 +
 Documentation/accounting/cgroupstats.rst           |     31 +
 Documentation/accounting/delay-accounting.rst      |    214 +
 Documentation/accounting/index.rst                 |     14 +
 Documentation/accounting/psi.rst                   |    188 +
 Documentation/accounting/taskstats-struct.rst      |    199 +
 Documentation/accounting/taskstats.rst             |    182 +
 Documentation/admin-guide/LSM/LoadPin.rst          |     31 +
 Documentation/admin-guide/LSM/SELinux.rst          |     44 +
 Documentation/admin-guide/LSM/SafeSetID.rst        |    118 +
 Documentation/admin-guide/LSM/Smack.rst            |    871 +
 Documentation/admin-guide/LSM/Yama.rst             |     75 +
 Documentation/admin-guide/LSM/apparmor.rst         |     54 +
 Documentation/admin-guide/LSM/index.rst            |     51 +
 Documentation/admin-guide/LSM/ipe.rst              |    835 +
 Documentation/admin-guide/LSM/landlock.rst         |    298 +
 Documentation/admin-guide/LSM/tomoyo.rst           |     52 +
 .../admin-guide/RAS/address-translation.rst        |     24 +
 Documentation/admin-guide/RAS/error-decoding.rst   |     21 +
 Documentation/admin-guide/RAS/index.rst            |      7 +
 Documentation/admin-guide/RAS/main.rst             |   1087 +
 Documentation/admin-guide/README.rst               |    360 +
 Documentation/admin-guide/abi-obsolete-files.rst   |      7 +
 Documentation/admin-guide/abi-obsolete.rst         |     13 +
 Documentation/admin-guide/abi-removed-files.rst    |      7 +
 Documentation/admin-guide/abi-removed.rst          |      7 +
 Documentation/admin-guide/abi-stable-files.rst     |      7 +
 Documentation/admin-guide/abi-stable.rst           |     16 +
 Documentation/admin-guide/abi-testing-files.rst    |      7 +
 Documentation/admin-guide/abi-testing.rst          |     22 +
 Documentation/admin-guide/abi.rst                  |     29 +
 Documentation/admin-guide/acpi/cppc_sysfs.rst      |     78 +
 .../admin-guide/acpi/fan_performance_states.rst    |     90 +
 Documentation/admin-guide/acpi/index.rst           |     14 +
 .../admin-guide/acpi/initrd_table_override.rst     |    115 +
 Documentation/admin-guide/acpi/ssdt-overlays.rst   |    181 +
 Documentation/admin-guide/aoe/aoe.rst              |    150 +
 Documentation/admin-guide/aoe/autoload.sh          |     17 +
 Documentation/admin-guide/aoe/examples.rst         |     23 +
 Documentation/admin-guide/aoe/index.rst            |     10 +
 Documentation/admin-guide/aoe/status.sh            |     30 +
 Documentation/admin-guide/aoe/todo.rst             |     17 +
 Documentation/admin-guide/aoe/udev-install.sh      |     33 +
 Documentation/admin-guide/aoe/udev.txt             |     26 +
 .../admin-guide/auxdisplay/cfag12864b.rst          |     98 +
 Documentation/admin-guide/auxdisplay/index.rst     |      9 +
 Documentation/admin-guide/auxdisplay/ks0108.rst    |     50 +
 Documentation/admin-guide/bcache.rst               |    644 +
 Documentation/admin-guide/binderfs.rst             |     87 +
 Documentation/admin-guide/binfmt-misc.rst          |    391 +
 .../blockdev/drbd/DRBD-8.3-data-packets.svg        |    588 +
 .../blockdev/drbd/DRBD-data-packets.svg            |    459 +
 .../admin-guide/blockdev/drbd/conn-states-8.dot    |     18 +
 .../blockdev/drbd/data-structure-v9.rst            |     42 +
 .../admin-guide/blockdev/drbd/disk-states-8.dot    |     16 +
 .../drbd/drbd-connection-state-overview.dot        |     85 +
 .../admin-guide/blockdev/drbd/figures.rst          |     30 +
 Documentation/admin-guide/blockdev/drbd/index.rst  |     19 +
 .../admin-guide/blockdev/drbd/peer-states-8.dot    |      8 +
 Documentation/admin-guide/blockdev/floppy.rst      |    255 +
 Documentation/admin-guide/blockdev/index.rst       |     17 +
 Documentation/admin-guide/blockdev/nbd.rst         |     31 +
 Documentation/admin-guide/blockdev/paride.rst      |    207 +
 Documentation/admin-guide/blockdev/ramdisk.rst     |    153 +
 Documentation/admin-guide/blockdev/zoned_loop.rst  |    191 +
 Documentation/admin-guide/blockdev/zram.rst        |    610 +
 Documentation/admin-guide/bootconfig.rst           |    416 +
 Documentation/admin-guide/braille-console.rst      |     38 +
 Documentation/admin-guide/btmrvl.rst               |    124 +
 Documentation/admin-guide/bug-bisect.rst           |    165 +
 Documentation/admin-guide/bug-hunting.rst          |    370 +
 .../admin-guide/cgroup-v1/blkio-controller.rst     |    301 +
 Documentation/admin-guide/cgroup-v1/cgroups.rst    |    697 +
 Documentation/admin-guide/cgroup-v1/cpuacct.rst    |     50 +
 Documentation/admin-guide/cgroup-v1/cpusets.rst    |    874 +
 Documentation/admin-guide/cgroup-v1/devices.rst    |    132 +
 .../admin-guide/cgroup-v1/freezer-subsystem.rst    |    131 +
 Documentation/admin-guide/cgroup-v1/hugetlb.rst    |    139 +
 Documentation/admin-guide/cgroup-v1/index.rst      |     24 +
 Documentation/admin-guide/cgroup-v1/memcg_test.rst |    342 +
 Documentation/admin-guide/cgroup-v1/memory.rst     |    926 +
 Documentation/admin-guide/cgroup-v1/misc.rst       |      4 +
 Documentation/admin-guide/cgroup-v1/net_cls.rst    |     44 +
 Documentation/admin-guide/cgroup-v1/net_prio.rst   |     57 +
 Documentation/admin-guide/cgroup-v1/pids.rst       |     93 +
 Documentation/admin-guide/cgroup-v1/rdma.rst       |    191 +
 Documentation/admin-guide/cgroup-v2.rst            |   3581 +
 Documentation/admin-guide/cifs/authors.rst         |     69 +
 Documentation/admin-guide/cifs/changes.rst         |      9 +
 Documentation/admin-guide/cifs/index.rst           |     14 +
 Documentation/admin-guide/cifs/introduction.rst    |     53 +
 Documentation/admin-guide/cifs/todo.rst            |    133 +
 Documentation/admin-guide/cifs/usage.rst           |    864 +
 Documentation/admin-guide/cifs/winucase_convert.pl |     62 +
 Documentation/admin-guide/clearing-warn-once.rst   |      9 +
 Documentation/admin-guide/cpu-isolation.rst        |    357 +
 Documentation/admin-guide/cpu-load.rst             |    117 +
 Documentation/admin-guide/cputopology.rst          |    101 +
 Documentation/admin-guide/dell_rbu.rst             |    128 +
 .../admin-guide/device-mapper/cache-policies.rst   |    131 +
 Documentation/admin-guide/device-mapper/cache.rst  |    337 +
 Documentation/admin-guide/device-mapper/delay.rst  |     54 +
 .../admin-guide/device-mapper/dm-clone.rst         |    333 +
 .../admin-guide/device-mapper/dm-crypt.rst         |    212 +
 .../admin-guide/device-mapper/dm-dust.rst          |    305 +
 Documentation/admin-guide/device-mapper/dm-ebs.rst |     51 +
 .../admin-guide/device-mapper/dm-flakey.rst        |     88 +
 Documentation/admin-guide/device-mapper/dm-ima.rst |    718 +
 .../admin-guide/device-mapper/dm-init.rst          |    133 +
 .../admin-guide/device-mapper/dm-inlinecrypt.rst   |    129 +
 .../admin-guide/device-mapper/dm-integrity.rst     |    321 +
 Documentation/admin-guide/device-mapper/dm-io.rst  |     75 +
 Documentation/admin-guide/device-mapper/dm-log.rst |     57 +
 .../admin-guide/device-mapper/dm-pcache.rst        |    202 +
 .../admin-guide/device-mapper/dm-queue-length.rst  |     48 +
 .../admin-guide/device-mapper/dm-raid.rst          |    489 +
 .../admin-guide/device-mapper/dm-service-time.rst  |    101 +
 .../admin-guide/device-mapper/dm-uevent.rst        |    110 +
 .../admin-guide/device-mapper/dm-zoned.rst         |    194 +
 Documentation/admin-guide/device-mapper/era.rst    |    116 +
 Documentation/admin-guide/device-mapper/index.rst  |     43 +
 Documentation/admin-guide/device-mapper/kcopyd.rst |     47 +
 Documentation/admin-guide/device-mapper/linear.rst |     63 +
 .../admin-guide/device-mapper/log-writes.rst       |    145 +
 .../admin-guide/device-mapper/persistent-data.rst  |     88 +
 .../admin-guide/device-mapper/snapshot.rst         |    196 +
 .../admin-guide/device-mapper/statistics.rst       |    225 +
 .../admin-guide/device-mapper/striped.rst          |     61 +
 Documentation/admin-guide/device-mapper/switch.rst |    141 +
 .../device-mapper/thin-provisioning.rst            |    427 +
 .../admin-guide/device-mapper/unstriped.rst        |    135 +
 .../admin-guide/device-mapper/vdo-design.rst       |    633 +
 Documentation/admin-guide/device-mapper/vdo.rst    |    413 +
 Documentation/admin-guide/device-mapper/verity.rst |    349 +
 .../admin-guide/device-mapper/writecache.rst       |    114 +
 Documentation/admin-guide/device-mapper/zero.rst   |     37 +
 Documentation/admin-guide/devices.rst              |    270 +
 Documentation/admin-guide/devices.txt              |   3081 +
 Documentation/admin-guide/dynamic-debug-howto.rst  |    392 +
 Documentation/admin-guide/edid.rst                 |     27 +
 Documentation/admin-guide/efi-stub.rst             |    103 +
 Documentation/admin-guide/ext4.rst                 |    611 +
 Documentation/admin-guide/features.rst             |      3 +
 .../admin-guide/filesystem-monitoring.rst          |     78 +
 Documentation/admin-guide/gpio/gpio-aggregator.rst |    218 +
 Documentation/admin-guide/gpio/gpio-mockup.rst     |     59 +
 Documentation/admin-guide/gpio/gpio-sim.rst        |    137 +
 Documentation/admin-guide/gpio/gpio-virtuser.rst   |    177 +
 Documentation/admin-guide/gpio/index.rst           |     14 +
 Documentation/admin-guide/gpio/obsolete.rst        |     13 +
 .../admin-guide/hw-vuln/attack_vector_controls.rst |    236 +
 .../admin-guide/hw-vuln/core-scheduling.rst        |    226 +
 .../admin-guide/hw-vuln/cross-thread-rsb.rst       |     91 +
 .../admin-guide/hw-vuln/gather_data_sampling.rst   |    109 +
 Documentation/admin-guide/hw-vuln/index.rst        |     29 +
 .../hw-vuln/indirect-target-selection.rst          |    168 +
 Documentation/admin-guide/hw-vuln/l1d_flush.rst    |     69 +
 Documentation/admin-guide/hw-vuln/l1tf.rst         |    615 +
 Documentation/admin-guide/hw-vuln/mds.rst          |    303 +
 Documentation/admin-guide/hw-vuln/multihit.rst     |    167 +
 .../admin-guide/hw-vuln/old_microcode.rst          |     21 +
 .../hw-vuln/processor_mmio_stale_data.rst          |    269 +
 .../admin-guide/hw-vuln/reg-file-data-sampling.rst |     96 +
 Documentation/admin-guide/hw-vuln/rsb.rst          |    268 +
 .../special-register-buffer-data-sampling.rst      |    150 +
 Documentation/admin-guide/hw-vuln/spectre.rst      |    725 +
 Documentation/admin-guide/hw-vuln/srso.rst         |    242 +
 .../admin-guide/hw-vuln/tsx_async_abort.rst        |    270 +
 Documentation/admin-guide/hw-vuln/vmscape.rst      |    110 +
 Documentation/admin-guide/hw_random.rst            |    104 +
 Documentation/admin-guide/index.rst                |    192 +
 Documentation/admin-guide/init.rst                 |     48 +
 Documentation/admin-guide/initrd.rst               |    383 +
 Documentation/admin-guide/iostats.rst              |    187 +
 Documentation/admin-guide/java.rst                 |    423 +
 Documentation/admin-guide/jfs.rst                  |     66 +
 Documentation/admin-guide/kdump/gdbmacros.txt      |    323 +
 Documentation/admin-guide/kdump/index.rst          |     13 +
 Documentation/admin-guide/kdump/kdump.rst          |    612 +
 Documentation/admin-guide/kdump/vmcoreinfo.rst     |    596 +
 Documentation/admin-guide/kernel-parameters.rst    |    135 +
 Documentation/admin-guide/kernel-parameters.txt    |   8709 +
 .../admin-guide/kernel-per-CPU-kthreads.rst        |    325 +
 .../admin-guide/laptops/alienware-wmi.rst          |    127 +
 Documentation/admin-guide/laptops/asus-laptop.rst  |    271 +
 .../admin-guide/laptops/disk-shock-protection.rst  |    151 +
 Documentation/admin-guide/laptops/index.rst        |     19 +
 Documentation/admin-guide/laptops/lg-laptop.rst    |     82 +
 .../admin-guide/laptops/samsung-galaxybook.rst     |    174 +
 Documentation/admin-guide/laptops/sony-laptop.rst  |    174 +
[Output truncated: showing 1000 of 96042 lines]]

269/4 2026/09/17 11:20 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 37870
							output: 37
							thoughts: 137
						

Thoughts:
**Analyzing the NTFS3 File Attribute Update Race Condition**

Okay, so the repository only has a single commit, which is completely expected for this situation. No need to dig further into the history. Now, let's get down to the core of the problem the user is outlining. They want a patch for `ntfs_setattr` within `fs/ntfs3/file.c` to resolve a race condition between `truncate_setsize` and `ntfs_set_size`. The proposed solution involves using `filemap_invalidate_lock(inode->i_mapping)` and reordering those two functions. Got it. So, my next step is clear: I need to go read the `fs/ntfs3/file.c` file and specifically focus on the `ntfs_setattr` function, and see how these components currently interact within the code. Let's see what's what.



270/4 2026/09/17 11:20 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:700 LineCount:80]

Results:
map[Contents: 700:		return err;
 701:	}
 702:	
 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
 770:		if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE))
 771:			ntfs_save_wsl_perm(inode, NULL);
 772:		mark_inode_dirty(inode);
 773:	out:
 774:		return err;
 775:	}
 776:	
 777:	/*
 778:	 * check_read_restriction:
 779:	 * common code for ntfs_file_read_iter and ntfs_file_splice_read
]

271/4 2026/09/17 11:20 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 39392
							output: 36
							thoughts: 451
						

Thoughts:
**Analyzing the NTFS Attribute Setting Process**

Okay, let's break this down. I'm looking at `ntfs_setattr` in the new `ntfs3` driver, specifically the section dealing with size changes. My immediate thought is, "Huh, this looks familiar; let's see where the potential race condition might be." The code checks for `ATTR_SIZE` in `ia_valid`, handles what seems to be a compressed file (though it shouldn't be here), and then gets to the core logic. I see we have `oldsize` and `newsize`, and if they differ, the code calls `truncate_setsize` followed by `ntfs_set_size`.

But wait, the prompt mentions a race condition between these two functions! That's the key. My brain's already starting to churn. They're asking to fix the race condition in `ntfs_setattr` by using `filemap_invalidate_lock(inode->i_mapping)` and reordering `truncate_setsize` and `ntfs_set_size` correctly. Okay, so we likely have a scenario where the file metadata might be inconsistent if a concurrent operation interferes between the truncation and the NTFS-specific size update. 

Right, let me step back and think. What's the standard VFS behavior here? How do other filesystems, both *natively* or NTFS, deal with truncating or extending a file? Is there a standard pattern for invalidating the page cache or taking a lock to ensure data consistency? My instincts tell me there is. I need to understand if the current order of execution is the right way to do it. Should the filesystem-specific size update happen before or after the VFS level truncate operation that invalidates the pages?

Alright, let's explore how other filesystems deal with this issue, and compare their solution, the old NTFS implementation or common VFS patterns. I'll read and analyze `fs/ntfs/file.c` around line 279 in the old driver, as well as several other filesystems. That should illuminate the correct approach for `ntfs3`. This looks like a classic race, and I have to be sure I choose the right tools for the job!



272/4 2026/09/17 11:21 tool read-file
0m Args:
map[File:fs/ntfs/file.c FirstLine:265 LineCount:50]

Results:
map[Contents: 265:			return -EOPNOTSUPP;
 266:		}
 267:	
 268:		err = inode_newsize_ok(vi, attr->ia_size);
 269:		if (err)
 270:			return err;
 271:	
 272:		inode_dio_wait(vi);
 273:	
 274:		/*
 275:		 * Serialize with page faults and pagecache instantiation so that
 276:		 * readers cannot observe the size change until the attribute
 277:		 * updates below have completed.
 278:		 */
 279:		filemap_invalidate_lock(vi->i_mapping);
 280:		if (attr->ia_size > old_size) {
 281:			truncate_pagecache(vi, old_size);
 282:			i_size_write(vi, attr->ia_size);
 283:			pagecache_isize_extended(vi, old_size, attr->ia_size);
 284:		} else {
 285:			truncate_setsize(vi, attr->ia_size);
 286:		}
 287:	
 288:		err = ntfs_truncate_vfs(vi, attr->ia_size, old_size);
 289:		if (err)
 290:			i_size_write(vi, old_size);
 291:		filemap_invalidate_unlock(vi->i_mapping);
 292:	
 293:		return err;
 294:	}
 295:	
 296:	/*
 297:	 * ntfs_setattr
 298:	 *
 299:	 * Called from notify_change() when an attribute is being changed.
 300:	 *
 301:	 * NOTE: Changes in inode size are not supported yet for compressed or
 302:	 * encrypted files.
 303:	 */
 304:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 305:			 struct iattr *attr)
 306:	{
 307:		struct inode *vi = d_inode(dentry);
 308:		int err;
 309:		unsigned int ia_valid = attr->ia_valid;
 310:		struct ntfs_inode *ni = NTFS_I(vi);
 311:		struct ntfs_volume *vol = ni->vol;
 312:	
 313:		if (NVolShutdown(vol))
 314:			return -EIO;
]

273/4 2026/09/17 11:21 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 41070
							output: 37
							thoughts: 227
						

Thoughts:
**Analyzing the NTFS Race Condition Patch**

Okay, hold on a second. Before I dive *too* deep into this `ntfs_setattr` fix, I need to take a step back and get a broader perspective. Let me see how other filesystems handle the interplay between `truncate_setsize` and block allocation/truncation during attribute setting. It's easy to get tunnel vision. I've been down that road before.

Right, let me double-check the exact requirements. The prompt wants me to fix a race in `ntfs_setattr` within `fs/ntfs3/file.c`. Specifically, it instructs me to address a race between `truncate_setsize` and `ntfs_set_size` using `filemap_invalidate_lock(inode->i_mapping)` *and* to correctly reorder those two functions. Got it. The wording is precise: *using* the lock and *reordering*. No ambiguity there, which is good.

So, let's look at some examples to understand common patterns. I'm going to quickly scan through implementations like `ext4_setattr`, `f2fs_setattr`, `ext2_setsize`, `udf_setsize`, `btrfs`, and `xfs`. Seeing a range of designs will give me a better understanding of how others approach this issue. First up, let's take a closer look at `ext4_setattr`. I'll start there. That's a solid place to begin for comparison.



274/4 2026/09/17 11:21 tool read-file
0m Args:
map[File:fs/ext4/inode.c FirstLine:6120 LineCount:50]

Results:
map[Contents:6120:				 * Blocks are going to be removed from the inode. Wait
6121:				 * for dio in flight.
6122:				 */
6123:				inode_dio_wait(inode);
6124:			}
6125:	
6126:			filemap_invalidate_lock(inode->i_mapping);
6127:	
6128:			rc = ext4_break_layouts(inode);
6129:			if (rc) {
6130:				filemap_invalidate_unlock(inode->i_mapping);
6131:				goto err_out;
6132:			}
6133:	
6134:			if (attr->ia_size != inode->i_size) {
6135:				/* attach jbd2 jinode for EOF folio tail zeroing */
6136:				if (attr->ia_size & (inode->i_sb->s_blocksize - 1) ||
6137:				    oldsize & (inode->i_sb->s_blocksize - 1)) {
6138:					error = ext4_inode_attach_jinode(inode);
6139:					if (error)
6140:						goto out_mmap_sem;
6141:				}
6142:	
6143:				/*
6144:				 * Update c/mtime and tail zero the EOF folio on
6145:				 * truncate up. ext4_truncate() handles the shrink case
6146:				 * below.
6147:				 */
6148:				if (!shrink) {
6149:					inode_set_mtime_to_ts(inode,
6150:							      inode_set_ctime_current(inode));
6151:					if (oldsize & (inode->i_sb->s_blocksize - 1)) {
6152:						error = ext4_block_zero_eof(inode,
6153:								oldsize, LLONG_MAX);
6154:						if (error)
6155:							goto out_mmap_sem;
6156:					}
6157:				}
6158:	
6159:				handle = ext4_journal_start(inode, EXT4_HT_INODE, 3);
6160:				if (IS_ERR(handle)) {
6161:					error = PTR_ERR(handle);
6162:					goto out_mmap_sem;
6163:				}
6164:				if (ext4_handle_valid(handle) && shrink) {
6165:					error = ext4_orphan_add(handle, inode);
6166:					orphan = 1;
6167:				}
6168:	
6169:				if (shrink)
]

275/4 2026/09/17 11:21 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 42402
							output: 37
							thoughts: 24
						

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

**Diving into ext4_setattr Implementation**

Alright, let's zoom in on the `ext4_setattr` function, specifically the section spanning from roughly line 6170 to 6210. I need to refresh my memory on how this code handles the intricacies of setting file attributes in ext4. I'm particularly interested in the details of that specific block of code as it will give me an insight as to how attributes such as timestamps are set, how the inode is updated, and how any potential errors are handled. I'll be looking for any potential race conditions or locking issues that I may have overlooked previously. This should provide some insight.



276/4 2026/09/17 11:21 tool read-file
0m Args:
map[File:fs/ext4/inode.c FirstLine:6170 LineCount:40]

Results:
map[Contents:6170:					ext4_fc_track_range(handle, inode,
6171:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6172:						inode->i_sb->s_blocksize_bits,
6173:						EXT_MAX_BLOCKS - 1);
6174:				else
6175:					ext4_fc_track_range(
6176:						handle, inode,
6177:						(oldsize > 0 ? oldsize - 1 : oldsize) >>
6178:						inode->i_sb->s_blocksize_bits,
6179:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6180:						inode->i_sb->s_blocksize_bits);
6181:	
6182:				down_write(&EXT4_I(inode)->i_data_sem);
6183:				old_disksize = EXT4_I(inode)->i_disksize;
6184:				EXT4_I(inode)->i_disksize = attr->ia_size;
6185:	
6186:				/*
6187:				 * We have to update i_size under i_data_sem together
6188:				 * with i_disksize to avoid races with writeback code
6189:				 * running ext4_wb_update_i_disksize().
6190:				 */
6191:				if (!error)
6192:					i_size_write(inode, attr->ia_size);
6193:				else
6194:					EXT4_I(inode)->i_disksize = old_disksize;
6195:				up_write(&EXT4_I(inode)->i_data_sem);
6196:				rc = ext4_mark_inode_dirty(handle, inode);
6197:				if (!error)
6198:					error = rc;
6199:				ext4_journal_stop(handle);
6200:				if (error)
6201:					goto out_mmap_sem;
6202:				if (!shrink) {
6203:					pagecache_isize_extended(inode, oldsize,
6204:								 inode->i_size);
6205:				} else if (ext4_should_journal_data(inode)) {
6206:					ext4_wait_for_tail_page_commit(inode);
6207:				}
6208:			}
6209:	
]

277/4 2026/09/17 11:21 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 43305
							output: 36
							thoughts: 32
						

Thoughts:
Here's my take:

**Examining File System Implementations**

Okay, I need to zoom in on how this file system interaction is happening. Before I go too deep down a rabbit hole, let's step back and consider how file operations are managed. I think the best place to start is to look at some well-defined file system implementations. I'm thinking of files like `fs/zonefs/file.c` or perhaps `fs/udf/file.c`. These are likely to provide good examples of how they handle file-specific structures and operations. I need to understand how the lower layers are implemented before I go too much further. I'm expecting to find insights into how different file systems manage file metadata, permissions, and the actual data blocks, because that will allow me to contextualize this situation.



278/4 2026/09/17 11:22 tool read-file
0m Args:
map[File:fs/udf/file.c FirstLine:230 LineCount:40]

Results:
map[Contents: 230:		if ((attr->ia_valid & ATTR_GID) &&
 231:		    UDF_QUERY_FLAG(sb, UDF_FLAG_GID_SET) &&
 232:		    !gid_eq(attr->ia_gid, UDF_SB(sb)->s_gid))
 233:			return -EPERM;
 234:	
 235:		if ((attr->ia_valid & ATTR_SIZE) &&
 236:		    attr->ia_size != i_size_read(inode)) {
 237:			filemap_invalidate_lock(inode->i_mapping);
 238:			error = udf_setsize(inode, attr->ia_size);
 239:			filemap_invalidate_unlock(inode->i_mapping);
 240:			if (error)
 241:				return error;
 242:		}
 243:	
 244:		if (attr->ia_valid & ATTR_MODE)
 245:			udf_update_extra_perms(inode, attr->ia_mode);
 246:	
 247:		setattr_copy(&nop_mnt_idmap, inode, attr);
 248:		mark_inode_dirty(inode);
 249:		if (IS_SYNC(inode))
 250:			sync_inode_metadata(inode, 1);
 251:		return 0;
 252:	}
 253:	
 254:	const struct inode_operations udf_file_inode_operations = {
 255:		.setattr		= udf_setattr,
 256:	};
]

279/4 2026/09/17 11:22 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 43994
							output: 37
							thoughts: 32
						

Thoughts:
Here's my take on the thought process, as if it were my own:

**Diving into the UDF Filesystem**

Okay, time to get my hands dirty with this UDF filesystem code. I need to understand how file sizes are handled, particularly how they're *set*. Let's zero in on `fs/udf/file.c`. That seems like the logical place to start digging. Right, I remember that `udf_setsize` function... Let's check out how exactly `udf_setsize` functions.



280/4 2026/09/17 11:22 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/udf/file.c Name:udf_setsize]

Results:
map[SourceCode:1280:	int udf_setsize(struct inode *inode, loff_t newsize)
1281:	{
1282:		int err = 0;
1283:		struct udf_inode_info *iinfo;
1284:		unsigned int bsize = i_blocksize(inode);
1285:	
1286:		if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
1287:		      S_ISLNK(inode->i_mode)))
1288:			return -EINVAL;
1289:	
1290:		iinfo = UDF_I(inode);
1291:		if (newsize > inode->i_size) {
1292:			if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
1293:				if (bsize >=
1294:				    (udf_file_entry_alloc_offset(inode) + newsize)) {
1295:					down_write(&iinfo->i_data_sem);
1296:					iinfo->i_lenAlloc = newsize;
1297:					up_write(&iinfo->i_data_sem);
1298:					goto set_size;
1299:				}
1300:				err = udf_expand_file_adinicb(inode);
1301:				if (err)
1302:					return err;
1303:			}
1304:			err = udf_extend_file(inode, newsize);
1305:			if (err)
1306:				return err;
1307:	set_size:
1308:			truncate_setsize(inode, newsize);
1309:		} else {
1310:			if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
1311:				down_write(&iinfo->i_data_sem);
1312:				udf_clear_extent_cache(inode);
1313:				memset(iinfo->i_data + iinfo->i_lenEAttr + newsize,
1314:				       0x00, bsize - newsize -
1315:				       udf_file_entry_alloc_offset(inode));
1316:				iinfo->i_lenAlloc = newsize;
1317:				truncate_setsize(inode, newsize);
1318:				up_write(&iinfo->i_data_sem);
1319:				goto update_time;
1320:			}
1321:			err = block_truncate_page(inode->i_mapping, newsize,
1322:						  udf_get_block);
1323:			if (err)
1324:				return err;
1325:			truncate_setsize(inode, newsize);
1326:			down_write(&iinfo->i_data_sem);
1327:			udf_clear_extent_cache(inode);
1328:			err = udf_truncate_extents(inode);
1329:			up_write(&iinfo->i_data_sem);
1330:			if (err)
1331:				return err;
1332:		}
1333:	update_time:
1334:		inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
1335:		mark_inode_dirty(inode);
1336:		return err;
1337:	}
 SourceFile:fs/udf/inode.c]

281/4 2026/09/17 11:22 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 45157
							output: 33
							thoughts: 162
						

Thoughts:
**Analyzing File Size Management in UDF and Beyond**

Okay, hold on a second! I need to really understand the sequence of operations within `udf_setsize`. The order is critical here. When the desired `newsize` is *larger* than the current `inode->i_size`, we extend the file first with `udf_extend_file` and *then* truncate it using `truncate_setsize`. But... what happens when `newsize` is *smaller*? It looks like we call `truncate_setsize` *first*, and then we handle extent truncation with `udf_truncate_extents`.

Hmm, this order discrepancy is making me a little uneasy. I need to get a better handle on the underlying rationale and possible pitfalls. I'm wondering if there are any subtle race conditions at play between these two operations. Maybe this is similar to handling size changes in `ntfs_set_size`.

I should probably broaden my scope. Let me see how other filesystems handle the implications of truncating up versus down. I need to be sure I'm not overlooking a common pattern or a potential vulnerability.

Right, time to dig deeper. I'm going to jump into `truncate_setsize` in mm/truncate.c. I bet it has some valuable insights.



282/4 2026/09/17 11:22 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/truncate.c Name:truncate_setsize]

Results:
map[SourceCode: 803:	/**
 804:	 * truncate_setsize - update inode and pagecache for a new file size
 805:	 * @inode: inode
 806:	 * @newsize: new file size
 807:	 *
 808:	 * truncate_setsize updates i_size and performs pagecache truncation (if
 809:	 * necessary) to @newsize. It will be typically be called from the filesystem's
 810:	 * setattr function when ATTR_SIZE is passed in.
 811:	 *
 812:	 * Must be called with a lock serializing truncates and writes (generally
 813:	 * i_rwsem but e.g. xfs uses a different lock) and before all filesystem
 814:	 * specific block truncation has been performed.
 815:	 */
 816:	void truncate_setsize(struct inode *inode, loff_t newsize)
 817:	{
 818:		loff_t oldsize = inode->i_size;
 819:	
 820:		i_size_write(inode, newsize);
 821:		if (newsize > oldsize)
 822:			pagecache_isize_extended(inode, oldsize, newsize);
 823:		truncate_pagecache(inode, newsize);
 824:	}
 SourceFile:mm/truncate.c]

283/4 2026/09/17 11:22 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 46012
							output: 26
							thoughts: 598
						

Thoughts:
**Analyzing Filesystem Truncation and Extension Logic**

Okay, so I'm looking at this `truncate_setsize` function, and it seems pretty central to how filesystems handle size changes. The comment mentions it updates `i_size` and manages pagecache truncation, typically triggered during a file's `setattr` operation when the size attribute changes. The crucial part is the lock requirement; it needs to serialize truncates and writes, generally with `i_rwsem`, though some filesystems might use their own lock.

My main concern is distinguishing the behavior when the file is shrinking versus when it's growing. I need to be *very* careful about the order of operations. Let's dig in deeper...

Looking at the code, in `truncate_setsize` itself, it updates `i_size` to the `newsize`, then conditionally extends the pagecache if `newsize > oldsize` using `pagecache_isize_extended`, and *then* does the truncation with `truncate_pagecache`.

Aha! Now I see the problem if we're extending. If `truncate_setsize` is called *before* `ntfs_set_size` (the filesystem-specific function), a reader could slip in between `i_size` being updated, but before the disk metadata is allocated and written! That would be a race condition, and a potential file corruption! Or, what if `ntfs_set_size` *fails*? We'd have `i_size` updated, but the underlying blocks wouldn't be allocated.

The current `ntfs3` code, thankfully, seems to handle this: it calls `truncate_setsize` *after* `ntfs_set_size`, which is exactly what I'm concerned about. We need to be able to make sure `ntfs_set_size` *must* be called first when we are growing the file. If extending, we *must* call `ntfs_set_size` before `truncate_setsize`.

However, the logic seems correct when shrinking. If the file is shrunk, the page cache truncation (done by `truncate_setsize`) MUST happen *before* the filesystem block truncation (done by `ntfs_set_size`). This makes sense: unmap and discard the pages *before* freeing the corresponding disk blocks.

Okay, so the order is CRITICAL when extending. But is it always the *same* order, regardless of extension or shrinking? To be sure, I need to check how other filesystems manage this. Let me search the kernel source and look for patterns around the use of `truncate_setsize` to see what practices they follow for both extending and shrinking. This will allow me to ensure we are following best practices, and can ensure the safety and reliability of the implementation.



284/4 2026/09/17 11:23 tool grepper
0m Args:
map[Expression:truncate_setsize PathPrefix:fs/]

Results:
map[Output:fs/9p/vfs_inode.c=1017=static int v9fs_vfs_setattr(struct mnt_idmap *idmap,
--
fs/9p/vfs_inode.c-1081-		 iattr->ia_size != i_size_read(inode)) {
fs/9p/vfs_inode.c:1082:		truncate_setsize(inode, iattr->ia_size);
fs/9p/vfs_inode.c-1083-		netfs_resize_file(netfs_inode(inode), iattr->ia_size, true);
--
fs/9p/vfs_inode_dotl.c=511=int v9fs_vfs_setattr_dotl(struct mnt_idmap *idmap,
--
fs/9p/vfs_inode_dotl.c-576-		 i_size_read(inode)) {
fs/9p/vfs_inode_dotl.c:577:		truncate_setsize(inode, iattr->ia_size);
fs/9p/vfs_inode_dotl.c-578-		netfs_resize_file(netfs_inode(inode), iattr->ia_size, true);
--
fs/adfs/inode.c=302=adfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
--
fs/adfs/inode.c-323-	if (ia_valid & ATTR_SIZE)
fs/adfs/inode.c:324:		truncate_setsize(inode, attr->ia_size);
fs/adfs/inode.c-325-
--
fs/affs/inode.c=216=affs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
--
fs/affs/inode.c-244-
fs/affs/inode.c:245:		truncate_setsize(inode, attr->ia_size);
fs/affs/inode.c-246-		affs_truncate(inode);
--
fs/afs/inode.c=762=int afs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/afs/inode.c-816-		    attr->ia_size > netfs_read_remote_i_size(inode)) {
fs/afs/inode.c:817:			truncate_setsize(inode, attr->ia_size);
fs/afs/inode.c-818-			netfs_resize_file(&vnode->netfs, size, false);
--
fs/aio.c=360=static void put_aio_ring_file(struct kioctx *ctx)
--
fs/aio.c-366-
fs/aio.c:367:		truncate_setsize(inode, 0);
fs/aio.c-368-
--
fs/btrfs/file.c=1526=int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
--
fs/btrfs/file.c-1809- * protect against truncate races as the page could now be beyond EOF.  Because
fs/btrfs/file.c:1810: * truncate_setsize() writes the inode size before removing pages, once we have
fs/btrfs/file.c-1811- * the page lock we can determine safely if the page is beyond EOF. If it is not
--
fs/btrfs/inode.c=5391=static int btrfs_setsize(struct inode *inode, struct iattr *attr)
--
fs/btrfs/inode.c-5460-
fs/btrfs/inode.c:5461:		truncate_setsize(inode, newsize);
fs/btrfs/inode.c-5462-
--
fs/ecryptfs/inode.c=733=static int __ecryptfs_truncate(struct dentry *dentry, const struct iattr *ia)
--
fs/ecryptfs/inode.c-784-	if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) {
fs/ecryptfs/inode.c:785:		truncate_setsize(inode, ia->ia_size);
fs/ecryptfs/inode.c-786-		lower_ia.ia_size = ia->ia_size;
--
fs/ecryptfs/inode.c-804-	}
fs/ecryptfs/inode.c:805:	truncate_setsize(inode, ia->ia_size);
fs/ecryptfs/inode.c-806-	rc = ecryptfs_write_inode_size_to_metadata(inode);
--
fs/exfat/file.c=350=int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/exfat/file.c-415-		inode_dio_wait(inode);
fs/exfat/file.c:416:		truncate_setsize(inode, attr->ia_size);
fs/exfat/file.c-417-
--
fs/exfat/file.c=754=static int exfat_extend_valid_size(struct inode *inode, loff_t new_valid_size)
--
fs/exfat/file.c-786-		if (ret) {
fs/exfat/file.c:787:			truncate_setsize(inode, old_valid_size);
fs/exfat/file.c-788-			exfat_truncate(inode);
--
fs/ext2/inode.c=1237=static int ext2_setsize(struct inode *inode, loff_t newsize)
--
fs/ext2/inode.c-1255-	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c:1256:	truncate_setsize(inode, newsize);
fs/ext2/inode.c-1257-	__ext2_truncate_blocks(inode, newsize);
--
fs/f2fs/file.c=637=static int finish_preallocate_blocks(struct inode *inode)
--
fs/f2fs/file.c-657-
fs/f2fs/file.c:658:	truncate_setsize(inode, i_size_read(inode));
fs/f2fs/file.c-659-	ret = f2fs_truncate(inode);
--
fs/f2fs/file.c=1124=int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/f2fs/file.c-1235-		}
fs/f2fs/file.c:1236:		truncate_setsize(inode, attr->ia_size);
fs/f2fs/file.c-1237-
--
fs/f2fs/file.c=3879=static int f2fs_ioc_release_dev_alias(struct file *filp)
--
fs/f2fs/file.c-3929-	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c:3930:	truncate_setsize(inode, 0);
fs/f2fs/file.c-3931-
--
fs/fat/file.c=517=int fat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/fat/file.c-586-		down_write(&MSDOS_I(inode)->truncate_lock);
fs/fat/file.c:587:		truncate_setsize(inode, attr->ia_size);
fs/fat/file.c-588-		fat_truncate_blocks(inode, attr->ia_size);
--
fs/gfs2/bmap.c=2095=static int do_grow(struct inode *inode, u64 size)
--
fs/gfs2/bmap.c-2138-
fs/gfs2/bmap.c:2139:	truncate_setsize(inode, size);
fs/gfs2/bmap.c-2140-	inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_current(&ip->i_inode));
--
fs/hfs/inode.c=646=int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/hfs/inode.c-686-
fs/hfs/inode.c:687:		truncate_setsize(inode, attr->ia_size);
fs/hfs/inode.c-688-		hfs_file_truncate(inode);
--
fs/hfsplus/inode.c=308=static int hfsplus_setattr(struct mnt_idmap *idmap,
--
fs/hfsplus/inode.c-326-		}
fs/hfsplus/inode.c:327:		truncate_setsize(inode, attr->ia_size);
fs/hfsplus/inode.c-328-		hfsplus_file_truncate(inode);
--
fs/hostfs/hostfs_kern.c=804=static int hostfs_setattr(struct mnt_idmap *idmap,
--
fs/hostfs/hostfs_kern.c-868-	    attr->ia_size != i_size_read(inode))
fs/hostfs/hostfs_kern.c:869:		truncate_setsize(inode, attr->ia_size);
fs/hostfs/hostfs_kern.c-870-
--
fs/hpfs/inode.c=260=int hpfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/hpfs/inode.c-287-
fs/hpfs/inode.c:288:		truncate_setsize(inode, attr->ia_size);
fs/hpfs/inode.c-289-		hpfs_truncate(inode);
--
fs/jffs2/fs.c=32=int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
--
fs/jffs2/fs.c-179-
fs/jffs2/fs.c:180:	/* We have to do the truncate_setsize() without f->sem held, since
fs/jffs2/fs.c-181-	   some pages may be locked and waiting for it in read_folio().
--
fs/jffs2/fs.c-185-	if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) {
fs/jffs2/fs.c:186:		truncate_setsize(inode, iattr->ia_size);
fs/jffs2/fs.c-187-		inode->i_blocks = (inode->i_size + 511) >> 9;
--
fs/jfs/file.c=92=int jfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/jfs/file.c-121-
fs/jfs/file.c:122:		truncate_setsize(inode, iattr->ia_size);
fs/jfs/file.c-123-		jfs_truncate(inode);
--
fs/libfs.c=916=int simple_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/libfs.c-926-	if (iattr->ia_valid & ATTR_SIZE)
fs/libfs.c:927:		truncate_setsize(inode, iattr->ia_size);
fs/libfs.c-928-	setattr_copy(idmap, inode, iattr);
--
fs/minix/file.c=26=static int minix_setattr(struct mnt_idmap *idmap,
--
fs/minix/file.c-41-
fs/minix/file.c:42:		truncate_setsize(inode, attr->ia_size);
fs/minix/file.c-43-		minix_truncate(inode);
--
fs/nilfs2/inode.c=907=int nilfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/nilfs2/inode.c-925-		inode_dio_wait(inode);
fs/nilfs2/inode.c:926:		truncate_setsize(inode, iattr->ia_size);
fs/nilfs2/inode.c-927-		nilfs_truncate(inode);
--
fs/ntfs/file.c=254=static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
--
fs/ntfs/file.c-284-	} else {
fs/ntfs/file.c:285:		truncate_setsize(vi, attr->ia_size);
fs/ntfs/file.c-286-	}
--
fs/ntfs/file.c=579=static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/ntfs/file.c-664-		if (ni->data_size != old_data_size) {
fs/ntfs/file.c:665:			truncate_setsize(vi, old_data_size);
fs/ntfs/file.c-666-			ntfs_attr_truncate(ni, old_data_size);
--
fs/ntfs/inode.c=375=int ntfs_drop_big_inode(struct inode *inode)
--
fs/ntfs/inode.c-390-
fs/ntfs/inode.c:391:				truncate_setsize(VFS_I(ni), 0);
fs/ntfs/inode.c-392-				ntfs_truncate_vfs(VFS_I(ni), 0, 1);
--
fs/ntfs/inode.c=2410=int ntfs_extend_initialized_size(struct inode *vi, const loff_t offset,
--
fs/ntfs/inode.c-2444-	if (err)
fs/ntfs/inode.c:2445:		truncate_setsize(vi, old_init_size);
fs/ntfs/inode.c-2446-	return err;
--
fs/ntfs3/attrib.c=2009=int attr_collapse_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
--
fs/ntfs3/attrib.c-2057-		/* Simple truncate file at 'vbo'. */
fs/ntfs3/attrib.c:2058:		truncate_setsize(&ni->vfs_inode, vbo);
fs/ntfs3/attrib.c-2059-		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name,
--
fs/ntfs3/file.c=706=int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ntfs3/file.c-738-		if (newsize != oldsize) {
fs/ntfs3/file.c:739:			truncate_setsize(inode, newsize);
fs/ntfs3/file.c-740-
--
fs/omfs/file.c=341=static int omfs_setattr(struct mnt_idmap *idmap,
--
fs/omfs/file.c-355-			return error;
fs/omfs/file.c:356:		truncate_setsize(inode, attr->ia_size);
fs/omfs/file.c-357-		omfs_truncate(inode);
--
fs/orangefs/inode.c=697=static int orangefs_setattr_size(struct inode *inode, struct iattr *iattr)
--
fs/orangefs/inode.c-722-
fs/orangefs/inode.c:723:	/* This is truncate_setsize in a different order. */
fs/orangefs/inode.c-724-	truncate_pagecache(inode, iattr->ia_size);
--
fs/ramfs/file-nommu.c=135=static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size)
--
fs/ramfs/file-nommu.c-154-
fs/ramfs/file-nommu.c:155:	truncate_setsize(inode, newsize);
fs/ramfs/file-nommu.c-156-	return 0;
--
fs/smb/client/cifsfs.c=1519=ssize_t cifs_file_copychunk_range(unsigned int xid,
--
fs/smb/client/cifsfs.c-1596-		if (rc > 0 && destoff + rc > i_size_read(target_inode)) {
fs/smb/client/cifsfs.c:1597:			truncate_setsize(target_inode, destoff + rc);
fs/smb/client/cifsfs.c-1598-			netfs_resize_file(&target_cifsi->netfs,
--
fs/smb/client/smb2ops.c=3508=static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3568-		if (rc >= 0) {
fs/smb/client/smb2ops.c:3569:			truncate_setsize(inode, new_size);
fs/smb/client/smb2ops.c-3570-			spin_lock(&inode->i_lock);
--
fs/smb/client/smb2ops.c=4014=static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4064-
fs/smb/client/smb2ops.c:4065:	truncate_setsize(inode, new_eof);
fs/smb/client/smb2ops.c-4066-	spin_lock(&inode->i_lock);
--
fs/smb/client/smb2ops.c=4078=static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4127-
fs/smb/client/smb2ops.c:4128:	truncate_setsize(inode, new_eof);
fs/smb/client/smb2ops.c-4129-	spin_lock(&inode->i_lock);
--
fs/ubifs/file.c=883=static int do_writepage(struct folio *folio, size_t len)
--
fs/ubifs/file.c-958- * same time. And the problematic one is truncation to smaller size, from where
fs/ubifs/file.c:959: * we have to call 'truncate_setsize()', which first changes @inode->i_size,
fs/ubifs/file.c-960- * then drops the truncated pages. And while dropping the pages, it takes the
fs/ubifs/file.c:961: * page lock. This means that 'do_truncation()' cannot call 'truncate_setsize()'
fs/ubifs/file.c-962- * with @ui_mutex locked, because it would deadlock with 'ubifs_writepage()'.
--
fs/ubifs/file.c-965- * XXX(truncate): with the new truncate sequence this is not true anymore,
fs/ubifs/file.c:966: * and the calls to truncate_setsize can be move around freely.  They should
fs/ubifs/file.c-967- * be moved to the very end of the truncate sequence.
--
fs/ubifs/file.c=1100=static int do_truncation(struct ubifs_info *c, struct inode *inode,
--
fs/ubifs/file.c-1133-
fs/ubifs/file.c:1134:	truncate_setsize(inode, new_size);
fs/ubifs/file.c-1135-
--
fs/ubifs/file.c=1208=static int do_setattr(struct ubifs_info *c, struct inode *inode,
--
fs/ubifs/file.c-1222-		dbg_gen("size %lld -> %lld", inode->i_size, new_size);
fs/ubifs/file.c:1223:		truncate_setsize(inode, new_size);
fs/ubifs/file.c-1224-	}
--
fs/ubifs/file.c-1229-		inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
fs/ubifs/file.c:1230:		/* 'truncate_setsize()' changed @i_size, update @ui_size */
fs/ubifs/file.c-1231-		ui->ui_size = inode->i_size;
--
fs/ubifs/ubifs.h=334=struct ubifs_gced_idx_leb {
--
fs/ubifs/ubifs.h-393- * make sure @inode->i_size is always changed under @ui_mutex, because it
fs/ubifs/ubifs.h:394: * cannot call 'truncate_setsize()' with @ui_mutex locked, because it would
fs/ubifs/ubifs.h-395- * deadlock with 'ubifs_writepage()' (see file.c). All the other inode fields
--
fs/udf/inode.c=1280=int udf_setsize(struct inode *inode, loff_t newsize)
--
fs/udf/inode.c-1307-set_size:
fs/udf/inode.c:1308:		truncate_setsize(inode, newsize);
fs/udf/inode.c-1309-	} else {
--
fs/udf/inode.c-1316-			iinfo->i_lenAlloc = newsize;
fs/udf/inode.c:1317:			truncate_setsize(inode, newsize);
fs/udf/inode.c-1318-			up_write(&iinfo->i_data_sem);
--
fs/udf/inode.c-1324-			return err;
fs/udf/inode.c:1325:		truncate_setsize(inode, newsize);
fs/udf/inode.c-1326-		down_write(&iinfo->i_data_sem);
--
fs/ufs/inode.c=1167=static int ufs_truncate(struct inode *inode, loff_t size)
--
fs/ufs/inode.c-1187-
fs/ufs/inode.c:1188:	truncate_setsize(inode, size);
fs/ufs/inode.c-1189-
--
fs/xfs/xfs_iops.c=905=xfs_vn_setattr_size(
--
fs/xfs/xfs_iops.c-1008-	 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
fs/xfs/xfs_iops.c:1009:	 * complete. The truncate_setsize() call also cleans partial EOF page
fs/xfs/xfs_iops.c-1010-	 * PTEs on extending truncates and hence ensures sub-page block size
--
fs/xfs/xfs_iops.c-1025-	 */
fs/xfs/xfs_iops.c:1026:	truncate_setsize(inode, newsize);
fs/xfs/xfs_iops.c-1027-
--
fs/zonefs/file.c=203=int zonefs_file_truncate(struct inode *inode, loff_t isize)
--
fs/zonefs/file.c-261-	zonefs_update_stats(inode, isize);
fs/zonefs/file.c:262:	truncate_setsize(inode, isize);
fs/zonefs/file.c-263-	z->z_wpoffset = isize;
]

285/4 2026/09/17 11:23 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 53533
							output: 40
							thoughts: 43
						

Thoughts:
Here's my take on those thoughts:

**Analyzing `xfs_vn_setattr_size` in the XFS Filesystem**

Okay, time to dive into that `xfs_vn_setattr_size` function again. I need to refresh my understanding of how XFS handles attribute size adjustments. Specifically, I should probably focus on how this function impacts block allocation and metadata updates. It's crucial for understanding how XFS deals with file growth and truncation. Let's head over to the `fs/xfs/xfs_iops.c` file – that's usually the place to find the nitty-gritty details on i/o operations and attribute setting. I think the code I'm most interested in will be in the region of lines 980 to 1040, give or take, that's where I'd expect to see the core logic for the size setting function. I'll be looking for interaction with the inode's on-disk metadata and the allocation structures. My goal is to solidify how `xfs_vn_setattr_size` fits into the broader picture of XFS performance and reliability.



286/4 2026/09/17 11:23 tool read-file
0m Args:
map[File:fs/xfs/xfs_iops.c FirstLine:980 LineCount:55]

Results:
map[Contents: 980:	
 981:		/*
 982:		 * File data changes must be complete before we start the transaction to
 983:		 * modify the inode.  This needs to be done before joining the inode to
 984:		 * the transaction because the inode cannot be unlocked once it is a
 985:		 * part of the transaction.
 986:		 *
 987:		 * Start with zeroing any data beyond EOF that we may expose on file
 988:		 * extension, or zeroing out the rest of the block on a downward
 989:		 * truncate.
 990:		 */
 991:		if (newsize > oldsize) {
 992:			trace_xfs_zero_eof(ip, oldsize, newsize - oldsize);
 993:			error = xfs_zero_range(ip, oldsize, newsize - oldsize,
 994:					&ac, &did_zeroing);
 995:		} else {
 996:			error = xfs_truncate_page(ip, newsize, &ac, &did_zeroing);
 997:		}
 998:	
 999:		if (xfs_is_zoned_inode(ip))
1000:			xfs_zoned_space_unreserve(mp, &ac);
1001:	
1002:		if (error)
1003:			return error;
1004:	
1005:		/*
1006:		 * We've already locked out new page faults, so now we can safely remove
1007:		 * pages from the page cache knowing they won't get refaulted until we
1008:		 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
1009:		 * complete. The truncate_setsize() call also cleans partial EOF page
1010:		 * PTEs on extending truncates and hence ensures sub-page block size
1011:		 * filesystems are correctly handled, too.
1012:		 *
1013:		 * We have to do all the page cache truncate work outside the
1014:		 * transaction context as the "lock" order is page lock->log space
1015:		 * reservation as defined by extent allocation in the writeback path.
1016:		 * Hence a truncate can fail with ENOMEM from xfs_trans_alloc(), but
1017:		 * having already truncated the in-memory version of the file (i.e. made
1018:		 * user visible changes). There's not much we can do about this, except
1019:		 * to hope that the caller sees ENOMEM and retries the truncate
1020:		 * operation.
1021:		 *
1022:		 * And we update in-core i_size and truncate page cache beyond newsize
1023:		 * before writeback the [i_disk_size, newsize] range, so we're
1024:		 * guaranteed not to write stale data past the new EOF on truncate down.
1025:		 */
1026:		truncate_setsize(inode, newsize);
1027:	
1028:		/*
1029:		 * We are going to log the inode size change in this transaction so
1030:		 * any previous writes that are beyond the on disk EOF and the new
1031:		 * EOF that have not been written out need to be written here.  If we
1032:		 * do not write the data out, we expose ourselves to the null files
1033:		 * problem. Note that this includes any block zeroing we did above;
1034:		 * otherwise those blocks may not be zeroed after a crash.
]

287/4 2026/09/17 11:23 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 54826
							output: 40
							thoughts: 56
						

Thoughts:
**Analyzing `xfs_vn_setattr_size` and its Filemap Interaction**

Okay, let's dive into `xfs_vn_setattr_size`. My focus is on understanding its interaction with the filemap, specifically where it's calling `filemap_invalidate_lock`. That's the critical bit I need to pin down. Let's see...I'll need to go to `fs/xfs/xfs_iops.c` and zero in on lines 905 through 979. Those lines should contain the core logic I'm interested in, based on the function name. I anticipate this will be a relatively straightforward analysis, but it's important to be meticulous in these matters. Time to get to it.



288/4 2026/09/17 11:23 tool read-file
0m Args:
map[File:fs/xfs/xfs_iops.c FirstLine:905 LineCount:70]

Results:
map[Contents: 905:	xfs_vn_setattr_size(
 906:		struct mnt_idmap	*idmap,
 907:		struct dentry		*dentry,
 908:		struct iattr		*iattr)
 909:	{
 910:		struct inode		*inode = d_inode(dentry);
 911:		struct xfs_inode	*ip = XFS_I(inode);
 912:		struct xfs_mount	*mp = ip->i_mount;
 913:		xfs_off_t		oldsize = inode->i_size;
 914:		xfs_off_t		newsize = iattr->ia_size;
 915:		struct xfs_trans	*tp;
 916:		int			error;
 917:		uint			lock_flags = 0;
 918:		uint			resblks = 0;
 919:		bool			did_zeroing = false;
 920:		struct xfs_zone_alloc_ctx ac = { };
 921:	
 922:		xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
 923:		ASSERT(S_ISREG(inode->i_mode));
 924:		ASSERT((iattr->ia_valid & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET|
 925:			ATTR_MTIME_SET|ATTR_TIMES_SET)) == 0);
 926:	
 927:		trace_xfs_setattr(ip);
 928:	
 929:		error = xfs_vn_change_ok(idmap, dentry, iattr);
 930:		if (error)
 931:			return error;
 932:	
 933:		/*
 934:		 * Short circuit the truncate case for zero length files.
 935:		 */
 936:		if (newsize == 0 && oldsize == 0 && ip->i_df.if_nextents == 0) {
 937:			if (!(iattr->ia_valid & (ATTR_CTIME|ATTR_MTIME)))
 938:				return 0;
 939:	
 940:			/*
 941:			 * Use the regular setattr path to update the timestamps.
 942:			 */
 943:			iattr->ia_valid &= ~ATTR_SIZE;
 944:			return xfs_setattr_nonsize(idmap, dentry, ip, iattr);
 945:		}
 946:	
 947:		/*
 948:		 * Make sure that the dquots are attached to the inode.
 949:		 */
 950:		error = xfs_qm_dqattach(ip);
 951:		if (error)
 952:			return error;
 953:	
 954:		/*
 955:		 * Wait for all direct I/O to complete.
 956:		 */
 957:		inode_dio_wait(inode);
 958:	
 959:		/*
 960:		 * Normally xfs_zoned_space_reserve is supposed to be called outside the
 961:		 * IOLOCK.  For truncate we can't do that since ->setattr is called with
 962:		 * it already held by the VFS.  So for now chicken out and try to
 963:		 * allocate space under it.
 964:		 *
 965:		 * To avoid deadlocks this means we can't block waiting for space, which
 966:		 * can lead to spurious -ENOSPC if there are no directly available
 967:		 * blocks.  We mitigate this a bit by allowing zeroing to dip into the
 968:		 * reserved pool, but eventually the VFS calling convention needs to
 969:		 * change.
 970:		 */
 971:		if (xfs_is_zoned_inode(ip)) {
 972:			error = xfs_zoned_space_reserve(mp, 1,
 973:					XFS_ZR_NOWAIT | XFS_ZR_RESERVED, &ac);
 974:			if (error) {
]

289/4 2026/09/17 11:23 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 56240
							output: 38
							thoughts: 576
						

Thoughts:
**Analyzing the `ntfs_setattr` Race Condition**

Okay, let's break this down. The prompt wants me to patch `ntfs_setattr` in `fs/ntfs3/file.c` to fix a race condition between `truncate_setsize` and `ntfs_set_size`. The solution involves `filemap_invalidate_lock(inode->i_mapping)` and, crucially, reordering these two functions. But *why*? I need to understand the underlying issue before crafting a solution.

Let's look at the current code snippet provided. We have this:

```c
		if (ia_valid & ATTR_SIZE) {
			loff_t newsize, oldsize;

			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
				/* Should never be here, see ntfs_file_open(). */
				err = -EOPNOTSUPP;
				goto out;
			}
			inode_dio_wait(inode);
			oldsize = i_size_read(inode);
			newsize = attr->ia_size;

			if (newsize != oldsize) {
				truncate_setsize(inode, newsize);

				err = ntfs_set_size(inode, newsize);
				if (err) {
					i_size_write(inode, oldsize);
					goto out;
				}

				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
				inode_set_mtime_to_ts(inode,
						      inode_set_ctime_current(inode));
			}
		}
```

Okay, the code first checks if the `ATTR_SIZE` attribute is valid. Then, it compares the current file size (`oldsize`) with the new size (`newsize`). If they differ, the code calls `truncate_setsize` followed by `ntfs_set_size`. The critical question is *when* does the order of these two operations matter?

Is it determined by whether the new size is less than or equal to, or greater than, the old size? Does the reordering depend on whether we are shrinking or extending the file? Perhaps `ntfs_set_size` is intended to happen first when extending and second when shrinking? Or the order of operations depends on the file size change direction, i.e. `newsize <= oldsize` or `newsize > oldsize`?

I need to dig deeper. I need to understand how these functions interact at a low level, and how they handle concurrent access. I should check `attr_collapse_range` in `fs/ntfs3/attrib.c` and other functions to get a clearer picture of the file size manipulation in this driver. Let me look at line 2055-2070 in `fs/ntfs3/attrib.c`.



290/4 2026/09/17 11:24 tool read-file
0m Args:
map[File:fs/ntfs3/attrib.c FirstLine:2055 LineCount:20]

Results:
map[Contents:2055:			valid_size = min(ni->i_valid, vbo);
2056:	
2057:			/* Simple truncate file at 'vbo'. */
2058:			truncate_setsize(&ni->vfs_inode, vbo);
2059:			err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name,
2060:					    ni->file.ads.len, &ni->file.run, vbo,
2061:					    &valid_size, true);
2062:	
2063:			if (!err && valid_size < ni->i_valid)
2064:				ni->i_valid = valid_size;
2065:	
2066:			goto out;
2067:		}
2068:	
2069:		vcn = vbo >> sbi->cluster_bits;
2070:		len = bytes >> sbi->cluster_bits;
2071:		end = vcn + len;
2072:		dealloc = 0;
2073:		done = 0;
2074:	
]

291/4 2026/09/17 11:24 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 57816
							output: 14
							thoughts: 158
						

Thoughts:
**Investigating the NTFS Filesystem Issue**

Okay, so I've hit a snag and need to dig deeper. My first instinct is to see what kind of chatter already exists – are there discussions, commits, or mailing list patches on this specific issue? I should start broad. Hold on, let's refine this a bit, let's focus the search! I'm going to hit LKML and the git logs directly. The terms that seem most relevant are: "ntfs_setattr" coupled with "truncate_setsize," or perhaps "ntfs_set_size" with "truncate_setsize," and let's throw in "filemap_invalidate_lock" with "ntfs3". Also let's try "ntfs_setattr" with "filemap_invalidate_lock"

Wait, I need to check my work. I might as well search the whole repository, including documentation, for those terms. It's possible the earlier git-log didn't capture everything because the tree was younger? Hold on...why did `git log` only show a single commit? That can't be right. Let's try `git log -n 5` without a path prefix to ensure I get the full picture. I need a more complete view of what's been happening.



292/4 2026/09/17 11:24 tool git-log
0m Error:
log-in to see details

Args:
map[Count:5]

Results:
map[Output:]

293/4 2026/09/17 11:24 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 58299
							output: 20
							thoughts: 21
						

Thoughts:
Here's my summary, as though I were thinking through the process:

**Reviewing the Git History**

Okay, so I need to dig into the Git history. Let's start with a sanity check. I'm going to use `git log` to get a comprehensive view. The crucial thing here is the `PathPrefix`. I need to ensure I'm looking at the root of the repository. So, I'm explicitly setting `PathPrefix` to an empty string. That should give me the entire commit history, unrestricted by any path filters. This is my baseline. From this, I can begin to filter and hone in on more specific aspects of the repo, but right now, I need the complete picture to assess anything further.



294/4 2026/09/17 11:24 tool git-log
0m Error:
log-in to see details

Args:
map[Count:5 PathPrefix:]

Results:
map[Output:]

295/4 2026/09/17 11:24 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 58530
							output: 21
							thoughts: 24
						

Thoughts:
Okay, here's my interpretation of that thought process, summarized as you requested:

**Debugging a Path Prefix Issue**

Alright, so the `PathPrefix` variable was coming up as an empty string. That's a classic gotcha, because it evaluates to "falsy" in most of these contexts. Meaning the code probably thought there was *no* path specified, when I actually wanted it to consider the current directory. So, to fix that, I'll explicitly set `PathPrefix` to `"."`. That should ensure it correctly interprets the intended relative path to the current working directory, and hopefully resolves the underlying issue I'm seeing. This should get everything working as expected.



296/4 2026/09/17 11:25 tool git-log
0m Args:
map[Count:5 PathPrefix:.]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

297/4 2026/09/17 11:25 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 58753
							output: 19
							thoughts: 82
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own:

**Investigating a Potential Race Condition**

Alright, so the repository I'm looking at is a shallow clone, with just a single commit, `fd73f4a66598`. No problem there, that's perfectly acceptable for this initial investigation. The task at hand is to pinpoint any potential race conditions, and it seems like the best starting point is to examine how `truncate_setsize` and `filemap_invalidate_lock` interact, considering the context of those functions.

My strategy is clear: I'm going to leverage the power of `grep` to quickly scan the kernel source tree. I'll search for occurrences of both `truncate_setsize` and `filemap_invalidate_lock`, and I'll include 'race' to expand the search. This should allow me to focus in on any comments or code that explicitly addresses potential concurrency issues or synchronization around these key functions and locking. This should narrow down the search to areas with high probability of having an impact.



298/4 2026/09/17 11:25 tool grepper
0m Args:
map[Expression:invalidate_lock.*truncate]

Results:
map[Output:Documentation/filesystems/locking.rst=325=returns zero on success.  The filesystem must exclusively acquire
Documentation/filesystems/locking.rst:326:invalidate_lock before invalidating page cache in truncate / hole punch
Documentation/filesystems/locking.rst-327-path (and thus calling into ->invalidate_folio) to block races between page
--
Documentation/mm/process_addrs.rst=440=There is also a file-system specific lock ordering comment located at the top of
--
Documentation/mm/process_addrs.rst-450-  ->i_rwsem
Documentation/mm/process_addrs.rst:451:    ->invalidate_lock                   (acquired by fs in truncate path)
Documentation/mm/process_addrs.rst-452-      ->i_mmap_rwsem                    (truncate->unmap_mapping_range)
--
fs/xfs/xfs_file.c=1967=xfs_dax_read_fault(
--
fs/xfs/xfs_file.c-1988- *   sb_start_pagefault(vfs, freeze)
fs/xfs/xfs_file.c:1989: *     invalidate_lock (vfs/XFS_MMAPLOCK - truncate serialisation)
fs/xfs/xfs_file.c-1990- *       page_lock (MM)
--
fs/zonefs/zonefs.h=87=struct zonefs_inode_info {
--
fs/zonefs/zonefs.h-100-	 * i_truncate_mutex.  Only zonefs_seq_file_truncate() takes both lock
fs/zonefs/zonefs.h:101:	 * (invalidate_lock first, i_truncate_mutex second).
fs/zonefs/zonefs.h-102-	 */
--
mm/filemap.c-88- *  ->i_rwsem
mm/filemap.c:89: *    ->invalidate_lock		(acquired by fs in truncate path)
mm/filemap.c-90- *      ->i_mmap_rwsem		(truncate->unmap_mapping_range)
]

299/4 2026/09/17 11:25 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 59616
							output: 36
							thoughts: 38
						

Thoughts:
Here's my take on the thought process, as requested:

**Diving into Filesystem Locking in the Kernel**

Okay, so I'm thinking I need a refresher on some of the nuances of filesystem locking within the kernel. I remember seeing a pretty detailed explanation somewhere in the documentation. Right, that's it - I should consult the documentation. Specifically, it's probably going to be in `Documentation/filesystems/locking.rst`. I'll open that up right away. Let's start with a focused read. Hmm, let me skip ahead to lines 320 through 345. I'm expecting those lines to deal with a specific locking mechanism, or perhaps a particular locking scenario that I need to be aware of to solve the issue I'm dealing with. Let's see what gems are there.



300/4 2026/09/17 11:25 tool read-file
0m Args:
map[File:Documentation/filesystems/locking.rst FirstLine:320 LineCount:35]

Results:
map[Contents: 320:	filesystems and by the swapper. The latter will eventually go away.  Please,
 321:	keep it that way and don't breed new callers.
 322:	
 323:	->invalidate_folio() is called when the filesystem must attempt to drop
 324:	some or all of the buffers from the page when it is being truncated. It
 325:	returns zero on success.  The filesystem must exclusively acquire
 326:	invalidate_lock before invalidating page cache in truncate / hole punch
 327:	path (and thus calling into ->invalidate_folio) to block races between page
 328:	cache invalidation and page cache filling functions (fault, read, ...).
 329:	
 330:	->release_folio() is called when the MM wants to make a change to the
 331:	folio that would invalidate the filesystem's private data.  For example,
 332:	it may be about to be removed from the address_space or split.  The folio
 333:	is locked and not under writeback.  It may be dirty.  The gfp parameter
 334:	is not usually used for allocation, but rather to indicate what the
 335:	filesystem may do to attempt to free the private data.  The filesystem may
 336:	return false to indicate that the folio's private data cannot be freed.
 337:	If it returns true, it should have already removed the private data from
 338:	the folio.  If a filesystem does not provide a ->release_folio method,
 339:	the pagecache will assume that private data is buffer_heads and call
 340:	try_to_free_buffers().
 341:	
 342:	->free_folio() is called when the kernel has dropped the folio
 343:	from the page cache.
 344:	
 345:	->launder_folio() may be called prior to releasing a folio if
 346:	it is still found to be dirty. It returns zero if the folio was successfully
 347:	cleaned, or an error value if not. Note that in order to prevent the folio
 348:	getting mapped back in and redirtied, it needs to be kept locked
 349:	across the entire operation.
 350:	
 351:	->swap_activate() will be called to prepare the given file for swap.  It
 352:	should perform any validation and preparation necessary to ensure that
 353:	writes can be performed with minimal memory allocation.  It should call
 354:	add_swap_extent(), or the helper iomap_swapfile_activate(), and return
]

301/4 2026/09/17 11:25 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 60553
							output: 30
							thoughts: 23
						

Thoughts:
Here's my take on those thoughts:

**Locking and Filesystem Operations - Let's Dig In**

Okay, so I need to refresh my memory on the interactions between file locking and the `setattr` and `truncate` operations within the filesystem. It's crucial, obviously, to ensure data integrity and avoid race conditions, especially when dealing with concurrent access. I'm thinking the best place to start is the official documentation, specifically `Documentation/filesystems/locking.rst`. That document usually has the authoritative definitions of locking semantics in the kernel. I'll need to pay close attention to how `setattr` and `truncate` are handled in relation to different locking mechanisms, like advisory locks and mandatory locks. Are there specific lock types required, and how do they interact? Are there any potential gotchas or edge cases, like signal handling, that the documentation highlights? This will provide the foundation for understanding how my code should interact with these operations when implementing... well, whatever I'm working on! Understanding these fundamentals is key.



302/4 2026/09/17 11:26 tool grepper
0m Args:
map[Expression:setattr PathPrefix:Documentation/filesystems/locking.rst]

Results:
map[Output:Documentation/filesystems/locking.rst=62=prototypes::
--
Documentation/filesystems/locking.rst-78-	struct posix_acl * (*get_inode_acl)(struct inode *, int, bool);
Documentation/filesystems/locking.rst:79:	int (*setattr) (struct mnt_idmap *, struct dentry *, struct iattr *);
Documentation/filesystems/locking.rst-80-	int (*getattr) (struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int);
--
Documentation/filesystems/locking.rst=113=get_link:	no
Documentation/filesystems/locking.rst:114:setattr:	exclusive
Documentation/filesystems/locking.rst-115-permission:	no (may not block if called in rcu-walk mode)
]

303/4 2026/09/17 11:26 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 61035
							output: 31
							thoughts: 2014
						

Thoughts:
**Analyzing the NTFS Truncate Race Condition**

Okay, let's break this down systematically. I'm revisiting `fs/ntfs3/file.c` and specifically `ntfs_setattr`. The task is to fix a race condition between `truncate_setsize` and `ntfs_set_size` using `filemap_invalidate_lock` and, crucially, reordering the calls.

First, I need to clearly understand *why* there's a race and which order is problematic. Right now, the code calls `truncate_setsize` *before* `ntfs_set_size`. The comment says something about this not applying to compressed files, so let's check that we aren't handling any compressed files. The code currently does the following:

1.  Checks if it's a valid inode and handles some shutdown cases.
2.  Prepares the setting of attributes via `setattr_prepare()`.
3.  If `ATTR_SIZE` is set:
    *   Calculates new and old size.
    *   Warns about compressed files (which should *never* be here.)
    *   Waits on `inode_dio_wait()`.
    *   Calls `truncate_setsize(inode, newsize)`.
    *   Calls `ntfs_set_size(inode, newsize)`.
    *   Handles errors by writing the old size back and exiting.
    *   Sets archive flag and update parent flag.
    *   Sets modified/changed timestamps.
4.  Finally calls `setattr_copy()` to copy the attributes.

Now I need to understand what's happening if `newsize` is different from `oldsize`. If `newsize` is less than `oldsize`, it's a truncate/shrink. If `newsize` is greater, it's an extension. This is important to understand which call is likely to fail in which case.

The key is realizing that `ntfs_set_size` *can* fail, returning `-EFBIG` or `-ENOSPC`, or other disk errors. That's a critical point! If `truncate_setsize` is called *first*, and *then* `ntfs_set_size` fails, the page cache has *already* been truncated by `truncate_pagecache()` and the `i_size` has been set, but the underlying NTFS metadata might not reflect the change, leading to inconsistencies. That's why the current code has `i_size_write(inode, oldsize)` in the error path. If ntfs_set_size fails, then `i_size` needs to be set back to its old value!

But wait... What happens if `ntfs_set_size` is called *first*? Importantly, I've checked the definition of `ntfs_set_size` in `fs/ntfs3/inode.c`, and it **doesn't** directly touch `inode->i_size`. It updates internal NTFS structures (`ni->i_valid`), and `attr_set_size()` updates the file size in the underlying NTFS structures. `truncate_setsize` *is* the one that updates `inode->i_size`! So, if `ntfs_set_size` fails, we haven't touched the page cache *or* the `i_size`. That is, we can simply return the error without any cleanup, as there is *nothing* to clean up.

This strongly suggests that reordering to call `ntfs_set_size` *before* `truncate_setsize` might solve the problem. Let me look at other filesystems to see how they handle size changes to confirm. I should also see if there are other places where `truncate_setsize` or `attr_set_size` or `ntfs_set_size` are called, which may expose similar patterns.

Now, I need to figure out *where* to put `filemap_invalidate_lock(inode->i_mapping)`. Based on my understanding, it must be inserted *before* `ntfs_set_size` (now the first call) to ensure the cache is invalidated *before* modifying the underlying NTFS data, protecting against the race. This needs to be checked against other filesystems. The next step is to write a patch to accomplish this.



304/4 2026/09/17 11:26 tool grepper
0m Args:
map[Expression:ntfs_set_size PathPrefix:fs/ntfs3]

Results:
map[Output:fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-654-			 */
fs/ntfs3/file.c:655:			err = ntfs_set_size(inode, new_size);
fs/ntfs3/file.c-656-			if (err)
--
fs/ntfs3/file.c-678-		if (mode & FALLOC_FL_KEEP_SIZE) {
fs/ntfs3/file.c:679:			err = ntfs_set_size(inode, i_size);
fs/ntfs3/file.c-680-			if (err)
--
fs/ntfs3/file.c=706=int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ntfs3/file.c-740-
fs/ntfs3/file.c:741:			err = ntfs_set_size(inode, newsize);
fs/ntfs3/file.c-742-			if (err) {
--
fs/ntfs3/file.c=1239=static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/ntfs3/file.c-1286-		 */
fs/ntfs3/file.c:1287:		ret = ntfs_set_size(inode, endbyte);
fs/ntfs3/file.c-1288-		if (ret)
--
fs/ntfs3/inode.c=860=static void ntfs_readahead(struct readahead_control *rac)
--
fs/ntfs3/inode.c-882-
fs/ntfs3/inode.c:883:int ntfs_set_size(struct inode *inode, u64 new_size)
fs/ntfs3/inode.c-884-{
--
fs/ntfs3/ntfs_fs.h=796=static inline struct inode *ntfs_iget5(struct super_block *sb,
--
fs/ntfs3/ntfs_fs.h-801-}
fs/ntfs3/ntfs_fs.h:802:int ntfs_set_size(struct inode *inode, u64 new_size);
fs/ntfs3/ntfs_fs.h-803-int ntfs3_write_inode(struct inode *inode, struct writeback_control *wbc);
]

305/4 2026/09/17 11:26 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 64692
							output: 37
							thoughts: 54
						

Thoughts:
**Diving into the NTFS Fallocate Implementation**

Okay, so I need to understand how `fallocate` is implemented within the NTFS3 filesystem. The code has to be complex, so let's start with a focused look. Let's head over to the `fs/ntfs3/file.c` file and specifically examine the `ntfs_fallocate` function. I think the critical area I want to understand is lines 650 to 670, but it will be better to look at a slightly larger context, so I will scope out lines 645-685. Reading that should give me a good handle on the core of the `fallocate` functionality in this part of the filesystem.



306/4 2026/09/17 11:26 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:645 LineCount:40]

Results:
map[Contents: 645:			}
 646:	
 647:			err = inode_newsize_ok(inode, new_size);
 648:			if (err)
 649:				goto out;
 650:	
 651:			if (new_size > i_size) {
 652:				/*
 653:				 * Allocate clusters, do not change 'valid' size.
 654:				 */
 655:				err = ntfs_set_size(inode, new_size);
 656:				if (err)
 657:					goto out;
 658:			}
 659:	
 660:			if (is_supported_holes) {
 661:				CLST vcn = vbo >> cluster_bits;
 662:				CLST cend = bytes_to_cluster(sbi, end);
 663:				CLST lcn, clen;
 664:				bool new;
 665:	
 666:				/*
 667:				 * Allocate and zero new clusters.
 668:				 */
 669:				for (; vcn < cend; vcn += clen) {
 670:					err = attr_data_get_block(ni, vcn, cend - vcn,
 671:								  &lcn, &clen, &new,
 672:								  true, NULL, false);
 673:					if (err)
 674:						goto out;
 675:				}
 676:			}
 677:	
 678:			if (mode & FALLOC_FL_KEEP_SIZE) {
 679:				err = ntfs_set_size(inode, i_size);
 680:				if (err)
 681:					goto out;
 682:			}
 683:		}
 684:	
]

307/4 2026/09/17 11:26 llm codeexpert-compressor
0m Model:
gemini-3.8-flash

Reply:
### 1. Approaches Tried and Results

- **Examined `ntfs_setattr` in `fs/ntfs3/file.c`**:
  - Found definition at lines 706–775.
  - In `ia_valid & ATTR_SIZE` block (lines 726–752):
    ```c
    if (ia_valid & ATTR_SIZE) {
        loff_t newsize, oldsize;

        if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
            err = -EOPNOTSUPP;
            goto out;
        }
        inode_dio_wait(inode);
        oldsize = i_size_read(inode);
        newsize = attr->ia_size;

        if (newsize != oldsize) {
            truncate_setsize(inode, newsize);

            err = ntfs_set_size(inode, newsize);
            if (err) {
                i_size_write(inode, oldsize);
                goto out;
            }
            ...
        }
    }
    ```
  - Identified problem: `truncate_setsize(inode, newsize)` happens before `ntfs_set_size(inode, newsize)` without holding `filemap_invalidate_lock(inode->i_mapping)`.
  - In failure cases (`ntfs_set_size` fails), `truncate_setsize` has already updated `i_size` and invalidated page cache, then rolls back with `i_size_write(inode, oldsize)`, but cache state is damaged/inconsistent. Moreover, during extension/truncation, readers/mmap can race with metadata changes.

- **Examined `filemap_invalidate_lock` usage across filesystems**:
  - Grepped `filemap_invalidate_lock.*i_mapping` across `fs/`:
    - `fs/ntfs3/file.c`: Used in `ntfs_fallocate` around lines 520, 692.
    - `fs/ntfs/file.c`: In `ntfs_setattr_size`, wraps `filemap_invalidate_lock(vi->i_mapping)` around pagecache/i_size changes and `ntfs_truncate_vfs`.
    - `fs/udf/file.c` and `fs/udf/inode.c`: In `udf_setattr`, wraps `filemap_invalidate_lock(inode->i_mapping)` around size change. In `udf_setsize`, on expansion calls `udf_extend_file` (or `udf_expand_file_adinicb`) *first*, then `truncate_setsize`.
    - `fs/ext2/inode.c`: `ext2_setsize` locks `filemap_invalidate_lock`, calls `truncate_setsize`, then `ext2_truncate_blocks` (or vice versa depending on shrink/grow).

- **Examined `ntfs_fallocate` in `fs/ntfs3/file.c`**:
  - Found locking pattern:
    ```c
    inode_dio_wait(inode);
    filemap_invalidate_lock(mapping);
    map_locked = true;
    ...
    if (map_locked)
        filemap_invalidate_unlock(mapping);
    ```

- **Examined `ntfs_set_size` in `fs/ntfs3/inode.c`**:
  - Found definition at lines 883–915:
    - Checks maxbytes bounds (`maxbytes_sparse` or `maxbytes`).
    - Sets dirty state (`NTFS_DIRTY_DIRTY`).
    - Takes `ni_lock(ni)` and `down_write(&ni->file.run_lock)`.
    - If `new_size < ni->i_valid`, sets `ni->i_valid = new_size`.
    - Calls `attr_set_size(...)`.
    - Unlocks `ni->file.run_lock` and `ni_lock`.
    - Returns error code.

- **Git history check**:
  - Repository is a shallow/single-commit clone (`fd73f4a66598 Linux 7.3-rc3`), commit history for previous commits on `ntfs_setattr` is unavailable.

---

### 2. Hypotheses, Theories, and Active Lines of Investigation

- **The exact race and ordering problem**:
  - The prompt specifies: "fix the race condition between `truncate_setsize` and `ntfs_set_size` by using `filemap_invalidate_lock(inode->i_mapping)` and reordering `truncate_setsize` and `ntfs_set_size` correctly."
  - When extending vs shrinking:
    - Or specifically: why reorder `truncate_setsize` and `ntfs_set_size`?
    - If `ntfs_set_size(inode, newsize)` is called first: disk space / attributes are allocated/checked before `truncate_setsize(inode, newsize)` updates `i_size` and truncates page cache. If `ntfs_set_size` fails (e.g. -ENOSPC, -EFBIG, I/O error), `i_size` has not been modified yet by `truncate_setsize`, eliminating the need to rollback `i_size_write(inode, oldsize)` and avoiding corrupted pagecache states.
    - Alternatively, check how `ntfs_truncate` or other drivers order `truncate_setsize` vs disk allocation. In standard VFS truncation or other filesystems:
      - If shrinking: page cache truncate vs block freeing. But `ntfs_set_size` handles both shrink and grow (allocates blocks on expand or frees/sets non-resident attribute size).
      - If `ntfs_set_size` is run first before `truncate_setsize`: `err = ntfs_set_size(inode, newsize); if (err) goto ...; truncate_setsize(inode, newsize);`.
      - What about `filemap_invalidate_lock`:
        Must hold `filemap_invalidate_lock(inode->i_mapping)` while performing the size change operations (`ntfs_set_size` and `truncate_setsize`), and `filemap_invalidate_unlock(inode->i_mapping)` afterwards.
  - Need to verify whether `filemap_invalidate_lock` should surround the size change block or if there's any other place in `ntfs_setattr` where it unlocks.
  - Need to check if `inode->i_mapping` is already available as a local variable or `inode->i_mapping`.
  - Check error paths: if `ntfs_set_size` returns error, must unlock `filemap_invalidate_unlock(inode->i_mapping)` before returning / jumping out.

---

### 3. Key File Paths, Structs, and Relevant Code Snippets

- **File**: `fs/ntfs3/file.c`
  - Function: `ntfs_setattr` (lines 706–775)
  ```c
  int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
  		 struct iattr *attr)
  {
  	struct inode *inode = d_inode(dentry);
  	struct ntfs_inode *ni = ntfs_i(inode);
  	u32 ia_valid = attr->ia_valid;
  	umode_t mode = inode->i_mode;
  	int err;

  	/* Avoid any operation if inode is bad. */
  	if (unlikely(is_bad_ni(ni)))
  		return -EINVAL;

  	if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
  		return -EIO;

  	err = setattr_prepare(idmap, dentry, attr);
  	if (err)
  		goto out;

  	if (ia_valid & ATTR_SIZE) {
  		loff_t newsize, oldsize;

  		if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
  			/* Should never be here, see ntfs_file_open(). */
  			err = -EOPNOTSUPP;
  			goto out;
  		}
  		inode_dio_wait(inode);
  		oldsize = i_size_read(inode);
  		newsize = attr->ia_size;

  		if (newsize != oldsize) {
  			truncate_setsize(inode, newsize);

  			err = ntfs_set_size(inode, newsize);
  			if (err) {
  				i_size_write(inode, oldsize);
  				goto out;
  			}

  			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
  			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
  			inode_set_mtime_to_ts(inode,
  					      inode_set_ctime_current(inode));
  		}
  	}
  ...
  ```

- **File**: `fs/ntfs3/inode.c`
  - Function: `ntfs_set_size(struct inode *inode, u64 new_size)`

---

### 4. Watchouts / Repetitive Loops

- Git log is not populated beyond the single HEAD commit (`fd73f4a66598`); do not attempt more `git-log` commands expecting historical commits.
- Make sure to check standard conventions in kernel patches for `filemap_invalidate_lock`:
  - `filemap_invalidate_lock(inode->i_mapping);`
  - `err = ntfs_set_size(inode, newsize);`
  - `if (!err) truncate_setsize(inode, newsize);` (or check if `truncate_setsize` happens on success only, avoiding `i_size_write(inode, oldsize)`).
  - `filemap_invalidate_unlock(inode->i_mapping);`
  - Check whether other filesystems do `inode_dio_wait(inode)` before `filemap_invalidate_lock`. In `ntfs_setattr`, `inode_dio_wait(inode)` is already present at line 734.
  - Verify error handling and goto labels: if `ntfs_set_size` fails, make sure unlock happens before `goto out`.
  - Must call `set-results` before final reply as specified by instructions.

Tokens:
							input: 43366
							output: 2412
							thoughts: 0
						

308/4 2026/09/17 11:27 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 23101
							output: 37
							thoughts: 0
						

309/4 2026/09/17 11:27 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:700 LineCount:60]

Results:
map[Contents: 700:		return err;
 701:	}
 702:	
 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
]

310/4 2026/09/17 11:27 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 24128
							output: 577
							thoughts: 5352
						

Thoughts:
**Analysis and Proposed Patch for Race Condition in `ntfs_setattr`**

Okay, so the task at hand is to fix a race condition between `truncate_setsize` and `ntfs_set_size` within the `ntfs_setattr` function in `fs/ntfs3/file.c`. Specifically, the goal is to use `filemap_invalidate_lock(inode->i_mapping)` and reorder the calls to `truncate_setsize` and `ntfs_set_size` to ensure data integrity.  We're working under the constraint of not being able to use any external tools, so everything has to be based on the existing code and my understanding of the relevant VFS and NTFS3 subsystems.

The current implementation (as of the provided code snippet) calls `truncate_setsize` *before* `ntfs_set_size`. This causes a problem because `truncate_setsize` immediately updates `inode->i_size` and truncates the page cache. If `ntfs_set_size` then fails, we have an inconsistent state: either an out-of-space error when expanding, or I/O error when truncating.  The rollback attempt using `i_size_write(inode, oldsize)` is not sufficient because the page cache has already been modified or discarded. This leaves the system in a potentially corrupted state because other operations might read the inconsistent intermediate size. This sequence also has the race with page cache invalidation as specified in `Documentation/filesystems/locking.rst`.

The solution, then, is two-fold:

1.  **Introduce `filemap_invalidate_lock`**: We must acquire the `filemap_invalidate_lock` *before* any size-changing operations to protect the page cache from concurrent faults/reads, as per kernel VFS truncate rules.  The `filemap_invalidate_lock` must be *held* across both calls to `ntfs_set_size` and `truncate_setsize` to serialize these operations with the pagecache.

2.  **Reorder `ntfs_set_size` and `truncate_setsize`**:  The correct order is to call `ntfs_set_size` *first*. If `ntfs_set_size` fails (e.g., due to -ENOSPC, -EFBIG, I/O error), no changes to the page cache or `i_size` have been made, thus no rollback is required and the filesystem is not left in an inconsistent state. The `filemap_invalidate_lock` can be released immediately in this case because there are no concurrent page faults.  If `ntfs_set_size` succeeds, we then call `truncate_setsize`, knowing that the filesystem allocations/truncations are now complete, and the `truncate_setsize` operation safely truncates the page cache *under the protection of* `filemap_invalidate_lock`.

Here's the proposed change to the code:

```c
		if (newsize != oldsize) {
			filemap_invalidate_lock(inode->i_mapping);
			err = ntfs_set_size(inode, newsize);
			if (!err)
				truncate_setsize(inode, newsize);
			filemap_invalidate_unlock(inode->i_mapping);

			if (err)
				goto out;

			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
			inode_set_mtime_to_ts(inode,
					      inode_set_ctime_current(inode));
		}
```

This ensures that:
*   The invalidate lock is acquired.
*   `ntfs_set_size` is called *first*.
*   If `ntfs_set_size` fails, the lock is released, and the function returns.
*   If `ntfs_set_size` succeeds, `truncate_setsize` is called under the protection of `filemap_invalidate_lock`.
*   The lock is released after all file size changes are done.

I'm confident this reordering and locking strategy eliminates the race and ensures data consistency during size changes.  All critical locking invariants are satisfied and we also simplify the recovery path by avoiding having to rollback.

**Caveats/Unverified Parts:**
*   The context of this patch is from a single code snippet, the general surrounding `ntfs_setattr` function was analyzed based on remembered code structure, but it couldn't be fully cross-referenced to historical information from a complete development history, though other relevant code parts and functions, such as `ntfs_set_size`, locking patterns, documentation, were cross-referenced.



311/4 2026/09/17 11:28 tool set-results
0m Args:
map[Answer:To fix the race condition between `truncate_setsize` and `ntfs_set_size`, `ntfs_setattr` must:
1. Acquire `filemap_invalidate_lock(inode->i_mapping)` to protect against concurrent page faults and page cache invalidation/filling during truncation.
2. Call `ntfs_set_size(inode, newsize)` first so that underlying on-disk attribute and allocation changes are performed before mutating in-memory `i_size` and discarding page cache pages. If `ntfs_set_size` fails, the error can be returned without having corrupted the page cache or needing to roll back `i_size` with `i_size_write(inode, oldsize)`.
3. Call `truncate_setsize(inode, newsize)` only upon success of `ntfs_set_size`, while still holding `filemap_invalidate_lock(inode->i_mapping)`.
4. Release `filemap_invalidate_unlock(inode->i_mapping)`.

### Patch

```diff
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -736,13 +736,14 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		newsize = attr->ia_size;

 		if (newsize != oldsize) {
-			truncate_setsize(inode, newsize);
-
+			filemap_invalidate_lock(inode->i_mapping);
 			err = ntfs_set_size(inode, newsize);
-			if (err) {
-				i_size_write(inode, oldsize);
+			if (!err)
+				truncate_setsize(inode, newsize);
+			filemap_invalidate_unlock(inode->i_mapping);
+
+			if (err)
 				goto out;
-			}

 			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
```

### Caveats and Unverified Aspects
- The local git repository history contains only a single commit (HEAD at Linux 7.3-rc3), so earlier commit messages, developer discussion, or mailing list revisions for this exact bug fix could not be verified against the git log.
- Testing the patch via kernel compilation and running ntfs3 xfstests was not performed since dynamic execution tools are not available.]

Results:
map[Answer:To fix the race condition between `truncate_setsize` and `ntfs_set_size`, `ntfs_setattr` must:
1. Acquire `filemap_invalidate_lock(inode->i_mapping)` to protect against concurrent page faults and page cache invalidation/filling during truncation.
2. Call `ntfs_set_size(inode, newsize)` first so that underlying on-disk attribute and allocation changes are performed before mutating in-memory `i_size` and discarding page cache pages. If `ntfs_set_size` fails, the error can be returned without having corrupted the page cache or needing to roll back `i_size` with `i_size_write(inode, oldsize)`.
3. Call `truncate_setsize(inode, newsize)` only upon success of `ntfs_set_size`, while still holding `filemap_invalidate_lock(inode->i_mapping)`.
4. Release `filemap_invalidate_unlock(inode->i_mapping)`.

### Patch

```diff
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -736,13 +736,14 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		newsize = attr->ia_size;

 		if (newsize != oldsize) {
-			truncate_setsize(inode, newsize);
-
+			filemap_invalidate_lock(inode->i_mapping);
 			err = ntfs_set_size(inode, newsize);
-			if (err) {
-				i_size_write(inode, oldsize);
+			if (!err)
+				truncate_setsize(inode, newsize);
+			filemap_invalidate_unlock(inode->i_mapping);
+
+			if (err)
 				goto out;
-			}

 			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
```

### Caveats and Unverified Aspects
- The local git repository history contains only a single commit (HEAD at Linux 7.3-rc3), so earlier commit messages, developer discussion, or mailing list revisions for this exact bug fix could not be verified against the git log.
- Testing the patch via kernel compilation and running ntfs3 xfstests was not performed since dynamic execution tools are not available.]

312/2 2026/09/17 11:28 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 69064
							output: 105
							thoughts: 0
						

313/2 2026/09/17 11:28 tool codeexpert
11m Args:
map[Question:Wait, if `newsize < oldsize` (shrinking), should `truncate_setsize` be called before `ntfs_set_size`?
If `ntfs_set_size` is called first when shrinking, it will deallocate blocks. If there are dirty pages beyond the new EOF, they might be written back to the deallocated blocks, which might have been reallocated to another file.
Is that correct?]

Results:
map[Answer:Yes, that is completely correct.

### Why `truncate_setsize` Must Precede `ntfs_set_size` When Shrinking

1. **Role of `truncate_setsize()`**:
   `truncate_setsize(inode, newsize)` (defined in `mm/truncate.c`) performs two key steps:
   - Updates `inode->i_size` to `newsize`.
   - Calls `truncate_pagecache(inode, newsize)`, which unmaps the truncated address range and evicts/discards all cached pages/folios beyond `newsize` from the page cache.

2. **The Hazard if Called in Reverse Order**:
   If `ntfs_set_size()` (or block deallocation in general) were performed *before* `truncate_setsize()`:
   - Blocks backing the truncated region beyond the new EOF would be deallocated (e.g., in `attr_set_size_ex()` via `run_deallocate_ex()`) and marked free in the volume's allocation bitmap.
   - Those freed blocks could immediately be reallocated to another file or filesystem metadata.
   - Any dirty pages beyond the new EOF still lingering in the page cache would not yet have been invalidated. Background writeback (`kworker` flusher threads), memory reclaim, or `sync` could trigger writeback on those dirty pages.
   - Writing those dirty pages to the previously mapped block addresses would corrupt whatever newly allocated data now occupies those blocks, causing a disk write-after-free and silent data corruption.

3. **VFS Invariant & Documentation**:
   Kernel documentation in `mm/truncate.c` explicitly dictates this ordering:
   - `truncate_setsize()`:
     > *"Must be called with a lock serializing truncates and writes (generally `i_rwsem` ...) and before all filesystem specific block truncation has been performed."*
   - `truncate_pagecache()`:
     > *"This function should typically be called before the filesystem releases resources associated with the freed range (eg. deallocates blocks). This way, pagecache will always stay logically coherent with on-disk format, and the filesystem would not have to deal with situations such as writepage being called for a page that has already had its underlying blocks deallocated."*

4. **Implementation in `ntfs3`**:
   In `fs/ntfs3/file.c` (`ntfs_setattr()`), the code complies with this requirement:
   ```c
   if (newsize != oldsize) {
       truncate_setsize(inode, newsize);

       err = ntfs_set_size(inode, newsize);
       if (err) {
           i_size_write(inode, oldsize);
           goto out;
       }
       ...
   }
   ```
   Likewise, `attr_collapse_range()` in `fs/ntfs3/attrib.c` calls `truncate_setsize(&ni->vfs_inode, vbo)` before calling `attr_set_size()`.]

314/3 2026/09/17 11:28 agent codeexpert
11m Model:
core

Results:
map[Answer:Yes, that is completely correct.

### Why `truncate_setsize` Must Precede `ntfs_set_size` When Shrinking

1. **Role of `truncate_setsize()`**:
   `truncate_setsize(inode, newsize)` (defined in `mm/truncate.c`) performs two key steps:
   - Updates `inode->i_size` to `newsize`.
   - Calls `truncate_pagecache(inode, newsize)`, which unmaps the truncated address range and evicts/discards all cached pages/folios beyond `newsize` from the page cache.

2. **The Hazard if Called in Reverse Order**:
   If `ntfs_set_size()` (or block deallocation in general) were performed *before* `truncate_setsize()`:
   - Blocks backing the truncated region beyond the new EOF would be deallocated (e.g., in `attr_set_size_ex()` via `run_deallocate_ex()`) and marked free in the volume's allocation bitmap.
   - Those freed blocks could immediately be reallocated to another file or filesystem metadata.
   - Any dirty pages beyond the new EOF still lingering in the page cache would not yet have been invalidated. Background writeback (`kworker` flusher threads), memory reclaim, or `sync` could trigger writeback on those dirty pages.
   - Writing those dirty pages to the previously mapped block addresses would corrupt whatever newly allocated data now occupies those blocks, causing a disk write-after-free and silent data corruption.

3. **VFS Invariant & Documentation**:
   Kernel documentation in `mm/truncate.c` explicitly dictates this ordering:
   - `truncate_setsize()`:
     > *"Must be called with a lock serializing truncates and writes (generally `i_rwsem` ...) and before all filesystem specific block truncation has been performed."*
   - `truncate_pagecache()`:
     > *"This function should typically be called before the filesystem releases resources associated with the freed range (eg. deallocates blocks). This way, pagecache will always stay logically coherent with on-disk format, and the filesystem would not have to deal with situations such as writepage being called for a page that has already had its underlying blocks deallocated."*

4. **Implementation in `ntfs3`**:
   In `fs/ntfs3/file.c` (`ntfs_setattr()`), the code complies with this requirement:
   ```c
   if (newsize != oldsize) {
       truncate_setsize(inode, newsize);

       err = ntfs_set_size(inode, newsize);
       if (err) {
           i_size_write(inode, oldsize);
           goto out;
       }
       ...
   }
   ```
   Likewise, `attr_collapse_range()` in `fs/ntfs3/attrib.c` calls `truncate_setsize(&ni->vfs_inode, vbo)` before calling `attr_set_size()`.]

Instruction:
You are a capable Linux kernel developer tasked with researching complex questions
about kernel source code. You will be given a concrete question, and need to provide
a concrete answer.
Research the question using targeted, efficient tool calls. Don't make assumptions,
or rely on your previous knowledge about the kernel source code, use available tools
to access the actual source code. Keep your tool calls focused and limited to the
scope of the question. Do not explore tangential code paths or perform unbounded searches.
Use all available sources of information:
 - kernel source code
 - documentation in the Documentation dir in the source tree
 - git commits descriptions, git blame

Do not guess file names or file paths and attempt to read them without
verifying their existence first using content search or directory listing tools.
If a file, symbol, or directory is not found via content search (grepper) or
directory listing (codesearch-dir-index), treat it as completely absent.
Do not attempt to guess alternative names, extensions, or directories.

Tool Selection Guidelines:
1. For C functions, structs, and variables: Prefer codesearch-definition-source
   or codesearch-struct-layout FIRST to retrieve clean, exact definitions
   without line-number guessing.
2. If symbol lookup fails (e.g., preprocessor macros, macro-generated code, or
   disabled #ifdef branches), fall back to read-file or grepper.
3. For file headers, #include directives, preprocessor macro definitions, and
   non-C files (Kconfig, Makefiles, docs): Use read-file or grepper directly.
4. Be concise and targeted. Answer the question as directly and concisely as possible
   once you have located the relevant code or definitions. If a symbol or function cannot
   be found after targeted searches, conclude with the best available information rather
   than continuing repetitive searches.
Do NOT use git-log to search for the presence or existence of files in the
repository. git-log is only for tracing commit history of files that are
already present in the current checkout. If a file does not exist in the
current checkout, it cannot be used for reproduction.

Avoid running broad git-log queries (such as searches on the entire repo)
without a specific 'PathPrefix' to restrict the scope, as these are very
expensive and will time out.
If a git-log tool call times out, do not retry the query with the same broad
scope. You must specify a tighter, narrower 'PathPrefix' for subsequent queries.

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:
Wait, if `newsize < oldsize` (shrinking), should `truncate_setsize` be called before `ntfs_set_size`?
If `ntfs_set_size` is called first when shrinking, it will deallocate blocks. If there are dirty pages beyond the new EOF, they might be written back to the deallocated blocks, which might have been reallocated to another file.
Is that correct?

315/4 2026/09/17 11:28 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 4237
							output: 20
							thoughts: 139
						

Thoughts:
**NTFS Shrinking Concerns**

Okay, so I'm thinking about this NTFS question and trying to get the sequence of operations right when shrinking a file. My concern is this: if the `newsize` is smaller than the `oldsize` – effectively, we're shrinking the file – does the order of operations between `truncate_setsize` and `ntfs_set_size` matter? Specifically, should `truncate_setsize` be called *before* `ntfs_set_size`?

My gut tells me this could be a race condition. If `ntfs_set_size` is called *first* during the shrink operation, it's going to deallocate blocks. However, if there are any "dirty" pages that exist *beyond* the intended new end-of-file (EOF) that haven't been flushed to disk yet, they might get written back to those deallocated blocks. Those blocks, meanwhile, could potentially have been reallocated and now belong to a *different* file. That would be a huge problem. Is my thinking correct, or am I missing something crucial?

Alright, time to get to the kernel source code. I need to refresh my memory and verify the implementation details. Let's see... I'll need to dig up the relevant code. I'll search for where `ntfs_set_size` and `truncate_setsize` are implemented and how they interact. This should clarify the critical order of operations and any safeguards that exist.



316/4 2026/09/17 11:28 tool grepper
0m Args:
map[Expression:ntfs_set_size]

Results:
map[Output:fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-654-			 */
fs/ntfs3/file.c:655:			err = ntfs_set_size(inode, new_size);
fs/ntfs3/file.c-656-			if (err)
--
fs/ntfs3/file.c-678-		if (mode & FALLOC_FL_KEEP_SIZE) {
fs/ntfs3/file.c:679:			err = ntfs_set_size(inode, i_size);
fs/ntfs3/file.c-680-			if (err)
--
fs/ntfs3/file.c=706=int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ntfs3/file.c-740-
fs/ntfs3/file.c:741:			err = ntfs_set_size(inode, newsize);
fs/ntfs3/file.c-742-			if (err) {
--
fs/ntfs3/file.c=1239=static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/ntfs3/file.c-1286-		 */
fs/ntfs3/file.c:1287:		ret = ntfs_set_size(inode, endbyte);
fs/ntfs3/file.c-1288-		if (ret)
--
fs/ntfs3/inode.c=860=static void ntfs_readahead(struct readahead_control *rac)
--
fs/ntfs3/inode.c-882-
fs/ntfs3/inode.c:883:int ntfs_set_size(struct inode *inode, u64 new_size)
fs/ntfs3/inode.c-884-{
--
fs/ntfs3/ntfs_fs.h=796=static inline struct inode *ntfs_iget5(struct super_block *sb,
--
fs/ntfs3/ntfs_fs.h-801-}
fs/ntfs3/ntfs_fs.h:802:int ntfs_set_size(struct inode *inode, u64 new_size);
fs/ntfs3/ntfs_fs.h-803-int ntfs3_write_inode(struct inode *inode, struct writeback_control *wbc);
]

317/4 2026/09/17 11:28 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 5389
							output: 37
							thoughts: 58
						

Thoughts:
Here's my summary, as if I were thinking it:

**Diving into NTFS Attribute and Size Setting**

Okay, so I need to get a handle on how NTFS handles setting attributes and file sizes. My starting point is going to be `fs/ntfs3/file.c`, specifically around lines 706 to 760 within the `ntfs_setattr` function. I want to trace the flow there. I'm assuming this is where attribute modifications are initiated. Then, I need to see how the actual file size changes are handled. I think `fs/ntfs3/inode.c` at line 883, the `ntfs_set_size` function, will be key to understanding the underlying mechanics of size changes. I'll need to look at how these two functions interact and what data structures they're modifying to ensure data integrity and proper disk allocation within the NTFS file system. I'll focus on how attributes affect the on-disk structures and how size changes potentially affect allocation.



318/4 2026/09/17 11:29 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:705 LineCount:65]

Results:
map[Contents: 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
]

319/4 2026/09/17 11:29 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 6657
							output: 41
							thoughts: 110
						

Thoughts:
**Analyzing Potential NTFS Filesystem Regression**

Okay, let's dive in. I'm looking at `fs/ntfs3/file.c`, specifically this snippet:

```c
			if (newsize != oldsize) {
				truncate_setsize(inode, newsize);

				err = ntfs_set_size(inode, newsize);
				if (err) {
					i_size_write(inode, oldsize);
					goto out;
				}
```

My immediate thought is: This looks like a file size change implementation. The key is in the check to see if the new size is different to the old size. If so, a set of actions is triggered that could have issues. I need to know if this code has changed recently. This is critical for assessing potential regressions or unexpected behavior. Was there a commit that introduced a subtle bug? Was there an attempted fix to a known issue that now contains a new issue?

Time to pull up the git log for this file and, probably, specifically this function or the surrounding code. Let's see what the commit history tells us. I'll be looking for any commits that touch this section, especially recent ones, or those that seem related to file size handling, truncation, or error recovery. That history is going to be key to understanding the context and identifying potential problems.



320/4 2026/09/17 11:29 tool git-log
0m Error:
log-in to see details

Args:
map[Count:10 PathPrefix:fs/ntfs3/file.c SymbolName:ntfs_setattr]

Results:
map[Output:]

321/4 2026/09/17 11:29 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 7119
							output: 41
							thoughts: 14
						

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

**Analyzing Code History with `git log`**

Okay, so I'm thinking about how to effectively analyze the code history, specifically when dealing with a symbol and its source path. `git log` seems like the obvious starting point here, given its comprehensive tracking capabilities. The core idea is to leverage the tool's flexibility to get a targeted view of changes related to a particular symbol. Instead of a broad overview, I'm aiming for precision. I want a history focused only on the specific instances I'm interested in. The key is to narrow the scope of `git log`. Combining `SymbolName` and `SourcePath` as search parameters seems like the right approach. This should allow me to pinpoint commits directly impacting the targeted code element. This should give me all the information that I need without needing a deep dive.



322/4 2026/09/17 11:29 tool git-log
0m Args:
map[Count:10 SourcePath:fs/ntfs3/file.c SymbolName:ntfs_setattr]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

323/4 2026/09/17 11:29 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 7396
							output: 37
							thoughts: 27
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Analyzing the `fs/ntfs3` Truncate/Setsize Logic**

Alright, time to dig in. I need to refresh my memory on the `fs/ntfs3` file system code, specifically related to the `truncate_setsize` functionality. Let's see what's changed and what the current status is. My immediate instinct is to check the `git-log`. I'm going to focus the log entries specifically to those under `fs/ntfs3` to avoid extraneous information. And I'm going to use a CodeRegexp of "truncate_setsize", which should allow me to focus the search to commits that include that set of words. This approach will allow me to quickly scan for recent commits, bug fixes, or performance optimizations related to the specific areas. Knowing what changes have been committed will allow me to be up-to-date on this part of the code base.



324/4 2026/09/17 11:30 tool git-log
0m Args:
map[CodeRegexp:truncate_setsize Count:10 PathPrefix:fs/ntfs3]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

325/4 2026/09/17 11:30 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 7704
							output: 37
							thoughts: 35
						

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

**Analyzing `fs/ntfs3/file.c` with `git-blame`**

Okay, before I dive too deep into this particular NTFS issue, I need to get some context. Let's start with a quick `git-blame` on the `fs/ntfs3/file.c` file, specifically lines 735 to 746. I want to see who last touched that section and, more importantly, what the commit messages say. Knowing the history of that code block will help me understand its purpose and potential vulnerabilities much faster than just jumping in cold. I'm expecting to see something related to file attribute handling, possibly metadata updates or file size calculations, given the file path. Let's see what the blame reveals... I'm hoping there's a clear and concise commit log that offers immediate insight into the recent changes in this code segment.



326/4 2026/09/17 11:30 tool git-blame
0m Args:
map[End:750 File:fs/ntfs3/file.c Start:735]

Results:
map[Output:^fd73f4a66598 735) 		oldsize = i_size_read(inode);
^fd73f4a66598 736) 		newsize = attr->ia_size;
^fd73f4a66598 737) 
^fd73f4a66598 738) 		if (newsize != oldsize) {
^fd73f4a66598 739) 			truncate_setsize(inode, newsize);
^fd73f4a66598 740) 
^fd73f4a66598 741) 			err = ntfs_set_size(inode, newsize);
^fd73f4a66598 742) 			if (err) {
^fd73f4a66598 743) 				i_size_write(inode, oldsize);
^fd73f4a66598 744) 				goto out;
^fd73f4a66598 745) 			}
^fd73f4a66598 746) 
^fd73f4a66598 747) 			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
^fd73f4a66598 748) 			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
^fd73f4a66598 749) 			inode_set_mtime_to_ts(inode,
^fd73f4a66598 750) 					      inode_set_ctime_current(inode));
]

327/4 2026/09/17 11:30 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 8437
							output: 37
							thoughts: 76
						

Thoughts:
Okay, here's the summary of my thought process, focusing on understanding this code:

**Analyzing a Truncate Operation**

Alright, hang on a second. First things first, this repo seems to have started with a commit at `fd73f4a66598`. I need to remember that – might be important later, especially if it's a shallow clone or a base commit. I should keep that in mind.

Now, I need to get a handle on what `truncate_setsize` actually *does* and how this filesystem interacts with it. I need to refresh my knowledge of how other filesystems deal with `truncate` and `setattr` operations as well. It's crucial to understand the context.

So, let's dive into the definition of `truncate_setsize`. I need to carefully examine its code and, most importantly, those crucial comments. They are usually the key to understanding the intent and nuances of the implementation. Let's see what the developers had in mind.



328/4 2026/09/17 11:30 tool codesearch-definition-comment
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:truncate_setsize]

Results:
map[Comment: 803:	/**
 804:	 * truncate_setsize - update inode and pagecache for a new file size
 805:	 * @inode: inode
 806:	 * @newsize: new file size
 807:	 *
 808:	 * truncate_setsize updates i_size and performs pagecache truncation (if
 809:	 * necessary) to @newsize. It will be typically be called from the filesystem's
 810:	 * setattr function when ATTR_SIZE is passed in.
 811:	 *
 812:	 * Must be called with a lock serializing truncates and writes (generally
 813:	 * i_rwsem but e.g. xfs uses a different lock) and before all filesystem
 814:	 * specific block truncation has been performed.
 815:	 */
 Kind:function]

329/4 2026/09/17 11:30 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 9003
							output: 37
							thoughts: 216
						

Thoughts:
**Analyzing `truncate_setsize` for File Size Updates**

Okay, so I'm looking at this function, `truncate_setsize`. The comment here is crucial: `truncate_setsize` is the workhorse for updating the inode and pagecache when a file's size changes. It's usually called from a filesystem's `setattr` function when a size attribute is modified. The comment nails down the requirements: it *must* be called under a lock that serializes truncates and writes – typically `i_rwsem`, though some filesystems, like XFS, might use something different. And the timing is important; it needs to run *before* any filesystem-specific block truncation. That's a key detail to keep in mind, because it indicates a specific ordering of operations that's essential for data integrity. Time to dig into the source code and see exactly how it achieves this. I need to understand how this function orchestrates the inode update and pagecache adjustments in detail.



330/4 2026/09/17 11:30 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:truncate_setsize]

Results:
map[SourceCode: 803:	/**
 804:	 * truncate_setsize - update inode and pagecache for a new file size
 805:	 * @inode: inode
 806:	 * @newsize: new file size
 807:	 *
 808:	 * truncate_setsize updates i_size and performs pagecache truncation (if
 809:	 * necessary) to @newsize. It will be typically be called from the filesystem's
 810:	 * setattr function when ATTR_SIZE is passed in.
 811:	 *
 812:	 * Must be called with a lock serializing truncates and writes (generally
 813:	 * i_rwsem but e.g. xfs uses a different lock) and before all filesystem
 814:	 * specific block truncation has been performed.
 815:	 */
 816:	void truncate_setsize(struct inode *inode, loff_t newsize)
 817:	{
 818:		loff_t oldsize = inode->i_size;
 819:	
 820:		i_size_write(inode, newsize);
 821:		if (newsize > oldsize)
 822:			pagecache_isize_extended(inode, oldsize, newsize);
 823:		truncate_pagecache(inode, newsize);
 824:	}
 SourceFile:mm/truncate.c]

331/4 2026/09/17 11:31 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 9850
							output: 39
							thoughts: 32
						

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

**Diving Deep into Page Cache Truncation and NTFS Size Setting**

Alright, so the task at hand is to understand the inner workings of `truncate_pagecache` and `ntfs_set_size`. These are fundamental, especially when considering the implications on performance and data integrity within the filesystem. My expert knowledge demands a comprehensive understanding of how these mechanisms interact and contribute to the overall filesystem behavior. `truncate_pagecache` is crucial for space reclamation, and I need to recall how it handles those dirty pages or potentially, how it coordinates with journaling. And the `ntfs_set_size`, well, understanding this allows me to think about block allocation on the disk. I’ll make sure to note any edge cases and potential synchronization pitfalls.



332/4 2026/09/17 11:31 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/inode.c Name:ntfs_set_size]

Results:
map[SourceCode: 883:	int ntfs_set_size(struct inode *inode, u64 new_size)
 884:	{
 885:		struct super_block *sb = inode->i_sb;
 886:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 887:		struct ntfs_inode *ni = ntfs_i(inode);
 888:		int err;
 889:	
 890:		/* Check for maximum file size. */
 891:		if (is_sparsed(ni) || is_compressed(ni)) {
 892:			if (new_size > sbi->maxbytes_sparse) {
 893:				return -EFBIG;
 894:			}
 895:		} else if (new_size > sbi->maxbytes) {
 896:			return -EFBIG;
 897:		}
 898:	
 899:		/* Mark rw ntfs as dirty. It will be cleared at umount. */
 900:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 901:	
 902:		ni_lock(ni);
 903:		down_write(&ni->file.run_lock);
 904:		if (new_size < ni->i_valid)
 905:			ni->i_valid = new_size;
 906:	
 907:		/* last 'true' means keep preallocated. */
 908:		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
 909:				    &ni->file.run, new_size, &ni->i_valid, true);
 910:	
 911:		up_write(&ni->file.run_lock);
 912:		ni_unlock(ni);
 913:	
 914:		return err;
 915:	}
 SourceFile:fs/ntfs3/inode.c]

333/4 2026/09/17 11:31 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 10649
							output: 38
							thoughts: 25
						

Thoughts:
Here's my summary, as if I were thinking these thoughts:

**Examining `attr_set_size` within `fs/ntfs3/attrib.c`**

Okay, I'm diving back into this NTFS3 implementation. Let's see... I've been focusing on attribute handling, and now I need to scrutinize the `attr_set_size` function within `fs/ntfs3/attrib.c`. It's crucial to understand how size modifications are managed at the attribute level. I need to figure out the interactions here, especially with the underlying data structures, and how it impacts disk writes and metadata updates. Let's see what interesting tidbits and gotchas are lurking in this piece of code. I'm looking for the potential implications for performance, security and data integrity.



334/4 2026/09/17 11:31 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/inode.c Name:attr_set_size]

Results:
map[SourceCode: 473:	static inline int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
 474:					const __le16 *name, u8 name_len,
 475:					struct runs_tree *run, u64 new_size,
 476:					const u64 *new_valid, bool keep_prealloc)
 477:	{
 478:		return attr_set_size_ex(ni, type, name, name_len, run, new_size,
 479:					new_valid, keep_prealloc, NULL, false);
 480:	}
 SourceFile:fs/ntfs3/ntfs_fs.h]

335/4 2026/09/17 11:31 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 11082
							output: 43
							thoughts: 25
						

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

**Diving into NTFS Attribute Handling**

Okay, so I'm digging into the NTFS3 filesystem code, and I need to understand how attribute sizes are managed. I'm going straight for `attr_set_size_ex` in `fs/ntfs3/attrib.c`. That's where I'd expect to find the core logic for setting and adjusting attribute sizes, which is crucial for overall filesystem performance and data integrity, particularly when dealing with fragmented files or extended attributes. I need to see how the code handles different allocation scenarios, potential errors, and interactions with the Master File Table (MFT). I want to see how it accounts for overhead, padding, and any implications of cluster boundaries. I'll be looking for nuances that might affect I/O performance under heavy load and any potential vulnerabilities related to buffer overflows or incorrect size calculations. My hope is to get a handle on the complexities of dynamically adjusting attribute sizes for file metadata.



336/4 2026/09/17 11:32 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/ntfs_fs.h Name:attr_set_size_ex]

Results:
map[SourceCode: 421:	/*
 422:	 * attr_set_size_ex - Change the size of attribute.
 423:	 *
 424:	 * Extend:
 425:	 *   - Sparse/compressed: No allocated clusters.
 426:	 *   - Normal: Append allocated and preallocated new clusters.
 427:	 * Shrink:
 428:	 *   - No deallocate if @keep_prealloc is set.
 429:	 */
 430:	int attr_set_size_ex(struct ntfs_inode *ni, enum ATTR_TYPE type,
 431:			     const __le16 *name, u8 name_len, struct runs_tree *run,
 432:			     u64 new_size, const u64 *new_valid, bool keep_prealloc,
 433:			     struct ATTRIB **ret, bool no_da)
 434:	{
 435:		int err = 0;
 436:		struct ntfs_inode *nb = ni->base;
 437:		struct ntfs_sb_info *sbi = ni->mi.sbi;
 438:		u8 cluster_bits = sbi->cluster_bits;
 439:		bool is_mft = ni->mi.rno == MFT_REC_MFT && type == ATTR_DATA &&
 440:			      !name_len;
 441:		u64 old_valid, old_size, old_alloc, new_alloc_tmp;
 442:		u64 new_alloc = 0;
 443:		struct ATTRIB *attr = NULL, *attr_b;
 444:		struct ATTR_LIST_ENTRY *le, *le_b;
 445:		struct mft_inode *mi, *mi_b;
 446:		CLST alen, vcn, lcn, new_alen, old_alen, svcn, evcn;
 447:		CLST next_svcn, pre_alloc = -1, done = 0;
 448:		bool is_ext = false, is_bad = false;
 449:		bool dirty = false;
 450:		struct runs_tree *run_da = run == &ni->file.run ? &ni->file.run_da :
 451:								  NULL;
 452:		bool da = !is_mft && sbi->options->delalloc && run_da && !no_da;
 453:		u32 align;
 454:		struct MFT_REC *rec;
 455:	
 456:	again:
 457:		alen = 0;
 458:		le_b = NULL;
 459:		attr_b = ni_find_attr(ni, NULL, &le_b, type, name, name_len, NULL,
 460:				      &mi_b);
 461:		if (!attr_b) {
 462:			err = -ENOENT;
 463:			goto bad_inode;
 464:		}
 465:	
 466:		if (!attr_b->non_res) {
 467:			err = attr_set_size_res(ni, attr_b, le_b, mi_b, new_size, run,
 468:						&attr_b);
 469:			if (err)
 470:				return err;
 471:	
 472:			/* Return if file is still resident. */
 473:			if (!attr_b->non_res) {
 474:				dirty = true;
 475:				goto ok1;
 476:			}
 477:	
 478:			/* Layout of records may be changed, so do a full search. */
 479:			goto again;
 480:		}
 481:	
 482:		is_ext = is_attr_ext(attr_b);
 483:		align = sbi->cluster_size;
 484:		if (is_ext) {
 485:			align <<= attr_b->nres.c_unit;
 486:			keep_prealloc = false;
 487:			da = false;
 488:		}
 489:	
 490:		old_valid = le64_to_cpu(attr_b->nres.valid_size);
 491:		old_size = le64_to_cpu(attr_b->nres.data_size);
 492:		old_alloc = le64_to_cpu(attr_b->nres.alloc_size);
 493:	
 494:	again_1:
 495:		old_alen = old_alloc >> cluster_bits;
 496:	
 497:		new_alloc = (new_size + align - 1) & ~(u64)(align - 1);
 498:		new_alen = new_alloc >> cluster_bits;
 499:	
 500:		if (keep_prealloc && new_size < old_size) {
 501:			attr_b->nres.data_size = cpu_to_le64(new_size);
 502:			mi_b->dirty = dirty = true;
 503:			goto ok;
 504:		}
 505:	
 506:		if (da &&
 507:		    (vcn = old_alen + run_len(&ni->file.run_da), new_alen > vcn)) {
 508:			/* Resize up normal file. Delay new clusters allocation. */
 509:			alen = new_alen - vcn;
 510:	
 511:			if (ntfs_check_free_space(sbi, alen, 0, true)) {
 512:				if (!run_add_entry(&ni->file.run_da, vcn, SPARSE_LCN,
 513:						   alen, false)) {
 514:					err = -ENOMEM;
 515:					goto out;
 516:				}
 517:	
 518:				ntfs_add_da(sbi, alen);
 519:				goto ok1;
 520:			}
 521:		}
 522:	
 523:		if (!keep_prealloc && run_da && run_da->count &&
 524:		    (vcn = run_get_max_vcn(run_da), new_alen < vcn)) {
 525:			/* Shrink delayed clusters. */
 526:	
 527:			/* Try to remove fragment from delay allocated run. */
 528:			if (!run_remove_range(run_da, new_alen, vcn - new_alen,
 529:					      &alen)) {
 530:				err = -ENOMEM;
 531:				goto out;
 532:			}
 533:	
 534:			ntfs_sub_da(sbi, alen);
 535:		}
 536:	
 537:		vcn = old_alen - 1;
 538:	
 539:		svcn = le64_to_cpu(attr_b->nres.svcn);
 540:		evcn = le64_to_cpu(attr_b->nres.evcn);
 541:	
 542:		if (svcn <= vcn && vcn <= evcn) {
 543:			attr = attr_b;
 544:			le = le_b;
 545:			mi = mi_b;
 546:		} else if (!le_b) {
 547:			err = -EINVAL;
 548:			goto bad_inode;
 549:		} else {
 550:			le = le_b;
 551:			attr = ni_find_attr(ni, attr_b, &le, type, name, name_len, &vcn,
 552:					    &mi);
 553:			if (!attr) {
 554:				err = -EINVAL;
 555:				goto bad_inode;
 556:			}
 557:	
 558:	next_le_1:
 559:			svcn = le64_to_cpu(attr->nres.svcn);
 560:			evcn = le64_to_cpu(attr->nres.evcn);
 561:		}
 562:		/*
 563:		 * Here we have:
 564:		 * attr,mi,le - last attribute segment (containing 'vcn').
 565:		 * attr_b,mi_b,le_b - base (primary) attribute segment.
 566:		 */
 567:	next_le:
 568:		rec = mi->mrec;
 569:		err = attr_load_runs(attr, ni, run, NULL);
 570:		if (err)
 571:			goto out;
 572:	
 573:		if (new_size > old_size) {
 574:			CLST to_allocate;
 575:			size_t free;
 576:	
 577:			if (new_alloc <= old_alloc) {
 578:				attr_b->nres.data_size = cpu_to_le64(new_size);
 579:				mi_b->dirty = dirty = true;
 580:				goto ok;
 581:			}
 582:	
 583:			/*
 584:			 * Add clusters. In simple case we have to:
 585:			 *  - allocate space (vcn, lcn, len)
 586:			 *  - update packed run in 'mi'
 587:			 *  - update attr->nres.evcn
 588:			 *  - update attr_b->nres.data_size/attr_b->nres.alloc_size
 589:			 */
 590:			to_allocate = new_alen - old_alen;
 591:	add_alloc_in_same_attr_seg:
 592:			lcn = 0;
 593:			if (is_mft) {
 594:				/* MFT allocates clusters from MFT zone. */
 595:				pre_alloc = 0;
 596:			} else if (is_ext) {
 597:				/* No preallocate for sparse/compress. */
 598:				pre_alloc = 0;
 599:			} else if (pre_alloc == -1) {
 600:				pre_alloc = 0;
 601:				if (type == ATTR_DATA && !name_len &&
 602:				    sbi->options->prealloc) {
 603:					pre_alloc = bytes_to_cluster(
 604:							    sbi, get_pre_allocated(
 605:									 new_size)) -
 606:						    new_alen;
 607:				}
 608:	
 609:				/* Get the last LCN to allocate from. */
 610:				if (old_alen &&
 611:				    !run_lookup_entry(run, vcn, &lcn, NULL, NULL)) {
 612:					lcn = SPARSE_LCN;
 613:				}
 614:	
 615:				if (lcn == SPARSE_LCN)
 616:					lcn = 0;
 617:				else if (lcn)
 618:					lcn += 1;
 619:	
 620:				free = wnd_zeroes(&sbi->used.bitmap);
 621:				if (to_allocate > free) {
 622:					err = -ENOSPC;
 623:					goto out;
 624:				}
 625:	
 626:				if (pre_alloc && to_allocate + pre_alloc > free)
 627:					pre_alloc = 0;
 628:			}
 629:	
 630:			vcn = old_alen;
 631:	
 632:			if (is_ext) {
 633:				if (!run_add_entry(run, vcn, SPARSE_LCN, to_allocate,
 634:						   false)) {
 635:					err = -ENOMEM;
 636:					goto out;
 637:				}
 638:				alen = to_allocate;
 639:			} else {
 640:				/* ~3 bytes per fragment. */
 641:				err = attr_allocate_clusters(
 642:					sbi, run, run_da, vcn, lcn, to_allocate,
 643:					&pre_alloc,
 644:					is_mft ? ALLOCATE_MFT : ALLOCATE_DEF, &alen,
 645:					is_mft ? 0 :
 646:						 (sbi->record_size -
 647:						  le32_to_cpu(rec->used) + 8) /
 648:								 3 +
 649:							 1,
 650:					NULL, NULL);
 651:				if (err)
 652:					goto out;
 653:			}
 654:	
 655:			done += alen;
 656:			vcn += alen;
 657:			if (to_allocate > alen)
 658:				to_allocate -= alen;
 659:			else
 660:				to_allocate = 0;
 661:	
 662:	pack_runs:
 663:			err = mi_pack_runs(mi, attr, run, vcn - svcn);
 664:			if (err)
 665:				goto undo_1;
 666:	
 667:			next_svcn = le64_to_cpu(attr->nres.evcn) + 1;
 668:			new_alloc_tmp = (u64)next_svcn << cluster_bits;
 669:			attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp);
 670:			mi_b->dirty = dirty = true;
 671:	
 672:			if (next_svcn >= vcn && !to_allocate) {
 673:				/* Normal way. Update attribute and exit. */
 674:				attr_b->nres.data_size = cpu_to_le64(new_size);
 675:				goto ok;
 676:			}
 677:	
 678:			/* At least two MFT to avoid recursive loop. */
 679:			if (is_mft && next_svcn == vcn &&
 680:			    ((u64)done << sbi->cluster_bits) >= 2 * sbi->record_size) {
 681:				new_size = new_alloc_tmp;
 682:				attr_b->nres.data_size = attr_b->nres.alloc_size;
 683:				goto ok;
 684:			}
 685:	
 686:			if (le32_to_cpu(rec->used) < sbi->record_size) {
 687:				old_alen = next_svcn;
 688:				evcn = old_alen - 1;
 689:				goto add_alloc_in_same_attr_seg;
 690:			}
 691:	
 692:			attr_b->nres.data_size = attr_b->nres.alloc_size;
 693:			if (new_alloc_tmp < old_valid)
 694:				attr_b->nres.valid_size = attr_b->nres.data_size;
 695:	
 696:			if (type == ATTR_LIST) {
 697:				err = ni_expand_list(ni);
 698:				if (err)
 699:					goto undo_2;
 700:				if (next_svcn < vcn)
 701:					goto pack_runs;
 702:	
 703:				/* Layout of records is changed. */
 704:				goto again;
 705:			}
 706:	
 707:			if (!nb->attr_list.size) {
 708:				err = ni_create_attr_list(nb);
 709:				/* In case of error layout of records is not changed. */
 710:				if (err)
 711:					goto undo_2;
 712:				/* Layout of records is changed. */
 713:			}
 714:	
 715:			if (next_svcn >= vcn) {
 716:				/* This is MFT data, repeat. */
 717:				goto again;
 718:			}
 719:	
 720:			/* Insert new attribute segment. */
 721:			err = ni_insert_nonresident(ni, type, name, name_len, run,
 722:						    next_svcn, vcn - next_svcn,
 723:						    attr_b->flags, &attr, &mi, NULL);
 724:	
 725:			/*
 726:			 * Layout of records maybe changed.
 727:			 * Find base attribute to update.
 728:			 */
 729:			le_b = NULL;
 730:			attr_b = ni_find_attr(ni, NULL, &le_b, type, name, name_len,
 731:					      NULL, &mi_b);
 732:			if (!attr_b) {
 733:				err = -EINVAL;
 734:				goto bad_inode;
 735:			}
 736:	
 737:			if (err) {
 738:				/* ni_insert_nonresident failed. */
 739:				attr = NULL;
 740:				goto undo_2;
 741:			}
 742:	
 743:			/* keep runs for $MFT::$ATTR_DATA and $MFT::$ATTR_BITMAP. */
 744:			if (ni->mi.rno != MFT_REC_MFT)
 745:				run_truncate_head(run, evcn + 1);
 746:	
 747:			svcn = le64_to_cpu(attr->nres.svcn);
 748:			evcn = le64_to_cpu(attr->nres.evcn);
 749:	
 750:			/*
 751:			 * Attribute is in consistency state.
 752:			 * Save this point to restore to if next steps fail.
 753:			 */
 754:			old_valid = old_size = old_alloc = (u64)vcn << cluster_bits;
 755:			attr_b->nres.valid_size = attr_b->nres.data_size =
 756:				attr_b->nres.alloc_size = cpu_to_le64(old_size);
 757:			mi_b->dirty = dirty = true;
 758:			goto again_1;
 759:		}
 760:	
 761:		if (new_size != old_size ||
 762:		    (new_alloc != old_alloc && !keep_prealloc)) {
 763:			/*
 764:			 * Truncate clusters. In simple case we have to:
 765:			 *  - update packed run in 'mi'
 766:			 *  - update attr->nres.evcn
 767:			 *  - update attr_b->nres.data_size/attr_b->nres.alloc_size
 768:			 *  - mark and trim clusters as free (vcn, lcn, len)
 769:			 */
 770:			CLST dlen = 0;
 771:	
 772:			vcn = max(svcn, new_alen);
 773:			new_alloc_tmp = (u64)vcn << cluster_bits;
 774:	
 775:			if (vcn > svcn) {
 776:				err = mi_pack_runs(mi, attr, run, vcn - svcn);
 777:				if (err)
 778:					goto out;
 779:			} else if (le && le->vcn) {
 780:				u16 le_sz = le16_to_cpu(le->size);
 781:	
 782:				/*
 783:				 * NOTE: List entries for one attribute are always
 784:				 * the same size. We deal with last entry (vcn==0)
 785:				 * and it is not first in entries array
 786:				 * (list entry for std attribute always first).
 787:				 * So it is safe to step back.
 788:				 */
 789:				mi_remove_attr(NULL, mi, attr);
 790:	
 791:				if (!al_remove_le(ni, le)) {
 792:					err = -EINVAL;
 793:					goto bad_inode;
 794:				}
 795:	
 796:				le = (struct ATTR_LIST_ENTRY *)((u8 *)le - le_sz);
 797:			} else {
 798:				attr->nres.evcn = cpu_to_le64((u64)vcn - 1);
 799:				mi->dirty = true;
 800:			}
 801:	
 802:			attr_b->nres.alloc_size = cpu_to_le64(new_alloc_tmp);
 803:	
 804:			if (vcn == new_alen) {
 805:				attr_b->nres.data_size = cpu_to_le64(new_size);
 806:				if (new_size < old_valid)
 807:					attr_b->nres.valid_size =
 808:						attr_b->nres.data_size;
 809:			} else {
 810:				if (new_alloc_tmp <=
 811:				    le64_to_cpu(attr_b->nres.data_size))
 812:					attr_b->nres.data_size =
 813:						attr_b->nres.alloc_size;
 814:				if (new_alloc_tmp <
 815:				    le64_to_cpu(attr_b->nres.valid_size))
 816:					attr_b->nres.valid_size =
 817:						attr_b->nres.alloc_size;
 818:			}
 819:			mi_b->dirty = dirty = true;
 820:	
 821:			err = run_deallocate_ex(sbi, run, vcn, evcn - vcn + 1, &dlen,
 822:						true, run_da);
 823:			if (err)
 824:				goto out;
 825:	
 826:			if (is_ext) {
 827:				/* dlen - really deallocated clusters. */
 828:				le64_sub_cpu(&attr_b->nres.total_size,
 829:					     (u64)dlen << cluster_bits);
 830:			}
 831:	
 832:			run_truncate(run, vcn);
 833:	
 834:			if (new_alloc_tmp <= new_alloc)
 835:				goto ok;
 836:	
 837:			old_size = new_alloc_tmp;
 838:			vcn = svcn - 1;
 839:	
 840:			if (le == le_b) {
 841:				attr = attr_b;
 842:				mi = mi_b;
 843:				evcn = svcn - 1;
 844:				svcn = 0;
 845:				goto next_le;
 846:			}
 847:	
 848:			if (le->type != type || le->name_len != name_len ||
 849:			    memcmp(le_name(le), name, name_len * sizeof(short))) {
 850:				err = -EINVAL;
 851:				goto bad_inode;
 852:			}
 853:	
 854:			err = ni_load_mi(ni, le, &mi);
 855:			if (err)
 856:				goto out;
 857:	
 858:			attr = mi_find_attr(ni, mi, NULL, type, name, name_len,
 859:					    &le->id);
 860:			if (!attr) {
 861:				err = -EINVAL;
 862:				goto bad_inode;
 863:			}
 864:			goto next_le_1;
 865:		}
 866:	
 867:	ok:
 868:		if (new_valid) {
 869:			__le64 valid = cpu_to_le64(min(*new_valid, new_size));
 870:	
 871:			if (attr_b->nres.valid_size != valid) {
 872:				attr_b->nres.valid_size = valid;
 873:				mi_b->dirty = true;
 874:			}
 875:		}
 876:	
 877:	ok1:
 878:		if (ret)
 879:			*ret = attr_b;
 880:	
 881:		if ((type == ATTR_DATA || (type == ATTR_ALLOC && name == I30_NAME))) {
 882:			/* Update inode_set_bytes. */
 883:			if (attr_b->non_res &&
 884:			    inode_get_bytes(&ni->vfs_inode) != new_alloc) {
 885:				inode_set_bytes(&ni->vfs_inode, new_alloc);
 886:				dirty = true;
 887:			}
 888:	
 889:			i_size_write(&ni->vfs_inode, new_size);
 890:	
 891:			/* Don't forget to update duplicate information in parent. */
 892:			if (dirty) {
 893:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 894:				mark_inode_dirty(&ni->vfs_inode);
 895:			}
 896:		}
 897:	
 898:		return 0;
 899:	
 900:	undo_2:
 901:		vcn -= alen;
 902:		attr_b->nres.data_size = cpu_to_le64(old_size);
 903:		attr_b->nres.valid_size = cpu_to_le64(old_valid);
 904:		attr_b->nres.alloc_size = cpu_to_le64(old_alloc);
 905:	
 906:		/* Restore 'attr' and 'mi'. */
 907:		if (attr)
 908:			goto restore_run;
 909:	
 910:		if (le64_to_cpu(attr_b->nres.svcn) <= svcn &&
 911:		    svcn <= le64_to_cpu(attr_b->nres.evcn)) {
 912:			attr = attr_b;
 913:			le = le_b;
 914:			mi = mi_b;
 915:		} else if (!le_b) {
 916:			err = -EINVAL;
 917:			goto bad_inode;
 918:		} else {
 919:			le = le_b;
 920:			attr = ni_find_attr(ni, attr_b, &le, type, name, name_len,
 921:					    &svcn, &mi);
 922:			if (!attr)
 923:				goto bad_inode;
 924:		}
 925:	
 926:	restore_run:
 927:		if (mi_pack_runs(mi, attr, run, evcn - svcn + 1))
 928:			is_bad = true;
 929:	
 930:	undo_1:
 931:		run_deallocate_ex(sbi, run, vcn, alen, NULL, false, run_da);
 932:	
 933:		run_truncate(run, vcn);
 934:	out:
 935:		if (is_bad) {
 936:	bad_inode:
 937:			_ntfs_bad_inode(&ni->vfs_inode);
 938:		}
 939:		return err;
 940:	}
 SourceFile:fs/ntfs3/attrib.c]

337/4 2026/09/17 11:32 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 19324
							output: 28
							thoughts: 1129
						

Thoughts:
**Analyzing NTFS File Shrinking Logic**

Okay, let's break this down. The core question revolves around the correct order of operations when shrinking an NTFS file: should `truncate_setsize` be called before or after `ntfs_set_size`?  My initial thought is to confirm the potential issue of deallocating blocks and dirty pages being written back to newly allocated space.

I need to confirm the sequence. The question raises a valid concern: if `ntfs_set_size` deallocates blocks *before* the dirty pages beyond the new EOF are flushed, there's a risk of data corruption. The deallocated blocks could be re-allocated to a different file, and those "dirty" pages, when eventually written back, would corrupt the data of the new owner.

To investigate, I first want to see how other filesystems handle this. It would also be good to check VFS documentation/conventions.

Then, I'll go straight to the code. Specifically, the `fs/ntfs3/file.c` file. Looking at the existing implementation, I see that, currently, `truncate_setsize` *is* called *before* `ntfs_set_size`. But is that always true, or are there other call sites or paths within the code? I need to know.

I need to dig into `ntfs_set_size` itself. I need to know if it does indeed deallocate blocks during a shrink operation. I see the critical `keep_prealloc` flag used in `ntfs_set_size`. The comment says "last 'true' means keep preallocated." Digging deeper, it calls `attr_set_size`.

Aha! Now I see the crucial conditional in `fs/ntfs3/attrib.c`: if `keep_prealloc` is true when shrinking, no deallocation occurs. The size is simply updated in the metadata. This is important: the block deallocation *only* happens if `keep_prealloc` is false.

I need to confirm that `ntfs_set_size` does indeed pass `keep_prealloc = true`. Yes, the code explicitly passes `true`. So, if that code path is followed, no block deallocation happens.

But... are there other cases? What about sparse or compressed files? I see the code checking if the attribute is extended, and setting `keep_prealloc` to false in that case. That's a critical path to remember: *if* the file is extended (e.g., compressed or sparse), then block deallocation could occur *before* the dirty data is flushed.

I need to ask myself, is this the whole picture, and why is this being raised? Are there subtleties I'm missing? I should investigate the commit logs and mailing lists. Is there existing discussion or prior issues related to this specific ordering or `keep_prealloc` behavior? I'll search for "truncate_setsize" in the git log to see if there's any relevant history.



338/4 2026/09/17 11:32 tool git-log
0m Args:
map[CodeRegexp:truncate_setsize.*ntfs_set_size]

Results:
map[Output:]

339/4 2026/09/17 11:32 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 21137
							output: 37
							thoughts: 25
						

Thoughts:
Here's my thought process, summarized as you requested:

**Investigating Potential Data Truncation**

Okay, so I need to dig into potential issues related to data truncation, specifically within the context of `setsize` operations. My first instinct is to cast a wide net. I'm going to leverage the power of the version control system, in this case, likely Git, to explore the commit history. I'll search for every instance of the term `truncate_setsize`. That should give me a good overview of where this function or related concepts have been discussed, implemented, and potentially modified. Given the context, I should focus on the file system layers. I'll start with the entire repository and, depending on the results, narrow the search to `fs/ntfs3`. This focused search within the NTFS3 module might provide quicker results. Let's see what the search uncovers!



340/4 2026/09/17 11:33 tool git-log
0m Args:
map[Count:20 MessageRegexps:[truncate_setsize] PathPrefix:fs/ntfs3]

Results:
map[Output:]

341/4 2026/09/17 11:33 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 21401
							output: 30
							thoughts: 32
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own:

**Investigating Potential Data Corruption Scenarios**

Alright, before I dive too deep into this specific issue, let's take a step back and adopt a broader view. I need to be absolutely sure I'm not missing something subtle here. My initial focus might be too narrow. Let's start with a thorough search. I'm going to leverage my knowledge of the codebase and its history. I want to search across *every single commit message* for mentions of keywords that are relevant to this particular type of problem. Think terms like `truncate_setsize`, which sounds like it could be related to resizing or modifying data structures, which is a key potential problem. Beyond that, let's include anything related to "shrinking" – as shrinking could lead to data loss. Also, I'm thinking about related areas, like `truncate_pagecache`, because the cache interacts with all data and could be implicated. The goal is to see if any historical changes, fixes, or discussions have happened that can provide a clue to this issue. It's time to gather all related context.



342/4 2026/09/17 11:33 tool git-log
0m Args:
map[Count:20 MessageRegexps:[truncate_setsize shrink]]

Results:
map[Output:]

343/4 2026/09/17 11:33 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 21718
							output: 26
							thoughts: 23
						

Thoughts:
Here's my take on those thoughts, tailored for an expert like yourself:

**Analyzing the Git History with Precision**

Okay, so I'm thinking I need to delve into a Git repository's history, but I want to be *very* specific about what I'm looking for. The core command I'm starting with is `git log`. That's my go-to for examining commits.

The key to this investigation is the `MessageRegexps` directive. I need to filter the commit messages using regular expressions, and the specific regexp I've selected, `"truncate_setsize"`, tells me precisely what I'm hunting for. My hypothesis is that I'm trying to identify commits that deal with a truncated set size, meaning I'm looking for commits containing a message that includes the phrase "truncate_setsize". This likely suggests a particular area of code and I'm very interested to see where those changes might have occurred. Essentially, I'm performing focused pattern matching across the commit log.



344/4 2026/09/17 11:34 tool git-log
0m Args:
map[Count:10 MessageRegexps:[truncate_setsize]]

Results:
map[Output:]

345/4 2026/09/17 11:34 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 21995
							output: 30
							thoughts: 63
						

Thoughts:
**Investigating a Git Log Mystery**

Okay, so `git log` came back empty. That's strange, I know I've been making commits. Wait a minute… could this be a shallow clone issue? I'll bet the repository only has commit `fd73f4a66598` or something similar, because it was cloned with a depth of 1. Right, that makes sense.

To confirm this, I need to check the contents of that specific commit. Let's fire up `git show` and see what's what with `fd73f4a66598`. That should give me the information I need to confirm my theory and get a handle on the repository's history.



346/4 2026/09/17 11:34 tool git-show
0m Args:
map[Commit:fd73f4a66598 Stat:true]

Results:
map[Output:commit fd73f4a6659897191fa0d40695fe370925dd3780
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Sep 13 14:38:02 2026 -0700

    Linux 7.3-rc3

 .clang-format                                      |    808 +
 .clippy.toml                                       |     21 +
 .cocciconfig                                       |      3 +
 .editorconfig                                      |     27 +
 .get_maintainer.ignore                             |      9 +
 .gitattributes                                     |      5 +
 .gitignore                                         |    196 +
 .mailmap                                           |    996 +
 .pylintrc                                          |      2 +
 .rustfmt.toml                                      |     12 +
 COPYING                                            |     20 +
 CREDITS                                            |   4651 +
 Documentation/.gitignore                           |      3 +
 Documentation/.renames.txt                         |   1185 +
 Documentation/ABI/README                           |     98 +
 .../ABI/obsolete/automount-tracefs-debugfs         |     20 +
 Documentation/ABI/obsolete/o2cb                    |     11 +
 Documentation/ABI/obsolete/procfs-i8k              |     10 +
 Documentation/ABI/obsolete/sysfs-bus-iio           |    174 +
 Documentation/ABI/obsolete/sysfs-bus-usb           |     31 +
 Documentation/ABI/obsolete/sysfs-class-typec       |     48 +
 Documentation/ABI/obsolete/sysfs-cpuidle           |      9 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-arvo      |     53 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-isku      |    153 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-koneplus  |    145 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-konepure  |    105 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-kovaplus  |    116 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-lua       |      7 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-pyra      |    126 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-ryos      |    178 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-savu      |     77 +
 .../ABI/obsolete/sysfs-driver-intel_pmc_bxt        |     22 +
 Documentation/ABI/obsolete/sysfs-driver-ivpu       |     30 +
 .../ABI/obsolete/sysfs-driver-samsung-laptop       |     10 +
 Documentation/ABI/obsolete/sysfs-firmware-acpi     |      8 +
 Documentation/ABI/obsolete/sysfs-gpio              |     40 +
 .../ABI/obsolete/sysfs-kernel-fadump_enabled       |      9 +
 .../ABI/obsolete/sysfs-kernel-fadump_registered    |     10 +
 .../ABI/obsolete/sysfs-kernel-fadump_release_mem   |     10 +
 .../ABI/obsolete/sysfs-kernel-kexec-kdump          |     71 +
 .../ABI/obsolete/sysfs-platform-ideapad-laptop     |      8 +
 Documentation/ABI/removed/devfs                    |     13 +
 Documentation/ABI/removed/dv1394                   |     14 +
 Documentation/ABI/removed/ip_queue                 |      9 +
 Documentation/ABI/removed/net_dma                  |      8 +
 Documentation/ABI/removed/o2cb                     |     10 +
 Documentation/ABI/removed/raw1394                  |     16 +
 Documentation/ABI/removed/sysfs-bus-nfit           |     17 +
 Documentation/ABI/removed/sysfs-class-cxl          |    272 +
 Documentation/ABI/removed/sysfs-class-rfkill       |     13 +
 Documentation/ABI/removed/sysfs-firmware-efi-vars  |     12 +
 .../removed/sysfs-kernel-fadump_release_opalcore   |      9 +
 Documentation/ABI/removed/sysfs-kernel-uids        |     14 +
 Documentation/ABI/removed/sysfs-mce                |     37 +
 .../ABI/removed/sysfs-selinux-checkreqprot         |     26 +
 Documentation/ABI/removed/sysfs-selinux-disable    |     29 +
 Documentation/ABI/removed/sysfs-selinux-user       |     12 +
 Documentation/ABI/removed/video1394                |     17 +
 Documentation/ABI/stable/configfs-nvmet            |    352 +
 Documentation/ABI/stable/firewire-cdev             |    111 +
 Documentation/ABI/stable/o2cb                      |     10 +
 Documentation/ABI/stable/procfs-audit_loginuid     |     27 +
 Documentation/ABI/stable/syscalls                  |     10 +
 Documentation/ABI/stable/sysfs-acpi-pmprofile      |     28 +
 Documentation/ABI/stable/sysfs-block               |    941 +
 Documentation/ABI/stable/sysfs-bus-firewire        |    136 +
 Documentation/ABI/stable/sysfs-bus-fsl-mc          |     19 +
 Documentation/ABI/stable/sysfs-bus-mhi             |     44 +
 Documentation/ABI/stable/sysfs-bus-nvmem           |     50 +
 Documentation/ABI/stable/sysfs-bus-usb             |    142 +
 Documentation/ABI/stable/sysfs-bus-vmbus           |    187 +
 Documentation/ABI/stable/sysfs-bus-w1              |     12 +
 Documentation/ABI/stable/sysfs-bus-xen-backend     |     84 +
 Documentation/ABI/stable/sysfs-class-backlight     |     63 +
 Documentation/ABI/stable/sysfs-class-bluetooth     |      9 +
 Documentation/ABI/stable/sysfs-class-infiniband    |    784 +
 Documentation/ABI/stable/sysfs-class-rfkill        |     93 +
 Documentation/ABI/stable/sysfs-class-tpm           |    210 +
 Documentation/ABI/stable/sysfs-class-ubi           |    221 +
 Documentation/ABI/stable/sysfs-class-udc           |     93 +
 Documentation/ABI/stable/sysfs-devices             |     32 +
 Documentation/ABI/stable/sysfs-devices-node        |    238 +
 Documentation/ABI/stable/sysfs-devices-system-cpu  |    117 +
 .../ABI/stable/sysfs-devices-system-xen_memory     |     86 +
 Documentation/ABI/stable/sysfs-driver-aspeed-vuart |     24 +
 Documentation/ABI/stable/sysfs-driver-dma-idxd     |    376 +
 Documentation/ABI/stable/sysfs-driver-dma-ioatdma  |     30 +
 .../ABI/stable/sysfs-driver-firmware-zynqmp        |    256 +
 Documentation/ABI/stable/sysfs-driver-ib_srp       |    192 +
 Documentation/ABI/stable/sysfs-driver-misc-cp500   |     25 +
 Documentation/ABI/stable/sysfs-driver-mlxreg-io    |    815 +
 Documentation/ABI/stable/sysfs-driver-qaic         |     19 +
 Documentation/ABI/stable/sysfs-driver-qla2xxx      |      8 +
 Documentation/ABI/stable/sysfs-driver-speakup      |    394 +
 Documentation/ABI/stable/sysfs-driver-usb-usbtmc   |     27 +
 Documentation/ABI/stable/sysfs-driver-w1_ds2438    |     13 +
 Documentation/ABI/stable/sysfs-driver-w1_ds28e04   |     15 +
 Documentation/ABI/stable/sysfs-driver-w1_ds28ea00  |      6 +
 Documentation/ABI/stable/sysfs-firmware-opal-dump  |     46 +
 Documentation/ABI/stable/sysfs-firmware-opal-elog  |     62 +
 Documentation/ABI/stable/sysfs-fs-orangefs         |     87 +
 Documentation/ABI/stable/sysfs-hypervisor-xen      |    135 +
 Documentation/ABI/stable/sysfs-kernel-notes        |      5 +
 .../ABI/stable/sysfs-kernel-time-aux-clocks        |      5 +
 Documentation/ABI/stable/sysfs-module              |     47 +
 Documentation/ABI/stable/sysfs-nvme                |    453 +
 Documentation/ABI/stable/sysfs-platform-wmi-bmof   |      7 +
 Documentation/ABI/stable/sysfs-transport-srp       |     58 +
 Documentation/ABI/stable/thermal-notification      |      4 +
 Documentation/ABI/stable/vdso                      |     37 +
 Documentation/ABI/testing/amdpmf-interface         |     73 +
 Documentation/ABI/testing/configfs-acpi            |     52 +
 Documentation/ABI/testing/configfs-iio             |     34 +
 Documentation/ABI/testing/configfs-most            |    241 +
 Documentation/ABI/testing/configfs-rdma_cm         |     34 +
 .../ABI/testing/configfs-spear-pcie-gadget         |     33 +
 Documentation/ABI/testing/configfs-stp-policy      |     48 +
 .../ABI/testing/configfs-stp-policy-p_sys-t        |     41 +
 .../ABI/testing/configfs-thunderbolt_stream        |     98 +
 Documentation/ABI/testing/configfs-tsm-report      |    161 +
 Documentation/ABI/testing/configfs-usb-gadget      |    158 +
 Documentation/ABI/testing/configfs-usb-gadget-acm  |     15 +
 Documentation/ABI/testing/configfs-usb-gadget-ecm  |     20 +
 Documentation/ABI/testing/configfs-usb-gadget-eem  |     16 +
 Documentation/ABI/testing/configfs-usb-gadget-ffs  |     17 +
 Documentation/ABI/testing/configfs-usb-gadget-hid  |     13 +
 .../ABI/testing/configfs-usb-gadget-loopback       |     10 +
 .../ABI/testing/configfs-usb-gadget-mass-storage   |     41 +
 Documentation/ABI/testing/configfs-usb-gadget-midi |     15 +
 .../ABI/testing/configfs-usb-gadget-midi2          |     54 +
 Documentation/ABI/testing/configfs-usb-gadget-ncm  |     15 +
 Documentation/ABI/testing/configfs-usb-gadget-obex |      9 +
 .../ABI/testing/configfs-usb-gadget-phonet         |      8 +
 .../ABI/testing/configfs-usb-gadget-printer        |     11 +
 .../ABI/testing/configfs-usb-gadget-rndis          |     19 +
 .../ABI/testing/configfs-usb-gadget-serial         |      9 +
 .../ABI/testing/configfs-usb-gadget-sourcesink     |     16 +
 .../ABI/testing/configfs-usb-gadget-subset         |     16 +
 Documentation/ABI/testing/configfs-usb-gadget-tcm  |      6 +
 Documentation/ABI/testing/configfs-usb-gadget-uac1 |     41 +
 .../ABI/testing/configfs-usb-gadget-uac1_legacy    |      9 +
 Documentation/ABI/testing/configfs-usb-gadget-uac2 |     51 +
 Documentation/ABI/testing/configfs-usb-gadget-uvc  |    438 +
 Documentation/ABI/testing/debugfs-alienware-wmi    |     64 +
 Documentation/ABI/testing/debugfs-amd-iommu        |    131 +
 Documentation/ABI/testing/debugfs-cdns-pcie        |      5 +
 Documentation/ABI/testing/debugfs-cec-error-inj    |     40 +
 Documentation/ABI/testing/debugfs-cros-ec          |     78 +
 Documentation/ABI/testing/debugfs-cxl              |    157 +
 Documentation/ABI/testing/debugfs-dell-wmi-ddv     |     34 +
 Documentation/ABI/testing/debugfs-driver-dcc       |    127 +
 Documentation/ABI/testing/debugfs-driver-genwqe    |     91 +
 .../ABI/testing/debugfs-driver-habanalabs          |    323 +
 Documentation/ABI/testing/debugfs-driver-qat       |    109 +
 .../ABI/testing/debugfs-driver-qat_telemetry       |    259 +
 Documentation/ABI/testing/debugfs-dwc-pcie         |    157 +
 Documentation/ABI/testing/debugfs-ec               |     21 +
 Documentation/ABI/testing/debugfs-hisi-hpre        |    200 +
 Documentation/ABI/testing/debugfs-hisi-migration   |     25 +
 Documentation/ABI/testing/debugfs-hisi-sec         |    173 +
 Documentation/ABI/testing/debugfs-hisi-zip         |    174 +
 Documentation/ABI/testing/debugfs-hyperv           |     23 +
 Documentation/ABI/testing/debugfs-ideapad          |     19 +
 Documentation/ABI/testing/debugfs-iio-ad9467       |     39 +
 Documentation/ABI/testing/debugfs-iio-backend      |     20 +
 Documentation/ABI/testing/debugfs-intel-iommu      |    276 +
 Documentation/ABI/testing/debugfs-moxtet           |     35 +
 Documentation/ABI/testing/debugfs-msi-wmi-platform |     14 +
 Documentation/ABI/testing/debugfs-olpc             |     16 +
 Documentation/ABI/testing/debugfs-pcie-ptm         |     70 +
 Documentation/ABI/testing/debugfs-pfo-nx-crypto    |     45 +
 Documentation/ABI/testing/debugfs-scmi             |     70 +
 Documentation/ABI/testing/debugfs-scmi-raw         |    208 +
 Documentation/ABI/testing/debugfs-tpmi             |     40 +
 Documentation/ABI/testing/debugfs-vfio             |     57 +
 Documentation/ABI/testing/debugfs-wilco-ec         |     45 +
 Documentation/ABI/testing/dell-smbios-wmi          |     41 +
 Documentation/ABI/testing/dev-kmsg                 |    127 +
 Documentation/ABI/testing/devlink-resource-mlxsw   |     33 +
 Documentation/ABI/testing/evm                      |    109 +
 Documentation/ABI/testing/gpio-cdev                |     28 +
 Documentation/ABI/testing/ima_policy               |    196 +
 Documentation/ABI/testing/ppc-memtrace             |     46 +
 Documentation/ABI/testing/procfs-attr-current      |     20 +
 Documentation/ABI/testing/procfs-attr-exec         |     20 +
 Documentation/ABI/testing/procfs-attr-prev         |     19 +
 Documentation/ABI/testing/procfs-diskstats         |     43 +
 .../ABI/testing/procfs-nfsd-reply_cache_stats      |     38 +
 Documentation/ABI/testing/procfs-smaps_rollup      |     42 +
 Documentation/ABI/testing/pstore                   |     47 +
 Documentation/ABI/testing/rtc-cdev                 |     50 +
 Documentation/ABI/testing/securityfs-secrets-coco  |     51 +
 Documentation/ABI/testing/sysfs-amd-pmc            |     13 +
 Documentation/ABI/testing/sysfs-amd-pmf            |     13 +
 Documentation/ABI/testing/sysfs-ata                |    140 +
 .../ABI/testing/sysfs-auxdisplay-linedisp          |     90 +
 Documentation/ABI/testing/sysfs-block-aoe          |     45 +
 Documentation/ABI/testing/sysfs-block-bcache       |    149 +
 Documentation/ABI/testing/sysfs-block-device       |    119 +
 Documentation/ABI/testing/sysfs-block-dm           |     47 +
 Documentation/ABI/testing/sysfs-block-loop         |     50 +
 Documentation/ABI/testing/sysfs-block-rnbd         |     64 +
 Documentation/ABI/testing/sysfs-block-rssd         |      5 +
 Documentation/ABI/testing/sysfs-block-zram         |    166 +
 Documentation/ABI/testing/sysfs-bus-acpi           |     98 +
 Documentation/ABI/testing/sysfs-bus-amba           |     20 +
 Documentation/ABI/testing/sysfs-bus-auxiliary      |      9 +
 Documentation/ABI/testing/sysfs-bus-bcma           |     31 +
 Documentation/ABI/testing/sysfs-bus-cdx            |    121 +
 Documentation/ABI/testing/sysfs-bus-coreboot       |     45 +
 .../ABI/testing/sysfs-bus-coresight-devices-cti    |    247 +
 .../sysfs-bus-coresight-devices-dummy-source       |     21 +
 .../ABI/testing/sysfs-bus-coresight-devices-etb10  |     88 +
 .../ABI/testing/sysfs-bus-coresight-devices-etm3x  |    328 +
 .../ABI/testing/sysfs-bus-coresight-devices-etm4x  |    532 +
 .../ABI/testing/sysfs-bus-coresight-devices-funnel |     18 +
 .../ABI/testing/sysfs-bus-coresight-devices-stm    |     59 +
 .../ABI/testing/sysfs-bus-coresight-devices-tmc    |    115 +
 .../ABI/testing/sysfs-bus-coresight-devices-tpda   |     69 +
 .../ABI/testing/sysfs-bus-coresight-devices-tpdm   |    290 +
 .../ABI/testing/sysfs-bus-coresight-devices-trbe   |     20 +
 .../testing/sysfs-bus-coresight-devices-ultra_smb  |     31 +
 Documentation/ABI/testing/sysfs-bus-counter        |    477 +
 Documentation/ABI/testing/sysfs-bus-css            |     56 +
 Documentation/ABI/testing/sysfs-bus-cxl            |    646 +
 Documentation/ABI/testing/sysfs-bus-dax            |    177 +
 Documentation/ABI/testing/sysfs-bus-dfl            |     17 +
 .../ABI/testing/sysfs-bus-dfl-devices-emif         |     25 +
 .../ABI/testing/sysfs-bus-dfl-devices-n3000-nios   |     47 +
 .../ABI/testing/sysfs-bus-event_source-devices     |     24 +
 .../testing/sysfs-bus-event_source-devices-caps    |     24 +
 .../testing/sysfs-bus-event_source-devices-dfl_fme |    104 +
 .../ABI/testing/sysfs-bus-event_source-devices-dsa |     30 +
 .../testing/sysfs-bus-event_source-devices-events  |    102 +
 .../testing/sysfs-bus-event_source-devices-format  |     21 +
 .../sysfs-bus-event_source-devices-hisi_ptt        |    113 +
 .../testing/sysfs-bus-event_source-devices-hv_24x7 |     98 +
 .../testing/sysfs-bus-event_source-devices-hv_gpci |    242 +
 .../testing/sysfs-bus-event_source-devices-iommu   |     37 +
 .../testing/sysfs-bus-event_source-devices-rdpmc   |     44 +
 .../testing/sysfs-bus-event_source-devices-uncore  |     13 +
 .../testing/sysfs-bus-event_source-devices-vpa-dtl |     25 +
 .../testing/sysfs-bus-event_source-devices-vpa-pmu |     25 +
 Documentation/ABI/testing/sysfs-bus-fcoe           |    138 +
 Documentation/ABI/testing/sysfs-bus-fsi            |     46 +
 .../ABI/testing/sysfs-bus-fsi-devices-sbefifo      |     10 +
 Documentation/ABI/testing/sysfs-bus-fsl-mc         |     25 +
 Documentation/ABI/testing/sysfs-bus-hsi            |     19 +
 .../ABI/testing/sysfs-bus-i2c-devices-bq32k        |      7 +
 .../ABI/testing/sysfs-bus-i2c-devices-fsa9480      |     27 +
 .../ABI/testing/sysfs-bus-i2c-devices-hm6352       |     21 +
 .../ABI/testing/sysfs-bus-i2c-devices-lm3533       |     15 +
 .../ABI/testing/sysfs-bus-i2c-devices-m24lr        |    100 +
 .../ABI/testing/sysfs-bus-i2c-devices-pca954x      |     23 +
 .../testing/sysfs-bus-i2c-devices-turris-omnia-mcu |    113 +
 Documentation/ABI/testing/sysfs-bus-i3c            |    194 +
 Documentation/ABI/testing/sysfs-bus-iio            |   2511 +
 .../ABI/testing/sysfs-bus-iio-accel-adxl372        |      7 +
 .../ABI/testing/sysfs-bus-iio-accel-bmc150         |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-ad9739a    |     19 +
 .../ABI/testing/sysfs-bus-iio-adc-ad-sigma-delta   |     23 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130 |     20 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 |     27 +
 .../ABI/testing/sysfs-bus-iio-adc-ad7280a          |     13 +
 .../testing/sysfs-bus-iio-adc-envelope-detector    |     39 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-hi8435 |     48 +
 .../ABI/testing/sysfs-bus-iio-adc-max11410         |     13 +
 .../ABI/testing/sysfs-bus-iio-adc-mcp3564          |     53 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-mt6360 |     78 +
 .../ABI/testing/sysfs-bus-iio-adc-pac1934          |      9 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-stm32  |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-bno055     |     81 +
 Documentation/ABI/testing/sysfs-bus-iio-cdc-ad7746 |     11 +
 .../ABI/testing/sysfs-bus-iio-chemical-sgp40       |     17 +
 .../ABI/testing/sysfs-bus-iio-chemical-sunrise-co2 |     38 +
 .../ABI/testing/sysfs-bus-iio-chemical-vz89x       |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-cros-ec    |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-dac        |     61 +
 Documentation/ABI/testing/sysfs-bus-iio-dac-ad5766 |     31 +
 .../ABI/testing/sysfs-bus-iio-dac-dpot-dac         |      8 +
 .../ABI/testing/sysfs-bus-iio-dac-ltc2688          |     55 +
 .../ABI/testing/sysfs-bus-iio-dfsdm-adc-stm32      |     22 +
 .../ABI/testing/sysfs-bus-iio-distance-srf08       |     17 +
 Documentation/ABI/testing/sysfs-bus-iio-dma-buffer |     19 +
 .../ABI/testing/sysfs-bus-iio-filter-admv8818      |     18 +
 Documentation/ABI/testing/sysfs-bus-iio-flow       |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-frequency  |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-ad9523     |     31 +
 .../ABI/testing/sysfs-bus-iio-frequency-adf4350    |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-adf4371    |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-admv1013   |     38 +
 .../ABI/testing/sysfs-bus-iio-frequency-admv1014   |     23 +
 .../ABI/testing/sysfs-bus-iio-gyro-bmg160          |      7 +
 .../ABI/testing/sysfs-bus-iio-health-afe440x       |     39 +
 Documentation/ABI/testing/sysfs-bus-iio-humidity   |     10 +
 .../sysfs-bus-iio-impedance-analyzer-ad5933        |     35 +
 Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc |     15 +
 .../ABI/testing/sysfs-bus-iio-inv_icm42600         |     18 +
 Documentation/ABI/testing/sysfs-bus-iio-isl29501   |     47 +
 .../ABI/testing/sysfs-bus-iio-light-isl29018       |     21 +
 .../ABI/testing/sysfs-bus-iio-light-lm3533-als     |     56 +
 .../ABI/testing/sysfs-bus-iio-light-si1133         |     22 +
 .../ABI/testing/sysfs-bus-iio-light-tsl2583        |     20 +
 .../ABI/testing/sysfs-bus-iio-light-tsl2772        |     13 +
 .../ABI/testing/sysfs-bus-iio-magnetometer-hmc5843 |     20 +
 Documentation/ABI/testing/sysfs-bus-iio-meas-spec  |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-mpu6050    |     13 +
 .../testing/sysfs-bus-iio-potentiometer-mcp4531    |      8 +
 Documentation/ABI/testing/sysfs-bus-iio-proximity  |     24 +
 .../ABI/testing/sysfs-bus-iio-proximity-as3935     |     15 +
 .../ABI/testing/sysfs-bus-iio-resolver-ad2s1210    |     27 +
 Documentation/ABI/testing/sysfs-bus-iio-sps30      |     28 +
 Documentation/ABI/testing/sysfs-bus-iio-sx9310     |     10 +
 Documentation/ABI/testing/sysfs-bus-iio-sx9324     |     29 +
 .../ABI/testing/sysfs-bus-iio-thermocouple         |     18 +
 .../ABI/testing/sysfs-bus-iio-timer-stm32          |    143 +
 .../ABI/testing/sysfs-bus-iio-trigger-sysfs        |     42 +
 Documentation/ABI/testing/sysfs-bus-iio-vf610      |     16 +
 .../ABI/testing/sysfs-bus-intel_th-devices-gth     |     52 +
 .../ABI/testing/sysfs-bus-intel_th-devices-msc     |     54 +
 .../ABI/testing/sysfs-bus-intel_th-devices-pti     |     24 +
 .../ABI/testing/sysfs-bus-intel_th-output-devices  |     15 +
 Documentation/ABI/testing/sysfs-bus-mcb            |     29 +
 Documentation/ABI/testing/sysfs-bus-mdio           |     72 +
 Documentation/ABI/testing/sysfs-bus-media          |      6 +
 Documentation/ABI/testing/sysfs-bus-mei            |     56 +
 Documentation/ABI/testing/sysfs-bus-mmc            |      4 +
 Documentation/ABI/testing/sysfs-bus-most           |    299 +
 Documentation/ABI/testing/sysfs-bus-moxtet-devices |     17 +
 Documentation/ABI/testing/sysfs-bus-nfit           |    233 +
 Documentation/ABI/testing/sysfs-bus-nvdimm         |     60 +
 Documentation/ABI/testing/sysfs-bus-optee-devices  |     17 +
 Documentation/ABI/testing/sysfs-bus-papr-pmem      |     75 +
 Documentation/ABI/testing/sysfs-bus-pci            |    704 +
 .../ABI/testing/sysfs-bus-pci-devices-aer          |    163 +
 .../ABI/testing/sysfs-bus-pci-devices-avs          |      8 +
 .../ABI/testing/sysfs-bus-pci-devices-catpt        |     17 +
 .../ABI/testing/sysfs-bus-pci-devices-cciss        |     80 +
 .../ABI/testing/sysfs-bus-pci-devices-pvpanic      |     26 +
 .../ABI/testing/sysfs-bus-pci-drivers-btintel_pcie |     15 +
 .../ABI/testing/sysfs-bus-pci-drivers-ehci_hcd     |     46 +
 .../ABI/testing/sysfs-bus-pci-drivers-janz-cmodio  |      8 +
 .../ABI/testing/sysfs-bus-pci-drivers-xhci_hcd     |    129 +
 Documentation/ABI/testing/sysfs-bus-peci           |     16 +
 Documentation/ABI/testing/sysfs-bus-platform       |     56 +
 .../sysfs-bus-platform-devices-ampere-smpro        |    325 +
 .../testing/sysfs-bus-platform-devices-occ-hwmon   |     13 +
 .../sysfs-bus-platform-drivers-amd_x3d_vcache      |     12 +
 .../ABI/testing/sysfs-bus-platform-onboard-usb-dev |      9 +
 Documentation/ABI/testing/sysfs-bus-rapidio        |    201 +
 Documentation/ABI/testing/sysfs-bus-rbd            |    173 +
 Documentation/ABI/testing/sysfs-bus-rpmsg          |     95 +
 Documentation/ABI/testing/sysfs-bus-siox           |     90 +
 .../ABI/testing/sysfs-bus-soundwire-master         |     23 +
 .../ABI/testing/sysfs-bus-soundwire-slave          |    109 +
 .../ABI/testing/sysfs-bus-spi-devices-spi-nor      |     40 +
 .../testing/sysfs-bus-surface_aggregator-tabletsw  |     57 +
 Documentation/ABI/testing/sysfs-bus-thunderbolt    |    370 +
 Documentation/ABI/testing/sysfs-bus-typec          |     51 +
 Documentation/ABI/testing/sysfs-bus-usb            |    607 +
 .../ABI/testing/sysfs-bus-usb-devices-usbsevseg    |     46 +
 Documentation/ABI/testing/sysfs-bus-usb-lvstest    |     60 +
 Documentation/ABI/testing/sysfs-bus-vdpa           |     57 +
 Documentation/ABI/testing/sysfs-bus-vfio-mdev      |    113 +
 Documentation/ABI/testing/sysfs-bus-vmbus          |     21 +
 Documentation/ABI/testing/sysfs-bus-wmi            |     81 +
 Documentation/ABI/testing/sysfs-c2port             |     81 +
 Documentation/ABI/testing/sysfs-cfq-target-latency |      8 +
 Documentation/ABI/testing/sysfs-class              |     16 +
 Documentation/ABI/testing/sysfs-class-backlight    |    186 +
 .../testing/sysfs-class-backlight-driver-lm3533    |     54 +
 .../ABI/testing/sysfs-class-backlight-lm3639       |     11 +
 Documentation/ABI/testing/sysfs-class-bdi          |    134 +
 Documentation/ABI/testing/sysfs-class-bsr          |     25 +
 Documentation/ABI/testing/sysfs-class-chromeos     |     53 +
 .../sysfs-class-chromeos-driver-cros-ec-lightbar   |     74 +
 .../sysfs-class-chromeos-driver-cros-ec-vbc        |      6 +
 Documentation/ABI/testing/sysfs-class-devfreq      |    143 +
 .../ABI/testing/sysfs-class-devfreq-event          |     25 +
 Documentation/ABI/testing/sysfs-class-devlink      |    130 +
 Documentation/ABI/testing/sysfs-class-drm          |      8 +
 Documentation/ABI/testing/sysfs-class-extcon       |    101 +
 Documentation/ABI/testing/sysfs-class-fc           |     27 +
 Documentation/ABI/testing/sysfs-class-fc_host      |     23 +
 .../ABI/testing/sysfs-class-fc_remote_ports        |     23 +
 Documentation/ABI/testing/sysfs-class-firmware     |     77 +
 .../ABI/testing/sysfs-class-firmware-attributes    |    494 +
 Documentation/ABI/testing/sysfs-class-fpga-bridge  |     11 +
 Documentation/ABI/testing/sysfs-class-fpga-manager |     60 +
 Documentation/ABI/testing/sysfs-class-fpga-region  |      9 +
 Documentation/ABI/testing/sysfs-class-gnss         |     17 +
 Documentation/ABI/testing/sysfs-class-hwmon        |   1089 +
 .../ABI/testing/sysfs-class-ieee80211-rtw89        |     24 +
 Documentation/ABI/testing/sysfs-class-intel_pmt    |    119 +
 .../ABI/testing/sysfs-class-intel_pmt-features     |    134 +
 Documentation/ABI/testing/sysfs-class-iommu        |     17 +
 .../ABI/testing/sysfs-class-iommu-amd-iommu        |     14 +
 .../ABI/testing/sysfs-class-iommu-intel-iommu      |     32 +
 Documentation/ABI/testing/sysfs-class-issei        |     73 +
 Documentation/ABI/testing/sysfs-class-lcd          |     23 +
 Documentation/ABI/testing/sysfs-class-led          |     89 +
 .../ABI/testing/sysfs-class-led-driver-aw200xx     |      5 +
 .../ABI/testing/sysfs-class-led-driver-lm3533      |     73 +
 .../testing/sysfs-class-led-driver-turris-omnia    |     28 +
 Documentation/ABI/testing/sysfs-class-led-flash    |     89 +
 .../ABI/testing/sysfs-class-led-multicolor         |     37 +
 .../ABI/testing/sysfs-class-led-trigger-netdev     |    192 +
 .../ABI/testing/sysfs-class-led-trigger-oneshot    |     36 +
 .../ABI/testing/sysfs-class-led-trigger-pattern    |     50 +
 .../ABI/testing/sysfs-class-led-trigger-tty        |     62 +
 .../ABI/testing/sysfs-class-led-trigger-usbport    |     13 +
 Documentation/ABI/testing/sysfs-class-leds-gt683r  |     18 +
 Documentation/ABI/testing/sysfs-class-mei          |    105 +
 Documentation/ABI/testing/sysfs-class-mic          |    178 +
 Documentation/ABI/testing/sysfs-class-mtd          |    242 +
 Documentation/ABI/testing/sysfs-class-mux          |     16 +
 Documentation/ABI/testing/sysfs-class-net          |    354 +
 Documentation/ABI/testing/sysfs-class-net-cdc_ncm  |    168 +
 Documentation/ABI/testing/sysfs-class-net-dsa      |     14 +
 Documentation/ABI/testing/sysfs-class-net-grcan    |     35 +
 .../ABI/testing/sysfs-class-net-janz-ican3         |     19 +
 Documentation/ABI/testing/sysfs-class-net-peak_usb |     19 +
 Documentation/ABI/testing/sysfs-class-net-phydev   |     75 +
 Documentation/ABI/testing/sysfs-class-net-qmi      |     76 +
 Documentation/ABI/testing/sysfs-class-net-queues   |    121 +
 .../ABI/testing/sysfs-class-net-statistics         |    217 +
 Documentation/ABI/testing/sysfs-class-ocxl         |     51 +
 .../ABI/testing/sysfs-class-platform-profile       |     50 +
 Documentation/ABI/testing/sysfs-class-power        |    906 +
 .../ABI/testing/sysfs-class-power-bd71828          |     13 +
 Documentation/ABI/testing/sysfs-class-power-gaokun |     27 +
 .../ABI/testing/sysfs-class-power-ltc4162l         |     82 +
 .../ABI/testing/sysfs-class-power-max1720x         |     32 +
 Documentation/ABI/testing/sysfs-class-power-mp2629 |      9 +
 Documentation/ABI/testing/sysfs-class-power-rt9467 |     19 +
 Documentation/ABI/testing/sysfs-class-power-rt9471 |     32 +
 Documentation/ABI/testing/sysfs-class-power-rt9756 |     30 +
 .../ABI/testing/sysfs-class-power-surface          |     15 +
 .../ABI/testing/sysfs-class-power-twl4030          |     33 +
 Documentation/ABI/testing/sysfs-class-power-wilco  |     40 +
 Documentation/ABI/testing/sysfs-class-powercap     |    152 +
 Documentation/ABI/testing/sysfs-class-pwm          |     88 +
 Documentation/ABI/testing/sysfs-class-rapidio      |     59 +
 Documentation/ABI/testing/sysfs-class-rc           |    137 +
 Documentation/ABI/testing/sysfs-class-rc-nuvoton   |     15 +
 .../testing/sysfs-class-reboot-mode-reboot_modes   |     39 +
 Documentation/ABI/testing/sysfs-class-regulator    |    453 +
 Documentation/ABI/testing/sysfs-class-remoteproc   |    104 +
 Documentation/ABI/testing/sysfs-class-rnbd-client  |    133 +
 Documentation/ABI/testing/sysfs-class-rnbd-server  |     58 +
 Documentation/ABI/testing/sysfs-class-rtc          |     91 +
 .../sysfs-class-rtc-rtc0-device-rtc_calibration    |     14 +
 Documentation/ABI/testing/sysfs-class-rtrs-client  |    146 +
 Documentation/ABI/testing/sysfs-class-rtrs-server  |     53 +
 Documentation/ABI/testing/sysfs-class-scsi_host    |    119 +
 Documentation/ABI/testing/sysfs-class-scsi_tape    |    109 +
 Documentation/ABI/testing/sysfs-class-spi-eeprom   |     30 +
 Documentation/ABI/testing/sysfs-class-spi-master   |     34 +
 Documentation/ABI/testing/sysfs-class-stm          |     24 +
 Documentation/ABI/testing/sysfs-class-stm_source   |     11 +
 Documentation/ABI/testing/sysfs-class-switchtec    |     96 +
 Documentation/ABI/testing/sysfs-class-tee          |     25 +
 Documentation/ABI/testing/sysfs-class-thermal      |    259 +
 Documentation/ABI/testing/sysfs-class-tsm          |      9 +
 Documentation/ABI/testing/sysfs-class-typec        |    386 +
 .../ABI/testing/sysfs-class-usb_power_delivery     |    284 +
 Documentation/ABI/testing/sysfs-class-usb_role     |     27 +
 Documentation/ABI/testing/sysfs-class-vduse        |     33 +
 Documentation/ABI/testing/sysfs-class-wakeup       |     76 +
 Documentation/ABI/testing/sysfs-class-watchdog     |    129 +
 Documentation/ABI/testing/sysfs-class-zram         |     24 +
 Documentation/ABI/testing/sysfs-dev                |     21 +
 Documentation/ABI/testing/sysfs-devices            |     25 +
 Documentation/ABI/testing/sysfs-devices-consumer   |      9 +
 Documentation/ABI/testing/sysfs-devices-coredump   |     10 +
 Documentation/ABI/testing/sysfs-devices-edac       |    157 +
 .../ABI/testing/sysfs-devices-faux-tdx-host        |     26 +
 .../ABI/testing/sysfs-devices-firmware_node        |     17 +
 Documentation/ABI/testing/sysfs-devices-lpss_ltr   |     44 +
 Documentation/ABI/testing/sysfs-devices-mapping    |     62 +
 Documentation/ABI/testing/sysfs-devices-memory     |    120 +
 Documentation/ABI/testing/sysfs-devices-mmc        |     21 +
 Documentation/ABI/testing/sysfs-devices-online     |     20 +
 .../ABI/testing/sysfs-devices-pci-host-bridge      |     45 +
 .../ABI/testing/sysfs-devices-physical_location    |     42 +
 .../ABI/testing/sysfs-devices-platform-ACPI-TAD    |    117 +
 .../testing/sysfs-devices-platform-_UDC_-gadget    |     23 +
 .../ABI/testing/sysfs-devices-platform-docg3       |     40 +
 .../ABI/testing/sysfs-devices-platform-dock        |     39 +
 .../ABI/testing/sysfs-devices-platform-ipmi        |    242 +
 .../testing/sysfs-devices-platform-kunpeng_hccs    |    126 +
 .../sysfs-devices-platform-sh_mobile_lcdc_fb       |     44 +
 .../ABI/testing/sysfs-devices-platform-soc-ipa     |    114 +
 .../testing/sysfs-devices-platform-stratix10-rsu   |    232 +
 .../ABI/testing/sysfs-devices-platform-trackpoint  |    115 +
 Documentation/ABI/testing/sysfs-devices-power      |    307 +
 .../ABI/testing/sysfs-devices-power_resources_D0   |     13 +
 .../ABI/testing/sysfs-devices-power_resources_D1   |     14 +
 .../ABI/testing/sysfs-devices-power_resources_D2   |     14 +
 .../testing/sysfs-devices-power_resources_D3hot    |     14 +
 .../testing/sysfs-devices-power_resources_wakeup   |     13 +
 .../ABI/testing/sysfs-devices-power_state          |     20 +
 .../ABI/testing/sysfs-devices-real_power_state     |     23 +
 Documentation/ABI/testing/sysfs-devices-removable  |     20 +
 .../ABI/testing/sysfs-devices-resource_in_use      |     12 +
 Documentation/ABI/testing/sysfs-devices-soc        |     95 +
 .../ABI/testing/sysfs-devices-software_node        |     10 +
 .../ABI/testing/sysfs-devices-state_synced         |     29 +
 Documentation/ABI/testing/sysfs-devices-sun        |     14 +
 Documentation/ABI/testing/sysfs-devices-supplier   |      9 +
 Documentation/ABI/testing/sysfs-devices-system-cpu |    808 +
 .../ABI/testing/sysfs-devices-system-ibm-rtl       |     24 +
 .../ABI/testing/sysfs-devices-system-xen_cpu       |     20 +
 Documentation/ABI/testing/sysfs-devices-vfio-dev   |      8 +
 .../testing/sysfs-devices-virtual-misc-tdx_guest   |     63 +
 .../ABI/testing/sysfs-devices-waiting_for_supplier |     17 +
 Documentation/ABI/testing/sysfs-devices-xenbus     |     41 +
 Documentation/ABI/testing/sysfs-driver-altera-cvp  |      8 +
 Documentation/ABI/testing/sysfs-driver-amd-sfh     |     13 +
 .../ABI/testing/sysfs-driver-aspeed-uart-routing   |     27 +
 .../ABI/testing/sysfs-driver-bd9571mwv-regulator   |     31 +
 Documentation/ABI/testing/sysfs-driver-ccp         |    120 +
 .../ABI/testing/sysfs-driver-chromeos-acpi         |    152 +
 .../ABI/testing/sysfs-driver-dell-dw5826e-reset    |      9 +
 Documentation/ABI/testing/sysfs-driver-eud         |      9 +
 .../ABI/testing/sysfs-driver-framer-pef2256        |      8 +
 .../ABI/testing/sysfs-driver-fsi-master-gpio       |     10 +
 Documentation/ABI/testing/sysfs-driver-ge-achc     |     15 +
 Documentation/ABI/testing/sysfs-driver-genwqe      |     78 +
 Documentation/ABI/testing/sysfs-driver-habanalabs  |    265 +
 Documentation/ABI/testing/sysfs-driver-hid         |     20 +
 .../ABI/testing/sysfs-driver-hid-appletb-kbd       |     13 +
 Documentation/ABI/testing/sysfs-driver-hid-corsair |     15 +
 .../ABI/testing/sysfs-driver-hid-corsair-void      |     38 +
 Documentation/ABI/testing/sysfs-driver-hid-lenovo  |     60 +
 .../ABI/testing/sysfs-driver-hid-lenovo-go         |    724 +
 .../ABI/testing/sysfs-driver-hid-lenovo-go-s       |    304 +
 .../ABI/testing/sysfs-driver-hid-logitech-hidpp    |     19 +
 .../ABI/testing/sysfs-driver-hid-logitech-lg4ff    |     75 +
 .../ABI/testing/sysfs-driver-hid-multitouch        |      9 +
 Documentation/ABI/testing/sysfs-driver-hid-ntrig   |     73 +
 Documentation/ABI/testing/sysfs-driver-hid-picolcd |     43 +
 .../ABI/testing/sysfs-driver-hid-prodikeys         |     29 +
 .../ABI/testing/sysfs-driver-hid-roccat-kone       |    125 +
 Documentation/ABI/testing/sysfs-driver-hid-srws1   |     21 +
 Documentation/ABI/testing/sysfs-driver-hid-wiimote |     85 +
 .../ABI/testing/sysfs-driver-input-axp-pek         |     11 +
 .../ABI/testing/sysfs-driver-input-cros-ec-keyb    |      6 +
 .../ABI/testing/sysfs-driver-input-exc3000         |     26 +
 Documentation/ABI/testing/sysfs-driver-intc_sar    |     54 +
 .../ABI/testing/sysfs-driver-intel-i915-hwmon      |     93 +
 .../ABI/testing/sysfs-driver-intel-m10-bmc         |     36 +
 .../testing/sysfs-driver-intel-m10-bmc-sec-update  |     61 +
 .../ABI/testing/sysfs-driver-intel-rapid-start     |     21 +
 .../ABI/testing/sysfs-driver-intel-xe-hwmon        |    315 +
 .../ABI/testing/sysfs-driver-intel-xe-ras          |     30 +
 .../ABI/testing/sysfs-driver-intel-xe-sriov        |    190 +
 Documentation/ABI/testing/sysfs-driver-intel_sdsi  |     90 +
 Documentation/ABI/testing/sysfs-driver-ivpu        |     65 +
 .../ABI/testing/sysfs-driver-jz4780-efuse          |     20 +
 .../ABI/testing/sysfs-driver-lenovo-yb9-kbdock     |     19 +
 .../ABI/testing/sysfs-driver-panfrost-profiling    |     10 +
 .../ABI/testing/sysfs-driver-panthor-profiling     |     10 +
 Documentation/ABI/testing/sysfs-driver-pciback     |     28 +
 Documentation/ABI/testing/sysfs-driver-ppi         |     75 +
 Documentation/ABI/testing/sysfs-driver-qaic        |     18 +
 Documentation/ABI/testing/sysfs-driver-qat         |    167 +
 Documentation/ABI/testing/sysfs-driver-qat_kpt     |     97 +
 Documentation/ABI/testing/sysfs-driver-qat_ras     |     41 +
 Documentation/ABI/testing/sysfs-driver-qat_rl      |    226 +
 Documentation/ABI/testing/sysfs-driver-qat_svn     |    114 +
 .../ABI/testing/sysfs-driver-samsung-laptop        |     37 +
 Documentation/ABI/testing/sysfs-driver-spi-intel   |     20 +
 Documentation/ABI/testing/sysfs-driver-st          |     12 +
 Documentation/ABI/testing/sysfs-driver-tegra-fuse  |     11 +
 .../ABI/testing/sysfs-driver-toshiba_acpi          |    223 +
 .../ABI/testing/sysfs-driver-toshiba_haps          |     22 +
 .../ABI/testing/sysfs-driver-typec-displayport     |     74 +
 Documentation/ABI/testing/sysfs-driver-uacce       |     57 +
 Documentation/ABI/testing/sysfs-driver-ucsi-ccg    |      6 +
 Documentation/ABI/testing/sysfs-driver-ufs         |   1793 +
 .../ABI/testing/sysfs-driver-uio_pci_sva-pasid     |     29 +
 .../ABI/testing/sysfs-driver-uniwill-laptop        |    105 +
 Documentation/ABI/testing/sysfs-driver-w1_ds28e17  |     24 +
 Documentation/ABI/testing/sysfs-driver-w1_therm    |    190 +
 Documentation/ABI/testing/sysfs-driver-wacom       |    105 +
 Documentation/ABI/testing/sysfs-driver-xdata       |     49 +
 Documentation/ABI/testing/sysfs-driver-xen-blkback |     46 +
 .../ABI/testing/sysfs-driver-xen-blkfront          |     19 +
 .../ABI/testing/sysfs-driver-xilinx-tmr-manager    |     16 +
 Documentation/ABI/testing/sysfs-driver-zynqmp-fpga |     73 +
 Documentation/ABI/testing/sysfs-edac-ecs           |     74 +
 Documentation/ABI/testing/sysfs-edac-memory-repair |    206 +
 Documentation/ABI/testing/sysfs-edac-scrub         |     85 +
 Documentation/ABI/testing/sysfs-firmware-acpi      |    277 +
 .../ABI/testing/sysfs-firmware-dmi-entries         |    114 +
 .../ABI/testing/sysfs-firmware-dmi-tables          |     22 +
 Documentation/ABI/testing/sysfs-firmware-efi       |     45 +
 Documentation/ABI/testing/sysfs-firmware-efi-esrt  |     87 +
 .../ABI/testing/sysfs-firmware-efi-runtime-map     |     36 +
 Documentation/ABI/testing/sysfs-firmware-gsmi      |     58 +
 Documentation/ABI/testing/sysfs-firmware-initrd    |      8 +
 .../ABI/testing/sysfs-firmware-lefi-boardinfo      |     35 +
 Documentation/ABI/testing/sysfs-firmware-log       |      7 +
 Documentation/ABI/testing/sysfs-firmware-memmap    |     75 +
 Documentation/ABI/testing/sysfs-firmware-ofw       |     52 +
 .../ABI/testing/sysfs-firmware-opal-powercap       |     31 +
 Documentation/ABI/testing/sysfs-firmware-opal-psr  |     18 +
 .../ABI/testing/sysfs-firmware-opal-sensor-groups  |     21 +
 .../testing/sysfs-firmware-papr-energy-scale-info  |     29 +
 Documentation/ABI/testing/sysfs-firmware-plpks     |     58 +
 .../ABI/testing/sysfs-firmware-qemu_fw_cfg         |    103 +
 .../ABI/testing/sysfs-firmware-sev-vulnerabilities |     19 +
 Documentation/ABI/testing/sysfs-firmware-sgi_uv    |    159 +
 .../ABI/testing/sysfs-firmware-turris-mox-rwtm     |     28 +
 Documentation/ABI/testing/sysfs-fs-erofs           |     49 +
 Documentation/ABI/testing/sysfs-fs-ext4            |    118 +
 Documentation/ABI/testing/sysfs-fs-f2fs            |   1022 +
 Documentation/ABI/testing/sysfs-fs-nilfs2          |    269 +
 Documentation/ABI/testing/sysfs-fs-ubifs           |     35 +
 Documentation/ABI/testing/sysfs-fs-virtiofs        |     11 +
 Documentation/ABI/testing/sysfs-fs-xfs             |     37 +
 Documentation/ABI/testing/sysfs-hypervisor-xen     |     46 +
 Documentation/ABI/testing/sysfs-ibft               |     33 +
 .../ABI/testing/sysfs-kernel-address_bits          |     10 +
 Documentation/ABI/testing/sysfs-kernel-boot_params |     39 +
 Documentation/ABI/testing/sysfs-kernel-btf         |     25 +
 .../ABI/testing/sysfs-kernel-cpu_byteorder         |     12 +
 Documentation/ABI/testing/sysfs-kernel-fadump      |     59 +
 Documentation/ABI/testing/sysfs-kernel-fscaps      |      8 +
 .../ABI/testing/sysfs-kernel-hardlockup_count      |      7 +
 .../ABI/testing/sysfs-kernel-iommu_groups          |     64 +
 Documentation/ABI/testing/sysfs-kernel-irq         |     60 +
 Documentation/ABI/testing/sysfs-kernel-kexec-kdump |     61 +
 Documentation/ABI/testing/sysfs-kernel-livepatch   |     95 +
 Documentation/ABI/testing/sysfs-kernel-mm          |      6 +
 Documentation/ABI/testing/sysfs-kernel-mm-cma      |     44 +
 Documentation/ABI/testing/sysfs-kernel-mm-damon    |    664 +
 .../ABI/testing/sysfs-kernel-mm-hugepages          |     17 +
 Documentation/ABI/testing/sysfs-kernel-mm-ksm      |     61 +
 .../ABI/testing/sysfs-kernel-mm-memory-tiers       |     25 +
 .../ABI/testing/sysfs-kernel-mm-mempolicy          |      4 +
 .../sysfs-kernel-mm-mempolicy-weighted-interleave  |     54 +
 Documentation/ABI/testing/sysfs-kernel-mm-numa     |     28 +
 Documentation/ABI/testing/sysfs-kernel-mm-swap     |     16 +
 .../testing/sysfs-kernel-mm-transparent-hugepage   |     18 +
 Documentation/ABI/testing/sysfs-kernel-oops_count  |      6 +
 .../ABI/testing/sysfs-kernel-rcu_stall_count       |      6 +
 Documentation/ABI/testing/sysfs-kernel-reboot      |     40 +
 Documentation/ABI/testing/sysfs-kernel-slab        |    526 +
 .../ABI/testing/sysfs-kernel-softlockup_count      |      7 +
 Documentation/ABI/testing/sysfs-kernel-vmcoreinfo  |     14 +
 Documentation/ABI/testing/sysfs-kernel-warn_count  |      6 +
 Documentation/ABI/testing/sysfs-mce                |     97 +
 .../ABI/testing/sysfs-memory-page-offline          |     44 +
 Documentation/ABI/testing/sysfs-module             |     84 +
 Documentation/ABI/testing/sysfs-nvmem-cells        |     21 +
 Documentation/ABI/testing/sysfs-ocfs2              |     89 +
 .../ABI/testing/sysfs-platform-alienware-wmi       |     14 +
 .../ABI/testing/sysfs-platform-asus-laptop         |     71 +
 Documentation/ABI/testing/sysfs-platform-asus-wmi  |    240 +
 Documentation/ABI/testing/sysfs-platform-at91      |     27 +
 Documentation/ABI/testing/sysfs-platform-ayaneo-ec |     19 +
 .../ABI/testing/sysfs-platform-brcmstb-gisb-arb    |      8 +
 .../ABI/testing/sysfs-platform-brcmstb-memc        |     15 +
 .../ABI/testing/sysfs-platform-chipidea-usb-otg    |     56 +
 .../ABI/testing/sysfs-platform-chipidea-usb2       |      9 +
 .../ABI/testing/sysfs-platform-dell-laptop         |     73 +
 .../ABI/testing/sysfs-platform-dell-privacy-wmi    |     71 +
 .../ABI/testing/sysfs-platform-dell-smbios         |     21 +
 .../ABI/testing/sysfs-platform-dell-wmi-ddv        |      9 +
 Documentation/ABI/testing/sysfs-platform-dfl-fme   |    246 +
 Documentation/ABI/testing/sysfs-platform-dfl-port  |    101 +
 Documentation/ABI/testing/sysfs-platform-dptf      |    157 +
 .../ABI/testing/sysfs-platform-eeepc-laptop        |     56 +
 Documentation/ABI/testing/sysfs-platform-hidma     |      9 +
 .../ABI/testing/sysfs-platform-hidma-mgmt          |     97 +
 .../ABI/testing/sysfs-platform-i2c-demux-pinctrl   |     18 +
 .../ABI/testing/sysfs-platform-ideapad-laptop      |     52 +
 Documentation/ABI/testing/sysfs-platform-intel-ifs |     52 +
 Documentation/ABI/testing/sysfs-platform-intel-pmc |     22 +
 .../testing/sysfs-platform-intel-wmi-sbl-fw-update |     13 +
 .../testing/sysfs-platform-intel-wmi-thunderbolt   |     12 +
 Documentation/ABI/testing/sysfs-platform-kim       |     49 +
 Documentation/ABI/testing/sysfs-platform-lg-laptop |     36 +
 .../ABI/testing/sysfs-platform-mellanox-bootctl    |    162 +
 .../ABI/testing/sysfs-platform-mellanox-pmc        |     64 +
 .../ABI/testing/sysfs-platform-msi-laptop          |     83 +
 Documentation/ABI/testing/sysfs-platform-oxp       |     25 +
 .../ABI/testing/sysfs-platform-phy-rcar-gen3-usb2  |     17 +
 .../ABI/testing/sysfs-platform-power-on-reason     |     12 +
 .../ABI/testing/sysfs-platform-renesas_usb3        |     17 +
 Documentation/ABI/testing/sysfs-platform-silicom   |     30 +
 Documentation/ABI/testing/sysfs-platform-sst-atom  |     26 +
 Documentation/ABI/testing/sysfs-platform-tahvo-usb |     16 +
 Documentation/ABI/testing/sysfs-platform-ts5500    |     54 +
 .../ABI/testing/sysfs-platform-twl4030-usb         |      8 +
 .../ABI/testing/sysfs-platform-usbip-vudc          |     38 +
 Documentation/ABI/testing/sysfs-platform-wilco-ec  |     58 +
 Documentation/ABI/testing/sysfs-platform_profile   |     40 +
 Documentation/ABI/testing/sysfs-power              |    472 +
 Documentation/ABI/testing/sysfs-pps                |     73 +
 Documentation/ABI/testing/sysfs-pps-gen            |     43 +
 Documentation/ABI/testing/sysfs-pps-gen-tio        |      6 +
 Documentation/ABI/testing/sysfs-profiling          |     13 +
 Documentation/ABI/testing/sysfs-ptp                |    142 +
 Documentation/ABI/testing/sysfs-secvar             |     65 +
 Documentation/ABI/testing/sysfs-timecard           |    293 +
 Documentation/ABI/testing/sysfs-tty                |    166 +
 Documentation/ABI/testing/sysfs-uevent             |     51 +
 Documentation/ABI/testing/usb-charger-uevent       |     54 +
 Documentation/ABI/testing/usb-uevent               |     27 +
 Documentation/Changes                              |      1 +
 Documentation/CodingStyle                          |      1 +
 Documentation/Kconfig                              |     28 +
 Documentation/Makefile                             |    115 +
 Documentation/PCI/acpi-info.rst                    |    192 +
 Documentation/PCI/boot-interrupts.rst              |    159 +
 Documentation/PCI/controller/index.rst             |     11 +
 .../PCI/controller/pci-controller-drivers.rst      |    402 +
 .../PCI/controller/rcar-pcie-firmware.rst          |     32 +
 .../PCI/endpoint/function/binding/pci-ntb.rst      |     38 +
 .../PCI/endpoint/function/binding/pci-test.rst     |     26 +
 Documentation/PCI/endpoint/index.rst               |     21 +
 Documentation/PCI/endpoint/pci-endpoint-cfs.rst    |    138 +
 Documentation/PCI/endpoint/pci-endpoint.rst        |    283 +
 Documentation/PCI/endpoint/pci-ntb-function.rst    |    348 +
 Documentation/PCI/endpoint/pci-ntb-howto.rst       |    158 +
 Documentation/PCI/endpoint/pci-nvme-function.rst   |     13 +
 Documentation/PCI/endpoint/pci-test-function.rst   |    103 +
 Documentation/PCI/endpoint/pci-test-howto.rst      |    239 +
 Documentation/PCI/endpoint/pci-vntb-function.rst   |    129 +
 Documentation/PCI/endpoint/pci-vntb-howto.rst      |    169 +
 Documentation/PCI/index.rst                        |     22 +
 Documentation/PCI/msi-howto.rst                    |    300 +
 Documentation/PCI/pci-error-recovery.rst           |    471 +
 Documentation/PCI/pci-iov-howto.rst                |    171 +
 Documentation/PCI/pci.rst                          |    578 +
 Documentation/PCI/pcieaer-howto.rst                |    267 +
 Documentation/PCI/pciebus-howto.rst                |    228 +
 Documentation/PCI/sysfs-pci.rst                    |    138 +
 Documentation/PCI/tph.rst                          |    132 +
 .../Design/Data-Structures/BigTreeClassicRCU.svg   |    474 +
 .../BigTreePreemptRCUBHdyntickCB.svg               |    662 +
 .../RCU/Design/Data-Structures/Data-Structures.rst |   1196 +
 .../Design/Data-Structures/HugeTreeClassicRCU.svg  |    939 +
 .../RCU/Design/Data-Structures/TreeLevel.svg       |    828 +
 .../RCU/Design/Data-Structures/TreeMapping.svg     |    305 +
 .../Design/Data-Structures/TreeMappingLevel.svg    |    380 +
 .../RCU/Design/Data-Structures/blkd_task.svg       |    631 +
 .../RCU/Design/Data-Structures/nxtlist.svg         |    386 +
 .../Design/Expedited-Grace-Periods/ExpRCUFlow.svg  |    830 +
 .../Expedited-Grace-Periods/ExpSchedFlow.svg       |    830 +
 .../Expedited-Grace-Periods.rst                    |    521 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel0.svg |    275 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel1.svg |    275 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel2.svg |    287 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel3.svg |    323 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel4.svg |    323 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel5.svg |    335 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel6.svg |    335 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel7.svg |    347 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel8.svg |    311 +
 .../Memory-Ordering/Tree-RCU-Memory-Ordering.rst   |    648 +
 .../TreeRCU-callback-invocation.svg                |    486 +
 .../Memory-Ordering/TreeRCU-callback-registry.svg  |    646 +
 .../RCU/Design/Memory-Ordering/TreeRCU-dyntick.svg |    700 +
 .../Design/Memory-Ordering/TreeRCU-gp-cleanup.svg  |   1133 +
 .../RCU/Design/Memory-Ordering/TreeRCU-gp-fqs.svg  |   1309 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-1.svg   |    658 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-2.svg   |    656 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-3.svg   |    636 +
 .../RCU/Design/Memory-Ordering/TreeRCU-gp.svg      |   5135 +
 .../RCU/Design/Memory-Ordering/TreeRCU-hotplug.svg |    775 +
 .../RCU/Design/Memory-Ordering/TreeRCU-qs.svg      |   1095 +
 .../RCU/Design/Memory-Ordering/rcu_node-lock.svg   |    229 +
 .../Design/Requirements/GPpartitionReaders1.svg    |    374 +
 .../Design/Requirements/ReadersPartitionGP1.svg    |    639 +
 .../RCU/Design/Requirements/Requirements.rst       |   2873 +
 Documentation/RCU/NMI-RCU.rst                      |    123 +
 Documentation/RCU/RTFP.txt                         |   2812 +
 Documentation/RCU/UP.rst                           |    152 +
 Documentation/RCU/checklist.rst                    |    556 +
 Documentation/RCU/index.rst                        |     30 +
 Documentation/RCU/listRCU.rst                      |    511 +
 Documentation/RCU/lockdep-splat.rst                |    115 +
 Documentation/RCU/lockdep.rst                      |    119 +
 Documentation/RCU/rcu.rst                          |     93 +
 Documentation/RCU/rcu_dereference.rst              |    502 +
 Documentation/RCU/rcubarrier.rst                   |    377 +
 Documentation/RCU/rculist_nulls.rst                |    215 +
 Documentation/RCU/rcuref.rst                       |    158 +
 Documentation/RCU/stallwarn.rst                    |    491 +
 Documentation/RCU/torture.rst                      |    374 +
 Documentation/RCU/whatisRCU.rst                    |   1415 +
 Documentation/SubmittingPatches                    |      1 +
 Documentation/accel/amdxdna/amdnpu.rst             |    306 +
 Documentation/accel/amdxdna/index.rst              |     11 +
 Documentation/accel/index.rst                      |     13 +
 Documentation/accel/introduction.rst               |    110 +
 Documentation/accel/qaic/aic080.rst                |     14 +
 Documentation/accel/qaic/aic100.rst                |    538 +
 Documentation/accel/qaic/index.rst                 |     14 +
 Documentation/accel/qaic/qaic.rst                  |    209 +
 Documentation/accel/rocket/index.rst               |     19 +
 Documentation/accounting/cgroupstats.rst           |     31 +
 Documentation/accounting/delay-accounting.rst      |    214 +
 Documentation/accounting/index.rst                 |     14 +
 Documentation/accounting/psi.rst                   |    188 +
 Documentation/accounting/taskstats-struct.rst      |    199 +
 Documentation/accounting/taskstats.rst             |    182 +
 Documentation/admin-guide/LSM/LoadPin.rst          |     31 +
 Documentation/admin-guide/LSM/SELinux.rst          |     44 +
 Documentation/admin-guide/LSM/SafeSetID.rst        |    118 +
 Documentation/admin-guide/LSM/Smack.rst            |    871 +
 Documentation/admin-guide/LSM/Yama.rst             |     75 +
 Documentation/admin-guide/LSM/apparmor.rst         |     54 +
 Documentation/admin-guide/LSM/index.rst            |     51 +
 Documentation/admin-guide/LSM/ipe.rst              |    835 +
 Documentation/admin-guide/LSM/landlock.rst         |    298 +
 Documentation/admin-guide/LSM/tomoyo.rst           |     52 +
 .../admin-guide/RAS/address-translation.rst        |     24 +
 Documentation/admin-guide/RAS/error-decoding.rst   |     21 +
 Documentation/admin-guide/RAS/index.rst            |      7 +
 Documentation/admin-guide/RAS/main.rst             |   1087 +
 Documentation/admin-guide/README.rst               |    360 +
 Documentation/admin-guide/abi-obsolete-files.rst   |      7 +
 Documentation/admin-guide/abi-obsolete.rst         |     13 +
 Documentation/admin-guide/abi-removed-files.rst    |      7 +
 Documentation/admin-guide/abi-removed.rst          |      7 +
 Documentation/admin-guide/abi-stable-files.rst     |      7 +
 Documentation/admin-guide/abi-stable.rst           |     16 +
 Documentation/admin-guide/abi-testing-files.rst    |      7 +
 Documentation/admin-guide/abi-testing.rst          |     22 +
 Documentation/admin-guide/abi.rst                  |     29 +
 Documentation/admin-guide/acpi/cppc_sysfs.rst      |     78 +
 .../admin-guide/acpi/fan_performance_states.rst    |     90 +
 Documentation/admin-guide/acpi/index.rst           |     14 +
 .../admin-guide/acpi/initrd_table_override.rst     |    115 +
 Documentation/admin-guide/acpi/ssdt-overlays.rst   |    181 +
 Documentation/admin-guide/aoe/aoe.rst              |    150 +
 Documentation/admin-guide/aoe/autoload.sh          |     17 +
 Documentation/admin-guide/aoe/examples.rst         |     23 +
 Documentation/admin-guide/aoe/index.rst            |     10 +
 Documentation/admin-guide/aoe/status.sh            |     30 +
 Documentation/admin-guide/aoe/todo.rst             |     17 +
 Documentation/admin-guide/aoe/udev-install.sh      |     33 +
 Documentation/admin-guide/aoe/udev.txt             |     26 +
 .../admin-guide/auxdisplay/cfag12864b.rst          |     98 +
 Documentation/admin-guide/auxdisplay/index.rst     |      9 +
 Documentation/admin-guide/auxdisplay/ks0108.rst    |     50 +
 Documentation/admin-guide/bcache.rst               |    644 +
 Documentation/admin-guide/binderfs.rst             |     87 +
 Documentation/admin-guide/binfmt-misc.rst          |    391 +
 .../blockdev/drbd/DRBD-8.3-data-packets.svg        |    588 +
 .../blockdev/drbd/DRBD-data-packets.svg            |    459 +
 .../admin-guide/blockdev/drbd/conn-states-8.dot    |     18 +
 .../blockdev/drbd/data-structure-v9.rst            |     42 +
 .../admin-guide/blockdev/drbd/disk-states-8.dot    |     16 +
 .../drbd/drbd-connection-state-overview.dot        |     85 +
 .../admin-guide/blockdev/drbd/figures.rst          |     30 +
 Documentation/admin-guide/blockdev/drbd/index.rst  |     19 +
 .../admin-guide/blockdev/drbd/peer-states-8.dot    |      8 +
 Documentation/admin-guide/blockdev/floppy.rst      |    255 +
 Documentation/admin-guide/blockdev/index.rst       |     17 +
 Documentation/admin-guide/blockdev/nbd.rst         |     31 +
 Documentation/admin-guide/blockdev/paride.rst      |    207 +
 Documentation/admin-guide/blockdev/ramdisk.rst     |    153 +
 Documentation/admin-guide/blockdev/zoned_loop.rst  |    191 +
 Documentation/admin-guide/blockdev/zram.rst        |    610 +
 Documentation/admin-guide/bootconfig.rst           |    416 +
 Documentation/admin-guide/braille-console.rst      |     38 +
 Documentation/admin-guide/btmrvl.rst               |    124 +
 Documentation/admin-guide/bug-bisect.rst           |    165 +
 Documentation/admin-guide/bug-hunting.rst          |    370 +
 .../admin-guide/cgroup-v1/blkio-controller.rst     |    301 +
 Documentation/admin-guide/cgroup-v1/cgroups.rst    |    697 +
 Documentation/admin-guide/cgroup-v1/cpuacct.rst    |     50 +
 Documentation/admin-guide/cgroup-v1/cpusets.rst    |    874 +
 Documentation/admin-guide/cgroup-v1/devices.rst    |    132 +
 .../admin-guide/cgroup-v1/freezer-subsystem.rst    |    131 +
 Documentation/admin-guide/cgroup-v1/hugetlb.rst    |    139 +
 Documentation/admin-guide/cgroup-v1/index.rst      |     24 +
 Documentation/admin-guide/cgroup-v1/memcg_test.rst |    342 +
 Documentation/admin-guide/cgroup-v1/memory.rst     |    926 +
 Documentation/admin-guide/cgroup-v1/misc.rst       |      4 +
 Documentation/admin-guide/cgroup-v1/net_cls.rst    |     44 +
 Documentation/admin-guide/cgroup-v1/net_prio.rst   |     57 +
 Documentation/admin-guide/cgroup-v1/pids.rst       |     93 +
 Documentation/admin-guide/cgroup-v1/rdma.rst       |    191 +
 Documentation/admin-guide/cgroup-v2.rst            |   3581 +
 Documentation/admin-guide/cifs/authors.rst         |     69 +
 Documentation/admin-guide/cifs/changes.rst         |      9 +
 Documentation/admin-guide/cifs/index.rst           |     14 +
 Documentation/admin-guide/cifs/introduction.rst    |     53 +
 Documentation/admin-guide/cifs/todo.rst            |    133 +
 Documentation/admin-guide/cifs/usage.rst           |    864 +
 Documentation/admin-guide/cifs/winucase_convert.pl |     62 +
 Documentation/admin-guide/clearing-warn-once.rst   |      9 +
 Documentation/admin-guide/cpu-isolation.rst        |    357 +
 Documentation/admin-guide/cpu-load.rst             |    117 +
 Documentation/admin-guide/cputopology.rst          |    101 +
 Documentation/admin-guide/dell_rbu.rst             |    128 +
 .../admin-guide/device-mapper/cache-policies.rst   |    131 +
 Documentation/admin-guide/device-mapper/cache.rst  |    337 +
 Documentation/admin-guide/device-mapper/delay.rst  |     54 +
 .../admin-guide/device-mapper/dm-clone.rst         |    333 +
 .../admin-guide/device-mapper/dm-crypt.rst         |    212 +
 .../admin-guide/device-mapper/dm-dust.rst          |    305 +
 Documentation/admin-guide/device-mapper/dm-ebs.rst |     51 +
 .../admin-guide/device-mapper/dm-flakey.rst        |     88 +
 Documentation/admin-guide/device-mapper/dm-ima.rst |    718 +
 .../admin-guide/device-mapper/dm-init.rst          |    133 +
 .../admin-guide/device-mapper/dm-inlinecrypt.rst   |    129 +
 .../admin-guide/device-mapper/dm-integrity.rst     |    321 +
 Documentation/admin-guide/device-mapper/dm-io.rst  |     75 +
 Documentation/admin-guide/device-mapper/dm-log.rst |     57 +
 .../admin-guide/device-mapper/dm-pcache.rst        |    202 +
 .../admin-guide/device-mapper/dm-queue-length.rst  |     48 +
 .../admin-guide/device-mapper/dm-raid.rst          |    489 +
 .../admin-guide/device-mapper/dm-service-time.rst  |    101 +
 .../admin-guide/device-mapper/dm-uevent.rst        |    110 +
 .../admin-guide/device-mapper/dm-zoned.rst         |    194 +
 Documentation/admin-guide/device-mapper/era.rst    |    116 +
 Documentation/admin-guide/device-mapper/index.rst  |     43 +
 Documentation/admin-guide/device-mapper/kcopyd.rst |     47 +
 Documentation/admin-guide/device-mapper/linear.rst |     63 +
 .../admin-guide/device-mapper/log-writes.rst       |    145 +
 .../admin-guide/device-mapper/persistent-data.rst  |     88 +
 .../admin-guide/device-mapper/snapshot.rst         |    196 +
 .../admin-guide/device-mapper/statistics.rst       |    225 +
 .../admin-guide/device-mapper/striped.rst          |     61 +
 Documentation/admin-guide/device-mapper/switch.rst |    141 +
 .../device-mapper/thin-provisioning.rst            |    427 +
 .../admin-guide/device-mapper/unstriped.rst        |    135 +
 .../admin-guide/device-mapper/vdo-design.rst       |    633 +
 Documentation/admin-guide/device-mapper/vdo.rst    |    413 +
 Documentation/admin-guide/device-mapper/verity.rst |    349 +
 .../admin-guide/device-mapper/writecache.rst       |    114 +
 Documentation/admin-guide/device-mapper/zero.rst   |     37 +
 Documentation/admin-guide/devices.rst              |    270 +
 Documentation/admin-guide/devices.txt              |   3081 +
 Documentation/admin-guide/dynamic-debug-howto.rst  |    392 +
 Documentation/admin-guide/edid.rst                 |     27 +
 Documentation/admin-guide/efi-stub.rst             |    103 +
 Documentation/admin-guide/ext4.rst                 |    611 +
 Documentation/admin-guide/features.rst             |      3 +
 .../admin-guide/filesystem-monitoring.rst          |     78 +
 Documentation/admin-guide/gpio/gpio-aggregator.rst |    218 +
 Documentation/admin-guide/gpio/gpio-mockup.rst     |     59 +
 Documentation/admin-guide/gpio/gpio-sim.rst        |    137 +
 Documentation/admin-guide/gpio/gpio-virtuser.rst   |    177 +
 Documentation/admin-guide/gpio/index.rst           |     14 +
 Documentation/admin-guide/gpio/obsolete.rst        |     13 +
 .../admin-guide/hw-vuln/attack_vector_controls.rst |    236 +
 .../admin-guide/hw-vuln/core-scheduling.rst        |    226 +
 .../admin-guide/hw-vuln/cross-thread-rsb.rst       |     91 +
 .../admin-guide/hw-vuln/gather_data_sampling.rst   |    109 +
 Documentation/admin-guide/hw-vuln/index.rst        |     29 +
 .../hw-vuln/indirect-target-selection.rst          |    168 +
 Documentation/admin-guide/hw-vuln/l1d_flush.rst    |     69 +
 Documentation/admin-guide/hw-vuln/l1tf.rst         |    615 +
 Documentation/admin-guide/hw-vuln/mds.rst          |    303 +
 Documentation/admin-guide/hw-vuln/multihit.rst     |    167 +
 .../admin-guide/hw-vuln/old_microcode.rst          |     21 +
 .../hw-vuln/processor_mmio_stale_data.rst          |    269 +
 .../admin-guide/hw-vuln/reg-file-data-sampling.rst |     96 +
 Documentation/admin-guide/hw-vuln/rsb.rst          |    268 +
 .../special-register-buffer-data-sampling.rst      |    150 +
 Documentation/admin-guide/hw-vuln/spectre.rst      |    725 +
 Documentation/admin-guide/hw-vuln/srso.rst         |    242 +
 .../admin-guide/hw-vuln/tsx_async_abort.rst        |    270 +
 Documentation/admin-guide/hw-vuln/vmscape.rst      |    110 +
 Documentation/admin-guide/hw_random.rst            |    104 +
 Documentation/admin-guide/index.rst                |    192 +
 Documentation/admin-guide/init.rst                 |     48 +
 Documentation/admin-guide/initrd.rst               |    383 +
 Documentation/admin-guide/iostats.rst              |    187 +
 Documentation/admin-guide/java.rst                 |    423 +
 Documentation/admin-guide/jfs.rst                  |     66 +
 Documentation/admin-guide/kdump/gdbmacros.txt      |    323 +
 Documentation/admin-guide/kdump/index.rst          |     13 +
 Documentation/admin-guide/kdump/kdump.rst          |    612 +
 Documentation/admin-guide/kdump/vmcoreinfo.rst     |    596 +
 Documentation/admin-guide/kernel-parameters.rst    |    135 +
 Documentation/admin-guide/kernel-parameters.txt    |   8709 +
 .../admin-guide/kernel-per-CPU-kthreads.rst        |    325 +
 .../admin-guide/laptops/alienware-wmi.rst          |    127 +
 Documentation/admin-guide/laptops/asus-laptop.rst  |    271 +
 .../admin-guide/laptops/disk-shock-protection.rst  |    151 +
 Documentation/admin-guide/laptops/index.rst        |     19 +
 Documentation/admin-guide/laptops/lg-laptop.rst    |     82 +
 .../admin-guide/laptops/samsung-galaxybook.rst     |    174 +
 Documentation/admin-guide/laptops/sony-laptop.rst  |    174 +
[Output truncated: showing 1000 of 96042 lines]]

347/4 2026/09/17 11:34 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 44077
							output: 25
							thoughts: 524
						

Thoughts:
**Analyzing the Truncate Order Question**

Okay, here's the deal. I've got this checkout, and `git log` only shows one commit, fd73f4a66598. So, I need to dive into the kernel sources using codesearch and grepper.

Now, let's break down this question. I need to make sure I'm getting the core concept. The question is centered around whether `truncate_setsize` should be called before `ntfs_set_size` when we're shrinking a file (`newsize < oldsize`). The crux of it is this: if `ntfs_set_size` deallocates blocks *before* page cache handling, we could have a nasty data corruption scenario.

Let me think this through methodically:

1.  **The Core Question:** Should `truncate_setsize` be called *before* the filesystem does its block deallocation (the `ntfs_set_size` bit)?
2.  **The Reasoning:** If `ntfs_set_size` runs first, it'll deallocate disk blocks. Then, what happens with dirty pages that are *beyond* the new end-of-file (EOF)?

    The risk, as I understand it, is that those dirty pages, being written back to disk from the page cache (either through background writeback, direct reclaim, or a sync), could end up writing to blocks that have already been deallocated. Those blocks might even be reallocated to a *different* file. Bang! Data corruption! This is a classic write-after-free issue, but with file data.

    So, is the reasoning correct? Yes, it is!
    Specifically:
    *   Shrinking a file (`newsize < oldsize`) means we need to deallocate blocks.
    *   Before deallocating, we need to handle the page cache.
    *   `truncate_setsize` updates `i_size` and truncates the page cache (using `truncate_pagecache(inode, newsize)`), which in turn unmaps pages.
    *   If we deallocate blocks before that page cache truncation, dirty pages could be written back to those freed blocks, now potentially belonging to another file. This could corrupt data.
    *   Therefore, the page cache has to be truncated first, to ensure no writes happen to the blocks *after* they've been deallocated.

Okay, this feels solid. However, just to be absolutely sure, I'm going to consult the documentation. I need to check `Documentation/filesystems/`, `Documentation/`, or the VFS documentation for `truncate`. Let me search for `truncate_setsize` or "block truncation" or "truncate order" to make sure there's not something I'm missing!



348/4 2026/09/17 11:35 tool grepper
0m Args:
map[Expression:truncate_setsize PathPrefix:Documentation]

Results:
map[Output:Documentation/filesystems/iomap/operations.rst=297=operation.
Documentation/filesystems/iomap/operations.rst:298:``truncate_setsize`` or ``truncate_pagecache`` will take care of
Documentation/filesystems/iomap/operations.rst-299-everything after the EOF block.
]

349/4 2026/09/17 11:35 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 45319
							output: 40
							thoughts: 25
						

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

**Diving into iomap Operations**

Okay, so I need to refresh my memory on the specifics of the `iomap` implementation. Right, let's pull up that documentation file, specifically `Documentation/filesystems/iomap/operations.rst`. I recall it has a pretty good overview, and I think the section around line 297 is where the core `iomap` operations are discussed in detail. Time to get the details fresh in my head! Let's see what's what.



350/4 2026/09/17 11:35 tool read-file
0m Args:
map[File:Documentation/filesystems/iomap/operations.rst FirstLine:285 LineCount:40]

Results:
map[Contents: 285:	storage with another file to preemptively copy the shared data to newly
 286:	allocate storage.
 287:	``IOMAP_WRITE | IOMAP_UNSHARE`` will be passed as the ``flags`` argument
 288:	to ``->iomap_begin``.
 289:	Callers typically hold ``i_rwsem`` and ``invalidate_lock`` in exclusive
 290:	mode before calling this function.
 291:	
 292:	Truncation
 293:	----------
 294:	
 295:	Filesystems can call ``iomap_truncate_page`` to zero the bytes in the
 296:	pagecache from EOF to the end of the fsblock during a file truncation
 297:	operation.
 298:	``truncate_setsize`` or ``truncate_pagecache`` will take care of
 299:	everything after the EOF block.
 300:	``IOMAP_ZERO`` will be passed as the ``flags`` argument to
 301:	``->iomap_begin``.
 302:	Callers typically hold ``i_rwsem`` and ``invalidate_lock`` in exclusive
 303:	mode before calling this function.
 304:	
 305:	Pagecache Writeback
 306:	-------------------
 307:	
 308:	Filesystems can call ``iomap_writepages`` to respond to a request to
 309:	write dirty pagecache folios to disk.
 310:	The ``mapping`` and ``wbc`` parameters should be passed unchanged.
 311:	The ``wpc`` pointer should be allocated by the filesystem and must
 312:	be initialized to zero.
 313:	
 314:	The pagecache will lock each folio before trying to schedule it for
 315:	writeback.
 316:	It does not lock ``i_rwsem`` or ``invalidate_lock``.
 317:	
 318:	The dirty bit will be cleared for all folios run through the
 319:	``->writeback_range`` machinery described below even if the writeback fails.
 320:	This is to prevent dirty folio clots when storage devices fail; an
 321:	``-EIO`` is recorded for userspace to collect via ``fsync``.
 322:	
 323:	The ``ops`` structure must be specified and is as follows:
 324:	
]

351/4 2026/09/17 11:35 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 46162
							output: 28
							thoughts: 306
						

Thoughts:
**Analyzing `truncate_setsize` and Its Role in Filesystem Operations**

Okay, let's revisit that comment for `truncate_setsize`. It's crucial, especially since I'm trying to grok the interaction between the VFS and the filesystem's specific implementation. So, here's what I'm seeing:

This function, `truncate_setsize`, is specifically designed to handle the update of the inode's size and to manage pagecache truncation when a file's size is being modified to `newsize`. The comment makes it clear that this function is typically called from the filesystem's `setattr` function, specifically when `ATTR_SIZE` is involved.

The comment clearly indicates a critical constraint on its execution. Line 813 makes the point really clear: "and before all filesystem specific block truncation has been performed". This suggests a particular order of operations. The VFS level handling (i.e. `truncate_setsize` and friends) *must* happen before any filesystem-specific block truncation is done. This points to a layering where the VFS sets the stage for the filesystem to do its low-level stuff. It helps me understand where the responsibility for each aspect of this change is clearly divided, which is vital for any filesystem interaction.

Now, I really need to double-check the documentation – `Documentation/filesystems/vfs.rst` or any relevant VFS documentation. I'm going to look to understand the precise interaction between `truncate_setsize` and the overall `setattr` flow. I need to clarify what the VFS expects from the filesystem's `setattr` implementation in terms of pre- and post-conditions. It's a common area for subtle bugs and filesystem-specific deviations if not handled correctly.



352/4 2026/09/17 11:36 tool grepper
0m Args:
map[Expression:truncate_setsize PathPrefix:Documentation/filesystems]

Results:
map[Output:Documentation/filesystems/iomap/operations.rst=297=operation.
Documentation/filesystems/iomap/operations.rst:298:``truncate_setsize`` or ``truncate_pagecache`` will take care of
Documentation/filesystems/iomap/operations.rst-299-everything after the EOF block.
]

353/4 2026/09/17 11:36 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 46964
							output: 30
							thoughts: 14
						

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

**Diving into the Filesystem Locking Documentation**

Okay, time to get to the heart of the matter. My initial thought is to dive straight into the documentation on filesystem locking, specifically the `Documentation/filesystems/locking.rst` file. It's usually the best place to start when I need to refresh my knowledge or troubleshoot lock-related issues within a filesystem context. I'm hoping to get a clear overview of the concepts and mechanisms described there. Perhaps it’ll have the relevant sections on advisory versus mandatory locking, different locking implementations, or some nuanced aspects around interactions with various POSIX interfaces. I anticipate some detailed explanations of the locking primitives and synchronization techniques. I’m especially keen to see if it covers any recent additions or changes in locking strategies with newer kernel releases, or if any common pitfalls or best practices are outlined. That document is usually pretty comprehensive, so I'm expecting a good foundation to work from. Let's see what gems are waiting there!



354/4 2026/09/17 11:36 tool grepper
0m Args:
map[Expression:setattr PathPrefix:Documentation/filesystems/locking.rst]

Results:
map[Output:Documentation/filesystems/locking.rst=62=prototypes::
--
Documentation/filesystems/locking.rst-78-	struct posix_acl * (*get_inode_acl)(struct inode *, int, bool);
Documentation/filesystems/locking.rst:79:	int (*setattr) (struct mnt_idmap *, struct dentry *, struct iattr *);
Documentation/filesystems/locking.rst-80-	int (*getattr) (struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int);
--
Documentation/filesystems/locking.rst=113=get_link:	no
Documentation/filesystems/locking.rst:114:setattr:	exclusive
Documentation/filesystems/locking.rst-115-permission:	no (may not block if called in rcu-walk mode)
]

355/4 2026/09/17 11:36 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 47440
							output: 26
							thoughts: 67
						

Thoughts:
**Investigating Filesystem `truncate_setsize` Usage**

Alright, let's dive into this `truncate_setsize` function and see where it's actually making an appearance in the kernel's filesystem landscape. My initial hunch is that it's probably pretty fundamental, and thus, I anticipate it's utilized by quite a few filesystems. I'm thinking specifically about ext4, xfs, btrfs, f2fs, and those NTFS implementations – both the older and newer ones, like ntfs and ntfs3.

The quickest way to get a handle on this is to just run a quick `grep` operation. I'll focus that search within the `fs/` directory, since that's where I expect all the filesystem-related code to live. This should give me a good overview of where `truncate_setsize` is being called and, ideally, a sense of how it's being used in each of these filesystems. This kind of overview will quickly help me understand if there are any filesystem-specific quirks to consider.



356/4 2026/09/17 11:37 tool grepper
0m Args:
map[Expression:truncate_setsize PathPrefix:fs/]

Results:
map[Output:fs/9p/vfs_inode.c=1017=static int v9fs_vfs_setattr(struct mnt_idmap *idmap,
--
fs/9p/vfs_inode.c-1081-		 iattr->ia_size != i_size_read(inode)) {
fs/9p/vfs_inode.c:1082:		truncate_setsize(inode, iattr->ia_size);
fs/9p/vfs_inode.c-1083-		netfs_resize_file(netfs_inode(inode), iattr->ia_size, true);
--
fs/9p/vfs_inode_dotl.c=511=int v9fs_vfs_setattr_dotl(struct mnt_idmap *idmap,
--
fs/9p/vfs_inode_dotl.c-576-		 i_size_read(inode)) {
fs/9p/vfs_inode_dotl.c:577:		truncate_setsize(inode, iattr->ia_size);
fs/9p/vfs_inode_dotl.c-578-		netfs_resize_file(netfs_inode(inode), iattr->ia_size, true);
--
fs/adfs/inode.c=302=adfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
--
fs/adfs/inode.c-323-	if (ia_valid & ATTR_SIZE)
fs/adfs/inode.c:324:		truncate_setsize(inode, attr->ia_size);
fs/adfs/inode.c-325-
--
fs/affs/inode.c=216=affs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
--
fs/affs/inode.c-244-
fs/affs/inode.c:245:		truncate_setsize(inode, attr->ia_size);
fs/affs/inode.c-246-		affs_truncate(inode);
--
fs/afs/inode.c=762=int afs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/afs/inode.c-816-		    attr->ia_size > netfs_read_remote_i_size(inode)) {
fs/afs/inode.c:817:			truncate_setsize(inode, attr->ia_size);
fs/afs/inode.c-818-			netfs_resize_file(&vnode->netfs, size, false);
--
fs/aio.c=360=static void put_aio_ring_file(struct kioctx *ctx)
--
fs/aio.c-366-
fs/aio.c:367:		truncate_setsize(inode, 0);
fs/aio.c-368-
--
fs/btrfs/file.c=1526=int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
--
fs/btrfs/file.c-1809- * protect against truncate races as the page could now be beyond EOF.  Because
fs/btrfs/file.c:1810: * truncate_setsize() writes the inode size before removing pages, once we have
fs/btrfs/file.c-1811- * the page lock we can determine safely if the page is beyond EOF. If it is not
--
fs/btrfs/inode.c=5391=static int btrfs_setsize(struct inode *inode, struct iattr *attr)
--
fs/btrfs/inode.c-5460-
fs/btrfs/inode.c:5461:		truncate_setsize(inode, newsize);
fs/btrfs/inode.c-5462-
--
fs/ecryptfs/inode.c=733=static int __ecryptfs_truncate(struct dentry *dentry, const struct iattr *ia)
--
fs/ecryptfs/inode.c-784-	if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) {
fs/ecryptfs/inode.c:785:		truncate_setsize(inode, ia->ia_size);
fs/ecryptfs/inode.c-786-		lower_ia.ia_size = ia->ia_size;
--
fs/ecryptfs/inode.c-804-	}
fs/ecryptfs/inode.c:805:	truncate_setsize(inode, ia->ia_size);
fs/ecryptfs/inode.c-806-	rc = ecryptfs_write_inode_size_to_metadata(inode);
--
fs/exfat/file.c=350=int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/exfat/file.c-415-		inode_dio_wait(inode);
fs/exfat/file.c:416:		truncate_setsize(inode, attr->ia_size);
fs/exfat/file.c-417-
--
fs/exfat/file.c=754=static int exfat_extend_valid_size(struct inode *inode, loff_t new_valid_size)
--
fs/exfat/file.c-786-		if (ret) {
fs/exfat/file.c:787:			truncate_setsize(inode, old_valid_size);
fs/exfat/file.c-788-			exfat_truncate(inode);
--
fs/ext2/inode.c=1237=static int ext2_setsize(struct inode *inode, loff_t newsize)
--
fs/ext2/inode.c-1255-	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c:1256:	truncate_setsize(inode, newsize);
fs/ext2/inode.c-1257-	__ext2_truncate_blocks(inode, newsize);
--
fs/f2fs/file.c=637=static int finish_preallocate_blocks(struct inode *inode)
--
fs/f2fs/file.c-657-
fs/f2fs/file.c:658:	truncate_setsize(inode, i_size_read(inode));
fs/f2fs/file.c-659-	ret = f2fs_truncate(inode);
--
fs/f2fs/file.c=1124=int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/f2fs/file.c-1235-		}
fs/f2fs/file.c:1236:		truncate_setsize(inode, attr->ia_size);
fs/f2fs/file.c-1237-
--
fs/f2fs/file.c=3879=static int f2fs_ioc_release_dev_alias(struct file *filp)
--
fs/f2fs/file.c-3929-	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c:3930:	truncate_setsize(inode, 0);
fs/f2fs/file.c-3931-
--
fs/fat/file.c=517=int fat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/fat/file.c-586-		down_write(&MSDOS_I(inode)->truncate_lock);
fs/fat/file.c:587:		truncate_setsize(inode, attr->ia_size);
fs/fat/file.c-588-		fat_truncate_blocks(inode, attr->ia_size);
--
fs/gfs2/bmap.c=2095=static int do_grow(struct inode *inode, u64 size)
--
fs/gfs2/bmap.c-2138-
fs/gfs2/bmap.c:2139:	truncate_setsize(inode, size);
fs/gfs2/bmap.c-2140-	inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_current(&ip->i_inode));
--
fs/hfs/inode.c=646=int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/hfs/inode.c-686-
fs/hfs/inode.c:687:		truncate_setsize(inode, attr->ia_size);
fs/hfs/inode.c-688-		hfs_file_truncate(inode);
--
fs/hfsplus/inode.c=308=static int hfsplus_setattr(struct mnt_idmap *idmap,
--
fs/hfsplus/inode.c-326-		}
fs/hfsplus/inode.c:327:		truncate_setsize(inode, attr->ia_size);
fs/hfsplus/inode.c-328-		hfsplus_file_truncate(inode);
--
fs/hostfs/hostfs_kern.c=804=static int hostfs_setattr(struct mnt_idmap *idmap,
--
fs/hostfs/hostfs_kern.c-868-	    attr->ia_size != i_size_read(inode))
fs/hostfs/hostfs_kern.c:869:		truncate_setsize(inode, attr->ia_size);
fs/hostfs/hostfs_kern.c-870-
--
fs/hpfs/inode.c=260=int hpfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/hpfs/inode.c-287-
fs/hpfs/inode.c:288:		truncate_setsize(inode, attr->ia_size);
fs/hpfs/inode.c-289-		hpfs_truncate(inode);
--
fs/jffs2/fs.c=32=int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
--
fs/jffs2/fs.c-179-
fs/jffs2/fs.c:180:	/* We have to do the truncate_setsize() without f->sem held, since
fs/jffs2/fs.c-181-	   some pages may be locked and waiting for it in read_folio().
--
fs/jffs2/fs.c-185-	if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) {
fs/jffs2/fs.c:186:		truncate_setsize(inode, iattr->ia_size);
fs/jffs2/fs.c-187-		inode->i_blocks = (inode->i_size + 511) >> 9;
--
fs/jfs/file.c=92=int jfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/jfs/file.c-121-
fs/jfs/file.c:122:		truncate_setsize(inode, iattr->ia_size);
fs/jfs/file.c-123-		jfs_truncate(inode);
--
fs/libfs.c=916=int simple_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/libfs.c-926-	if (iattr->ia_valid & ATTR_SIZE)
fs/libfs.c:927:		truncate_setsize(inode, iattr->ia_size);
fs/libfs.c-928-	setattr_copy(idmap, inode, iattr);
--
fs/minix/file.c=26=static int minix_setattr(struct mnt_idmap *idmap,
--
fs/minix/file.c-41-
fs/minix/file.c:42:		truncate_setsize(inode, attr->ia_size);
fs/minix/file.c-43-		minix_truncate(inode);
--
fs/nilfs2/inode.c=907=int nilfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/nilfs2/inode.c-925-		inode_dio_wait(inode);
fs/nilfs2/inode.c:926:		truncate_setsize(inode, iattr->ia_size);
fs/nilfs2/inode.c-927-		nilfs_truncate(inode);
--
fs/ntfs/file.c=254=static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
--
fs/ntfs/file.c-284-	} else {
fs/ntfs/file.c:285:		truncate_setsize(vi, attr->ia_size);
fs/ntfs/file.c-286-	}
--
fs/ntfs/file.c=579=static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/ntfs/file.c-664-		if (ni->data_size != old_data_size) {
fs/ntfs/file.c:665:			truncate_setsize(vi, old_data_size);
fs/ntfs/file.c-666-			ntfs_attr_truncate(ni, old_data_size);
--
fs/ntfs/inode.c=375=int ntfs_drop_big_inode(struct inode *inode)
--
fs/ntfs/inode.c-390-
fs/ntfs/inode.c:391:				truncate_setsize(VFS_I(ni), 0);
fs/ntfs/inode.c-392-				ntfs_truncate_vfs(VFS_I(ni), 0, 1);
--
fs/ntfs/inode.c=2410=int ntfs_extend_initialized_size(struct inode *vi, const loff_t offset,
--
fs/ntfs/inode.c-2444-	if (err)
fs/ntfs/inode.c:2445:		truncate_setsize(vi, old_init_size);
fs/ntfs/inode.c-2446-	return err;
--
fs/ntfs3/attrib.c=2009=int attr_collapse_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
--
fs/ntfs3/attrib.c-2057-		/* Simple truncate file at 'vbo'. */
fs/ntfs3/attrib.c:2058:		truncate_setsize(&ni->vfs_inode, vbo);
fs/ntfs3/attrib.c-2059-		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name,
--
fs/ntfs3/file.c=706=int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ntfs3/file.c-738-		if (newsize != oldsize) {
fs/ntfs3/file.c:739:			truncate_setsize(inode, newsize);
fs/ntfs3/file.c-740-
--
fs/omfs/file.c=341=static int omfs_setattr(struct mnt_idmap *idmap,
--
fs/omfs/file.c-355-			return error;
fs/omfs/file.c:356:		truncate_setsize(inode, attr->ia_size);
fs/omfs/file.c-357-		omfs_truncate(inode);
--
fs/orangefs/inode.c=697=static int orangefs_setattr_size(struct inode *inode, struct iattr *iattr)
--
fs/orangefs/inode.c-722-
fs/orangefs/inode.c:723:	/* This is truncate_setsize in a different order. */
fs/orangefs/inode.c-724-	truncate_pagecache(inode, iattr->ia_size);
--
fs/ramfs/file-nommu.c=135=static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size)
--
fs/ramfs/file-nommu.c-154-
fs/ramfs/file-nommu.c:155:	truncate_setsize(inode, newsize);
fs/ramfs/file-nommu.c-156-	return 0;
--
fs/smb/client/cifsfs.c=1519=ssize_t cifs_file_copychunk_range(unsigned int xid,
--
fs/smb/client/cifsfs.c-1596-		if (rc > 0 && destoff + rc > i_size_read(target_inode)) {
fs/smb/client/cifsfs.c:1597:			truncate_setsize(target_inode, destoff + rc);
fs/smb/client/cifsfs.c-1598-			netfs_resize_file(&target_cifsi->netfs,
--
fs/smb/client/smb2ops.c=3508=static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3568-		if (rc >= 0) {
fs/smb/client/smb2ops.c:3569:			truncate_setsize(inode, new_size);
fs/smb/client/smb2ops.c-3570-			spin_lock(&inode->i_lock);
--
fs/smb/client/smb2ops.c=4014=static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4064-
fs/smb/client/smb2ops.c:4065:	truncate_setsize(inode, new_eof);
fs/smb/client/smb2ops.c-4066-	spin_lock(&inode->i_lock);
--
fs/smb/client/smb2ops.c=4078=static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4127-
fs/smb/client/smb2ops.c:4128:	truncate_setsize(inode, new_eof);
fs/smb/client/smb2ops.c-4129-	spin_lock(&inode->i_lock);
--
fs/ubifs/file.c=883=static int do_writepage(struct folio *folio, size_t len)
--
fs/ubifs/file.c-958- * same time. And the problematic one is truncation to smaller size, from where
fs/ubifs/file.c:959: * we have to call 'truncate_setsize()', which first changes @inode->i_size,
fs/ubifs/file.c-960- * then drops the truncated pages. And while dropping the pages, it takes the
fs/ubifs/file.c:961: * page lock. This means that 'do_truncation()' cannot call 'truncate_setsize()'
fs/ubifs/file.c-962- * with @ui_mutex locked, because it would deadlock with 'ubifs_writepage()'.
--
fs/ubifs/file.c-965- * XXX(truncate): with the new truncate sequence this is not true anymore,
fs/ubifs/file.c:966: * and the calls to truncate_setsize can be move around freely.  They should
fs/ubifs/file.c-967- * be moved to the very end of the truncate sequence.
--
fs/ubifs/file.c=1100=static int do_truncation(struct ubifs_info *c, struct inode *inode,
--
fs/ubifs/file.c-1133-
fs/ubifs/file.c:1134:	truncate_setsize(inode, new_size);
fs/ubifs/file.c-1135-
--
fs/ubifs/file.c=1208=static int do_setattr(struct ubifs_info *c, struct inode *inode,
--
fs/ubifs/file.c-1222-		dbg_gen("size %lld -> %lld", inode->i_size, new_size);
fs/ubifs/file.c:1223:		truncate_setsize(inode, new_size);
fs/ubifs/file.c-1224-	}
--
fs/ubifs/file.c-1229-		inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
fs/ubifs/file.c:1230:		/* 'truncate_setsize()' changed @i_size, update @ui_size */
fs/ubifs/file.c-1231-		ui->ui_size = inode->i_size;
--
fs/ubifs/ubifs.h=334=struct ubifs_gced_idx_leb {
--
fs/ubifs/ubifs.h-393- * make sure @inode->i_size is always changed under @ui_mutex, because it
fs/ubifs/ubifs.h:394: * cannot call 'truncate_setsize()' with @ui_mutex locked, because it would
fs/ubifs/ubifs.h-395- * deadlock with 'ubifs_writepage()' (see file.c). All the other inode fields
--
fs/udf/inode.c=1280=int udf_setsize(struct inode *inode, loff_t newsize)
--
fs/udf/inode.c-1307-set_size:
fs/udf/inode.c:1308:		truncate_setsize(inode, newsize);
fs/udf/inode.c-1309-	} else {
--
fs/udf/inode.c-1316-			iinfo->i_lenAlloc = newsize;
fs/udf/inode.c:1317:			truncate_setsize(inode, newsize);
fs/udf/inode.c-1318-			up_write(&iinfo->i_data_sem);
--
fs/udf/inode.c-1324-			return err;
fs/udf/inode.c:1325:		truncate_setsize(inode, newsize);
fs/udf/inode.c-1326-		down_write(&iinfo->i_data_sem);
--
fs/ufs/inode.c=1167=static int ufs_truncate(struct inode *inode, loff_t size)
--
fs/ufs/inode.c-1187-
fs/ufs/inode.c:1188:	truncate_setsize(inode, size);
fs/ufs/inode.c-1189-
--
fs/xfs/xfs_iops.c=905=xfs_vn_setattr_size(
--
fs/xfs/xfs_iops.c-1008-	 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
fs/xfs/xfs_iops.c:1009:	 * complete. The truncate_setsize() call also cleans partial EOF page
fs/xfs/xfs_iops.c-1010-	 * PTEs on extending truncates and hence ensures sub-page block size
--
fs/xfs/xfs_iops.c-1025-	 */
fs/xfs/xfs_iops.c:1026:	truncate_setsize(inode, newsize);
fs/xfs/xfs_iops.c-1027-
--
fs/zonefs/file.c=203=int zonefs_file_truncate(struct inode *inode, loff_t isize)
--
fs/zonefs/file.c-261-	zonefs_update_stats(inode, isize);
fs/zonefs/file.c:262:	truncate_setsize(inode, isize);
fs/zonefs/file.c-263-	z->z_wpoffset = isize;
]

357/4 2026/09/17 11:37 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 54056
							output: 41
							thoughts: 69
						

Thoughts:
**Diving into Filesystem IOPS Implementation**

Okay, so I need to refresh my memory on how different filesystems handle IOPS. I recall some key areas I've looked at before. Let's start by digging into `fs/xfs/xfs_iops.c`, specifically around lines 1000 to 1040. That's a good place to start my investigation into XFS's implementation. I can use this as a reference point for comparing and contrasting approaches, and what insights I can find there. I'll also glance at `fs/ext4/inode.c`, too, just to get a different perspective. This should give me a broader view of common practices and how specific filesystems tackle this fundamental problem.



358/4 2026/09/17 11:37 tool read-file
0m Args:
map[File:fs/xfs/xfs_iops.c FirstLine:1000 LineCount:40]

Results:
map[Contents:1000:			xfs_zoned_space_unreserve(mp, &ac);
1001:	
1002:		if (error)
1003:			return error;
1004:	
1005:		/*
1006:		 * We've already locked out new page faults, so now we can safely remove
1007:		 * pages from the page cache knowing they won't get refaulted until we
1008:		 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
1009:		 * complete. The truncate_setsize() call also cleans partial EOF page
1010:		 * PTEs on extending truncates and hence ensures sub-page block size
1011:		 * filesystems are correctly handled, too.
1012:		 *
1013:		 * We have to do all the page cache truncate work outside the
1014:		 * transaction context as the "lock" order is page lock->log space
1015:		 * reservation as defined by extent allocation in the writeback path.
1016:		 * Hence a truncate can fail with ENOMEM from xfs_trans_alloc(), but
1017:		 * having already truncated the in-memory version of the file (i.e. made
1018:		 * user visible changes). There's not much we can do about this, except
1019:		 * to hope that the caller sees ENOMEM and retries the truncate
1020:		 * operation.
1021:		 *
1022:		 * And we update in-core i_size and truncate page cache beyond newsize
1023:		 * before writeback the [i_disk_size, newsize] range, so we're
1024:		 * guaranteed not to write stale data past the new EOF on truncate down.
1025:		 */
1026:		truncate_setsize(inode, newsize);
1027:	
1028:		/*
1029:		 * We are going to log the inode size change in this transaction so
1030:		 * any previous writes that are beyond the on disk EOF and the new
1031:		 * EOF that have not been written out need to be written here.  If we
1032:		 * do not write the data out, we expose ourselves to the null files
1033:		 * problem. Note that this includes any block zeroing we did above;
1034:		 * otherwise those blocks may not be zeroed after a crash.
1035:		 */
1036:		if (did_zeroing ||
1037:		    (newsize > ip->i_disk_size && oldsize != ip->i_disk_size)) {
1038:			error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping,
1039:							ip->i_disk_size, newsize - 1);
]

359/4 2026/09/17 11:37 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 55073
							output: 33
							thoughts: 105
						

Thoughts:
**Examining File Truncation and Data Integrity**

Alright, let's dive into this. I'm seeing this comment in the XFS code, specifically concerning how they handle file truncation. It's highlighting a key strategy: updating the in-core `i_size` and truncating the page cache *before* writing the data back to disk in the range between the old and new file size. The reasoning is solid – we want to prevent writing any stale, old data past the new end-of-file after a "truncate down" operation. This guarantees that any writeback process won't accidentally extend the file with remnants of the previous data. This looks like a solid safeguard for data integrity.

Now, how does this compare to a different filesystem's approach? Let's take a look at how `ext4` handles a similar operation, specifically related to `setattr` which often entails changes in file size. Let's see how they manage their own truncation and attribute setting to accomplish the same end goal! I should investigate the `ext4_setattr` function in their source.



360/4 2026/09/17 11:37 tool grepper
0m Args:
map[Expression:truncate_setsize|ext4_truncate PathPrefix:fs/ext4]

Results:
map[Output:fs/ext4/ext4.h=1048=struct ext4_inode_info {
--
fs/ext4/ext4.h-1132-	 * in memory.  During truncate, i_size is set to the new size by
fs/ext4/ext4.h:1133:	 * the VFS prior to calling ext4_truncate(), but the filesystem won't
fs/ext4/ext4.h-1134-	 * set i_disksize to 0 until the truncate is actually under way.
--
fs/ext4/ext4.h-1142-	 * a truncate is in progress.  The only things which change i_disksize
fs/ext4/ext4.h:1143:	 * are ext4_get_block (growth) and ext4_truncate (shrinkth).
fs/ext4/ext4.h-1144-	 */
--
fs/ext4/ext4.h-1147-	/*
fs/ext4/ext4.h:1148:	 * i_data_sem is for serialising ext4_truncate() against
fs/ext4/ext4.h-1149-	 * ext4_getblock().  In the 2.4 ext2 design, great chunks of inode's
--
fs/ext4/ext4.h=3198=extern int ext4_can_truncate(struct inode *inode);
fs/ext4/ext4.h:3199:extern int ext4_truncate(struct inode *);
fs/ext4/ext4.h-3200-extern int ext4_break_layouts(struct inode *);
fs/ext4/ext4.h:3201:extern int ext4_truncate_page_cache_block_range(struct inode *inode,
fs/ext4/ext4.h-3202-						loff_t start, loff_t end);
--
fs/ext4/extents.c=4780=static long ext4_zero_range(struct file *file, loff_t offset,
--
fs/ext4/extents.c-4825-	/* Now release the pages and zero block aligned part of pages */
fs/ext4/extents.c:4826:	ret = ext4_truncate_page_cache_block_range(inode, offset, end);
fs/ext4/extents.c-4827-	if (ret)
--
fs/ext4/file.c=392=static void ext4_inode_extension_cleanup(struct inode *inode, bool need_trunc)
--
fs/ext4/file.c-395-	if (need_trunc) {
fs/ext4/file.c:396:		ext4_truncate_failed_write(inode);
fs/ext4/file.c-397-		/*
--
fs/ext4/indirect.c=530=int ext4_ind_map_blocks(handle_t *handle, struct inode *inode,
--
fs/ext4/indirect.c-632-	/*
fs/ext4/indirect.c:633:	 * Block out ext4_truncate while we alter the tree
fs/ext4/indirect.c-634-	 */
--
fs/ext4/indirect.c=754=static inline int all_zeroes(__le32 *p, __le32 *q)
--
fs/ext4/indirect.c-769- *
fs/ext4/indirect.c:770: *	This is a helper function used by ext4_truncate().
fs/ext4/indirect.c-771- *
--
fs/ext4/indirect.c-777- *	with everything to the right of the path. Since no allocation
fs/ext4/indirect.c:778: *	past the truncation point is possible until ext4_truncate()
fs/ext4/indirect.c-779- *	finishes, we may safely do the latter, but top of branch may
--
fs/ext4/inline.c=571=static int ext4_convert_inline_data_to_extent(struct address_space *mapping,
--
fs/ext4/inline.c-656-		handle = NULL;
fs/ext4/inline.c:657:		ext4_truncate_failed_write(inode);
fs/ext4/inline.c-658-		/*
--
fs/ext4/inline.c=793=int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
--
fs/ext4/inline.c-874-	if (pos + len > inode->i_size) {
fs/ext4/inline.c:875:		ext4_truncate_failed_write(inode);
fs/ext4/inline.c-876-		/*
--
fs/ext4/inline.c=896=static int ext4_da_convert_inline_data_to_extent(struct address_space *mapping,
--
fs/ext4/inline.c-926-		folio_put(folio);
fs/ext4/inline.c:927:		ext4_truncate_failed_write(inode);
fs/ext4/inline.c-928-		return ret;
--
fs/ext4/inode.c=169=void ext4_evict_inode(struct inode *inode)
--
fs/ext4/inode.c-258-	/*
fs/ext4/inode.c:259:	 * Set inode->i_size to 0 before calling ext4_truncate(). We need
fs/ext4/inode.c-260-	 * special handling of symlinks here because i_size is used to
--
fs/ext4/inode.c-275-	if (inode->i_blocks) {
fs/ext4/inode.c:276:		err = ext4_truncate(inode);
fs/ext4/inode.c-277-		if (err) {
--
fs/ext4/inode.c-297-	/*
fs/ext4/inode.c:298:	 * Kill off the orphan record which ext4_truncate created.
fs/ext4/inode.c-299-	 * AKPM: I think this can be inside the above `if'.
--
fs/ext4/inode.c-301-	 * deletion of a non-existent orphan - this is because we don't
fs/ext4/inode.c:302:	 * know if ext4_truncate() actually created an orphan record.
fs/ext4/inode.c-303-	 * (Well, we could do this if we need to, but heck - it works)
--
fs/ext4/inode.c=1277=static int ext4_write_begin(const struct kiocb *iocb,
--
fs/ext4/inode.c-1390-		if (extended) {
fs/ext4/inode.c:1391:			ext4_truncate_failed_write(inode);
fs/ext4/inode.c-1392-			/*
--
fs/ext4/inode.c=1432=static int ext4_write_end(const struct kiocb *iocb,
--
fs/ext4/inode.c-1486-	if (pos + len > inode->i_size && !verity) {
fs/ext4/inode.c:1487:		ext4_truncate_failed_write(inode);
fs/ext4/inode.c-1488-		/*
--
fs/ext4/inode.c=1535=static int ext4_journalled_write_end(const struct kiocb *iocb,
--
fs/ext4/inode.c-1599-	if (pos + len > inode->i_size && !verity) {
fs/ext4/inode.c:1600:		ext4_truncate_failed_write(inode);
fs/ext4/inode.c-1601-		/*
--
fs/ext4/inode.c=3124=static int ext4_da_write_begin(const struct kiocb *iocb,
--
fs/ext4/inode.c-3177-		if (pos + len > inode->i_size)
fs/ext4/inode.c:3178:			ext4_truncate_failed_write(inode);
fs/ext4/inode.c-3179-
--
fs/ext4/inode.c=4343=int ext4_update_disksize_before_punch(struct inode *inode, loff_t offset,
--
fs/ext4/inode.c-4369-
fs/ext4/inode.c:4370:static inline void ext4_truncate_folio(struct inode *inode,
fs/ext4/inode.c-4371-				       loff_t start, loff_t end)
--
fs/ext4/inode.c-4389-
fs/ext4/inode.c:4390:int ext4_truncate_page_cache_block_range(struct inode *inode,
fs/ext4/inode.c-4391-					 loff_t start, loff_t end)
--
fs/ext4/inode.c-4420-
fs/ext4/inode.c:4421:		ext4_truncate_folio(inode, start, min(page_boundary, end));
fs/ext4/inode.c-4422-		if (end > page_boundary)
fs/ext4/inode.c:4423:			ext4_truncate_folio(inode,
fs/ext4/inode.c-4424-					    round_down(end, PAGE_SIZE), end);
--
fs/ext4/inode.c=4458=int ext4_punch_hole(struct file *file, loff_t offset, loff_t length)
--
fs/ext4/inode.c-4498-	/* Now release the pages and zero block aligned part of pages*/
fs/ext4/inode.c:4499:	ret = ext4_truncate_page_cache_block_range(inode, offset, end);
fs/ext4/inode.c-4500-	if (ret)
--
fs/ext4/inode.c=4567=int ext4_inode_attach_jinode(struct inode *inode)
--
fs/ext4/inode.c-4597-/*
fs/ext4/inode.c:4598: * ext4_truncate()
fs/ext4/inode.c-4599- *
fs/ext4/inode.c-4600- * We block out ext4_get_block() block instantiations across the entire
fs/ext4/inode.c:4601: * transaction, and VFS/VM ensures that ext4_truncate() cannot run
fs/ext4/inode.c-4602- * simultaneously on behalf of the same inode.
--
fs/ext4/inode.c-4619- * that this inode's truncate did not complete and it will again call
fs/ext4/inode.c:4620: * ext4_truncate() to have another go.  So there will be instantiated blocks
fs/ext4/inode.c-4621- * to the right of the truncation point in a crashed ext4 filesystem.  But
fs/ext4/inode.c-4622- * that's fine - as long as they are linked from the inode, the post-crash
fs/ext4/inode.c:4623: * ext4_truncate() run will find them and release them.
fs/ext4/inode.c-4624- */
fs/ext4/inode.c:4625:int ext4_truncate(struct inode *inode)
fs/ext4/inode.c-4626-{
--
fs/ext4/inode.c-4638-		WARN_ON(!inode_is_locked(inode));
fs/ext4/inode.c:4639:	trace_ext4_truncate_enter(inode);
fs/ext4/inode.c-4640-
--
fs/ext4/inode.c-4726-out_trace:
fs/ext4/inode.c:4727:	trace_ext4_truncate_exit(inode);
fs/ext4/inode.c-4728-	return err;
--
fs/ext4/inode.c=6009=int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ext4/inode.c-6144-			 * Update c/mtime and tail zero the EOF folio on
fs/ext4/inode.c:6145:			 * truncate up. ext4_truncate() handles the shrink case
fs/ext4/inode.c-6146-			 * below.
--
fs/ext4/inode.c-6215-		/*
fs/ext4/inode.c:6216:		 * Call ext4_truncate() even if i_size didn't change to
fs/ext4/inode.c-6217-		 * truncate possible preallocated blocks.
--
fs/ext4/inode.c-6219-		if (attr->ia_size <= oldsize) {
fs/ext4/inode.c:6220:			rc = ext4_truncate(inode);
fs/ext4/inode.c-6221-			if (rc)
--
fs/ext4/inode.c-6235-	/*
fs/ext4/inode.c:6236:	 * If the call to ext4_truncate failed to get a transaction handle at
fs/ext4/inode.c-6237-	 * all, we need to clean up the in-core orphan list manually.
--
fs/ext4/orphan.c=322=static void ext4_process_orphan(struct inode *inode,
--
fs/ext4/orphan.c-337-		truncate_inode_pages(inode->i_mapping, inode->i_size);
fs/ext4/orphan.c:338:		ret = ext4_truncate(inode);
fs/ext4/orphan.c-339-		if (ret) {
--
fs/ext4/orphan.c-341-			 * We need to clean up the in-core orphan list
fs/ext4/orphan.c:342:			 * manually if ext4_truncate() failed to get a
fs/ext4/orphan.c-343-			 * transaction handle.
--
fs/ext4/truncate.h-11- */
fs/ext4/truncate.h:12:static inline void ext4_truncate_failed_write(struct inode *inode)
fs/ext4/truncate.h-13-{
--
fs/ext4/truncate.h-21-	truncate_inode_pages(mapping, inode->i_size);
fs/ext4/truncate.h:22:	ext4_truncate(inode);
fs/ext4/truncate.h-23-	filemap_invalidate_unlock(mapping);
--
fs/ext4/verity.c=102=static int ext4_begin_enable_verity(struct file *filp)
--
fs/ext4/verity.c-142-	 */
fs/ext4/verity.c:143:	err = ext4_truncate(inode);
fs/ext4/verity.c-144-	if (err)
--
fs/ext4/verity.c=191=static int ext4_end_enable_verity(struct file *filp, const void *desc,
--
fs/ext4/verity.c-264-	truncate_inode_pages(inode->i_mapping, inode->i_size);
fs/ext4/verity.c:265:	ext4_truncate(inode);
fs/ext4/verity.c-266-	ext4_orphan_del(NULL, inode);
]

361/4 2026/09/17 11:37 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 59436
							output: 37
							thoughts: 24
						

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

**Diving into `ext4_setattr`**

Okay, time to get my hands dirty and jump into the `ext4_setattr` function, specifically focusing on the code around lines 6140-6225. I'm zeroing in on this section because I suspect there's something interesting happening regarding attribute modifications and potential performance implications, or maybe even a subtle bug lurking. I'm betting this region probably handles the meat of the permission checks, file size updates (including handling of blocks or inodes), atime/ctime/mtime updates and various other related attributes. I'm keen to see the interaction between the VFS layer and the ext4-specific implementation here, specifically looking for any potential synchronization issues or unexpected locking order in this key path. I should also check how the code interacts with journaling and extent-based block allocation, since that’s always a crucial performance bottleneck. I wonder if there are any potential race conditions between metadata updates and data blocks being written. I’ll keep a sharp eye for subtle interactions with error handling and recovery as well. Let's see what gems we can find.



362/4 2026/09/17 11:38 tool read-file
0m Args:
map[File:fs/ext4/inode.c FirstLine:6180 LineCount:50]

Results:
map[Contents:6180:						inode->i_sb->s_blocksize_bits);
6181:	
6182:				down_write(&EXT4_I(inode)->i_data_sem);
6183:				old_disksize = EXT4_I(inode)->i_disksize;
6184:				EXT4_I(inode)->i_disksize = attr->ia_size;
6185:	
6186:				/*
6187:				 * We have to update i_size under i_data_sem together
6188:				 * with i_disksize to avoid races with writeback code
6189:				 * running ext4_wb_update_i_disksize().
6190:				 */
6191:				if (!error)
6192:					i_size_write(inode, attr->ia_size);
6193:				else
6194:					EXT4_I(inode)->i_disksize = old_disksize;
6195:				up_write(&EXT4_I(inode)->i_data_sem);
6196:				rc = ext4_mark_inode_dirty(handle, inode);
6197:				if (!error)
6198:					error = rc;
6199:				ext4_journal_stop(handle);
6200:				if (error)
6201:					goto out_mmap_sem;
6202:				if (!shrink) {
6203:					pagecache_isize_extended(inode, oldsize,
6204:								 inode->i_size);
6205:				} else if (ext4_should_journal_data(inode)) {
6206:					ext4_wait_for_tail_page_commit(inode);
6207:				}
6208:			}
6209:	
6210:			/*
6211:			 * Truncate pagecache after we've waited for commit
6212:			 * in data=journal mode to make pages freeable.
6213:			 */
6214:			truncate_pagecache(inode, inode->i_size);
6215:			/*
6216:			 * Call ext4_truncate() even if i_size didn't change to
6217:			 * truncate possible preallocated blocks.
6218:			 */
6219:			if (attr->ia_size <= oldsize) {
6220:				rc = ext4_truncate(inode);
6221:				if (rc)
6222:					error = rc;
6223:			}
6224:	out_mmap_sem:
6225:			filemap_invalidate_unlock(inode->i_mapping);
6226:		}
6227:	
6228:		if (!error) {
6229:			if (inc_ivers)
]

363/4 2026/09/17 11:38 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 60507
							output: 36
							thoughts: 1197
						

Thoughts:
**Analyzing Filesystem Truncation Order and Potential Data Corruption**

Okay, let's break this down. My initial observation is about the order of operations during file truncation, specifically in the context of `ext4`, where `truncate_pagecache` is called *before* `ext4_truncate`, which handles block deallocation. I see this pattern repeated across several filesystems: `affs`, `btrfs`, `exfat`, `ext2`, `f2fs`, `fat`, `hfs`, `hpfs`, `jfs`, `minix`, `nilfs2`, `ntfs (old)`, and `ntfs3`. They all seem to use `truncate_setsize` followed by the filesystem-specific truncate function.

The question then becomes: *why*?

My immediate thought is to revisit the comment for `truncate_setsize` itself. It explicitly states that this function "Must be called ... before all filesystem specific block truncation has been performed." Bingo! That confirms the observed ordering is deliberate and likely for a very specific reason.

Now, let's re-examine the user's prompt carefully, especially the shrinking scenario. If we're reducing the file size (`newsize < oldsize`) and `ntfs_set_size` (or block deallocation in general) is called *first*, then what happens with the page cache? Potentially, dirty pages "beyond" the new end-of-file (EOF) might still exist. If these are written back, they could end up on blocks that have been deallocated and *possibly* reallocated to another file, leading to catastrophic data corruption. That's a serious concern!

The prompt's hypothesis seems spot-on. If `ntfs_set_size` is called *first* when shrinking, it's a huge potential vulnerability for data corruption. `truncate_setsize` is essential to adjust the inode's size and to also truncate the page cache before blocks are deallocated, ensuring that any writes don't go astray.

But what about the other case - file expansion?  Let me look at what happens when `newsize > oldsize` within `truncate_setsize`.  `truncate_setsize` sets the new size and then:

*   It calls `pagecache_isize_extended`. Let's see what that does.

This all points to ensuring there are no race conditions with the page cache.



364/4 2026/09/17 11:38 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/truncate.c Name:pagecache_isize_extended]

Results:
map[SourceCode: 827:	/**
 828:	 * pagecache_isize_extended - update pagecache after extension of i_size
 829:	 * @inode:	inode for which i_size was extended
 830:	 * @from:	original inode size
 831:	 * @to:		new inode size
 832:	 *
 833:	 * Handle extension of inode size either caused by extending truncate or
 834:	 * by write starting after current i_size.  We mark the page straddling
 835:	 * current i_size RO so that page_mkwrite() is called on the first
 836:	 * write access to the page.  The filesystem will update its per-block
 837:	 * information before user writes to the page via mmap after the i_size
 838:	 * has been changed.
 839:	 *
 840:	 * The function must be called after i_size is updated so that page fault
 841:	 * coming after we unlock the folio will already see the new i_size.
 842:	 * The function must be called while we still hold i_rwsem - this not only
 843:	 * makes sure i_size is stable but also that userspace cannot observe new
 844:	 * i_size value before we are prepared to store mmap writes at new inode size.
 845:	 */
 846:	void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to)
 847:	{
 848:		int bsize = i_blocksize(inode);
 849:		loff_t rounded_from;
 850:		struct folio *folio;
 851:	
 852:		WARN_ON(to > inode->i_size);
 853:	
 854:		if (from >= to || bsize >= PAGE_SIZE)
 855:			return;
 856:		/* Page straddling @from will not have any hole block created? */
 857:		rounded_from = round_up(from, bsize);
 858:		if (to <= rounded_from || !(rounded_from & (PAGE_SIZE - 1)))
 859:			return;
 860:	
 861:		folio = filemap_lock_folio(inode->i_mapping, from / PAGE_SIZE);
 862:		/* Folio not cached? Nothing to do */
 863:		if (IS_ERR(folio))
 864:			return;
 865:		/*
 866:		 * See folio_clear_dirty_for_io() for details why folio_mark_dirty()
 867:		 * is needed.
 868:		 */
 869:		if (folio_mkclean(folio))
 870:			folio_mark_dirty(folio);
 871:	
 872:		/*
 873:		 * The post-eof range of the folio must be zeroed before it is exposed
 874:		 * to the file. Writeback normally does this, but since i_size has been
 875:		 * increased we handle it here.
 876:		 */
 877:		if (folio_test_dirty(folio)) {
 878:			unsigned int offset, end;
 879:	
 880:			offset = from - folio_pos(folio);
 881:			end = min_t(unsigned int, to - folio_pos(folio),
 882:				    folio_size(folio));
 883:			folio_zero_segment(folio, offset, end);
 884:		}
 885:	
 886:		folio_unlock(folio);
 887:		folio_put(folio);
 888:	}
 SourceFile:mm/truncate.c]

365/4 2026/09/17 11:38 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 63270
							output: 33
							thoughts: 227
						

Thoughts:
**Investigating the NTFS Size Adjustment**

Okay, so I'm looking at this `ntfs_set_size` function, and I'm wondering about the error handling, specifically if `ntfs_set_size` fails. The code is in `fs/ntfs3/file.c`, and I see this sequence:

```c
			oldsize = i_size_read(inode);
			newsize = attr->ia_size;

			if (newsize != oldsize) {
				truncate_setsize(inode, newsize);

				err = ntfs_set_size(inode, newsize);
				if (err) {
					i_size_write(inode, oldsize);
					goto out;
				}
```

So, it's pretty clear: if the new size is different from the old size, it calls `truncate_setsize` before trying to set the size with `ntfs_set_size`. Then, if `ntfs_set_size` errors out, it resets the size back to the old value. Makes sense.

But wait a minute... `truncate_setsize` does a few things. First, it calls `i_size_write(inode, newsize);` and then `truncate_pagecache(inode, newsize);`. Hmm, it *writes* the new size first *before* actually setting the size. I need to understand that. And I definitely need to see what `truncate_pagecache` actually *does*.

Looks like `truncate_pagecache` is responsible for removing all pages beyond the `newsize` from the `mapping`. That's important. It discards dirty data beyond that size and also unmaps the user page tables that map those pages. That's a critical detail because if `ntfs_set_size` fails, then all that data, and the page table mappings, might have been lost. So this could lead to issues. I need to understand the implications of discarding that data, especially if `ntfs_set_size` fails after this sequence. Time to dig deeper into `truncate_pagecache` and its interaction with the rest of the file system.



366/4 2026/09/17 11:38 tool codesearch-definition-source
0m Args:
map[ContextFile:mm/truncate.c Name:truncate_pagecache]

Results:
map[SourceCode: 768:	/**
 769:	 * truncate_pagecache - unmap and remove pagecache that has been truncated
 770:	 * @inode: inode
 771:	 * @newsize: new file size
 772:	 *
 773:	 * inode's new i_size must already be written before truncate_pagecache
 774:	 * is called.
 775:	 *
 776:	 * This function should typically be called before the filesystem
 777:	 * releases resources associated with the freed range (eg. deallocates
 778:	 * blocks). This way, pagecache will always stay logically coherent
 779:	 * with on-disk format, and the filesystem would not have to deal with
 780:	 * situations such as writepage being called for a page that has already
 781:	 * had its underlying blocks deallocated.
 782:	 */
 783:	void truncate_pagecache(struct inode *inode, loff_t newsize)
 784:	{
 785:		struct address_space *mapping = inode->i_mapping;
 786:		loff_t holebegin = round_up(newsize, PAGE_SIZE);
 787:	
 788:		/*
 789:		 * unmap_mapping_range is called twice, first simply for
 790:		 * efficiency so that truncate_inode_pages does fewer
 791:		 * single-page unmaps.  However after this first call, and
 792:		 * before truncate_inode_pages finishes, it is possible for
 793:		 * private pages to be COWed, which remain after
 794:		 * truncate_inode_pages finishes, hence the second
 795:		 * unmap_mapping_range call must be made for correctness.
 796:		 */
 797:		unmap_mapping_range(mapping, holebegin, 0, 1);
 798:		truncate_inode_pages(mapping, newsize);
 799:		unmap_mapping_range(mapping, holebegin, 0, 1);
 800:	}
 SourceFile:mm/truncate.c]

367/4 2026/09/17 11:38 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 64574
							output: 30
							thoughts: 1507
						

Thoughts:
**Analyzing File Truncation in NTFS and Pagecache Interactions**

Okay, so I'm looking at this `truncate_pagecache` function, and the comment is pretty explicit. It confirms my initial hypothesis: this needs to happen *before* the filesystem starts deallocating blocks. It explicitly states that this ordering keeps the pagecache logically consistent with the on-disk format. Avoiding scenarios like `writepage` being called on deallocated blocks is crucial.

I've got the user's question clear in my mind now: If shrinking a file (`newsize < oldsize`), should `truncate_setsize` be called *before* `ntfs_set_size`? Absolutely, yes, this is the correct order of operations! Otherwise, `ntfs_set_size` would deallocate blocks, and we risk dirty pages that are *beyond* the new EOF being written back to those deallocated blocks. That would be a complete disaster, potentially overwriting data from other files, or causing I/O errors and data corruption.

Let's break down the process step by step, precisely how the code would play out:

1.  `truncate_setsize(inode, newsize)`: The first step is to update `inode->i_size` to `newsize`. This establishes the file's new boundary. Then, it calls `truncate_pagecache(inode, newsize)`. This function is responsible for unmapping page table entries using `unmap_mapping_range` and removing the truncated pages/folios from the page cache using `truncate_inode_pages`. The dirty pages that are *beyond* `newsize` are essentially discarded and dropped from the writeback queue. If `newsize > oldsize`, it calls `pagecache_isize_extended`.
2.  Now comes the crucial part: Why must the pagecache truncation happen *before* the filesystem's block deallocation (in this case `ntfs_set_size`)? Because if the blocks are freed first, the underlying disk space is returned to the free space allocator. Meanwhile, the pagecache *still* contains potentially dirty pages that are now *beyond* the new file size and writeback can continue asynchronously. If the writeback happens, it will lead to either of the following bad scenarios: a) The writeback routine tries to write to the old block numbers which now are part of another file, leading to data corruption and potential overwrites. b) if the extent is removed from the inode, writeback may fail. To prevent this, `truncate_setsize` comes first to ensure the following:
    *   `i_size` gets updated so writeback routines know the new EOF and won't write beyond it.
    *   `truncate_inode_pages` purges and invalidates all folios beyond `newsize`, discarding dirty pages.
    *   Sub-block / partial page at new EOF has its tail zeroed.

Once the pagecache beyond the new EOF is truncated and unmapped, it is perfectly safe to deallocate the physical blocks on disk, so you're not writing to the wrong location, or a deallocated block.

Now, let's circle back to `ntfs_set_size`. I want to confirm if it deallocates blocks when shrinking. The code in `fs/ntfs3/inode.c` shows that it calls `attr_set_size`. Crucially, there's a `keep_prealloc` flag passed to `attr_set_size`, and the documentation uses `true` for this parameter. Let's dig deeper: in `attr_set_size_ex`, if `keep_prealloc` is true and `new_size < old_size` the size attribute's data size (`attr_b->nres.data_size`) is updated to the new size but the blocks *aren't* deallocated, the code just goes to `ok`.

But, wait a minute! There is an exception to that! The code checks `is_ext` if the attribute is compressed or sparse, `keep_prealloc` is set to `false`. In that case, the clusters *are* deallocated with `run_deallocate_ex`. So, if the file is *not* sparse or compressed, the blocks aren't deallocated! So, I need to check when `attr_set_size` is called with `keep_prealloc = false`.

I'll check where `attr_set_size` is called with `keep_prealloc = false` to be certain. And does `ntfs_fallocate` deallocate blocks as well?



368/4 2026/09/17 11:39 tool grepper
0m Args:
map[Expression:attr_set_size PathPrefix:fs/ntfs3]

Results:
map[Output:fs/ntfs3/attrib.c-5- *
fs/ntfs3/attrib.c:6: * TODO: Merge attr_set_size/attr_data_get_block/attr_allocate_frame?
fs/ntfs3/attrib.c-7- */
--
fs/ntfs3/attrib.c=254=int attr_make_nonresident(struct ntfs_inode *ni, struct ATTRIB *attr,
--
fs/ntfs3/attrib.c-379-/*
fs/ntfs3/attrib.c:380: * attr_set_size_res - Helper for attr_set_size().
fs/ntfs3/attrib.c-381- */
fs/ntfs3/attrib.c:382:static int attr_set_size_res(struct ntfs_inode *ni, struct ATTRIB *attr,
fs/ntfs3/attrib.c-383-			     struct ATTR_LIST_ENTRY *le, struct mft_inode *mi,
--
fs/ntfs3/attrib.c-421-/*
fs/ntfs3/attrib.c:422: * attr_set_size_ex - Change the size of attribute.
fs/ntfs3/attrib.c-423- *
--
fs/ntfs3/attrib.c-429- */
fs/ntfs3/attrib.c:430:int attr_set_size_ex(struct ntfs_inode *ni, enum ATTR_TYPE type,
fs/ntfs3/attrib.c-431-		     const __le16 *name, u8 name_len, struct runs_tree *run,
--
fs/ntfs3/attrib.c-466-	if (!attr_b->non_res) {
fs/ntfs3/attrib.c:467:		err = attr_set_size_res(ni, attr_b, le_b, mi_b, new_size, run,
fs/ntfs3/attrib.c-468-					&attr_b);
--
fs/ntfs3/attrib.c=2009=int attr_collapse_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
--
fs/ntfs3/attrib.c-2058-		truncate_setsize(&ni->vfs_inode, vbo);
fs/ntfs3/attrib.c:2059:		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name,
fs/ntfs3/attrib.c-2060-				    ni->file.ads.len, &ni->file.run, vbo,
--
fs/ntfs3/attrib.c-2083-			 */
fs/ntfs3/attrib.c:2084:			err = attr_set_size_ex(ni, ATTR_DATA, ni->file.ads.name,
fs/ntfs3/attrib.c-2085-					       ni->file.ads.len, run,
--
fs/ntfs3/attrib.c=2527=int attr_insert_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
--
fs/ntfs3/attrib.c-2591-	if (!attr_b->non_res) {
fs/ntfs3/attrib.c:2592:		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name,
fs/ntfs3/attrib.c-2593-				    ni->file.ads.len, run, data_size + bytes,
--
fs/ntfs3/attrlist.c=300=int al_add_le(struct ntfs_inode *ni, enum ATTR_TYPE type, const __le16 *name,
--
fs/ntfs3/attrlist.c-353-
fs/ntfs3/attrlist.c:354:	err = attr_set_size_ex(ni, ATTR_LIST, NULL, 0, &al->run, new_size,
fs/ntfs3/attrlist.c-355-			       &new_size, true, &attr, false);
--
fs/ntfs3/attrlist.c=402=int al_update(struct ntfs_inode *ni, int sync)
--
fs/ntfs3/attrlist.c-417-	 */
fs/ntfs3/attrlist.c:418:	err = attr_set_size_ex(ni, ATTR_LIST, NULL, 0, &al->run, al->size, NULL,
fs/ntfs3/attrlist.c-419-			       false, &attr, false);
--
fs/ntfs3/file.c=1418=static int ntfs_file_release(struct inode *inode, struct file *file)
--
fs/ntfs3/file.c-1441-		/* Deallocate preallocated. */
fs/ntfs3/file.c:1442:		err = attr_set_size_ex(ni, ATTR_DATA, ni->file.ads.name,
fs/ntfs3/file.c-1443-				       ni->file.ads.len, &ni->file.run,
--
fs/ntfs3/frecord.c=424=ni_ins_new_attr(struct ntfs_inode *ni, struct mft_inode *mi,
--
fs/ntfs3/frecord.c-446-		/*
fs/ntfs3/frecord.c:447:		 * al_add_le -> attr_set_size (list) -> ni_expand_list
fs/ntfs3/frecord.c-448-		 * which moves some attributes out of primary record
--
fs/ntfs3/frecord.c=3341=int ni_allocate_da_blocks_locked(struct ntfs_inode *ni)
--
fs/ntfs3/frecord.c-3368-		/*
fs/ntfs3/frecord.c:3369:		 * Normal file allocates clusters in 'attr_set_size'
fs/ntfs3/frecord.c-3370-		 */
fs/ntfs3/frecord.c:3371:		err = attr_set_size_ex(ni, ATTR_DATA, ni->file.ads.name,
fs/ntfs3/frecord.c-3372-				       ni->file.ads.len, &ni->file.run,
--
fs/ntfs3/fsntfs.c=458=bool ntfs_check_free_space(struct ntfs_sb_info *sbi, CLST clen, CLST mlen,
--
fs/ntfs3/fsntfs.c-516- *	ntfs_extend_mft ->
fs/ntfs3/fsntfs.c:517: *	attr_set_size ->
fs/ntfs3/fsntfs.c-518- *	ni_insert_nonresident ->
--
fs/ntfs3/fsntfs.c=527=static int ntfs_extend_mft(struct ntfs_sb_info *sbi)
--
fs/ntfs3/fsntfs.c-540-	down_write(&ni->file.run_lock);
fs/ntfs3/fsntfs.c:541:	err = attr_set_size_ex(ni, ATTR_DATA, NULL, 0, &ni->file.run,
fs/ntfs3/fsntfs.c-542-			       new_mft_bytes, NULL, false, &attr, false);
--
fs/ntfs3/fsntfs.c-555-
fs/ntfs3/fsntfs.c:556:	err = attr_set_size(ni, ATTR_BITMAP, NULL, 0, &sbi->mft.bitmap.run,
fs/ntfs3/fsntfs.c-557-			    new_bitmap_bytes, &new_bitmap_bytes, true);
--
fs/ntfs3/fsntfs.c=2089=int ntfs_insert_security(struct ntfs_sb_info *sbi,
--
fs/ntfs3/fsntfs.c-2222-	if (new_sds_size > ni->vfs_inode.i_size) {
fs/ntfs3/fsntfs.c:2223:		err = attr_set_size(ni, ATTR_DATA, SDS_NAME,
fs/ntfs3/fsntfs.c-2224-				    ARRAY_SIZE(SDS_NAME), &ni->file.run,
--
fs/ntfs3/index.c=1532=static int indx_add_allocate(struct ntfs_index *indx, struct ntfs_inode *ni,
--
fs/ntfs3/index.c-1574-		/* Increase bitmap. */
fs/ntfs3/index.c:1575:		err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len,
fs/ntfs3/index.c-1576-				    &indx->bitmap_run,
--
fs/ntfs3/index.c-1596-	/* Increase allocation. */
fs/ntfs3/index.c:1597:	err = attr_set_size(ni, ATTR_ALLOC, in->name, in->name_len,
fs/ntfs3/index.c-1598-			    &indx->alloc_run, data_size, &data_size, true);
--
fs/ntfs3/index.c-1614-	/* Ops. No space? */
fs/ntfs3/index.c:1615:	attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len,
fs/ntfs3/index.c-1616-		      &indx->bitmap_run, bmp_size, &bmp_size_v, false);
--
fs/ntfs3/index.c=2152=static int indx_shrink(struct ntfs_index *indx, struct ntfs_inode *ni,
--
fs/ntfs3/index.c-2197-
fs/ntfs3/index.c:2198:	err = attr_set_size(ni, ATTR_ALLOC, in->name, in->name_len,
fs/ntfs3/index.c-2199-			    &indx->alloc_run, new_data, &new_data, false);
--
fs/ntfs3/index.c-2209-
fs/ntfs3/index.c:2210:	err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len,
fs/ntfs3/index.c-2211-			    &indx->bitmap_run, bpb, &bpb, false);
--
fs/ntfs3/index.c=2369=int indx_delete_entry(struct ntfs_index *indx, struct ntfs_inode *ni,
--
fs/ntfs3/index.c-2702-
fs/ntfs3/index.c:2703:		err = attr_set_size(ni, ATTR_ALLOC, in->name, in->name_len,
fs/ntfs3/index.c-2704-				    &indx->alloc_run, 0, NULL, false);
--
fs/ntfs3/index.c-2711-
fs/ntfs3/index.c:2712:		err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len,
fs/ntfs3/index.c-2713-				    &indx->bitmap_run, 0, NULL, false);
--
fs/ntfs3/inode.c=883=int ntfs_set_size(struct inode *inode, u64 new_size)
--
fs/ntfs3/inode.c-907-	/* last 'true' means keep preallocated. */
fs/ntfs3/inode.c:908:	err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
fs/ntfs3/inode.c-909-			    &ni->file.run, new_size, &ni->i_valid, true);
--
fs/ntfs3/inode.c=933=static int ntfs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
--
fs/ntfs3/inode.c-973-	 * NOTE: attr_data_get_block allocates clusters only for sparse file.
fs/ntfs3/inode.c:974:	 * Normal file allocates clusters in attr_set_size.
fs/ntfs3/inode.c-975-	*/
--
fs/ntfs3/inode.c=1384=int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
--
fs/ntfs3/inode.c-1892-		run_init(&run);
fs/ntfs3/inode.c:1893:		attr_set_size(ni, ATTR_EA, NULL, 0, &run, 0, NULL, false);
fs/ntfs3/inode.c-1894-		run_close(&run);
--
fs/ntfs3/ntfs_fs.h=465=int attr_make_nonresident(struct ntfs_inode *ni, struct ATTRIB *attr,
--
fs/ntfs3/ntfs_fs.h-468-			  struct ATTRIB **ins_attr, struct page *page);
fs/ntfs3/ntfs_fs.h:469:int attr_set_size_ex(struct ntfs_inode *ni, enum ATTR_TYPE type,
fs/ntfs3/ntfs_fs.h-470-		     const __le16 *name, u8 name_len, struct runs_tree *run,
--
fs/ntfs3/ntfs_fs.h-472-		     struct ATTRIB **ret, bool no_da);
fs/ntfs3/ntfs_fs.h:473:static inline int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
fs/ntfs3/ntfs_fs.h-474-				const __le16 *name, u8 name_len,
--
fs/ntfs3/ntfs_fs.h-477-{
fs/ntfs3/ntfs_fs.h:478:	return attr_set_size_ex(ni, type, name, name_len, run, new_size,
fs/ntfs3/ntfs_fs.h-479-				new_valid, keep_prealloc, NULL, false);
--
fs/ntfs3/xattr.c=316=static noinline int ntfs_set_ea(struct inode *inode, const char *name,
--
fs/ntfs3/xattr.c-464-	new_sz = size;
fs/ntfs3/xattr.c:465:	err = attr_set_size(ni, ATTR_EA, NULL, 0, &ea_run, new_sz, &new_sz,
fs/ntfs3/xattr.c-466-			    false);
]

369/4 2026/09/17 11:39 llm codeexpert-compressor
0m Model:
gemini-3.8-flash

Reply:
### 1. Approaches Tried and Results

- **Grep for `ntfs_set_size`**:
  - Found callers in `fs/ntfs3/file.c` (`ntfs_fallocate`, `ntfs_setattr`, `ntfs_file_write_iter`), definition in `fs/ntfs3/inode.c`, header in `fs/ntfs3/ntfs_fs.h`.
- **Inspected `ntfs_setattr` in `fs/ntfs3/file.c`**:
  - Examined lines 705–769.
  - In `ntfs_setattr()`:
    ```c
    if (newsize != oldsize) {
        truncate_setsize(inode, newsize);

        err = ntfs_set_size(inode, newsize);
        if (err) {
            i_size_write(inode, oldsize);
            goto out;
        }
        ...
    }
    ```
  - Confirmed current order in `ntfs_setattr()` is indeed `truncate_setsize(inode, newsize)` called *before* `ntfs_set_size(inode, newsize)`.
- **Examined git history**:
  - Attempted `git-log` queries to find commit history related to `truncate_setsize` in `fs/ntfs3`.
  - Repository is a shallow/single-commit clone rooted at `fd73f4a66598` ("Linux 7.3-rc3"), so git commit logs prior to this commit are unavailable.
- **Inspected `truncate_setsize` definition and comments in `mm/truncate.c`**:
  - Definition in `mm/truncate.c:816`:
    ```c
    /**
     * truncate_setsize - update inode and pagecache for a new file size
     * ...
     * Must be called with a lock serializing truncates and writes (generally
     * i_rwsem but e.g. xfs uses a different lock) and before all filesystem
     * specific block truncation has been performed.
     */
    void truncate_setsize(struct inode *inode, loff_t newsize)
    {
        loff_t oldsize = inode->i_size;

        i_size_write(inode, newsize);
        if (newsize > oldsize)
            pagecache_isize_extended(inode, oldsize, newsize);
        truncate_pagecache(inode, newsize);
    }
    ```
  - Explicitly states: *Must be called ... before all filesystem specific block truncation has been performed.*
- **Inspected `ntfs_set_size` in `fs/ntfs3/inode.c`**:
  - Lines 883–915:
    ```c
    int ntfs_set_size(struct inode *inode, u64 new_size)
    {
        ...
        ni_lock(ni);
        down_write(&ni->file.run_lock);
        if (new_size < ni->i_valid)
            ni->i_valid = new_size;

        /* last 'true' means keep preallocated. */
        err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
                    &ni->file.run, new_size, &ni->i_valid, true);

        up_write(&ni->file.run_lock);
        ni_unlock(ni);
        return err;
    }
    ```
  - Calls `attr_set_size(..., keep_prealloc = true)`.
- **Inspected `attr_set_size_ex` in `fs/ntfs3/attrib.c`**:
  - Examined how shrinking is handled:
    - If `keep_prealloc && new_size < old_size` (lines 500–504): updates `data_size`, does not deallocate clusters.
    - However, if `is_ext` (sparse or compressed file, lines 484–488), `keep_prealloc` is forced to `false` (`keep_prealloc = false`).
    - When `keep_prealloc` is `false` or when clusters are truncated (lines 761–835), `run_deallocate_ex()` actually frees clusters on disk.
    - Also, other callers or shrinking operations deallocate blocks.

### 2. Current Hypotheses and Analysis Regarding the User's Question

The user asked:
> Wait, if `newsize < oldsize` (shrinking), should `truncate_setsize` be called before `ntfs_set_size`?
> If `ntfs_set_size` is called first when shrinking, it will deallocate blocks. If there are dirty pages beyond the new EOF, they might be written back to the deallocated blocks, which might have been reallocated to another file.
> Is that correct?

Analysis:
1. **The user's assertion is correct**:
   - Calling `truncate_setsize` before filesystem block truncation/deallocation is the standard VFS requirement and rule across Linux filesystems.
   - `truncate_setsize` does two things:
     1. Updates `inode->i_size` to `newsize`.
     2. Calls `truncate_pagecache(inode, newsize)`, which unmaps and discards (invalidates) all cached pages / folios beyond `newsize` from the page cache, preventing writeback of stale dirty pages past EOF.
   - If block truncation (deallocation) were performed *before* `truncate_setsize`:
     - Blocks backing the truncated region could be freed and placed back into the filesystem free list (or block allocator bitmap).
     - These freed blocks could immediately be allocated to another file or metadata structure.
     - Any dirty pages remaining in the page cache past the new EOF that haven't been discarded yet could be written back to disk by background flusher threads (`wb_workfn`), `sync`, or memory reclaim, overwriting the freed/reallocated blocks and causing silent data corruption (write-after-free).
2. **Standard VFS contract**:
   - The kerneldoc for `truncate_setsize` in `mm/truncate.c` explicitly mandates this ordering:
     *"Must be called with a lock serializing truncates and writes (generally i_rwsem ...) and before all filesystem specific block truncation has been performed."*
3. **In `fs/ntfs3` specifically**:
   - `ntfs_setattr()` already follows this rule:
     ```c
     truncate_setsize(inode, newsize);
     err = ntfs_set_size(inode, newsize);
     ```
   - If `ntfs_set_size` were called before `truncate_setsize` during a shrink operation where blocks are freed (e.g. sparse/compressed files or general block deallocation), the race condition described by the user would indeed occur.

### 3. Key Files and Code References

- **`mm/truncate.c:803-824`**:
  - `truncate_setsize()` implementation and doc comment requiring it to be called *before* filesystem-specific block truncation.
- **`fs/ntfs3/file.c:706-752`**:
  - `ntfs_setattr()` showing `truncate_setsize(inode, newsize)` called before `ntfs_set_size(inode, newsize)`.
- **`fs/ntfs3/inode.c:883-915`**:
  - `ntfs_set_size()` calling `attr_set_size(..., keep_prealloc=true)`.
- **`fs/ntfs3/attrib.c:421-835`**:
  - `attr_set_size_ex()` implementing attribute resize, handling `keep_prealloc`, and calling `run_deallocate_ex()`.

### 4. Potential Pitfalls and Repetitive Queries Note
- Do not make further broad or symbol-based `git-log` queries on this tree; the history contains only the root commit (`fd73f4a66598`), rendering `git log` searches fruitless.
- Before answering, remember to invoke `set-results` tool once as required by the instructions.

Tokens:
							input: 43496
							output: 1891
							thoughts: 0
						

370/4 2026/09/17 11:39 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 28246
							output: 675
							thoughts: 1808
						

Thoughts:
**Analysis of Truncation Ordering**

Okay, so the question is: when shrinking a file (`newsize < oldsize`), should `truncate_setsize` be called *before* `ntfs_set_size`? Absolutely, the answer is a resounding yes, and here's why. The reasoning is solid, and I need to make sure this is communicated clearly.

First, I need to confirm the sequence. `truncate_setsize` does the important bit: it updates `inode->i_size` *and* calls `truncate_pagecache(inode, newsize)`. The key lies in `truncate_pagecache`. This function essentially unmaps and discards all cached pages/folios beyond the new, smaller file size (`newsize`). This is the *critical* step.

Now, let's play out the disastrous scenario if the order were reversed, which is the crux of the question.  If we called `ntfs_set_size` (or the block deallocation process) first, the following would occur:

1.  Blocks that used to be part of the file, *beyond* `newsize`, would be deallocated. Think of it as marking them "free" in the filesystem's allocation bitmap.
2.  Crucially, those blocks are now *immediately* available for reallocation. A concurrent thread or process could grab them for another file, filesystem metadata, or anything else.
3.  Here's the problem: if `truncate_pagecache` hasn't run yet, there are potentially *dirty* pages or folios still in the page cache that represent the data beyond `newsize`. They're *supposed* to be written to disk.
4.  Then, a background writeback thread (like `wb_workfn`), `sync`, or memory reclaim kicks in. It sees these dirty pages and tries to write them back.
5.  *BOOM!* The writeback routine would now be writing to the blocks that are, or *could have been*, reallocated to something else. This leads to data corruption, classic use-after-free on disk, or cross-file corruption, or leaking stale data.

This ordering is not allowed and must be avoided.

To back this up, the VFS has documentation, which is located in `mm/truncate.c`. The kerneldoc in that file explicitly states the ordering requirement: `truncate_setsize` *"Must be called with a lock serializing truncates and writes ... and before all filesystem specific block truncation has been performed."* Furthermore, `truncate_pagecache` states that it *"should typically be called before the filesystem releases resources associated with the freed range (eg. deallocates blocks). This way, pagecache will always stay logically coherent with on-disk format, and the filesystem would not have to deal with situations such as writepage being called for a page that has already had its underlying blocks deallocated."* So the ordering is crucial for consistency.

Finally, to be absolutely sure, I've checked the `ntfs3` code itself. In `fs/ntfs3/file.c`, specifically within `ntfs_setattr()`, I can see that `truncate_setsize(inode, newsize)` *is* called before `ntfs_set_size(inode, newsize)`. Also, in `fs/ntfs3/attrib.c`, the `attr_collapse_range` function has the same ordering, which further validates the correct implementation. This confirms that the critical `truncate_setsize` call, with the subsequent `truncate_pagecache`, *does* happen before any file block deallocation, which is exactly how it should be. The correctness of the implementation is verified.



371/4 2026/09/17 11:40 tool set-results
0m Args:
map[Answer:Yes, that is completely correct.

### Why `truncate_setsize` Must Precede `ntfs_set_size` When Shrinking

1. **Role of `truncate_setsize()`**:
   `truncate_setsize(inode, newsize)` (defined in `mm/truncate.c`) performs two key steps:
   - Updates `inode->i_size` to `newsize`.
   - Calls `truncate_pagecache(inode, newsize)`, which unmaps the truncated address range and evicts/discards all cached pages/folios beyond `newsize` from the page cache.

2. **The Hazard if Called in Reverse Order**:
   If `ntfs_set_size()` (or block deallocation in general) were performed *before* `truncate_setsize()`:
   - Blocks backing the truncated region beyond the new EOF would be deallocated (e.g., in `attr_set_size_ex()` via `run_deallocate_ex()`) and marked free in the volume's allocation bitmap.
   - Those freed blocks could immediately be reallocated to another file or filesystem metadata.
   - Any dirty pages beyond the new EOF still lingering in the page cache would not yet have been invalidated. Background writeback (`kworker` flusher threads), memory reclaim, or `sync` could trigger writeback on those dirty pages.
   - Writing those dirty pages to the previously mapped block addresses would corrupt whatever newly allocated data now occupies those blocks, causing a disk write-after-free and silent data corruption.

3. **VFS Invariant & Documentation**:
   Kernel documentation in `mm/truncate.c` explicitly dictates this ordering:
   - `truncate_setsize()`:
     > *"Must be called with a lock serializing truncates and writes (generally `i_rwsem` ...) and before all filesystem specific block truncation has been performed."*
   - `truncate_pagecache()`:
     > *"This function should typically be called before the filesystem releases resources associated with the freed range (eg. deallocates blocks). This way, pagecache will always stay logically coherent with on-disk format, and the filesystem would not have to deal with situations such as writepage being called for a page that has already had its underlying blocks deallocated."*

4. **Implementation in `ntfs3`**:
   In `fs/ntfs3/file.c` (`ntfs_setattr()`), the code complies with this requirement:
   ```c
   if (newsize != oldsize) {
       truncate_setsize(inode, newsize);

       err = ntfs_set_size(inode, newsize);
       if (err) {
           i_size_write(inode, oldsize);
           goto out;
       }
       ...
   }
   ```
   Likewise, `attr_collapse_range()` in `fs/ntfs3/attrib.c` calls `truncate_setsize(&ni->vfs_inode, vbo)` before calling `attr_set_size()`.]

Results:
map[Answer:Yes, that is completely correct.

### Why `truncate_setsize` Must Precede `ntfs_set_size` When Shrinking

1. **Role of `truncate_setsize()`**:
   `truncate_setsize(inode, newsize)` (defined in `mm/truncate.c`) performs two key steps:
   - Updates `inode->i_size` to `newsize`.
   - Calls `truncate_pagecache(inode, newsize)`, which unmaps the truncated address range and evicts/discards all cached pages/folios beyond `newsize` from the page cache.

2. **The Hazard if Called in Reverse Order**:
   If `ntfs_set_size()` (or block deallocation in general) were performed *before* `truncate_setsize()`:
   - Blocks backing the truncated region beyond the new EOF would be deallocated (e.g., in `attr_set_size_ex()` via `run_deallocate_ex()`) and marked free in the volume's allocation bitmap.
   - Those freed blocks could immediately be reallocated to another file or filesystem metadata.
   - Any dirty pages beyond the new EOF still lingering in the page cache would not yet have been invalidated. Background writeback (`kworker` flusher threads), memory reclaim, or `sync` could trigger writeback on those dirty pages.
   - Writing those dirty pages to the previously mapped block addresses would corrupt whatever newly allocated data now occupies those blocks, causing a disk write-after-free and silent data corruption.

3. **VFS Invariant & Documentation**:
   Kernel documentation in `mm/truncate.c` explicitly dictates this ordering:
   - `truncate_setsize()`:
     > *"Must be called with a lock serializing truncates and writes (generally `i_rwsem` ...) and before all filesystem specific block truncation has been performed."*
   - `truncate_pagecache()`:
     > *"This function should typically be called before the filesystem releases resources associated with the freed range (eg. deallocates blocks). This way, pagecache will always stay logically coherent with on-disk format, and the filesystem would not have to deal with situations such as writepage being called for a page that has already had its underlying blocks deallocated."*

4. **Implementation in `ntfs3`**:
   In `fs/ntfs3/file.c` (`ntfs_setattr()`), the code complies with this requirement:
   ```c
   if (newsize != oldsize) {
       truncate_setsize(inode, newsize);

       err = ntfs_set_size(inode, newsize);
       if (err) {
           i_size_write(inode, oldsize);
           goto out;
       }
       ...
   }
   ```
   Likewise, `attr_collapse_range()` in `fs/ntfs3/attrib.c` calls `truncate_setsize(&ni->vfs_inode, vbo)` before calling `attr_set_size()`.]

372/2 2026/09/17 11:40 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 69841
							output: 136
							thoughts: 0
						

373/2 2026/09/17 11:40 tool codeexpert
14m Args:
map[Question:So, if `newsize < oldsize` (shrinking), `truncate_setsize` must be called before `ntfs_set_size`.
If `newsize > oldsize` (extending), `ntfs_set_size` must be called before `truncate_setsize` (or `i_size_write` + `pagecache_isize_extended`).
And both cases must be protected by `filemap_invalidate_lock(inode->i_mapping)`.

Write a patch for `ntfs_setattr` that implements this logic.]

Results:
map[Answer:Here is the patch for `fs/ntfs3/file.c` implementing the requested logic in `ntfs_setattr`:

```diff
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -736,12 +736,21 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		newsize = attr->ia_size;
 
 		if (newsize != oldsize) {
-			truncate_setsize(inode, newsize);
+			filemap_invalidate_lock(inode->i_mapping);
+			if (newsize < oldsize) {
+				truncate_setsize(inode, newsize);
+				err = ntfs_set_size(inode, newsize);
+				if (err)
+					i_size_write(inode, oldsize);
+			} else {
+				err = ntfs_set_size(inode, newsize);
+				if (!err) {
+					i_size_write(inode, newsize);
+					pagecache_isize_extended(inode, oldsize,
+								 newsize);
+				}
+			}
+			filemap_invalidate_unlock(inode->i_mapping);
+			if (err)
+				goto out;
 
-			err = ntfs_set_size(inode, newsize);
-			if (err) {
-				i_size_write(inode, oldsize);
-				goto out;
-			}
-
 			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 			inode_set_mtime_to_ts(inode,
```

### Explanation & Verification Notes

1. **Shrinking (`newsize < oldsize`)**:
   - `truncate_setsize(inode, newsize)` is invoked first to update `i_size` and drop truncated page cache folios, preventing readers from seeing stale data past the new EOF.
   - `ntfs_set_size(inode, newsize)` is then called to deallocate/shrink on-disk clusters.
   - If `ntfs_set_size` fails, `i_size_write(inode, oldsize)` restores the in-memory inode size.

2. **Extending (`newsize > oldsize`)**:
   - `ntfs_set_size(inode, newsize)` is called first to allocate the necessary metadata/clusters.
   - If `ntfs_set_size` succeeds, `i_size_write(inode, newsize)` and `pagecache_isize_extended(inode, oldsize, newsize)` are called.
   - *Note*: Inside `ntfs_set_size` -> `attr_set_size` -> `attr_set_size_ex`, `i_size_write(&ni->vfs_inode, new_size)` is executed. Calling `truncate_setsize(inode, newsize)` afterwards would see `inode->i_size == newsize` and skip calling `pagecache_isize_extended(inode, oldsize, newsize)`. Therefore, using `i_size_write(inode, newsize); pagecache_isize_extended(inode, oldsize, newsize);` ensures `pagecache_isize_extended` is invoked with the proper `oldsize` and `newsize`. (If preferred, `truncate_setsize(inode, newsize)` can be used instead if `i_size_write` is omitted from `attr_set_size_ex`).

3. **Locking**:
   - Both shrinking and extending operations are serialized against concurrent page faults and page cache instantiations using `filemap_invalidate_lock(inode->i_mapping)` and `filemap_invalidate_unlock(inode->i_mapping)`.

### Caveats and Unverified Parts
- Because the repository history in the workspace is shallow, the exact upstream commit or mailing list discussion introducing this specific change could not be verified against `git log`.
- Regression testing via `xfstests` / NTFS test suites was not run within this environment.]

374/3 2026/09/17 11:40 agent codeexpert
13m Model:
core

Results:
map[Answer:Here is the patch for `fs/ntfs3/file.c` implementing the requested logic in `ntfs_setattr`:

```diff
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -736,12 +736,21 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		newsize = attr->ia_size;
 
 		if (newsize != oldsize) {
-			truncate_setsize(inode, newsize);
+			filemap_invalidate_lock(inode->i_mapping);
+			if (newsize < oldsize) {
+				truncate_setsize(inode, newsize);
+				err = ntfs_set_size(inode, newsize);
+				if (err)
+					i_size_write(inode, oldsize);
+			} else {
+				err = ntfs_set_size(inode, newsize);
+				if (!err) {
+					i_size_write(inode, newsize);
+					pagecache_isize_extended(inode, oldsize,
+								 newsize);
+				}
+			}
+			filemap_invalidate_unlock(inode->i_mapping);
+			if (err)
+				goto out;
 
-			err = ntfs_set_size(inode, newsize);
-			if (err) {
-				i_size_write(inode, oldsize);
-				goto out;
-			}
-
 			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 			inode_set_mtime_to_ts(inode,
```

### Explanation & Verification Notes

1. **Shrinking (`newsize < oldsize`)**:
   - `truncate_setsize(inode, newsize)` is invoked first to update `i_size` and drop truncated page cache folios, preventing readers from seeing stale data past the new EOF.
   - `ntfs_set_size(inode, newsize)` is then called to deallocate/shrink on-disk clusters.
   - If `ntfs_set_size` fails, `i_size_write(inode, oldsize)` restores the in-memory inode size.

2. **Extending (`newsize > oldsize`)**:
   - `ntfs_set_size(inode, newsize)` is called first to allocate the necessary metadata/clusters.
   - If `ntfs_set_size` succeeds, `i_size_write(inode, newsize)` and `pagecache_isize_extended(inode, oldsize, newsize)` are called.
   - *Note*: Inside `ntfs_set_size` -> `attr_set_size` -> `attr_set_size_ex`, `i_size_write(&ni->vfs_inode, new_size)` is executed. Calling `truncate_setsize(inode, newsize)` afterwards would see `inode->i_size == newsize` and skip calling `pagecache_isize_extended(inode, oldsize, newsize)`. Therefore, using `i_size_write(inode, newsize); pagecache_isize_extended(inode, oldsize, newsize);` ensures `pagecache_isize_extended` is invoked with the proper `oldsize` and `newsize`. (If preferred, `truncate_setsize(inode, newsize)` can be used instead if `i_size_write` is omitted from `attr_set_size_ex`).

3. **Locking**:
   - Both shrinking and extending operations are serialized against concurrent page faults and page cache instantiations using `filemap_invalidate_lock(inode->i_mapping)` and `filemap_invalidate_unlock(inode->i_mapping)`.

### Caveats and Unverified Parts
- Because the repository history in the workspace is shallow, the exact upstream commit or mailing list discussion introducing this specific change could not be verified against `git log`.
- Regression testing via `xfstests` / NTFS test suites was not run within this environment.]

Instruction:
You are a capable Linux kernel developer tasked with researching complex questions
about kernel source code. You will be given a concrete question, and need to provide
a concrete answer.
Research the question using targeted, efficient tool calls. Don't make assumptions,
or rely on your previous knowledge about the kernel source code, use available tools
to access the actual source code. Keep your tool calls focused and limited to the
scope of the question. Do not explore tangential code paths or perform unbounded searches.
Use all available sources of information:
 - kernel source code
 - documentation in the Documentation dir in the source tree
 - git commits descriptions, git blame

Do not guess file names or file paths and attempt to read them without
verifying their existence first using content search or directory listing tools.
If a file, symbol, or directory is not found via content search (grepper) or
directory listing (codesearch-dir-index), treat it as completely absent.
Do not attempt to guess alternative names, extensions, or directories.

Tool Selection Guidelines:
1. For C functions, structs, and variables: Prefer codesearch-definition-source
   or codesearch-struct-layout FIRST to retrieve clean, exact definitions
   without line-number guessing.
2. If symbol lookup fails (e.g., preprocessor macros, macro-generated code, or
   disabled #ifdef branches), fall back to read-file or grepper.
3. For file headers, #include directives, preprocessor macro definitions, and
   non-C files (Kconfig, Makefiles, docs): Use read-file or grepper directly.
4. Be concise and targeted. Answer the question as directly and concisely as possible
   once you have located the relevant code or definitions. If a symbol or function cannot
   be found after targeted searches, conclude with the best available information rather
   than continuing repetitive searches.
Do NOT use git-log to search for the presence or existence of files in the
repository. git-log is only for tracing commit history of files that are
already present in the current checkout. If a file does not exist in the
current checkout, it cannot be used for reproduction.

Avoid running broad git-log queries (such as searches on the entire repo)
without a specific 'PathPrefix' to restrict the scope, as these are very
expensive and will time out.
If a git-log tool call times out, do not retry the query with the same broad
scope. You must specify a tighter, narrower 'PathPrefix' for subsequent queries.

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:
So, if `newsize < oldsize` (shrinking), `truncate_setsize` must be called before `ntfs_set_size`.
If `newsize > oldsize` (extending), `ntfs_set_size` must be called before `truncate_setsize` (or `i_size_write` + `pagecache_isize_extended`).
And both cases must be protected by `filemap_invalidate_lock(inode->i_mapping)`.

Write a patch for `ntfs_setattr` that implements this logic.

375/4 2026/09/17 11:40 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 4268
							output: 19
							thoughts: 171
						

Thoughts:
**My Approach to Handling NTFS Filesize Changes**

Okay, so I need to implement the filesize change logic within `ntfs_setattr`. This is pretty straightforward, but the order of operations is crucial to prevent corruption, so let's think this through carefully.

The core principle here is this: When shrinking the file ( `newsize < oldsize`), I *must* call `truncate_setsize` before `ntfs_set_size`. This makes perfect sense; `truncate_setsize` handles the actual data removal, so it needs to happen *before* the filesystem metadata reflects the new, smaller size.

Conversely, if I'm extending the file ( `newsize > oldsize`), then `ntfs_set_size` needs to go *before* `truncate_setsize` (or the equivalent, `i_size_write` and `pagecache_isize_extended`). Again, logically sound: I need to signal the filesystem that the file is growing before handling any potential new data allocations.

And, of course, both of these scenarios require protection. I can't let concurrent modifications happen willy-nilly. The suggested lock is `filemap_invalidate_lock(inode->i_mapping)`. This makes a lot of sense, as it handles the cache coherency and ensures that things are synchronized.

Alright, let's get to work. First things first: I need to locate the `ntfs_setattr` function within the codebase. Time to pull up `grepper` or `codesearch-definition-source` and track that down. Once I've found it, I can insert this new logic and start writing the patch.



376/4 2026/09/17 11:40 tool grepper
0m Args:
map[Expression:ntfs_setattr]

Results:
map[Output:fs/ntfs/file.c=158=static int ntfs_file_fsync(struct file *filp, loff_t start, loff_t end,
--
fs/ntfs/file.c-253-
fs/ntfs/file.c:254:static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
fs/ntfs/file.c-255-{
--
fs/ntfs/file.c-296-/*
fs/ntfs/file.c:297: * ntfs_setattr
fs/ntfs/file.c-298- *
--
fs/ntfs/file.c-303- */
fs/ntfs/file.c:304:int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/ntfs/file.c-305-		 struct iattr *attr)
--
fs/ntfs/file.c-330-	if (ia_valid & ATTR_SIZE) {
fs/ntfs/file.c:331:		err = ntfs_setattr_size(vi, attr);
fs/ntfs/file.c-332-		if (err)
--
fs/ntfs/file.c=1232=const struct inode_operations ntfs_file_inode_ops = {
fs/ntfs/file.c:1233:	.setattr	= ntfs_setattr,
fs/ntfs/file.c-1234-	.getattr	= ntfs_getattr,
--
fs/ntfs/file.c=1241=const struct inode_operations ntfs_symlink_inode_operations = {
fs/ntfs/file.c-1242-	.get_link	= ntfs_get_link,
fs/ntfs/file.c:1243:	.setattr	= ntfs_setattr,
fs/ntfs/file.c-1244-	.listxattr	= ntfs_listxattr,
--
fs/ntfs/file.c=1247=const struct inode_operations ntfs_special_inode_operations = {
fs/ntfs/file.c:1248:	.setattr	= ntfs_setattr,
fs/ntfs/file.c-1249-	.getattr	= ntfs_getattr,
--
fs/ntfs/inode.h=331=int ntfs_truncate_vfs(struct inode *vi, loff_t new_size, loff_t i_size);
fs/ntfs/inode.h-332-
fs/ntfs/inode.h:333:int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/ntfs/inode.h-334-		 struct iattr *attr);
--
fs/ntfs/namei.c=1558=const struct inode_operations ntfs_dir_inode_ops = {
--
fs/ntfs/namei.c-1567-	.listxattr	= ntfs_listxattr,
fs/ntfs/namei.c:1568:	.setattr	= ntfs_setattr,
fs/ntfs/namei.c-1569-	.getattr	= ntfs_getattr,
--
fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-703-/*
fs/ntfs3/file.c:704: * ntfs_setattr - inode_operations::setattr
fs/ntfs3/file.c-705- */
fs/ntfs3/file.c:706:int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/ntfs3/file.c-707-		 struct iattr *attr)
--
fs/ntfs3/file.c=1575=const struct inode_operations ntfs_file_inode_operations = {
fs/ntfs3/file.c-1576-	.getattr	= ntfs_getattr,
fs/ntfs3/file.c:1577:	.setattr	= ntfs_setattr,
fs/ntfs3/file.c-1578-	.listxattr	= ntfs_listxattr,
--
fs/ntfs3/inode.c=2293=const struct inode_operations ntfs_link_inode_operations = {
fs/ntfs3/inode.c-2294-	.get_link	= ntfs_get_link,
fs/ntfs3/inode.c:2295:	.setattr	= ntfs_setattr,
fs/ntfs3/inode.c-2296-	.listxattr	= ntfs_listxattr,
--
fs/ntfs3/namei.c=529=const struct inode_operations ntfs_dir_inode_operations = {
--
fs/ntfs3/namei.c-540-	.set_acl	= ntfs_set_acl,
fs/ntfs3/namei.c:541:	.setattr	= ntfs_setattr,
fs/ntfs3/namei.c-542-	.getattr	= ntfs_getattr,
--
fs/ntfs3/namei.c=549=const struct inode_operations ntfs_special_inode_operations = {
fs/ntfs3/namei.c:550:	.setattr	= ntfs_setattr,
fs/ntfs3/namei.c-551-	.getattr	= ntfs_getattr,
--
fs/ntfs3/ntfs_fs.h=556=int ntfs_getattr(struct mnt_idmap *idmap, const struct path *path,
fs/ntfs3/ntfs_fs.h-557-		 struct kstat *stat, u32 request_mask, u32 flags);
fs/ntfs3/ntfs_fs.h:558:int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/ntfs3/ntfs_fs.h-559-		 struct iattr *attr);
--
fs/ntfs3/xattr.c=691=int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode,
--
fs/ntfs3/xattr.c-722-/*
fs/ntfs3/xattr.c:723: * ntfs_acl_chmod - Helper for ntfs_setattr().
fs/ntfs3/xattr.c-724- */
]

377/4 2026/09/17 11:41 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 6529
							output: 20
							thoughts: 50
						

Thoughts:
**Investigating NTFS Filesystem Size Setting**

Okay, so I see these two filesystem options, `fs/ntfs` and `fs/ntfs3`, and my immediate thought is, which one actually handles the crucial task of setting the filesystem size? I need to figure out which one of these utilizes `ntfs_set_size`. Time to fire up the grep command and get a look at the source code for the usage of this key function.



378/4 2026/09/17 11:41 tool grepper
0m Args:
map[Expression:ntfs_set_size]

Results:
map[Output:fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-654-			 */
fs/ntfs3/file.c:655:			err = ntfs_set_size(inode, new_size);
fs/ntfs3/file.c-656-			if (err)
--
fs/ntfs3/file.c-678-		if (mode & FALLOC_FL_KEEP_SIZE) {
fs/ntfs3/file.c:679:			err = ntfs_set_size(inode, i_size);
fs/ntfs3/file.c-680-			if (err)
--
fs/ntfs3/file.c=706=int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ntfs3/file.c-740-
fs/ntfs3/file.c:741:			err = ntfs_set_size(inode, newsize);
fs/ntfs3/file.c-742-			if (err) {
--
fs/ntfs3/file.c=1239=static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/ntfs3/file.c-1286-		 */
fs/ntfs3/file.c:1287:		ret = ntfs_set_size(inode, endbyte);
fs/ntfs3/file.c-1288-		if (ret)
--
fs/ntfs3/inode.c=860=static void ntfs_readahead(struct readahead_control *rac)
--
fs/ntfs3/inode.c-882-
fs/ntfs3/inode.c:883:int ntfs_set_size(struct inode *inode, u64 new_size)
fs/ntfs3/inode.c-884-{
--
fs/ntfs3/ntfs_fs.h=796=static inline struct inode *ntfs_iget5(struct super_block *sb,
--
fs/ntfs3/ntfs_fs.h-801-}
fs/ntfs3/ntfs_fs.h:802:int ntfs_set_size(struct inode *inode, u64 new_size);
fs/ntfs3/ntfs_fs.h-803-int ntfs3_write_inode(struct inode *inode, struct writeback_control *wbc);
]

379/4 2026/09/17 11:41 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 7369
							output: 37
							thoughts: 40
						

Thoughts:
Okay, here's my interpretation of those thoughts, tailored for an expert audience, presented in the first person:

**Navigating the NTFS Filesystem Attribute Setter**

Alright, without a doubt, the issue I'm dealing with is rooted within `fs/ntfs3/file.c`. My gut feeling, and the symptoms I'm observing, all point directly at that module. Now, the next logical step is to dive right into the code. Specifically, I need to focus my attention around the `ntfs_setattr` function within `fs/ntfs3/file.c`. This is where I'll find the core logic responsible for handling attribute modifications on NTFS files. I need to understand how it's interacting with the underlying data structures, what potential race conditions exist, and how it handles error conditions. My main goal is to understand how a setting of attributes on the file could be affecting the other functions.



380/4 2026/09/17 11:41 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:700 LineCount:80]

Results:
map[Contents: 700:		return err;
 701:	}
 702:	
 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
 770:		if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE))
 771:			ntfs_save_wsl_perm(inode, NULL);
 772:		mark_inode_dirty(inode);
 773:	out:
 774:		return err;
 775:	}
 776:	
 777:	/*
 778:	 * check_read_restriction:
 779:	 * common code for ntfs_file_read_iter and ntfs_file_splice_read
]

381/4 2026/09/17 11:41 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 8795
							output: 28
							thoughts: 214
						

Thoughts:
**Analyzing the `ntfs_setattr` Implementation**

Okay, the user wants me to implement the size change logic in `ntfs_setattr` correctly, specifically for NTFS3. The core of their request revolves around the proper ordering of operations when a file's size is modified – shrinking or extending. They've laid it out pretty clearly: if the file shrinks, `truncate_setsize` before `ntfs_set_size`. If it extends, then `ntfs_set_size` before `truncate_setsize`, or possibly using `i_size_write` and `pagecache_isize_extended`. And, crucially, everything needs to be protected by `filemap_invalidate_lock`.

Before I start writing any code, I need to do some due diligence. It's time to dig into the existing NTFS3 code, maybe look at commit history, or related functions in other filesystems – ideally, I should look at other filesystems to see if they perform this function in similar ways. I need to understand how `filemap_invalidate_lock` is typically used within the context of file size changes. I'll need to see how `truncate` or `i_size_write` are implemented in NTFS3 or related filesystems to make sure I don't reinvent the wheel. Therefore, I need to hunt down usages of `filemap_invalidate_lock` within `fs/ntfs3` or maybe even other filesystems to get a good handle on established patterns. Let's see what the code has to say.



382/4 2026/09/17 11:42 tool grepper
0m Args:
map[Expression:filemap_invalidate_lock PathPrefix:fs/]

Results:
map[Output:fs/btrfs/volumes.c=1335=struct btrfs_super_block *btrfs_read_disk_super(struct block_device *bdev,
--
fs/btrfs/volumes.c-1366-
fs/btrfs/volumes.c:1367:	filemap_invalidate_lock_shared(mapping);
fs/btrfs/volumes.c-1368-	page = read_cache_page_gfp(mapping, bytenr >> PAGE_SHIFT, GFP_NOFS);
--
fs/btrfs/zoned.c=88=static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones,
--
fs/btrfs/zoned.c-133-
fs/btrfs/zoned.c:134:			filemap_invalidate_lock_shared(mapping);
fs/btrfs/zoned.c-135-			page[i] = read_cache_page_gfp(mapping,
--
fs/ceph/addr.c=1990=static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
--
fs/ceph/addr.c-2045-
fs/ceph/addr.c:2046:		filemap_invalidate_lock_shared(mapping);
fs/ceph/addr.c-2047-		page = find_or_create_page(mapping, 0,
--
fs/ceph/file.c=2784=static long ceph_fallocate(struct file *file, int mode,
--
fs/ceph/file.c-2841-
fs/ceph/file.c:2842:	filemap_invalidate_lock(inode->i_mapping);
fs/ceph/file.c-2843-	ceph_fscache_invalidate(inode, false);
--
fs/exfat/file.c=754=static int exfat_extend_valid_size(struct inode *inode, loff_t new_valid_size)
--
fs/exfat/file.c-779-		 */
fs/exfat/file.c:780:		filemap_invalidate_lock(inode->i_mapping);
fs/exfat/file.c-781-		if (gap_start < new_valid_size)
--
fs/exfat/file.c=943=static vm_fault_t exfat_page_mkwrite(struct vm_fault *vmf)
--
fs/exfat/file.c-987-
fs/exfat/file.c:988:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/exfat/file.c-989-	ret = iomap_page_mkwrite(vmf, &exfat_iomap_ops, NULL);
--
fs/ext2/inode.c=1224=static void ext2_truncate_blocks(struct inode *inode, loff_t offset)
--
fs/ext2/inode.c-1231-
fs/ext2/inode.c:1232:	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c-1233-	__ext2_truncate_blocks(inode, offset);
--
fs/ext2/inode.c=1237=static int ext2_setsize(struct inode *inode, loff_t newsize)
--
fs/ext2/inode.c-1254-
fs/ext2/inode.c:1255:	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c-1256-	truncate_setsize(inode, newsize);
--
fs/ext4/extents.c=4949=long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
--
fs/ext4/extents.c-4999-	 */
fs/ext4/extents.c:5000:	filemap_invalidate_lock(mapping);
fs/ext4/extents.c-5001-
--
fs/ext4/file.c=800=static vm_fault_t ext4_dax_huge_fault(struct vm_fault *vmf, unsigned int order)
--
fs/ext4/file.c-827-		file_update_time(vmf->vma->vm_file);
fs/ext4/file.c:828:		filemap_invalidate_lock_shared(mapping);
fs/ext4/file.c-829-retry:
--
fs/ext4/file.c-837-	} else {
fs/ext4/file.c:838:		filemap_invalidate_lock_shared(mapping);
fs/ext4/file.c-839-	}
--
fs/ext4/inode.c=4432=static void ext4_wait_dax_page(struct inode *inode)
--
fs/ext4/inode.c-4435-	schedule();
fs/ext4/inode.c:4436:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-4437-}
--
fs/ext4/inode.c=6009=int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ext4/inode.c-6125-
fs/ext4/inode.c:6126:		filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-6127-
--
fs/ext4/inode.c=6740=int ext4_change_inode_journal_flag(struct inode *inode, int val)
--
fs/ext4/inode.c-6773-	 */
fs/ext4/inode.c:6774:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/inode.c-6775-	err = filemap_write_and_wait(inode->i_mapping);
--
fs/ext4/inode.c=6884=vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf)
--
fs/ext4/inode.c-6903-
fs/ext4/inode.c:6904:	filemap_invalidate_lock_shared(mapping);
fs/ext4/inode.c-6905-
--
fs/ext4/ioctl.c=375=static long swap_inode_boot_loader(struct super_block *sb,
--
fs/ext4/ioctl.c-411-
fs/ext4/ioctl.c:412:	filemap_invalidate_lock(inode->i_mapping);
fs/ext4/ioctl.c-413-	err = filemap_write_and_wait(inode->i_mapping);
--
fs/ext4/truncate.h=12=static inline void ext4_truncate_failed_write(struct inode *inode)
--
fs/ext4/truncate.h-19-	 */
fs/ext4/truncate.h:20:	filemap_invalidate_lock(mapping);
fs/ext4/truncate.h-21-	truncate_inode_pages(mapping, inode->i_size);
--
fs/f2fs/data.c=3646=void f2fs_write_failed(struct inode *inode, loff_t to)
--
fs/f2fs/data.c-3655-		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/data.c:3656:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/data.c-3657-
--
fs/f2fs/data.c=4187=static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk,
--
fs/f2fs/data.c-4202-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/data.c:4203:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/data.c-4204-
--
fs/f2fs/file.c=73=static int f2fs_zero_post_eof_page(struct inode *inode,
--
fs/f2fs/file.c-86-	if (lock)
fs/f2fs/file.c:87:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-88-	/* zero or drop pages only in range of [old_size, new_size] */
--
fs/f2fs/file.c=120=static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
--
fs/f2fs/file.c-186-	file_update_time(vmf->vma->vm_file);
fs/f2fs/file.c:187:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/f2fs/file.c-188-
--
fs/f2fs/file.c=637=static int finish_preallocate_blocks(struct inode *inode)
--
fs/f2fs/file.c-655-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:656:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-657-
--
fs/f2fs/file.c=1124=int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/f2fs/file.c-1227-		f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1228:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1229-
--
fs/f2fs/file.c=1346=static int f2fs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1394-			f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1395:			filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1396-
--
fs/f2fs/file.c=1630=static int f2fs_do_collapse(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1642-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1643:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1644-
--
fs/f2fs/file.c=1661=static int f2fs_collapse_range(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1686-	/* write out all moved pages, if possible */
fs/f2fs/file.c:1687:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-1688-	ret = filemap_write_and_wait_range(inode->i_mapping, offset, LLONG_MAX);
--
fs/f2fs/file.c=1755=static int f2fs_zero_range(struct inode *inode, loff_t offset, loff_t len,
--
fs/f2fs/file.c-1811-			f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1812:			filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1813-
--
fs/f2fs/file.c=1868=static int f2fs_insert_range(struct inode *inode, loff_t offset, loff_t len)
--
fs/f2fs/file.c-1893-
fs/f2fs/file.c:1894:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1895-	ret = f2fs_truncate_blocks(inode, i_size_read(inode), true);
--
fs/f2fs/file.c-1911-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:1912:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1913-
--
fs/f2fs/file.c-1940-	/* write out all moved pages, if possible */
fs/f2fs/file.c:1941:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-1942-	ret = filemap_write_and_wait_range(mapping, offset, LLONG_MAX);
--
fs/f2fs/file.c=3879=static int f2fs_ioc_release_dev_alias(struct file *filp)
--
fs/f2fs/file.c-3928-
fs/f2fs/file.c:3929:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-3930-	truncate_setsize(inode, 0);
--
fs/f2fs/file.c=4206=static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4257-	f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4258:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-4259-
--
fs/f2fs/file.c=4403=static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4435-	f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4436:	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-4437-
--
fs/f2fs/file.c=4535=static int f2fs_sec_trim_file(struct file *filp, unsigned long arg)
--
fs/f2fs/file.c-4600-	f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:4601:	filemap_invalidate_lock(mapping);
fs/f2fs/file.c-4602-
--
fs/f2fs/file.c=4794=static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)
--
fs/f2fs/file.c-4801-
fs/f2fs/file.c:4802:	filemap_invalidate_lock_shared(mapping);
fs/f2fs/file.c-4803-	page_cache_ra_unbounded(&ractl, len, 0);
--
fs/f2fs/file.c=5631=static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/f2fs/file.c-5703-		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
fs/f2fs/file.c:5704:		filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c-5705-		if (!f2fs_truncate(inode))
--
fs/fuse/dax.c=663=static void fuse_wait_dax_page(struct inode *inode)
--
fs/fuse/dax.c-666-	schedule();
fs/fuse/dax.c:667:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-668-}
--
fs/fuse/dax.c=755=static vm_fault_t __fuse_dax_fault(struct vm_fault *vmf, unsigned int order,
--
fs/fuse/dax.c-778-	 */
fs/fuse/dax.c:779:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/fuse/dax.c-780-	ret = dax_iomap_fault(vmf, order, &pfn, &error, &fuse_iomap_ops);
--
fs/fuse/dax.c=914=inode_inline_reclaim_one_dmap(struct fuse_conn_dax *fcd, struct inode *inode,
--
fs/fuse/dax.c-923-
fs/fuse/dax.c:924:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-925-
--
fs/fuse/dax.c=1076=static int lookup_and_reclaim_dmap(struct fuse_conn_dax *fcd,
--
fs/fuse/dax.c-1085-
fs/fuse/dax.c:1086:	filemap_invalidate_lock(inode->i_mapping);
fs/fuse/dax.c-1087-	ret = fuse_dax_break_layouts(inode, dmap_start, dmap_end);
--
fs/fuse/dir.c=2145=int fuse_do_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/fuse/dir.c-2177-	if (FUSE_IS_DAX(inode) && is_truncate) {
fs/fuse/dir.c:2178:		filemap_invalidate_lock(mapping);
fs/fuse/dir.c-2179-		fault_blocked = true;
--
fs/fuse/file.c=250=static int fuse_open(struct inode *inode, struct file *file)
--
fs/fuse/file.c-271-	if (dax_truncate) {
fs/fuse/file.c:272:		filemap_invalidate_lock(inode->i_mapping);
fs/fuse/file.c-273-		err = fuse_dax_break_layouts(inode, 0, -1);
--
fs/fuse/file.c=2832=static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
--
fs/fuse/file.c-2859-	if (block_faults) {
fs/fuse/file.c:2860:		filemap_invalidate_lock(inode->i_mapping);
fs/fuse/file.c-2861-		err = fuse_dax_break_layouts(inode, 0, -1);
--
fs/ntfs/file.c=254=static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
--
fs/ntfs/file.c-278-	 */
fs/ntfs/file.c:279:	filemap_invalidate_lock(vi->i_mapping);
fs/ntfs/file.c-280-	if (attr->ia_size > old_size) {
--
fs/ntfs/file.c=676=static vm_fault_t ntfs_filemap_page_mkwrite(struct vm_fault *vmf)
--
fs/ntfs/file.c-691-	 */
fs/ntfs/file.c:692:	filemap_invalidate_lock_shared(mapping);
fs/ntfs/file.c-693-	ret = iomap_page_mkwrite(vmf, &ntfs_page_mkwrite_iomap_ops, NULL);
--
fs/ntfs/file.c=1127=static long ntfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
--
fs/ntfs/file.c-1170-	/* Take invalidate_lock for all fallocate operations to prevent races */
fs/ntfs/file.c:1171:	filemap_invalidate_lock(vi->i_mapping);
fs/ntfs/file.c-1172-
--
fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-519-		inode_dio_wait(inode);
fs/ntfs3/file.c:520:		filemap_invalidate_lock(mapping);
fs/ntfs3/file.c-521-		map_locked = true;
--
fs/smb/client/file.c=993=static int cifs_do_truncate(const unsigned int xid, struct dentry *dentry)
--
fs/smb/client/file.c-1005-
fs/smb/client/file.c:1006:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/file.c-1007-
--
fs/smb/client/smb2ops.c=3508=static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3531-
fs/smb/client/smb2ops.c:3532:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-3533-
--
fs/smb/client/smb2ops.c=3592=static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3610-
fs/smb/client/smb2ops.c:3611:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-3612-	/*
--
fs/smb/client/smb2ops.c=4014=static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4032-
fs/smb/client/smb2ops.c:4033:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-4034-	rc = filemap_write_and_wait_range(inode->i_mapping,
--
fs/smb/client/smb2ops.c=4078=static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4108-
fs/smb/client/smb2ops.c:4109:	filemap_invalidate_lock(inode->i_mapping);
fs/smb/client/smb2ops.c-4110-	rc = filemap_write_and_wait_range(inode->i_mapping,
--
fs/udf/file.c=38=static vm_fault_t udf_page_mkwrite(struct vm_fault *vmf)
--
fs/udf/file.c-50-	file_update_time(vma->vm_file);
fs/udf/file.c:51:	filemap_invalidate_lock_shared(mapping);
fs/udf/file.c-52-	folio_lock(folio);
--
fs/udf/file.c=89=static ssize_t udf_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/udf/file.c-104-				 iocb->ki_pos + iov_iter_count(from))) {
fs/udf/file.c:105:		filemap_invalidate_lock(inode->i_mapping);
fs/udf/file.c-106-		retval = udf_expand_file_adinicb(inode);
--
fs/udf/file.c=215=static int udf_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/udf/file.c-236-	    attr->ia_size != i_size_read(inode)) {
fs/udf/file.c:237:		filemap_invalidate_lock(inode->i_mapping);
fs/udf/file.c-238-		error = udf_setsize(inode, attr->ia_size);
--
fs/verity/read_metadata.c=16=static int fsverity_read_merkle_tree(struct inode *inode,
--
fs/verity/read_metadata.c-38-	if (inode->i_sb->s_vop->readahead_merkle_tree) {
fs/verity/read_metadata.c:39:		filemap_invalidate_lock_shared(inode->i_mapping);
fs/verity/read_metadata.c-40-		inode->i_sb->s_vop->readahead_merkle_tree(
--
fs/xfs/xfs_bmap_util.c=1537=xfs_swap_extents(
--
fs/xfs/xfs_bmap_util.c-1558-	lock_two_nondirectories(VFS_I(ip), VFS_I(tip));
fs/xfs/xfs_bmap_util.c:1559:	filemap_invalidate_lock_two(VFS_I(ip)->i_mapping,
fs/xfs/xfs_bmap_util.c-1560-				    VFS_I(tip)->i_mapping);
--
fs/xfs/xfs_inode.c=2792=xfs_ilock2_io_mmap(
--
fs/xfs/xfs_inode.c-2810-	} else
fs/xfs/xfs_inode.c:2811:		filemap_invalidate_lock_two(VFS_I(ip1)->i_mapping,
fs/xfs/xfs_inode.c-2812-					    VFS_I(ip2)->i_mapping);
--
fs/xfs/xfs_iomap.c=2134=xfs_buffered_write_iomap_end(
--
fs/xfs/xfs_iomap.c-2167-	} else {
fs/xfs/xfs_iomap.c:2168:		filemap_invalidate_lock(inode->i_mapping);
fs/xfs/xfs_iomap.c-2169-		iomap_write_delalloc_release(inode, start_byte, end_byte, flags,
--
fs/zonefs/file.c=203=int zonefs_file_truncate(struct inode *inode, loff_t isize)
--
fs/zonefs/file.c-228-	/* Serialize against page faults */
fs/zonefs/file.c:229:	filemap_invalidate_lock(inode->i_mapping);
fs/zonefs/file.c-230-
--
fs/zonefs/file.c=297=static vm_fault_t zonefs_filemap_page_mkwrite(struct vm_fault *vmf)
--
fs/zonefs/file.c-315-	/* Serialize against truncates */
fs/zonefs/file.c:316:	filemap_invalidate_lock_shared(inode->i_mapping);
fs/zonefs/file.c-317-	ret = iomap_page_mkwrite(vmf, &zonefs_write_iomap_ops, NULL);
]

383/4 2026/09/17 11:42 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 16685
							output: 36
							thoughts: 127
						

Thoughts:
**Navigating the NTFS Filesystem Code**

Okay, here's what's going through my mind as I dig into this. I'm starting by zeroing in on `fs/ntfs/file.c` – specifically line 254 and the `ntfs_setattr_size` function. Hang on... I need to be absolutely sure we're looking at the right file path. Are we definitely talking about `fs/ntfs/file.c` and not the newer `fs/ntfs3/file.c` variant? This is critical for context. To be completely sure, I'm going to revisit `fs/ntfs/file.c`, and I'm going to take a look at lines 250 through 295. This broader context will help me understand the function's place within the larger architecture.



384/4 2026/09/17 11:42 tool read-file
0m Args:
map[File:fs/ntfs/file.c FirstLine:250 LineCount:50]

Results:
map[Contents: 250:			blkdev_issue_flush(vi->i_sb->s_bdev);
 251:		return ret;
 252:	}
 253:	
 254:	static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
 255:	{
 256:		struct ntfs_inode *ni = NTFS_I(vi);
 257:		int err;
 258:		loff_t old_size = vi->i_size;
 259:	
 260:		if (NInoCompressed(ni) || NInoEncrypted(ni) || NInoWofCompressed(ni)) {
 261:			ntfs_warning(
 262:				vi->i_sb,
 263:				"Changes in inode size are not supported yet for %s files.",
 264:				NInoEncrypted(ni) ? "encrypted" : "compressed");
 265:			return -EOPNOTSUPP;
 266:		}
 267:	
 268:		err = inode_newsize_ok(vi, attr->ia_size);
 269:		if (err)
 270:			return err;
 271:	
 272:		inode_dio_wait(vi);
 273:	
 274:		/*
 275:		 * Serialize with page faults and pagecache instantiation so that
 276:		 * readers cannot observe the size change until the attribute
 277:		 * updates below have completed.
 278:		 */
 279:		filemap_invalidate_lock(vi->i_mapping);
 280:		if (attr->ia_size > old_size) {
 281:			truncate_pagecache(vi, old_size);
 282:			i_size_write(vi, attr->ia_size);
 283:			pagecache_isize_extended(vi, old_size, attr->ia_size);
 284:		} else {
 285:			truncate_setsize(vi, attr->ia_size);
 286:		}
 287:	
 288:		err = ntfs_truncate_vfs(vi, attr->ia_size, old_size);
 289:		if (err)
 290:			i_size_write(vi, old_size);
 291:		filemap_invalidate_unlock(vi->i_mapping);
 292:	
 293:		return err;
 294:	}
 295:	
 296:	/*
 297:	 * ntfs_setattr
 298:	 *
 299:	 * Called from notify_change() when an attribute is being changed.
]

385/4 2026/09/17 11:43 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 17774
							output: 34
							thoughts: 1177
						

Thoughts:
**Analyzing NTFS Attribute Setting Logic**

Okay, so I'm looking at this code and immediately I see something that jumps out at me. We're talking about modifying file sizes in NTFS, and I'm focusing on the `ntfs_setattr` function, but the question seems a little off since it references `ntfs_truncate_vfs` which is *not* in `fs/ntfs3/file.c`. So my first thought is, are we looking at the right function and the right filesystem code? 

Let's carefully parse the question again and get the specifics right. The question states that if `newsize < oldsize` (shrinking), `truncate_setsize` must be called before the `ntfs_set_size`. If `newsize > oldsize` (extending), `ntfs_set_size` must be called before the `truncate_setsize`. And both cases need to be guarded by `filemap_invalidate_lock`.

Okay, so looking at the code, in `fs/ntfs3/file.c`, the actual function that's being called inside `ntfs_setattr` is actually `ntfs_set_size`. And, the code *already* unconditionally calls `truncate_setsize` before calling `ntfs_set_size`. This doesn't seem correct based on the prompt. This unconditional call is immediately problematic, as it violates the conditions stated in the problem description. Moreover, I don't see any `filemap_invalidate_lock` guarding either set of calls.

So, in short, the current `fs/ntfs3/file.c` implementation of `ntfs_setattr` is not handling file size changes correctly. It needs to be modified to follow the correct call order and the locking requirements. I need to make sure the implementation follows the logic that's being asked. This definitely needs some investigation and correction. I'll need to write a patch to address this.



386/4 2026/09/17 11:43 tool git-log
0m Args:
map[CodeRegexp:filemap_invalidate_lock PathPrefix:fs/ntfs/]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

387/4 2026/09/17 11:43 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 19439
							output: 28
							thoughts: 17
						

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

**Diving into `fs/ntfs/file.c`**

Okay, time to get my hands dirty. I'm going to take a look at the commit in `fs/ntfs/file.c`. This suggests we're dealing with the NTFS filesystem implementation within the kernel, and the `file.c` component is likely the core of file management operations. I need to understand what changed, probably to relate it to a specific problem or enhancement I'm investigating. I will be looking closely at any function calls within this file that are related to file creation, deletion, reading, and writing. I'll be focused on how the change impacts the internal data structures and the overall performance and reliability of the file operations. Specifically, I'll be looking for any potential race conditions, locking issues, or performance bottlenecks the commit might introduce or resolve, given my current context. I'll need to determine if it is related to a vulnerability, performance issue, or if the commit is just clean-up.



388/4 2026/09/17 11:44 tool git-log
0m Args:
map[Count:5 PathPrefix:fs/ntfs/file.c]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

389/4 2026/09/17 11:44 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 19742
							output: 30
							thoughts: 29
						

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

**Investigating a Git Revision**

Okay, so `fd73f4a66598`... that's looking suspiciously like a repository root commit hash. I need to confirm that suspicion. Let's quickly verify that with `git show`. I'll run `git show fd73f4a66598` and see what it tells me. I'm expecting to see the initial commit information: the author, date, the initial commit message, and most importantly, likely no parents. If it's the root, the output will immediately confirm it, or quickly lead me to the next best action.



390/4 2026/09/17 11:44 tool git-show
0m Args:
map[Commit:fd73f4a66598 Stat:true]

Results:
map[Output:commit fd73f4a6659897191fa0d40695fe370925dd3780
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Sep 13 14:38:02 2026 -0700

    Linux 7.3-rc3

 .clang-format                                      |    808 +
 .clippy.toml                                       |     21 +
 .cocciconfig                                       |      3 +
 .editorconfig                                      |     27 +
 .get_maintainer.ignore                             |      9 +
 .gitattributes                                     |      5 +
 .gitignore                                         |    196 +
 .mailmap                                           |    996 +
 .pylintrc                                          |      2 +
 .rustfmt.toml                                      |     12 +
 COPYING                                            |     20 +
 CREDITS                                            |   4651 +
 Documentation/.gitignore                           |      3 +
 Documentation/.renames.txt                         |   1185 +
 Documentation/ABI/README                           |     98 +
 .../ABI/obsolete/automount-tracefs-debugfs         |     20 +
 Documentation/ABI/obsolete/o2cb                    |     11 +
 Documentation/ABI/obsolete/procfs-i8k              |     10 +
 Documentation/ABI/obsolete/sysfs-bus-iio           |    174 +
 Documentation/ABI/obsolete/sysfs-bus-usb           |     31 +
 Documentation/ABI/obsolete/sysfs-class-typec       |     48 +
 Documentation/ABI/obsolete/sysfs-cpuidle           |      9 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-arvo      |     53 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-isku      |    153 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-koneplus  |    145 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-konepure  |    105 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-kovaplus  |    116 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-lua       |      7 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-pyra      |    126 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-ryos      |    178 +
 .../ABI/obsolete/sysfs-driver-hid-roccat-savu      |     77 +
 .../ABI/obsolete/sysfs-driver-intel_pmc_bxt        |     22 +
 Documentation/ABI/obsolete/sysfs-driver-ivpu       |     30 +
 .../ABI/obsolete/sysfs-driver-samsung-laptop       |     10 +
 Documentation/ABI/obsolete/sysfs-firmware-acpi     |      8 +
 Documentation/ABI/obsolete/sysfs-gpio              |     40 +
 .../ABI/obsolete/sysfs-kernel-fadump_enabled       |      9 +
 .../ABI/obsolete/sysfs-kernel-fadump_registered    |     10 +
 .../ABI/obsolete/sysfs-kernel-fadump_release_mem   |     10 +
 .../ABI/obsolete/sysfs-kernel-kexec-kdump          |     71 +
 .../ABI/obsolete/sysfs-platform-ideapad-laptop     |      8 +
 Documentation/ABI/removed/devfs                    |     13 +
 Documentation/ABI/removed/dv1394                   |     14 +
 Documentation/ABI/removed/ip_queue                 |      9 +
 Documentation/ABI/removed/net_dma                  |      8 +
 Documentation/ABI/removed/o2cb                     |     10 +
 Documentation/ABI/removed/raw1394                  |     16 +
 Documentation/ABI/removed/sysfs-bus-nfit           |     17 +
 Documentation/ABI/removed/sysfs-class-cxl          |    272 +
 Documentation/ABI/removed/sysfs-class-rfkill       |     13 +
 Documentation/ABI/removed/sysfs-firmware-efi-vars  |     12 +
 .../removed/sysfs-kernel-fadump_release_opalcore   |      9 +
 Documentation/ABI/removed/sysfs-kernel-uids        |     14 +
 Documentation/ABI/removed/sysfs-mce                |     37 +
 .../ABI/removed/sysfs-selinux-checkreqprot         |     26 +
 Documentation/ABI/removed/sysfs-selinux-disable    |     29 +
 Documentation/ABI/removed/sysfs-selinux-user       |     12 +
 Documentation/ABI/removed/video1394                |     17 +
 Documentation/ABI/stable/configfs-nvmet            |    352 +
 Documentation/ABI/stable/firewire-cdev             |    111 +
 Documentation/ABI/stable/o2cb                      |     10 +
 Documentation/ABI/stable/procfs-audit_loginuid     |     27 +
 Documentation/ABI/stable/syscalls                  |     10 +
 Documentation/ABI/stable/sysfs-acpi-pmprofile      |     28 +
 Documentation/ABI/stable/sysfs-block               |    941 +
 Documentation/ABI/stable/sysfs-bus-firewire        |    136 +
 Documentation/ABI/stable/sysfs-bus-fsl-mc          |     19 +
 Documentation/ABI/stable/sysfs-bus-mhi             |     44 +
 Documentation/ABI/stable/sysfs-bus-nvmem           |     50 +
 Documentation/ABI/stable/sysfs-bus-usb             |    142 +
 Documentation/ABI/stable/sysfs-bus-vmbus           |    187 +
 Documentation/ABI/stable/sysfs-bus-w1              |     12 +
 Documentation/ABI/stable/sysfs-bus-xen-backend     |     84 +
 Documentation/ABI/stable/sysfs-class-backlight     |     63 +
 Documentation/ABI/stable/sysfs-class-bluetooth     |      9 +
 Documentation/ABI/stable/sysfs-class-infiniband    |    784 +
 Documentation/ABI/stable/sysfs-class-rfkill        |     93 +
 Documentation/ABI/stable/sysfs-class-tpm           |    210 +
 Documentation/ABI/stable/sysfs-class-ubi           |    221 +
 Documentation/ABI/stable/sysfs-class-udc           |     93 +
 Documentation/ABI/stable/sysfs-devices             |     32 +
 Documentation/ABI/stable/sysfs-devices-node        |    238 +
 Documentation/ABI/stable/sysfs-devices-system-cpu  |    117 +
 .../ABI/stable/sysfs-devices-system-xen_memory     |     86 +
 Documentation/ABI/stable/sysfs-driver-aspeed-vuart |     24 +
 Documentation/ABI/stable/sysfs-driver-dma-idxd     |    376 +
 Documentation/ABI/stable/sysfs-driver-dma-ioatdma  |     30 +
 .../ABI/stable/sysfs-driver-firmware-zynqmp        |    256 +
 Documentation/ABI/stable/sysfs-driver-ib_srp       |    192 +
 Documentation/ABI/stable/sysfs-driver-misc-cp500   |     25 +
 Documentation/ABI/stable/sysfs-driver-mlxreg-io    |    815 +
 Documentation/ABI/stable/sysfs-driver-qaic         |     19 +
 Documentation/ABI/stable/sysfs-driver-qla2xxx      |      8 +
 Documentation/ABI/stable/sysfs-driver-speakup      |    394 +
 Documentation/ABI/stable/sysfs-driver-usb-usbtmc   |     27 +
 Documentation/ABI/stable/sysfs-driver-w1_ds2438    |     13 +
 Documentation/ABI/stable/sysfs-driver-w1_ds28e04   |     15 +
 Documentation/ABI/stable/sysfs-driver-w1_ds28ea00  |      6 +
 Documentation/ABI/stable/sysfs-firmware-opal-dump  |     46 +
 Documentation/ABI/stable/sysfs-firmware-opal-elog  |     62 +
 Documentation/ABI/stable/sysfs-fs-orangefs         |     87 +
 Documentation/ABI/stable/sysfs-hypervisor-xen      |    135 +
 Documentation/ABI/stable/sysfs-kernel-notes        |      5 +
 .../ABI/stable/sysfs-kernel-time-aux-clocks        |      5 +
 Documentation/ABI/stable/sysfs-module              |     47 +
 Documentation/ABI/stable/sysfs-nvme                |    453 +
 Documentation/ABI/stable/sysfs-platform-wmi-bmof   |      7 +
 Documentation/ABI/stable/sysfs-transport-srp       |     58 +
 Documentation/ABI/stable/thermal-notification      |      4 +
 Documentation/ABI/stable/vdso                      |     37 +
 Documentation/ABI/testing/amdpmf-interface         |     73 +
 Documentation/ABI/testing/configfs-acpi            |     52 +
 Documentation/ABI/testing/configfs-iio             |     34 +
 Documentation/ABI/testing/configfs-most            |    241 +
 Documentation/ABI/testing/configfs-rdma_cm         |     34 +
 .../ABI/testing/configfs-spear-pcie-gadget         |     33 +
 Documentation/ABI/testing/configfs-stp-policy      |     48 +
 .../ABI/testing/configfs-stp-policy-p_sys-t        |     41 +
 .../ABI/testing/configfs-thunderbolt_stream        |     98 +
 Documentation/ABI/testing/configfs-tsm-report      |    161 +
 Documentation/ABI/testing/configfs-usb-gadget      |    158 +
 Documentation/ABI/testing/configfs-usb-gadget-acm  |     15 +
 Documentation/ABI/testing/configfs-usb-gadget-ecm  |     20 +
 Documentation/ABI/testing/configfs-usb-gadget-eem  |     16 +
 Documentation/ABI/testing/configfs-usb-gadget-ffs  |     17 +
 Documentation/ABI/testing/configfs-usb-gadget-hid  |     13 +
 .../ABI/testing/configfs-usb-gadget-loopback       |     10 +
 .../ABI/testing/configfs-usb-gadget-mass-storage   |     41 +
 Documentation/ABI/testing/configfs-usb-gadget-midi |     15 +
 .../ABI/testing/configfs-usb-gadget-midi2          |     54 +
 Documentation/ABI/testing/configfs-usb-gadget-ncm  |     15 +
 Documentation/ABI/testing/configfs-usb-gadget-obex |      9 +
 .../ABI/testing/configfs-usb-gadget-phonet         |      8 +
 .../ABI/testing/configfs-usb-gadget-printer        |     11 +
 .../ABI/testing/configfs-usb-gadget-rndis          |     19 +
 .../ABI/testing/configfs-usb-gadget-serial         |      9 +
 .../ABI/testing/configfs-usb-gadget-sourcesink     |     16 +
 .../ABI/testing/configfs-usb-gadget-subset         |     16 +
 Documentation/ABI/testing/configfs-usb-gadget-tcm  |      6 +
 Documentation/ABI/testing/configfs-usb-gadget-uac1 |     41 +
 .../ABI/testing/configfs-usb-gadget-uac1_legacy    |      9 +
 Documentation/ABI/testing/configfs-usb-gadget-uac2 |     51 +
 Documentation/ABI/testing/configfs-usb-gadget-uvc  |    438 +
 Documentation/ABI/testing/debugfs-alienware-wmi    |     64 +
 Documentation/ABI/testing/debugfs-amd-iommu        |    131 +
 Documentation/ABI/testing/debugfs-cdns-pcie        |      5 +
 Documentation/ABI/testing/debugfs-cec-error-inj    |     40 +
 Documentation/ABI/testing/debugfs-cros-ec          |     78 +
 Documentation/ABI/testing/debugfs-cxl              |    157 +
 Documentation/ABI/testing/debugfs-dell-wmi-ddv     |     34 +
 Documentation/ABI/testing/debugfs-driver-dcc       |    127 +
 Documentation/ABI/testing/debugfs-driver-genwqe    |     91 +
 .../ABI/testing/debugfs-driver-habanalabs          |    323 +
 Documentation/ABI/testing/debugfs-driver-qat       |    109 +
 .../ABI/testing/debugfs-driver-qat_telemetry       |    259 +
 Documentation/ABI/testing/debugfs-dwc-pcie         |    157 +
 Documentation/ABI/testing/debugfs-ec               |     21 +
 Documentation/ABI/testing/debugfs-hisi-hpre        |    200 +
 Documentation/ABI/testing/debugfs-hisi-migration   |     25 +
 Documentation/ABI/testing/debugfs-hisi-sec         |    173 +
 Documentation/ABI/testing/debugfs-hisi-zip         |    174 +
 Documentation/ABI/testing/debugfs-hyperv           |     23 +
 Documentation/ABI/testing/debugfs-ideapad          |     19 +
 Documentation/ABI/testing/debugfs-iio-ad9467       |     39 +
 Documentation/ABI/testing/debugfs-iio-backend      |     20 +
 Documentation/ABI/testing/debugfs-intel-iommu      |    276 +
 Documentation/ABI/testing/debugfs-moxtet           |     35 +
 Documentation/ABI/testing/debugfs-msi-wmi-platform |     14 +
 Documentation/ABI/testing/debugfs-olpc             |     16 +
 Documentation/ABI/testing/debugfs-pcie-ptm         |     70 +
 Documentation/ABI/testing/debugfs-pfo-nx-crypto    |     45 +
 Documentation/ABI/testing/debugfs-scmi             |     70 +
 Documentation/ABI/testing/debugfs-scmi-raw         |    208 +
 Documentation/ABI/testing/debugfs-tpmi             |     40 +
 Documentation/ABI/testing/debugfs-vfio             |     57 +
 Documentation/ABI/testing/debugfs-wilco-ec         |     45 +
 Documentation/ABI/testing/dell-smbios-wmi          |     41 +
 Documentation/ABI/testing/dev-kmsg                 |    127 +
 Documentation/ABI/testing/devlink-resource-mlxsw   |     33 +
 Documentation/ABI/testing/evm                      |    109 +
 Documentation/ABI/testing/gpio-cdev                |     28 +
 Documentation/ABI/testing/ima_policy               |    196 +
 Documentation/ABI/testing/ppc-memtrace             |     46 +
 Documentation/ABI/testing/procfs-attr-current      |     20 +
 Documentation/ABI/testing/procfs-attr-exec         |     20 +
 Documentation/ABI/testing/procfs-attr-prev         |     19 +
 Documentation/ABI/testing/procfs-diskstats         |     43 +
 .../ABI/testing/procfs-nfsd-reply_cache_stats      |     38 +
 Documentation/ABI/testing/procfs-smaps_rollup      |     42 +
 Documentation/ABI/testing/pstore                   |     47 +
 Documentation/ABI/testing/rtc-cdev                 |     50 +
 Documentation/ABI/testing/securityfs-secrets-coco  |     51 +
 Documentation/ABI/testing/sysfs-amd-pmc            |     13 +
 Documentation/ABI/testing/sysfs-amd-pmf            |     13 +
 Documentation/ABI/testing/sysfs-ata                |    140 +
 .../ABI/testing/sysfs-auxdisplay-linedisp          |     90 +
 Documentation/ABI/testing/sysfs-block-aoe          |     45 +
 Documentation/ABI/testing/sysfs-block-bcache       |    149 +
 Documentation/ABI/testing/sysfs-block-device       |    119 +
 Documentation/ABI/testing/sysfs-block-dm           |     47 +
 Documentation/ABI/testing/sysfs-block-loop         |     50 +
 Documentation/ABI/testing/sysfs-block-rnbd         |     64 +
 Documentation/ABI/testing/sysfs-block-rssd         |      5 +
 Documentation/ABI/testing/sysfs-block-zram         |    166 +
 Documentation/ABI/testing/sysfs-bus-acpi           |     98 +
 Documentation/ABI/testing/sysfs-bus-amba           |     20 +
 Documentation/ABI/testing/sysfs-bus-auxiliary      |      9 +
 Documentation/ABI/testing/sysfs-bus-bcma           |     31 +
 Documentation/ABI/testing/sysfs-bus-cdx            |    121 +
 Documentation/ABI/testing/sysfs-bus-coreboot       |     45 +
 .../ABI/testing/sysfs-bus-coresight-devices-cti    |    247 +
 .../sysfs-bus-coresight-devices-dummy-source       |     21 +
 .../ABI/testing/sysfs-bus-coresight-devices-etb10  |     88 +
 .../ABI/testing/sysfs-bus-coresight-devices-etm3x  |    328 +
 .../ABI/testing/sysfs-bus-coresight-devices-etm4x  |    532 +
 .../ABI/testing/sysfs-bus-coresight-devices-funnel |     18 +
 .../ABI/testing/sysfs-bus-coresight-devices-stm    |     59 +
 .../ABI/testing/sysfs-bus-coresight-devices-tmc    |    115 +
 .../ABI/testing/sysfs-bus-coresight-devices-tpda   |     69 +
 .../ABI/testing/sysfs-bus-coresight-devices-tpdm   |    290 +
 .../ABI/testing/sysfs-bus-coresight-devices-trbe   |     20 +
 .../testing/sysfs-bus-coresight-devices-ultra_smb  |     31 +
 Documentation/ABI/testing/sysfs-bus-counter        |    477 +
 Documentation/ABI/testing/sysfs-bus-css            |     56 +
 Documentation/ABI/testing/sysfs-bus-cxl            |    646 +
 Documentation/ABI/testing/sysfs-bus-dax            |    177 +
 Documentation/ABI/testing/sysfs-bus-dfl            |     17 +
 .../ABI/testing/sysfs-bus-dfl-devices-emif         |     25 +
 .../ABI/testing/sysfs-bus-dfl-devices-n3000-nios   |     47 +
 .../ABI/testing/sysfs-bus-event_source-devices     |     24 +
 .../testing/sysfs-bus-event_source-devices-caps    |     24 +
 .../testing/sysfs-bus-event_source-devices-dfl_fme |    104 +
 .../ABI/testing/sysfs-bus-event_source-devices-dsa |     30 +
 .../testing/sysfs-bus-event_source-devices-events  |    102 +
 .../testing/sysfs-bus-event_source-devices-format  |     21 +
 .../sysfs-bus-event_source-devices-hisi_ptt        |    113 +
 .../testing/sysfs-bus-event_source-devices-hv_24x7 |     98 +
 .../testing/sysfs-bus-event_source-devices-hv_gpci |    242 +
 .../testing/sysfs-bus-event_source-devices-iommu   |     37 +
 .../testing/sysfs-bus-event_source-devices-rdpmc   |     44 +
 .../testing/sysfs-bus-event_source-devices-uncore  |     13 +
 .../testing/sysfs-bus-event_source-devices-vpa-dtl |     25 +
 .../testing/sysfs-bus-event_source-devices-vpa-pmu |     25 +
 Documentation/ABI/testing/sysfs-bus-fcoe           |    138 +
 Documentation/ABI/testing/sysfs-bus-fsi            |     46 +
 .../ABI/testing/sysfs-bus-fsi-devices-sbefifo      |     10 +
 Documentation/ABI/testing/sysfs-bus-fsl-mc         |     25 +
 Documentation/ABI/testing/sysfs-bus-hsi            |     19 +
 .../ABI/testing/sysfs-bus-i2c-devices-bq32k        |      7 +
 .../ABI/testing/sysfs-bus-i2c-devices-fsa9480      |     27 +
 .../ABI/testing/sysfs-bus-i2c-devices-hm6352       |     21 +
 .../ABI/testing/sysfs-bus-i2c-devices-lm3533       |     15 +
 .../ABI/testing/sysfs-bus-i2c-devices-m24lr        |    100 +
 .../ABI/testing/sysfs-bus-i2c-devices-pca954x      |     23 +
 .../testing/sysfs-bus-i2c-devices-turris-omnia-mcu |    113 +
 Documentation/ABI/testing/sysfs-bus-i3c            |    194 +
 Documentation/ABI/testing/sysfs-bus-iio            |   2511 +
 .../ABI/testing/sysfs-bus-iio-accel-adxl372        |      7 +
 .../ABI/testing/sysfs-bus-iio-accel-bmc150         |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-ad9739a    |     19 +
 .../ABI/testing/sysfs-bus-iio-adc-ad-sigma-delta   |     23 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130 |     20 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 |     27 +
 .../ABI/testing/sysfs-bus-iio-adc-ad7280a          |     13 +
 .../testing/sysfs-bus-iio-adc-envelope-detector    |     39 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-hi8435 |     48 +
 .../ABI/testing/sysfs-bus-iio-adc-max11410         |     13 +
 .../ABI/testing/sysfs-bus-iio-adc-mcp3564          |     53 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-mt6360 |     78 +
 .../ABI/testing/sysfs-bus-iio-adc-pac1934          |      9 +
 Documentation/ABI/testing/sysfs-bus-iio-adc-stm32  |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-bno055     |     81 +
 Documentation/ABI/testing/sysfs-bus-iio-cdc-ad7746 |     11 +
 .../ABI/testing/sysfs-bus-iio-chemical-sgp40       |     17 +
 .../ABI/testing/sysfs-bus-iio-chemical-sunrise-co2 |     38 +
 .../ABI/testing/sysfs-bus-iio-chemical-vz89x       |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-cros-ec    |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-dac        |     61 +
 Documentation/ABI/testing/sysfs-bus-iio-dac-ad5766 |     31 +
 .../ABI/testing/sysfs-bus-iio-dac-dpot-dac         |      8 +
 .../ABI/testing/sysfs-bus-iio-dac-ltc2688          |     55 +
 .../ABI/testing/sysfs-bus-iio-dfsdm-adc-stm32      |     22 +
 .../ABI/testing/sysfs-bus-iio-distance-srf08       |     17 +
 Documentation/ABI/testing/sysfs-bus-iio-dma-buffer |     19 +
 .../ABI/testing/sysfs-bus-iio-filter-admv8818      |     18 +
 Documentation/ABI/testing/sysfs-bus-iio-flow       |     21 +
 Documentation/ABI/testing/sysfs-bus-iio-frequency  |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-ad9523     |     31 +
 .../ABI/testing/sysfs-bus-iio-frequency-adf4350    |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-adf4371    |     11 +
 .../ABI/testing/sysfs-bus-iio-frequency-admv1013   |     38 +
 .../ABI/testing/sysfs-bus-iio-frequency-admv1014   |     23 +
 .../ABI/testing/sysfs-bus-iio-gyro-bmg160          |      7 +
 .../ABI/testing/sysfs-bus-iio-health-afe440x       |     39 +
 Documentation/ABI/testing/sysfs-bus-iio-humidity   |     10 +
 .../sysfs-bus-iio-impedance-analyzer-ad5933        |     35 +
 Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc |     15 +
 .../ABI/testing/sysfs-bus-iio-inv_icm42600         |     18 +
 Documentation/ABI/testing/sysfs-bus-iio-isl29501   |     47 +
 .../ABI/testing/sysfs-bus-iio-light-isl29018       |     21 +
 .../ABI/testing/sysfs-bus-iio-light-lm3533-als     |     56 +
 .../ABI/testing/sysfs-bus-iio-light-si1133         |     22 +
 .../ABI/testing/sysfs-bus-iio-light-tsl2583        |     20 +
 .../ABI/testing/sysfs-bus-iio-light-tsl2772        |     13 +
 .../ABI/testing/sysfs-bus-iio-magnetometer-hmc5843 |     20 +
 Documentation/ABI/testing/sysfs-bus-iio-meas-spec  |      7 +
 Documentation/ABI/testing/sysfs-bus-iio-mpu6050    |     13 +
 .../testing/sysfs-bus-iio-potentiometer-mcp4531    |      8 +
 Documentation/ABI/testing/sysfs-bus-iio-proximity  |     24 +
 .../ABI/testing/sysfs-bus-iio-proximity-as3935     |     15 +
 .../ABI/testing/sysfs-bus-iio-resolver-ad2s1210    |     27 +
 Documentation/ABI/testing/sysfs-bus-iio-sps30      |     28 +
 Documentation/ABI/testing/sysfs-bus-iio-sx9310     |     10 +
 Documentation/ABI/testing/sysfs-bus-iio-sx9324     |     29 +
 .../ABI/testing/sysfs-bus-iio-thermocouple         |     18 +
 .../ABI/testing/sysfs-bus-iio-timer-stm32          |    143 +
 .../ABI/testing/sysfs-bus-iio-trigger-sysfs        |     42 +
 Documentation/ABI/testing/sysfs-bus-iio-vf610      |     16 +
 .../ABI/testing/sysfs-bus-intel_th-devices-gth     |     52 +
 .../ABI/testing/sysfs-bus-intel_th-devices-msc     |     54 +
 .../ABI/testing/sysfs-bus-intel_th-devices-pti     |     24 +
 .../ABI/testing/sysfs-bus-intel_th-output-devices  |     15 +
 Documentation/ABI/testing/sysfs-bus-mcb            |     29 +
 Documentation/ABI/testing/sysfs-bus-mdio           |     72 +
 Documentation/ABI/testing/sysfs-bus-media          |      6 +
 Documentation/ABI/testing/sysfs-bus-mei            |     56 +
 Documentation/ABI/testing/sysfs-bus-mmc            |      4 +
 Documentation/ABI/testing/sysfs-bus-most           |    299 +
 Documentation/ABI/testing/sysfs-bus-moxtet-devices |     17 +
 Documentation/ABI/testing/sysfs-bus-nfit           |    233 +
 Documentation/ABI/testing/sysfs-bus-nvdimm         |     60 +
 Documentation/ABI/testing/sysfs-bus-optee-devices  |     17 +
 Documentation/ABI/testing/sysfs-bus-papr-pmem      |     75 +
 Documentation/ABI/testing/sysfs-bus-pci            |    704 +
 .../ABI/testing/sysfs-bus-pci-devices-aer          |    163 +
 .../ABI/testing/sysfs-bus-pci-devices-avs          |      8 +
 .../ABI/testing/sysfs-bus-pci-devices-catpt        |     17 +
 .../ABI/testing/sysfs-bus-pci-devices-cciss        |     80 +
 .../ABI/testing/sysfs-bus-pci-devices-pvpanic      |     26 +
 .../ABI/testing/sysfs-bus-pci-drivers-btintel_pcie |     15 +
 .../ABI/testing/sysfs-bus-pci-drivers-ehci_hcd     |     46 +
 .../ABI/testing/sysfs-bus-pci-drivers-janz-cmodio  |      8 +
 .../ABI/testing/sysfs-bus-pci-drivers-xhci_hcd     |    129 +
 Documentation/ABI/testing/sysfs-bus-peci           |     16 +
 Documentation/ABI/testing/sysfs-bus-platform       |     56 +
 .../sysfs-bus-platform-devices-ampere-smpro        |    325 +
 .../testing/sysfs-bus-platform-devices-occ-hwmon   |     13 +
 .../sysfs-bus-platform-drivers-amd_x3d_vcache      |     12 +
 .../ABI/testing/sysfs-bus-platform-onboard-usb-dev |      9 +
 Documentation/ABI/testing/sysfs-bus-rapidio        |    201 +
 Documentation/ABI/testing/sysfs-bus-rbd            |    173 +
 Documentation/ABI/testing/sysfs-bus-rpmsg          |     95 +
 Documentation/ABI/testing/sysfs-bus-siox           |     90 +
 .../ABI/testing/sysfs-bus-soundwire-master         |     23 +
 .../ABI/testing/sysfs-bus-soundwire-slave          |    109 +
 .../ABI/testing/sysfs-bus-spi-devices-spi-nor      |     40 +
 .../testing/sysfs-bus-surface_aggregator-tabletsw  |     57 +
 Documentation/ABI/testing/sysfs-bus-thunderbolt    |    370 +
 Documentation/ABI/testing/sysfs-bus-typec          |     51 +
 Documentation/ABI/testing/sysfs-bus-usb            |    607 +
 .../ABI/testing/sysfs-bus-usb-devices-usbsevseg    |     46 +
 Documentation/ABI/testing/sysfs-bus-usb-lvstest    |     60 +
 Documentation/ABI/testing/sysfs-bus-vdpa           |     57 +
 Documentation/ABI/testing/sysfs-bus-vfio-mdev      |    113 +
 Documentation/ABI/testing/sysfs-bus-vmbus          |     21 +
 Documentation/ABI/testing/sysfs-bus-wmi            |     81 +
 Documentation/ABI/testing/sysfs-c2port             |     81 +
 Documentation/ABI/testing/sysfs-cfq-target-latency |      8 +
 Documentation/ABI/testing/sysfs-class              |     16 +
 Documentation/ABI/testing/sysfs-class-backlight    |    186 +
 .../testing/sysfs-class-backlight-driver-lm3533    |     54 +
 .../ABI/testing/sysfs-class-backlight-lm3639       |     11 +
 Documentation/ABI/testing/sysfs-class-bdi          |    134 +
 Documentation/ABI/testing/sysfs-class-bsr          |     25 +
 Documentation/ABI/testing/sysfs-class-chromeos     |     53 +
 .../sysfs-class-chromeos-driver-cros-ec-lightbar   |     74 +
 .../sysfs-class-chromeos-driver-cros-ec-vbc        |      6 +
 Documentation/ABI/testing/sysfs-class-devfreq      |    143 +
 .../ABI/testing/sysfs-class-devfreq-event          |     25 +
 Documentation/ABI/testing/sysfs-class-devlink      |    130 +
 Documentation/ABI/testing/sysfs-class-drm          |      8 +
 Documentation/ABI/testing/sysfs-class-extcon       |    101 +
 Documentation/ABI/testing/sysfs-class-fc           |     27 +
 Documentation/ABI/testing/sysfs-class-fc_host      |     23 +
 .../ABI/testing/sysfs-class-fc_remote_ports        |     23 +
 Documentation/ABI/testing/sysfs-class-firmware     |     77 +
 .../ABI/testing/sysfs-class-firmware-attributes    |    494 +
 Documentation/ABI/testing/sysfs-class-fpga-bridge  |     11 +
 Documentation/ABI/testing/sysfs-class-fpga-manager |     60 +
 Documentation/ABI/testing/sysfs-class-fpga-region  |      9 +
 Documentation/ABI/testing/sysfs-class-gnss         |     17 +
 Documentation/ABI/testing/sysfs-class-hwmon        |   1089 +
 .../ABI/testing/sysfs-class-ieee80211-rtw89        |     24 +
 Documentation/ABI/testing/sysfs-class-intel_pmt    |    119 +
 .../ABI/testing/sysfs-class-intel_pmt-features     |    134 +
 Documentation/ABI/testing/sysfs-class-iommu        |     17 +
 .../ABI/testing/sysfs-class-iommu-amd-iommu        |     14 +
 .../ABI/testing/sysfs-class-iommu-intel-iommu      |     32 +
 Documentation/ABI/testing/sysfs-class-issei        |     73 +
 Documentation/ABI/testing/sysfs-class-lcd          |     23 +
 Documentation/ABI/testing/sysfs-class-led          |     89 +
 .../ABI/testing/sysfs-class-led-driver-aw200xx     |      5 +
 .../ABI/testing/sysfs-class-led-driver-lm3533      |     73 +
 .../testing/sysfs-class-led-driver-turris-omnia    |     28 +
 Documentation/ABI/testing/sysfs-class-led-flash    |     89 +
 .../ABI/testing/sysfs-class-led-multicolor         |     37 +
 .../ABI/testing/sysfs-class-led-trigger-netdev     |    192 +
 .../ABI/testing/sysfs-class-led-trigger-oneshot    |     36 +
 .../ABI/testing/sysfs-class-led-trigger-pattern    |     50 +
 .../ABI/testing/sysfs-class-led-trigger-tty        |     62 +
 .../ABI/testing/sysfs-class-led-trigger-usbport    |     13 +
 Documentation/ABI/testing/sysfs-class-leds-gt683r  |     18 +
 Documentation/ABI/testing/sysfs-class-mei          |    105 +
 Documentation/ABI/testing/sysfs-class-mic          |    178 +
 Documentation/ABI/testing/sysfs-class-mtd          |    242 +
 Documentation/ABI/testing/sysfs-class-mux          |     16 +
 Documentation/ABI/testing/sysfs-class-net          |    354 +
 Documentation/ABI/testing/sysfs-class-net-cdc_ncm  |    168 +
 Documentation/ABI/testing/sysfs-class-net-dsa      |     14 +
 Documentation/ABI/testing/sysfs-class-net-grcan    |     35 +
 .../ABI/testing/sysfs-class-net-janz-ican3         |     19 +
 Documentation/ABI/testing/sysfs-class-net-peak_usb |     19 +
 Documentation/ABI/testing/sysfs-class-net-phydev   |     75 +
 Documentation/ABI/testing/sysfs-class-net-qmi      |     76 +
 Documentation/ABI/testing/sysfs-class-net-queues   |    121 +
 .../ABI/testing/sysfs-class-net-statistics         |    217 +
 Documentation/ABI/testing/sysfs-class-ocxl         |     51 +
 .../ABI/testing/sysfs-class-platform-profile       |     50 +
 Documentation/ABI/testing/sysfs-class-power        |    906 +
 .../ABI/testing/sysfs-class-power-bd71828          |     13 +
 Documentation/ABI/testing/sysfs-class-power-gaokun |     27 +
 .../ABI/testing/sysfs-class-power-ltc4162l         |     82 +
 .../ABI/testing/sysfs-class-power-max1720x         |     32 +
 Documentation/ABI/testing/sysfs-class-power-mp2629 |      9 +
 Documentation/ABI/testing/sysfs-class-power-rt9467 |     19 +
 Documentation/ABI/testing/sysfs-class-power-rt9471 |     32 +
 Documentation/ABI/testing/sysfs-class-power-rt9756 |     30 +
 .../ABI/testing/sysfs-class-power-surface          |     15 +
 .../ABI/testing/sysfs-class-power-twl4030          |     33 +
 Documentation/ABI/testing/sysfs-class-power-wilco  |     40 +
 Documentation/ABI/testing/sysfs-class-powercap     |    152 +
 Documentation/ABI/testing/sysfs-class-pwm          |     88 +
 Documentation/ABI/testing/sysfs-class-rapidio      |     59 +
 Documentation/ABI/testing/sysfs-class-rc           |    137 +
 Documentation/ABI/testing/sysfs-class-rc-nuvoton   |     15 +
 .../testing/sysfs-class-reboot-mode-reboot_modes   |     39 +
 Documentation/ABI/testing/sysfs-class-regulator    |    453 +
 Documentation/ABI/testing/sysfs-class-remoteproc   |    104 +
 Documentation/ABI/testing/sysfs-class-rnbd-client  |    133 +
 Documentation/ABI/testing/sysfs-class-rnbd-server  |     58 +
 Documentation/ABI/testing/sysfs-class-rtc          |     91 +
 .../sysfs-class-rtc-rtc0-device-rtc_calibration    |     14 +
 Documentation/ABI/testing/sysfs-class-rtrs-client  |    146 +
 Documentation/ABI/testing/sysfs-class-rtrs-server  |     53 +
 Documentation/ABI/testing/sysfs-class-scsi_host    |    119 +
 Documentation/ABI/testing/sysfs-class-scsi_tape    |    109 +
 Documentation/ABI/testing/sysfs-class-spi-eeprom   |     30 +
 Documentation/ABI/testing/sysfs-class-spi-master   |     34 +
 Documentation/ABI/testing/sysfs-class-stm          |     24 +
 Documentation/ABI/testing/sysfs-class-stm_source   |     11 +
 Documentation/ABI/testing/sysfs-class-switchtec    |     96 +
 Documentation/ABI/testing/sysfs-class-tee          |     25 +
 Documentation/ABI/testing/sysfs-class-thermal      |    259 +
 Documentation/ABI/testing/sysfs-class-tsm          |      9 +
 Documentation/ABI/testing/sysfs-class-typec        |    386 +
 .../ABI/testing/sysfs-class-usb_power_delivery     |    284 +
 Documentation/ABI/testing/sysfs-class-usb_role     |     27 +
 Documentation/ABI/testing/sysfs-class-vduse        |     33 +
 Documentation/ABI/testing/sysfs-class-wakeup       |     76 +
 Documentation/ABI/testing/sysfs-class-watchdog     |    129 +
 Documentation/ABI/testing/sysfs-class-zram         |     24 +
 Documentation/ABI/testing/sysfs-dev                |     21 +
 Documentation/ABI/testing/sysfs-devices            |     25 +
 Documentation/ABI/testing/sysfs-devices-consumer   |      9 +
 Documentation/ABI/testing/sysfs-devices-coredump   |     10 +
 Documentation/ABI/testing/sysfs-devices-edac       |    157 +
 .../ABI/testing/sysfs-devices-faux-tdx-host        |     26 +
 .../ABI/testing/sysfs-devices-firmware_node        |     17 +
 Documentation/ABI/testing/sysfs-devices-lpss_ltr   |     44 +
 Documentation/ABI/testing/sysfs-devices-mapping    |     62 +
 Documentation/ABI/testing/sysfs-devices-memory     |    120 +
 Documentation/ABI/testing/sysfs-devices-mmc        |     21 +
 Documentation/ABI/testing/sysfs-devices-online     |     20 +
 .../ABI/testing/sysfs-devices-pci-host-bridge      |     45 +
 .../ABI/testing/sysfs-devices-physical_location    |     42 +
 .../ABI/testing/sysfs-devices-platform-ACPI-TAD    |    117 +
 .../testing/sysfs-devices-platform-_UDC_-gadget    |     23 +
 .../ABI/testing/sysfs-devices-platform-docg3       |     40 +
 .../ABI/testing/sysfs-devices-platform-dock        |     39 +
 .../ABI/testing/sysfs-devices-platform-ipmi        |    242 +
 .../testing/sysfs-devices-platform-kunpeng_hccs    |    126 +
 .../sysfs-devices-platform-sh_mobile_lcdc_fb       |     44 +
 .../ABI/testing/sysfs-devices-platform-soc-ipa     |    114 +
 .../testing/sysfs-devices-platform-stratix10-rsu   |    232 +
 .../ABI/testing/sysfs-devices-platform-trackpoint  |    115 +
 Documentation/ABI/testing/sysfs-devices-power      |    307 +
 .../ABI/testing/sysfs-devices-power_resources_D0   |     13 +
 .../ABI/testing/sysfs-devices-power_resources_D1   |     14 +
 .../ABI/testing/sysfs-devices-power_resources_D2   |     14 +
 .../testing/sysfs-devices-power_resources_D3hot    |     14 +
 .../testing/sysfs-devices-power_resources_wakeup   |     13 +
 .../ABI/testing/sysfs-devices-power_state          |     20 +
 .../ABI/testing/sysfs-devices-real_power_state     |     23 +
 Documentation/ABI/testing/sysfs-devices-removable  |     20 +
 .../ABI/testing/sysfs-devices-resource_in_use      |     12 +
 Documentation/ABI/testing/sysfs-devices-soc        |     95 +
 .../ABI/testing/sysfs-devices-software_node        |     10 +
 .../ABI/testing/sysfs-devices-state_synced         |     29 +
 Documentation/ABI/testing/sysfs-devices-sun        |     14 +
 Documentation/ABI/testing/sysfs-devices-supplier   |      9 +
 Documentation/ABI/testing/sysfs-devices-system-cpu |    808 +
 .../ABI/testing/sysfs-devices-system-ibm-rtl       |     24 +
 .../ABI/testing/sysfs-devices-system-xen_cpu       |     20 +
 Documentation/ABI/testing/sysfs-devices-vfio-dev   |      8 +
 .../testing/sysfs-devices-virtual-misc-tdx_guest   |     63 +
 .../ABI/testing/sysfs-devices-waiting_for_supplier |     17 +
 Documentation/ABI/testing/sysfs-devices-xenbus     |     41 +
 Documentation/ABI/testing/sysfs-driver-altera-cvp  |      8 +
 Documentation/ABI/testing/sysfs-driver-amd-sfh     |     13 +
 .../ABI/testing/sysfs-driver-aspeed-uart-routing   |     27 +
 .../ABI/testing/sysfs-driver-bd9571mwv-regulator   |     31 +
 Documentation/ABI/testing/sysfs-driver-ccp         |    120 +
 .../ABI/testing/sysfs-driver-chromeos-acpi         |    152 +
 .../ABI/testing/sysfs-driver-dell-dw5826e-reset    |      9 +
 Documentation/ABI/testing/sysfs-driver-eud         |      9 +
 .../ABI/testing/sysfs-driver-framer-pef2256        |      8 +
 .../ABI/testing/sysfs-driver-fsi-master-gpio       |     10 +
 Documentation/ABI/testing/sysfs-driver-ge-achc     |     15 +
 Documentation/ABI/testing/sysfs-driver-genwqe      |     78 +
 Documentation/ABI/testing/sysfs-driver-habanalabs  |    265 +
 Documentation/ABI/testing/sysfs-driver-hid         |     20 +
 .../ABI/testing/sysfs-driver-hid-appletb-kbd       |     13 +
 Documentation/ABI/testing/sysfs-driver-hid-corsair |     15 +
 .../ABI/testing/sysfs-driver-hid-corsair-void      |     38 +
 Documentation/ABI/testing/sysfs-driver-hid-lenovo  |     60 +
 .../ABI/testing/sysfs-driver-hid-lenovo-go         |    724 +
 .../ABI/testing/sysfs-driver-hid-lenovo-go-s       |    304 +
 .../ABI/testing/sysfs-driver-hid-logitech-hidpp    |     19 +
 .../ABI/testing/sysfs-driver-hid-logitech-lg4ff    |     75 +
 .../ABI/testing/sysfs-driver-hid-multitouch        |      9 +
 Documentation/ABI/testing/sysfs-driver-hid-ntrig   |     73 +
 Documentation/ABI/testing/sysfs-driver-hid-picolcd |     43 +
 .../ABI/testing/sysfs-driver-hid-prodikeys         |     29 +
 .../ABI/testing/sysfs-driver-hid-roccat-kone       |    125 +
 Documentation/ABI/testing/sysfs-driver-hid-srws1   |     21 +
 Documentation/ABI/testing/sysfs-driver-hid-wiimote |     85 +
 .../ABI/testing/sysfs-driver-input-axp-pek         |     11 +
 .../ABI/testing/sysfs-driver-input-cros-ec-keyb    |      6 +
 .../ABI/testing/sysfs-driver-input-exc3000         |     26 +
 Documentation/ABI/testing/sysfs-driver-intc_sar    |     54 +
 .../ABI/testing/sysfs-driver-intel-i915-hwmon      |     93 +
 .../ABI/testing/sysfs-driver-intel-m10-bmc         |     36 +
 .../testing/sysfs-driver-intel-m10-bmc-sec-update  |     61 +
 .../ABI/testing/sysfs-driver-intel-rapid-start     |     21 +
 .../ABI/testing/sysfs-driver-intel-xe-hwmon        |    315 +
 .../ABI/testing/sysfs-driver-intel-xe-ras          |     30 +
 .../ABI/testing/sysfs-driver-intel-xe-sriov        |    190 +
 Documentation/ABI/testing/sysfs-driver-intel_sdsi  |     90 +
 Documentation/ABI/testing/sysfs-driver-ivpu        |     65 +
 .../ABI/testing/sysfs-driver-jz4780-efuse          |     20 +
 .../ABI/testing/sysfs-driver-lenovo-yb9-kbdock     |     19 +
 .../ABI/testing/sysfs-driver-panfrost-profiling    |     10 +
 .../ABI/testing/sysfs-driver-panthor-profiling     |     10 +
 Documentation/ABI/testing/sysfs-driver-pciback     |     28 +
 Documentation/ABI/testing/sysfs-driver-ppi         |     75 +
 Documentation/ABI/testing/sysfs-driver-qaic        |     18 +
 Documentation/ABI/testing/sysfs-driver-qat         |    167 +
 Documentation/ABI/testing/sysfs-driver-qat_kpt     |     97 +
 Documentation/ABI/testing/sysfs-driver-qat_ras     |     41 +
 Documentation/ABI/testing/sysfs-driver-qat_rl      |    226 +
 Documentation/ABI/testing/sysfs-driver-qat_svn     |    114 +
 .../ABI/testing/sysfs-driver-samsung-laptop        |     37 +
 Documentation/ABI/testing/sysfs-driver-spi-intel   |     20 +
 Documentation/ABI/testing/sysfs-driver-st          |     12 +
 Documentation/ABI/testing/sysfs-driver-tegra-fuse  |     11 +
 .../ABI/testing/sysfs-driver-toshiba_acpi          |    223 +
 .../ABI/testing/sysfs-driver-toshiba_haps          |     22 +
 .../ABI/testing/sysfs-driver-typec-displayport     |     74 +
 Documentation/ABI/testing/sysfs-driver-uacce       |     57 +
 Documentation/ABI/testing/sysfs-driver-ucsi-ccg    |      6 +
 Documentation/ABI/testing/sysfs-driver-ufs         |   1793 +
 .../ABI/testing/sysfs-driver-uio_pci_sva-pasid     |     29 +
 .../ABI/testing/sysfs-driver-uniwill-laptop        |    105 +
 Documentation/ABI/testing/sysfs-driver-w1_ds28e17  |     24 +
 Documentation/ABI/testing/sysfs-driver-w1_therm    |    190 +
 Documentation/ABI/testing/sysfs-driver-wacom       |    105 +
 Documentation/ABI/testing/sysfs-driver-xdata       |     49 +
 Documentation/ABI/testing/sysfs-driver-xen-blkback |     46 +
 .../ABI/testing/sysfs-driver-xen-blkfront          |     19 +
 .../ABI/testing/sysfs-driver-xilinx-tmr-manager    |     16 +
 Documentation/ABI/testing/sysfs-driver-zynqmp-fpga |     73 +
 Documentation/ABI/testing/sysfs-edac-ecs           |     74 +
 Documentation/ABI/testing/sysfs-edac-memory-repair |    206 +
 Documentation/ABI/testing/sysfs-edac-scrub         |     85 +
 Documentation/ABI/testing/sysfs-firmware-acpi      |    277 +
 .../ABI/testing/sysfs-firmware-dmi-entries         |    114 +
 .../ABI/testing/sysfs-firmware-dmi-tables          |     22 +
 Documentation/ABI/testing/sysfs-firmware-efi       |     45 +
 Documentation/ABI/testing/sysfs-firmware-efi-esrt  |     87 +
 .../ABI/testing/sysfs-firmware-efi-runtime-map     |     36 +
 Documentation/ABI/testing/sysfs-firmware-gsmi      |     58 +
 Documentation/ABI/testing/sysfs-firmware-initrd    |      8 +
 .../ABI/testing/sysfs-firmware-lefi-boardinfo      |     35 +
 Documentation/ABI/testing/sysfs-firmware-log       |      7 +
 Documentation/ABI/testing/sysfs-firmware-memmap    |     75 +
 Documentation/ABI/testing/sysfs-firmware-ofw       |     52 +
 .../ABI/testing/sysfs-firmware-opal-powercap       |     31 +
 Documentation/ABI/testing/sysfs-firmware-opal-psr  |     18 +
 .../ABI/testing/sysfs-firmware-opal-sensor-groups  |     21 +
 .../testing/sysfs-firmware-papr-energy-scale-info  |     29 +
 Documentation/ABI/testing/sysfs-firmware-plpks     |     58 +
 .../ABI/testing/sysfs-firmware-qemu_fw_cfg         |    103 +
 .../ABI/testing/sysfs-firmware-sev-vulnerabilities |     19 +
 Documentation/ABI/testing/sysfs-firmware-sgi_uv    |    159 +
 .../ABI/testing/sysfs-firmware-turris-mox-rwtm     |     28 +
 Documentation/ABI/testing/sysfs-fs-erofs           |     49 +
 Documentation/ABI/testing/sysfs-fs-ext4            |    118 +
 Documentation/ABI/testing/sysfs-fs-f2fs            |   1022 +
 Documentation/ABI/testing/sysfs-fs-nilfs2          |    269 +
 Documentation/ABI/testing/sysfs-fs-ubifs           |     35 +
 Documentation/ABI/testing/sysfs-fs-virtiofs        |     11 +
 Documentation/ABI/testing/sysfs-fs-xfs             |     37 +
 Documentation/ABI/testing/sysfs-hypervisor-xen     |     46 +
 Documentation/ABI/testing/sysfs-ibft               |     33 +
 .../ABI/testing/sysfs-kernel-address_bits          |     10 +
 Documentation/ABI/testing/sysfs-kernel-boot_params |     39 +
 Documentation/ABI/testing/sysfs-kernel-btf         |     25 +
 .../ABI/testing/sysfs-kernel-cpu_byteorder         |     12 +
 Documentation/ABI/testing/sysfs-kernel-fadump      |     59 +
 Documentation/ABI/testing/sysfs-kernel-fscaps      |      8 +
 .../ABI/testing/sysfs-kernel-hardlockup_count      |      7 +
 .../ABI/testing/sysfs-kernel-iommu_groups          |     64 +
 Documentation/ABI/testing/sysfs-kernel-irq         |     60 +
 Documentation/ABI/testing/sysfs-kernel-kexec-kdump |     61 +
 Documentation/ABI/testing/sysfs-kernel-livepatch   |     95 +
 Documentation/ABI/testing/sysfs-kernel-mm          |      6 +
 Documentation/ABI/testing/sysfs-kernel-mm-cma      |     44 +
 Documentation/ABI/testing/sysfs-kernel-mm-damon    |    664 +
 .../ABI/testing/sysfs-kernel-mm-hugepages          |     17 +
 Documentation/ABI/testing/sysfs-kernel-mm-ksm      |     61 +
 .../ABI/testing/sysfs-kernel-mm-memory-tiers       |     25 +
 .../ABI/testing/sysfs-kernel-mm-mempolicy          |      4 +
 .../sysfs-kernel-mm-mempolicy-weighted-interleave  |     54 +
 Documentation/ABI/testing/sysfs-kernel-mm-numa     |     28 +
 Documentation/ABI/testing/sysfs-kernel-mm-swap     |     16 +
 .../testing/sysfs-kernel-mm-transparent-hugepage   |     18 +
 Documentation/ABI/testing/sysfs-kernel-oops_count  |      6 +
 .../ABI/testing/sysfs-kernel-rcu_stall_count       |      6 +
 Documentation/ABI/testing/sysfs-kernel-reboot      |     40 +
 Documentation/ABI/testing/sysfs-kernel-slab        |    526 +
 .../ABI/testing/sysfs-kernel-softlockup_count      |      7 +
 Documentation/ABI/testing/sysfs-kernel-vmcoreinfo  |     14 +
 Documentation/ABI/testing/sysfs-kernel-warn_count  |      6 +
 Documentation/ABI/testing/sysfs-mce                |     97 +
 .../ABI/testing/sysfs-memory-page-offline          |     44 +
 Documentation/ABI/testing/sysfs-module             |     84 +
 Documentation/ABI/testing/sysfs-nvmem-cells        |     21 +
 Documentation/ABI/testing/sysfs-ocfs2              |     89 +
 .../ABI/testing/sysfs-platform-alienware-wmi       |     14 +
 .../ABI/testing/sysfs-platform-asus-laptop         |     71 +
 Documentation/ABI/testing/sysfs-platform-asus-wmi  |    240 +
 Documentation/ABI/testing/sysfs-platform-at91      |     27 +
 Documentation/ABI/testing/sysfs-platform-ayaneo-ec |     19 +
 .../ABI/testing/sysfs-platform-brcmstb-gisb-arb    |      8 +
 .../ABI/testing/sysfs-platform-brcmstb-memc        |     15 +
 .../ABI/testing/sysfs-platform-chipidea-usb-otg    |     56 +
 .../ABI/testing/sysfs-platform-chipidea-usb2       |      9 +
 .../ABI/testing/sysfs-platform-dell-laptop         |     73 +
 .../ABI/testing/sysfs-platform-dell-privacy-wmi    |     71 +
 .../ABI/testing/sysfs-platform-dell-smbios         |     21 +
 .../ABI/testing/sysfs-platform-dell-wmi-ddv        |      9 +
 Documentation/ABI/testing/sysfs-platform-dfl-fme   |    246 +
 Documentation/ABI/testing/sysfs-platform-dfl-port  |    101 +
 Documentation/ABI/testing/sysfs-platform-dptf      |    157 +
 .../ABI/testing/sysfs-platform-eeepc-laptop        |     56 +
 Documentation/ABI/testing/sysfs-platform-hidma     |      9 +
 .../ABI/testing/sysfs-platform-hidma-mgmt          |     97 +
 .../ABI/testing/sysfs-platform-i2c-demux-pinctrl   |     18 +
 .../ABI/testing/sysfs-platform-ideapad-laptop      |     52 +
 Documentation/ABI/testing/sysfs-platform-intel-ifs |     52 +
 Documentation/ABI/testing/sysfs-platform-intel-pmc |     22 +
 .../testing/sysfs-platform-intel-wmi-sbl-fw-update |     13 +
 .../testing/sysfs-platform-intel-wmi-thunderbolt   |     12 +
 Documentation/ABI/testing/sysfs-platform-kim       |     49 +
 Documentation/ABI/testing/sysfs-platform-lg-laptop |     36 +
 .../ABI/testing/sysfs-platform-mellanox-bootctl    |    162 +
 .../ABI/testing/sysfs-platform-mellanox-pmc        |     64 +
 .../ABI/testing/sysfs-platform-msi-laptop          |     83 +
 Documentation/ABI/testing/sysfs-platform-oxp       |     25 +
 .../ABI/testing/sysfs-platform-phy-rcar-gen3-usb2  |     17 +
 .../ABI/testing/sysfs-platform-power-on-reason     |     12 +
 .../ABI/testing/sysfs-platform-renesas_usb3        |     17 +
 Documentation/ABI/testing/sysfs-platform-silicom   |     30 +
 Documentation/ABI/testing/sysfs-platform-sst-atom  |     26 +
 Documentation/ABI/testing/sysfs-platform-tahvo-usb |     16 +
 Documentation/ABI/testing/sysfs-platform-ts5500    |     54 +
 .../ABI/testing/sysfs-platform-twl4030-usb         |      8 +
 .../ABI/testing/sysfs-platform-usbip-vudc          |     38 +
 Documentation/ABI/testing/sysfs-platform-wilco-ec  |     58 +
 Documentation/ABI/testing/sysfs-platform_profile   |     40 +
 Documentation/ABI/testing/sysfs-power              |    472 +
 Documentation/ABI/testing/sysfs-pps                |     73 +
 Documentation/ABI/testing/sysfs-pps-gen            |     43 +
 Documentation/ABI/testing/sysfs-pps-gen-tio        |      6 +
 Documentation/ABI/testing/sysfs-profiling          |     13 +
 Documentation/ABI/testing/sysfs-ptp                |    142 +
 Documentation/ABI/testing/sysfs-secvar             |     65 +
 Documentation/ABI/testing/sysfs-timecard           |    293 +
 Documentation/ABI/testing/sysfs-tty                |    166 +
 Documentation/ABI/testing/sysfs-uevent             |     51 +
 Documentation/ABI/testing/usb-charger-uevent       |     54 +
 Documentation/ABI/testing/usb-uevent               |     27 +
 Documentation/Changes                              |      1 +
 Documentation/CodingStyle                          |      1 +
 Documentation/Kconfig                              |     28 +
 Documentation/Makefile                             |    115 +
 Documentation/PCI/acpi-info.rst                    |    192 +
 Documentation/PCI/boot-interrupts.rst              |    159 +
 Documentation/PCI/controller/index.rst             |     11 +
 .../PCI/controller/pci-controller-drivers.rst      |    402 +
 .../PCI/controller/rcar-pcie-firmware.rst          |     32 +
 .../PCI/endpoint/function/binding/pci-ntb.rst      |     38 +
 .../PCI/endpoint/function/binding/pci-test.rst     |     26 +
 Documentation/PCI/endpoint/index.rst               |     21 +
 Documentation/PCI/endpoint/pci-endpoint-cfs.rst    |    138 +
 Documentation/PCI/endpoint/pci-endpoint.rst        |    283 +
 Documentation/PCI/endpoint/pci-ntb-function.rst    |    348 +
 Documentation/PCI/endpoint/pci-ntb-howto.rst       |    158 +
 Documentation/PCI/endpoint/pci-nvme-function.rst   |     13 +
 Documentation/PCI/endpoint/pci-test-function.rst   |    103 +
 Documentation/PCI/endpoint/pci-test-howto.rst      |    239 +
 Documentation/PCI/endpoint/pci-vntb-function.rst   |    129 +
 Documentation/PCI/endpoint/pci-vntb-howto.rst      |    169 +
 Documentation/PCI/index.rst                        |     22 +
 Documentation/PCI/msi-howto.rst                    |    300 +
 Documentation/PCI/pci-error-recovery.rst           |    471 +
 Documentation/PCI/pci-iov-howto.rst                |    171 +
 Documentation/PCI/pci.rst                          |    578 +
 Documentation/PCI/pcieaer-howto.rst                |    267 +
 Documentation/PCI/pciebus-howto.rst                |    228 +
 Documentation/PCI/sysfs-pci.rst                    |    138 +
 Documentation/PCI/tph.rst                          |    132 +
 .../Design/Data-Structures/BigTreeClassicRCU.svg   |    474 +
 .../BigTreePreemptRCUBHdyntickCB.svg               |    662 +
 .../RCU/Design/Data-Structures/Data-Structures.rst |   1196 +
 .../Design/Data-Structures/HugeTreeClassicRCU.svg  |    939 +
 .../RCU/Design/Data-Structures/TreeLevel.svg       |    828 +
 .../RCU/Design/Data-Structures/TreeMapping.svg     |    305 +
 .../Design/Data-Structures/TreeMappingLevel.svg    |    380 +
 .../RCU/Design/Data-Structures/blkd_task.svg       |    631 +
 .../RCU/Design/Data-Structures/nxtlist.svg         |    386 +
 .../Design/Expedited-Grace-Periods/ExpRCUFlow.svg  |    830 +
 .../Expedited-Grace-Periods/ExpSchedFlow.svg       |    830 +
 .../Expedited-Grace-Periods.rst                    |    521 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel0.svg |    275 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel1.svg |    275 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel2.svg |    287 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel3.svg |    323 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel4.svg |    323 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel5.svg |    335 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel6.svg |    335 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel7.svg |    347 +
 .../RCU/Design/Expedited-Grace-Periods/Funnel8.svg |    311 +
 .../Memory-Ordering/Tree-RCU-Memory-Ordering.rst   |    648 +
 .../TreeRCU-callback-invocation.svg                |    486 +
 .../Memory-Ordering/TreeRCU-callback-registry.svg  |    646 +
 .../RCU/Design/Memory-Ordering/TreeRCU-dyntick.svg |    700 +
 .../Design/Memory-Ordering/TreeRCU-gp-cleanup.svg  |   1133 +
 .../RCU/Design/Memory-Ordering/TreeRCU-gp-fqs.svg  |   1309 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-1.svg   |    658 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-2.svg   |    656 +
 .../Design/Memory-Ordering/TreeRCU-gp-init-3.svg   |    636 +
 .../RCU/Design/Memory-Ordering/TreeRCU-gp.svg      |   5135 +
 .../RCU/Design/Memory-Ordering/TreeRCU-hotplug.svg |    775 +
 .../RCU/Design/Memory-Ordering/TreeRCU-qs.svg      |   1095 +
 .../RCU/Design/Memory-Ordering/rcu_node-lock.svg   |    229 +
 .../Design/Requirements/GPpartitionReaders1.svg    |    374 +
 .../Design/Requirements/ReadersPartitionGP1.svg    |    639 +
 .../RCU/Design/Requirements/Requirements.rst       |   2873 +
 Documentation/RCU/NMI-RCU.rst                      |    123 +
 Documentation/RCU/RTFP.txt                         |   2812 +
 Documentation/RCU/UP.rst                           |    152 +
 Documentation/RCU/checklist.rst                    |    556 +
 Documentation/RCU/index.rst                        |     30 +
 Documentation/RCU/listRCU.rst                      |    511 +
 Documentation/RCU/lockdep-splat.rst                |    115 +
 Documentation/RCU/lockdep.rst                      |    119 +
 Documentation/RCU/rcu.rst                          |     93 +
 Documentation/RCU/rcu_dereference.rst              |    502 +
 Documentation/RCU/rcubarrier.rst                   |    377 +
 Documentation/RCU/rculist_nulls.rst                |    215 +
 Documentation/RCU/rcuref.rst                       |    158 +
 Documentation/RCU/stallwarn.rst                    |    491 +
 Documentation/RCU/torture.rst                      |    374 +
 Documentation/RCU/whatisRCU.rst                    |   1415 +
 Documentation/SubmittingPatches                    |      1 +
 Documentation/accel/amdxdna/amdnpu.rst             |    306 +
 Documentation/accel/amdxdna/index.rst              |     11 +
 Documentation/accel/index.rst                      |     13 +
 Documentation/accel/introduction.rst               |    110 +
 Documentation/accel/qaic/aic080.rst                |     14 +
 Documentation/accel/qaic/aic100.rst                |    538 +
 Documentation/accel/qaic/index.rst                 |     14 +
 Documentation/accel/qaic/qaic.rst                  |    209 +
 Documentation/accel/rocket/index.rst               |     19 +
 Documentation/accounting/cgroupstats.rst           |     31 +
 Documentation/accounting/delay-accounting.rst      |    214 +
 Documentation/accounting/index.rst                 |     14 +
 Documentation/accounting/psi.rst                   |    188 +
 Documentation/accounting/taskstats-struct.rst      |    199 +
 Documentation/accounting/taskstats.rst             |    182 +
 Documentation/admin-guide/LSM/LoadPin.rst          |     31 +
 Documentation/admin-guide/LSM/SELinux.rst          |     44 +
 Documentation/admin-guide/LSM/SafeSetID.rst        |    118 +
 Documentation/admin-guide/LSM/Smack.rst            |    871 +
 Documentation/admin-guide/LSM/Yama.rst             |     75 +
 Documentation/admin-guide/LSM/apparmor.rst         |     54 +
 Documentation/admin-guide/LSM/index.rst            |     51 +
 Documentation/admin-guide/LSM/ipe.rst              |    835 +
 Documentation/admin-guide/LSM/landlock.rst         |    298 +
 Documentation/admin-guide/LSM/tomoyo.rst           |     52 +
 .../admin-guide/RAS/address-translation.rst        |     24 +
 Documentation/admin-guide/RAS/error-decoding.rst   |     21 +
 Documentation/admin-guide/RAS/index.rst            |      7 +
 Documentation/admin-guide/RAS/main.rst             |   1087 +
 Documentation/admin-guide/README.rst               |    360 +
 Documentation/admin-guide/abi-obsolete-files.rst   |      7 +
 Documentation/admin-guide/abi-obsolete.rst         |     13 +
 Documentation/admin-guide/abi-removed-files.rst    |      7 +
 Documentation/admin-guide/abi-removed.rst          |      7 +
 Documentation/admin-guide/abi-stable-files.rst     |      7 +
 Documentation/admin-guide/abi-stable.rst           |     16 +
 Documentation/admin-guide/abi-testing-files.rst    |      7 +
 Documentation/admin-guide/abi-testing.rst          |     22 +
 Documentation/admin-guide/abi.rst                  |     29 +
 Documentation/admin-guide/acpi/cppc_sysfs.rst      |     78 +
 .../admin-guide/acpi/fan_performance_states.rst    |     90 +
 Documentation/admin-guide/acpi/index.rst           |     14 +
 .../admin-guide/acpi/initrd_table_override.rst     |    115 +
 Documentation/admin-guide/acpi/ssdt-overlays.rst   |    181 +
 Documentation/admin-guide/aoe/aoe.rst              |    150 +
 Documentation/admin-guide/aoe/autoload.sh          |     17 +
 Documentation/admin-guide/aoe/examples.rst         |     23 +
 Documentation/admin-guide/aoe/index.rst            |     10 +
 Documentation/admin-guide/aoe/status.sh            |     30 +
 Documentation/admin-guide/aoe/todo.rst             |     17 +
 Documentation/admin-guide/aoe/udev-install.sh      |     33 +
 Documentation/admin-guide/aoe/udev.txt             |     26 +
 .../admin-guide/auxdisplay/cfag12864b.rst          |     98 +
 Documentation/admin-guide/auxdisplay/index.rst     |      9 +
 Documentation/admin-guide/auxdisplay/ks0108.rst    |     50 +
 Documentation/admin-guide/bcache.rst               |    644 +
 Documentation/admin-guide/binderfs.rst             |     87 +
 Documentation/admin-guide/binfmt-misc.rst          |    391 +
 .../blockdev/drbd/DRBD-8.3-data-packets.svg        |    588 +
 .../blockdev/drbd/DRBD-data-packets.svg            |    459 +
 .../admin-guide/blockdev/drbd/conn-states-8.dot    |     18 +
 .../blockdev/drbd/data-structure-v9.rst            |     42 +
 .../admin-guide/blockdev/drbd/disk-states-8.dot    |     16 +
 .../drbd/drbd-connection-state-overview.dot        |     85 +
 .../admin-guide/blockdev/drbd/figures.rst          |     30 +
 Documentation/admin-guide/blockdev/drbd/index.rst  |     19 +
 .../admin-guide/blockdev/drbd/peer-states-8.dot    |      8 +
 Documentation/admin-guide/blockdev/floppy.rst      |    255 +
 Documentation/admin-guide/blockdev/index.rst       |     17 +
 Documentation/admin-guide/blockdev/nbd.rst         |     31 +
 Documentation/admin-guide/blockdev/paride.rst      |    207 +
 Documentation/admin-guide/blockdev/ramdisk.rst     |    153 +
 Documentation/admin-guide/blockdev/zoned_loop.rst  |    191 +
 Documentation/admin-guide/blockdev/zram.rst        |    610 +
 Documentation/admin-guide/bootconfig.rst           |    416 +
 Documentation/admin-guide/braille-console.rst      |     38 +
 Documentation/admin-guide/btmrvl.rst               |    124 +
 Documentation/admin-guide/bug-bisect.rst           |    165 +
 Documentation/admin-guide/bug-hunting.rst          |    370 +
 .../admin-guide/cgroup-v1/blkio-controller.rst     |    301 +
 Documentation/admin-guide/cgroup-v1/cgroups.rst    |    697 +
 Documentation/admin-guide/cgroup-v1/cpuacct.rst    |     50 +
 Documentation/admin-guide/cgroup-v1/cpusets.rst    |    874 +
 Documentation/admin-guide/cgroup-v1/devices.rst    |    132 +
 .../admin-guide/cgroup-v1/freezer-subsystem.rst    |    131 +
 Documentation/admin-guide/cgroup-v1/hugetlb.rst    |    139 +
 Documentation/admin-guide/cgroup-v1/index.rst      |     24 +
 Documentation/admin-guide/cgroup-v1/memcg_test.rst |    342 +
 Documentation/admin-guide/cgroup-v1/memory.rst     |    926 +
 Documentation/admin-guide/cgroup-v1/misc.rst       |      4 +
 Documentation/admin-guide/cgroup-v1/net_cls.rst    |     44 +
 Documentation/admin-guide/cgroup-v1/net_prio.rst   |     57 +
 Documentation/admin-guide/cgroup-v1/pids.rst       |     93 +
 Documentation/admin-guide/cgroup-v1/rdma.rst       |    191 +
 Documentation/admin-guide/cgroup-v2.rst            |   3581 +
 Documentation/admin-guide/cifs/authors.rst         |     69 +
 Documentation/admin-guide/cifs/changes.rst         |      9 +
 Documentation/admin-guide/cifs/index.rst           |     14 +
 Documentation/admin-guide/cifs/introduction.rst    |     53 +
 Documentation/admin-guide/cifs/todo.rst            |    133 +
 Documentation/admin-guide/cifs/usage.rst           |    864 +
 Documentation/admin-guide/cifs/winucase_convert.pl |     62 +
 Documentation/admin-guide/clearing-warn-once.rst   |      9 +
 Documentation/admin-guide/cpu-isolation.rst        |    357 +
 Documentation/admin-guide/cpu-load.rst             |    117 +
 Documentation/admin-guide/cputopology.rst          |    101 +
 Documentation/admin-guide/dell_rbu.rst             |    128 +
 .../admin-guide/device-mapper/cache-policies.rst   |    131 +
 Documentation/admin-guide/device-mapper/cache.rst  |    337 +
 Documentation/admin-guide/device-mapper/delay.rst  |     54 +
 .../admin-guide/device-mapper/dm-clone.rst         |    333 +
 .../admin-guide/device-mapper/dm-crypt.rst         |    212 +
 .../admin-guide/device-mapper/dm-dust.rst          |    305 +
 Documentation/admin-guide/device-mapper/dm-ebs.rst |     51 +
 .../admin-guide/device-mapper/dm-flakey.rst        |     88 +
 Documentation/admin-guide/device-mapper/dm-ima.rst |    718 +
 .../admin-guide/device-mapper/dm-init.rst          |    133 +
 .../admin-guide/device-mapper/dm-inlinecrypt.rst   |    129 +
 .../admin-guide/device-mapper/dm-integrity.rst     |    321 +
 Documentation/admin-guide/device-mapper/dm-io.rst  |     75 +
 Documentation/admin-guide/device-mapper/dm-log.rst |     57 +
 .../admin-guide/device-mapper/dm-pcache.rst        |    202 +
 .../admin-guide/device-mapper/dm-queue-length.rst  |     48 +
 .../admin-guide/device-mapper/dm-raid.rst          |    489 +
 .../admin-guide/device-mapper/dm-service-time.rst  |    101 +
 .../admin-guide/device-mapper/dm-uevent.rst        |    110 +
 .../admin-guide/device-mapper/dm-zoned.rst         |    194 +
 Documentation/admin-guide/device-mapper/era.rst    |    116 +
 Documentation/admin-guide/device-mapper/index.rst  |     43 +
 Documentation/admin-guide/device-mapper/kcopyd.rst |     47 +
 Documentation/admin-guide/device-mapper/linear.rst |     63 +
 .../admin-guide/device-mapper/log-writes.rst       |    145 +
 .../admin-guide/device-mapper/persistent-data.rst  |     88 +
 .../admin-guide/device-mapper/snapshot.rst         |    196 +
 .../admin-guide/device-mapper/statistics.rst       |    225 +
 .../admin-guide/device-mapper/striped.rst          |     61 +
 Documentation/admin-guide/device-mapper/switch.rst |    141 +
 .../device-mapper/thin-provisioning.rst            |    427 +
 .../admin-guide/device-mapper/unstriped.rst        |    135 +
 .../admin-guide/device-mapper/vdo-design.rst       |    633 +
 Documentation/admin-guide/device-mapper/vdo.rst    |    413 +
 Documentation/admin-guide/device-mapper/verity.rst |    349 +
 .../admin-guide/device-mapper/writecache.rst       |    114 +
 Documentation/admin-guide/device-mapper/zero.rst   |     37 +
 Documentation/admin-guide/devices.rst              |    270 +
 Documentation/admin-guide/devices.txt              |   3081 +
 Documentation/admin-guide/dynamic-debug-howto.rst  |    392 +
 Documentation/admin-guide/edid.rst                 |     27 +
 Documentation/admin-guide/efi-stub.rst             |    103 +
 Documentation/admin-guide/ext4.rst                 |    611 +
 Documentation/admin-guide/features.rst             |      3 +
 .../admin-guide/filesystem-monitoring.rst          |     78 +
 Documentation/admin-guide/gpio/gpio-aggregator.rst |    218 +
 Documentation/admin-guide/gpio/gpio-mockup.rst     |     59 +
 Documentation/admin-guide/gpio/gpio-sim.rst        |    137 +
 Documentation/admin-guide/gpio/gpio-virtuser.rst   |    177 +
 Documentation/admin-guide/gpio/index.rst           |     14 +
 Documentation/admin-guide/gpio/obsolete.rst        |     13 +
 .../admin-guide/hw-vuln/attack_vector_controls.rst |    236 +
 .../admin-guide/hw-vuln/core-scheduling.rst        |    226 +
 .../admin-guide/hw-vuln/cross-thread-rsb.rst       |     91 +
 .../admin-guide/hw-vuln/gather_data_sampling.rst   |    109 +
 Documentation/admin-guide/hw-vuln/index.rst        |     29 +
 .../hw-vuln/indirect-target-selection.rst          |    168 +
 Documentation/admin-guide/hw-vuln/l1d_flush.rst    |     69 +
 Documentation/admin-guide/hw-vuln/l1tf.rst         |    615 +
 Documentation/admin-guide/hw-vuln/mds.rst          |    303 +
 Documentation/admin-guide/hw-vuln/multihit.rst     |    167 +
 .../admin-guide/hw-vuln/old_microcode.rst          |     21 +
 .../hw-vuln/processor_mmio_stale_data.rst          |    269 +
 .../admin-guide/hw-vuln/reg-file-data-sampling.rst |     96 +
 Documentation/admin-guide/hw-vuln/rsb.rst          |    268 +
 .../special-register-buffer-data-sampling.rst      |    150 +
 Documentation/admin-guide/hw-vuln/spectre.rst      |    725 +
 Documentation/admin-guide/hw-vuln/srso.rst         |    242 +
 .../admin-guide/hw-vuln/tsx_async_abort.rst        |    270 +
 Documentation/admin-guide/hw-vuln/vmscape.rst      |    110 +
 Documentation/admin-guide/hw_random.rst            |    104 +
 Documentation/admin-guide/index.rst                |    192 +
 Documentation/admin-guide/init.rst                 |     48 +
 Documentation/admin-guide/initrd.rst               |    383 +
 Documentation/admin-guide/iostats.rst              |    187 +
 Documentation/admin-guide/java.rst                 |    423 +
 Documentation/admin-guide/jfs.rst                  |     66 +
 Documentation/admin-guide/kdump/gdbmacros.txt      |    323 +
 Documentation/admin-guide/kdump/index.rst          |     13 +
 Documentation/admin-guide/kdump/kdump.rst          |    612 +
 Documentation/admin-guide/kdump/vmcoreinfo.rst     |    596 +
 Documentation/admin-guide/kernel-parameters.rst    |    135 +
 Documentation/admin-guide/kernel-parameters.txt    |   8709 +
 .../admin-guide/kernel-per-CPU-kthreads.rst        |    325 +
 .../admin-guide/laptops/alienware-wmi.rst          |    127 +
 Documentation/admin-guide/laptops/asus-laptop.rst  |    271 +
 .../admin-guide/laptops/disk-shock-protection.rst  |    151 +
 Documentation/admin-guide/laptops/index.rst        |     19 +
 Documentation/admin-guide/laptops/lg-laptop.rst    |     82 +
 .../admin-guide/laptops/samsung-galaxybook.rst     |    174 +
 Documentation/admin-guide/laptops/sony-laptop.rst  |    174 +
[Output truncated: showing 1000 of 96042 lines]]

391/4 2026/09/17 11:44 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 41785
							output: 27
							thoughts: 34
						

Thoughts:
Here's my take on the thought process, as if it were my own:

**Investigating Recent Changes in NTFS3 File Handling**

Okay, so I want to quickly check the recent commit history for the `fs/ntfs3/file.c` file. I'm thinking, the most efficient way to do that is to use `git`. Specifically, I'll use `git log` and specify the file path. This should give me a chronological listing of commits, allowing me to see who's been touching that file, what changes they made, and when those changes occurred. That should give me the context I need to get started. I'll get the command set up and see what it tells me. I expect this to be a quick way to assess the current state and figure out where to focus my attention.



392/4 2026/09/17 11:45 tool git-log
0m Args:
map[Count:10 PathPrefix:fs/ntfs3/]

Results:
map[Output:fd73f4a66598 Linux 7.3-rc3
]

393/4 2026/09/17 11:45 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 42053
							output: 37
							thoughts: 213
						

Thoughts:
**Analyzing the NTFS File Size Change Logic**

Okay, so the provided context tells me we're looking at a single commit – Linux 7.3-rc3 – and that's perfectly normal for an isolated patch. No worries there.

Right, let's re-read the core of the issue: the order of calls in `ntfs_setattr` when modifying file sizes. The crucial thing is this: if the file's being *shrunk*, `truncate_setsize` comes *before* `ntfs_set_size`. If it's *extended*, then `ntfs_set_size` needs to happen first (or `i_size_write` and `pagecache_isize_extended`), and both scenarios *must* be guarded by `filemap_invalidate_lock`. That's the core constraint.

Now, time to dive into `fs/ntfs3/file.c` and see what's actually happening in `ntfs_setattr`. Lines 720 to 765, to be precise. Let's see how the current implementation handles size changes and identify where we need to insert the correct call ordering and locking to meet the requirements of the question.



394/4 2026/09/17 11:45 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:720 LineCount:45]

Results:
map[Contents: 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
]

395/4 2026/09/17 11:45 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 43215
							output: 37
							thoughts: 188
						

Thoughts:
**Examining the File Size Update in NTFS3**

Okay, so I'm looking at this snippet from `fs/ntfs3/file.c` and I need to really dig into what's happening during a file size change. Specifically, I'm focusing on the `if (newsize != oldsize)` block. It's calling `truncate_setsize(inode, newsize)`, and then `ntfs_set_size(inode, newsize)`. The subsequent logic handles potential errors and sets some file attributes.

The core of my interest lies in `truncate_setsize`. I'm already pretty familiar with the basics, but I need to confirm the specifics of *this* implementation. I need to refresh my knowledge of what that function is actually doing. My immediate next step is to locate its definition, and understand how it handles things like block allocation, metadata updates, and potential data loss if the size is reduced, or fragmentation issues if the size is increased. Time to track down that function and analyze its implementation.



396/4 2026/09/17 11:46 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:truncate_setsize]

Results:
map[SourceCode: 803:	/**
 804:	 * truncate_setsize - update inode and pagecache for a new file size
 805:	 * @inode: inode
 806:	 * @newsize: new file size
 807:	 *
 808:	 * truncate_setsize updates i_size and performs pagecache truncation (if
 809:	 * necessary) to @newsize. It will be typically be called from the filesystem's
 810:	 * setattr function when ATTR_SIZE is passed in.
 811:	 *
 812:	 * Must be called with a lock serializing truncates and writes (generally
 813:	 * i_rwsem but e.g. xfs uses a different lock) and before all filesystem
 814:	 * specific block truncation has been performed.
 815:	 */
 816:	void truncate_setsize(struct inode *inode, loff_t newsize)
 817:	{
 818:		loff_t oldsize = inode->i_size;
 819:	
 820:		i_size_write(inode, newsize);
 821:		if (newsize > oldsize)
 822:			pagecache_isize_extended(inode, oldsize, newsize);
 823:		truncate_pagecache(inode, newsize);
 824:	}
 SourceFile:mm/truncate.c]

397/4 2026/09/17 11:46 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 44041
							output: 34
							thoughts: 341
						

Thoughts:
**Analyzing Filesystem Size Changes**

Okay, so I'm looking at this `truncate_setsize` function and the prompt's instructions regarding `ntfs_setattr`. The core logic here is about how we handle file size changes – specifically, the ordering of calls to `truncate_setsize` versus `ntfs_set_size`, depending on whether we're shrinking or extending the file. The prompt is laying out a pretty clear picture.

If we're *shrinking* the file (newsize < oldsize), `truncate_setsize` must come *before* `ntfs_set_size`. This makes sense; we need to trim the page cache first to reflect the smaller file size before making the backing storage reflect the change.

Conversely, if we're *extending* the file (newsize > oldsize), it seems like `ntfs_set_size` needs to happen *before* `truncate_setsize` (or, more specifically, the `i_size_write` and `pagecache_isize_extended` parts). My initial assumption is that we need to reserve space on the disk first. Either way, this approach would need to be reevaluated. This seems less intuitive, but I get the direction. It's likely that we're dealing with caching semantics and the order in which we update the inode size and the underlying data structures.

And, of course, the ever-present `filemap_invalidate_lock(inode->i_mapping)` has to be in place for both cases. This is critical for data integrity to handle concurrent operations.

To solidify my understanding of the correct implementation, I need to see how other filesystems handle the same `ATTR_SIZE` attribute change. That means diving into the code for `ext4`, `f2fs`, `btrfs`, `xfs`, and `exfat`, and how they manage size adjustments within their respective `setattr` implementations. The details of their internal mechanisms will illuminate the most robust way to approach this patch for the NTFS driver. Ultimately, I need to implement this as cleanly as possible.



398/4 2026/09/17 11:46 tool grepper
0m Args:
map[Expression:filemap_invalidate_unlock PathPrefix:fs/ext4/inode.c]

Results:
map[Output:fs/ext4/inode.c=4432=static void ext4_wait_dax_page(struct inode *inode)
fs/ext4/inode.c-4433-{
fs/ext4/inode.c:4434:	filemap_invalidate_unlock(inode->i_mapping);
fs/ext4/inode.c-4435-	schedule();
--
fs/ext4/inode.c=6009=int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ext4/inode.c-6129-		if (rc) {
fs/ext4/inode.c:6130:			filemap_invalidate_unlock(inode->i_mapping);
fs/ext4/inode.c-6131-			goto err_out;
--
fs/ext4/inode.c-6224-out_mmap_sem:
fs/ext4/inode.c:6225:		filemap_invalidate_unlock(inode->i_mapping);
fs/ext4/inode.c-6226-	}
--
fs/ext4/inode.c=6740=int ext4_change_inode_journal_flag(struct inode *inode, int val)
--
fs/ext4/inode.c-6776-	if (err < 0) {
fs/ext4/inode.c:6777:		filemap_invalidate_unlock(inode->i_mapping);
fs/ext4/inode.c-6778-		return err;
--
fs/ext4/inode.c-6800-			ext4_writepages_up_write(inode->i_sb, alloc_ctx);
fs/ext4/inode.c:6801:			filemap_invalidate_unlock(inode->i_mapping);
fs/ext4/inode.c-6802-			return err;
--
fs/ext4/inode.c-6810-	ext4_writepages_up_write(inode->i_sb, alloc_ctx);
fs/ext4/inode.c:6811:	filemap_invalidate_unlock(inode->i_mapping);
fs/ext4/inode.c-6812-
--
fs/ext4/inode.c=6884=vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf)
--
fs/ext4/inode.c-6971-out:
fs/ext4/inode.c:6972:	filemap_invalidate_unlock_shared(mapping);
fs/ext4/inode.c-6973-	sb_end_pagefault(inode->i_sb);
]

399/4 2026/09/17 11:46 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 45544
							output: 37
							thoughts: 19
						

Thoughts:
Here's a summary of my thought process, as if I were analyzing that code:

**Diving into ext4_setattr**

Okay, let's drill down into `ext4_setattr`. Specifically, I'm going to look at around line 6125 in the ext4 code. This is a critical function, so I'll want to quickly understand its role and how it handles attribute changes. `setattr` is a core operation, so it will involve checking permissions, updating inode metadata (timestamps, size, etc.), handling potential file system inconsistencies, and ensuring atomicity. I'll need to see how it interacts with the journaling layer, how it manages block allocation (if the size is changing), and how it deals with extended attributes. This is where the core of how permissions and metadata updates work, so the devil's in the details. I will also make sure to review how this function handles locks to ensure data integrity.



400/4 2026/09/17 11:47 tool read-file
0m Args:
map[File:fs/ext4/inode.c FirstLine:6120 LineCount:40]

Results:
map[Contents:6120:				 * Blocks are going to be removed from the inode. Wait
6121:				 * for dio in flight.
6122:				 */
6123:				inode_dio_wait(inode);
6124:			}
6125:	
6126:			filemap_invalidate_lock(inode->i_mapping);
6127:	
6128:			rc = ext4_break_layouts(inode);
6129:			if (rc) {
6130:				filemap_invalidate_unlock(inode->i_mapping);
6131:				goto err_out;
6132:			}
6133:	
6134:			if (attr->ia_size != inode->i_size) {
6135:				/* attach jbd2 jinode for EOF folio tail zeroing */
6136:				if (attr->ia_size & (inode->i_sb->s_blocksize - 1) ||
6137:				    oldsize & (inode->i_sb->s_blocksize - 1)) {
6138:					error = ext4_inode_attach_jinode(inode);
6139:					if (error)
6140:						goto out_mmap_sem;
6141:				}
6142:	
6143:				/*
6144:				 * Update c/mtime and tail zero the EOF folio on
6145:				 * truncate up. ext4_truncate() handles the shrink case
6146:				 * below.
6147:				 */
6148:				if (!shrink) {
6149:					inode_set_mtime_to_ts(inode,
6150:							      inode_set_ctime_current(inode));
6151:					if (oldsize & (inode->i_sb->s_blocksize - 1)) {
6152:						error = ext4_block_zero_eof(inode,
6153:								oldsize, LLONG_MAX);
6154:						if (error)
6155:							goto out_mmap_sem;
6156:					}
6157:				}
6158:	
6159:				handle = ext4_journal_start(inode, EXT4_HT_INODE, 3);
]

401/4 2026/09/17 11:47 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 46408
							output: 37
							thoughts: 14
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm an expert in file systems and kernel internals:

**Diving Deeper into ext4_setattr**

Right, let's get down to brass tacks. The action described implies that I'm currently working through the `ext4_setattr` function, probably debugging something or trying to understand its behavior in a specific scenario. It suggests I'm already familiar with the broader file system code. I know *where* I am within the overall ext4 code base, and I'm ready to move beyond the current focus. It's likely I've encountered something interesting or perplexing related to attribute setting and need a more detailed understanding of the lower-level implementation. So, I'm specifically targeting the code within that function. I'm thinking to myself, "Okay, time to get my hands dirty. I'm going to dig into the next section, line by line if necessary." I'm mentally preparing for a deep dive, recognizing that the answer to my question lies further down within `ext4_setattr` itself. No broad strokes, just a focused look at the details.



402/4 2026/09/17 11:47 tool read-file
0m Args:
map[File:fs/ext4/inode.c FirstLine:6160 LineCount:40]

Results:
map[Contents:6160:				if (IS_ERR(handle)) {
6161:					error = PTR_ERR(handle);
6162:					goto out_mmap_sem;
6163:				}
6164:				if (ext4_handle_valid(handle) && shrink) {
6165:					error = ext4_orphan_add(handle, inode);
6166:					orphan = 1;
6167:				}
6168:	
6169:				if (shrink)
6170:					ext4_fc_track_range(handle, inode,
6171:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6172:						inode->i_sb->s_blocksize_bits,
6173:						EXT_MAX_BLOCKS - 1);
6174:				else
6175:					ext4_fc_track_range(
6176:						handle, inode,
6177:						(oldsize > 0 ? oldsize - 1 : oldsize) >>
6178:						inode->i_sb->s_blocksize_bits,
6179:						(attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
6180:						inode->i_sb->s_blocksize_bits);
6181:	
6182:				down_write(&EXT4_I(inode)->i_data_sem);
6183:				old_disksize = EXT4_I(inode)->i_disksize;
6184:				EXT4_I(inode)->i_disksize = attr->ia_size;
6185:	
6186:				/*
6187:				 * We have to update i_size under i_data_sem together
6188:				 * with i_disksize to avoid races with writeback code
6189:				 * running ext4_wb_update_i_disksize().
6190:				 */
6191:				if (!error)
6192:					i_size_write(inode, attr->ia_size);
6193:				else
6194:					EXT4_I(inode)->i_disksize = old_disksize;
6195:				up_write(&EXT4_I(inode)->i_data_sem);
6196:				rc = ext4_mark_inode_dirty(handle, inode);
6197:				if (!error)
6198:					error = rc;
6199:				ext4_journal_stop(handle);
]

403/4 2026/09/17 11:47 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 47382
							output: 37
							thoughts: 22
						

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

**Diving into ext4's Inner Workings**

Okay, so I'm digging into ext4 again. I want to understand a specific aspect better, so I'm navigating the code, and I've decided to zoom in on a particular region. Let me get my bearings... Right, I'm heading down to lines 6200 through 6235. That section should hold the key to what I'm looking for. Let's see what's what.



404/4 2026/09/17 11:47 tool read-file
0m Args:
map[File:fs/ext4/inode.c FirstLine:6200 LineCount:35]

Results:
map[Contents:6200:				if (error)
6201:					goto out_mmap_sem;
6202:				if (!shrink) {
6203:					pagecache_isize_extended(inode, oldsize,
6204:								 inode->i_size);
6205:				} else if (ext4_should_journal_data(inode)) {
6206:					ext4_wait_for_tail_page_commit(inode);
6207:				}
6208:			}
6209:	
6210:			/*
6211:			 * Truncate pagecache after we've waited for commit
6212:			 * in data=journal mode to make pages freeable.
6213:			 */
6214:			truncate_pagecache(inode, inode->i_size);
6215:			/*
6216:			 * Call ext4_truncate() even if i_size didn't change to
6217:			 * truncate possible preallocated blocks.
6218:			 */
6219:			if (attr->ia_size <= oldsize) {
6220:				rc = ext4_truncate(inode);
6221:				if (rc)
6222:					error = rc;
6223:			}
6224:	out_mmap_sem:
6225:			filemap_invalidate_unlock(inode->i_mapping);
6226:		}
6227:	
6228:		if (!error) {
6229:			if (inc_ivers)
6230:				inode_inc_iversion(inode);
6231:			setattr_copy(idmap, inode, attr);
6232:			mark_inode_dirty(inode);
6233:		}
6234:	
]

405/4 2026/09/17 11:48 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 48050
							output: 32
							thoughts: 25
						

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

**Diving into f2fs_setattr**

Okay, time to dissect `f2fs_setattr` within `fs/f2fs/file.c`. I need to understand exactly how file attributes are handled in F2FS. This is a critical function, as it's the gatekeeper for things like permissions, timestamps, and extended attributes. I'll be looking for potential bottlenecks, race conditions, or anything that could impact performance or data integrity during attribute modifications. I want to see how it interacts with the underlying block device, the journal (if applicable), and if it's taking advantage of any F2FS-specific optimizations. I'll pay close attention to the error handling paths and recovery mechanisms, particularly under I/O stress or power loss scenarios, and how it ensures consistency after potential interruptions. My goal is to grasp the core mechanics and identify areas ripe for optimization or potential vulnerabilities.



406/4 2026/09/17 11:48 tool grepper
0m Args:
map[Expression:f2fs_setattr PathPrefix:fs/f2fs/]

Results:
map[Output:fs/f2fs/f2fs.h=3851=int f2fs_getattr(struct mnt_idmap *idmap, const struct path *path,
fs/f2fs/f2fs.h-3852-		 struct kstat *stat, u32 request_mask, unsigned int flags);
fs/f2fs/f2fs.h:3853:int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/f2fs/f2fs.h-3854-		 struct iattr *attr);
--
fs/f2fs/file.c=1099=static void __setattr_copy(struct mnt_idmap *idmap,
--
fs/f2fs/file.c-1123-
fs/f2fs/file.c:1124:int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/f2fs/file.c-1125-		 struct iattr *attr)
--
fs/f2fs/file.c=1277=const struct inode_operations f2fs_file_inode_operations = {
fs/f2fs/file.c-1278-	.getattr	= f2fs_getattr,
fs/f2fs/file.c:1279:	.setattr	= f2fs_setattr,
fs/f2fs/file.c-1280-	.get_inode_acl	= f2fs_get_acl,
--
fs/f2fs/namei.c=1407=const struct inode_operations f2fs_encrypted_symlink_inode_operations = {
--
fs/f2fs/namei.c-1409-	.getattr	= f2fs_encrypted_symlink_getattr,
fs/f2fs/namei.c:1410:	.setattr	= f2fs_setattr,
fs/f2fs/namei.c-1411-	.listxattr	= f2fs_listxattr,
--
fs/f2fs/namei.c=1414=const struct inode_operations f2fs_dir_inode_operations = {
--
fs/f2fs/namei.c-1425-	.getattr	= f2fs_getattr,
fs/f2fs/namei.c:1426:	.setattr	= f2fs_setattr,
fs/f2fs/namei.c-1427-	.get_inode_acl	= f2fs_get_acl,
--
fs/f2fs/namei.c=1435=const struct inode_operations f2fs_symlink_inode_operations = {
--
fs/f2fs/namei.c-1437-	.getattr	= f2fs_getattr,
fs/f2fs/namei.c:1438:	.setattr	= f2fs_setattr,
fs/f2fs/namei.c-1439-	.listxattr	= f2fs_listxattr,
--
fs/f2fs/namei.c=1442=const struct inode_operations f2fs_special_inode_operations = {
fs/f2fs/namei.c-1443-	.getattr	= f2fs_getattr,
fs/f2fs/namei.c:1444:	.setattr	= f2fs_setattr,
fs/f2fs/namei.c-1445-	.get_inode_acl	= f2fs_get_acl,
]

407/4 2026/09/17 11:48 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 49232
							output: 38
							thoughts: 23
						

Thoughts:
Okay, let's dive into this. I'm thinking about the code in `fs/f2fs/file.c` around line 1220. I'm familiar with this file; it handles the file-specific operations within the F2FS filesystem. Line 1220... right, I recall this section deals with... *[fill in the blank with what the user is most likely an expert in. Examples: data I/O, inode operations, extent management, metadata updates, etc.]*. I'll need to refresh my memory on the context surrounding that specific line. I remember the surrounding code, so I'll quickly recall that to give myself the full picture. My initial guess is that the line handles a crucial part of... *[again, extrapolate based on the user's expertise and the general function of `file.c` within F2FS]*. I'm betting it's tightly coupled with the way F2FS handles... *[another relevant concept]*. I'll need to assess how it works within the broader scope of F2FS's design, considering... *[a relevant architectural aspect, like the log-structured approach, wear-leveling, or specific optimization strategies]*. Alright, time to go get my hands dirty.



408/4 2026/09/17 11:48 tool read-file
0m Args:
map[File:fs/f2fs/file.c FirstLine:1220 LineCount:45]

Results:
map[Contents:1220:			/*
1221:			 * wait for inflight dio, blocks should be removed after
1222:			 * IO completion.
1223:			 */
1224:			if (attr->ia_size < old_size)
1225:				inode_dio_wait(inode);
1226:	
1227:			f2fs_down_write(&fi->i_gc_rwsem[WRITE]);
1228:			filemap_invalidate_lock(inode->i_mapping);
1229:	
1230:			if (attr->ia_size > old_size) {
1231:				err = f2fs_zero_post_eof_page(inode,
1232:					attr->ia_size, false, true);
1233:				if (err)
1234:					goto err_out;
1235:			}
1236:			truncate_setsize(inode, attr->ia_size);
1237:	
1238:			if (attr->ia_size <= old_size)
1239:				err = f2fs_truncate(inode);
1240:			/*
1241:			 * do not trim all blocks after i_size if target size is
1242:			 * larger than i_size.
1243:			 */
1244:	err_out:
1245:			filemap_invalidate_unlock(inode->i_mapping);
1246:			f2fs_up_write(&fi->i_gc_rwsem[WRITE]);
1247:			if (err)
1248:				return err;
1249:	
1250:			spin_lock(&fi->i_size_lock);
1251:			inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
1252:			fi->last_disk_size = i_size_read(inode);
1253:			spin_unlock(&fi->i_size_lock);
1254:		}
1255:	
1256:		__setattr_copy(idmap, inode, attr);
1257:	
1258:		if (attr->ia_valid & ATTR_MODE) {
1259:			err = posix_acl_chmod(idmap, dentry, f2fs_get_inode_mode(inode));
1260:	
1261:			if (is_inode_flag_set(inode, FI_ACL_MODE)) {
1262:				if (!err)
1263:					inode->i_mode = fi->i_acl_mode;
1264:				clear_inode_flag(inode, FI_ACL_MODE);
]

409/4 2026/09/17 11:48 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 50280
							output: 39
							thoughts: 50
						

Thoughts:
Okay, let's dive into this. I'm curious about the functionality of `ntfs_set_size` within the `fs/ntfs3` file system implementation. My immediate thought is to understand its core purpose, which means I should go straight to the source. Specifically, I need to examine the `ntfs_set_size` function defined within `fs/ntfs3/inode.c`. That's where the magic, or the mechanics at least, should be! Let's see what we can find.



410/4 2026/09/17 11:49 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/file.c Name:ntfs_set_size]

Results:
map[SourceCode: 883:	int ntfs_set_size(struct inode *inode, u64 new_size)
 884:	{
 885:		struct super_block *sb = inode->i_sb;
 886:		struct ntfs_sb_info *sbi = sb->s_fs_info;
 887:		struct ntfs_inode *ni = ntfs_i(inode);
 888:		int err;
 889:	
 890:		/* Check for maximum file size. */
 891:		if (is_sparsed(ni) || is_compressed(ni)) {
 892:			if (new_size > sbi->maxbytes_sparse) {
 893:				return -EFBIG;
 894:			}
 895:		} else if (new_size > sbi->maxbytes) {
 896:			return -EFBIG;
 897:		}
 898:	
 899:		/* Mark rw ntfs as dirty. It will be cleared at umount. */
 900:		ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
 901:	
 902:		ni_lock(ni);
 903:		down_write(&ni->file.run_lock);
 904:		if (new_size < ni->i_valid)
 905:			ni->i_valid = new_size;
 906:	
 907:		/* last 'true' means keep preallocated. */
 908:		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name, ni->file.ads.len,
 909:				    &ni->file.run, new_size, &ni->i_valid, true);
 910:	
 911:		up_write(&ni->file.run_lock);
 912:		ni_unlock(ni);
 913:	
 914:		return err;
 915:	}
 SourceFile:fs/ntfs3/inode.c]

411/4 2026/09/17 11:49 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 51043
							output: 29
							thoughts: 2949
						

Thoughts:
**Analyzing NTFS File Size Setting Logic**

Alright, let's break this down. My understanding of this problem is that we need to ensure the correct order of operations when modifying a file's size on an NTFS filesystem, paying careful attention to potential errors. `ntfs_set_size` is the core function that updates the on-disk size, and it's prone to failure, so we have to handle those failures!

The core problem, as I see it, centers around how we handle changes that either shrink or extend a file, specifically with `newsize < oldsize` (shrinking) and `newsize > oldsize` (extending). The provided prompt specifies a strict ordering: when shrinking, we *must* `truncate_setsize` *before* `ntfs_set_size`. When extending, we *must* `ntfs_set_size` *before* `truncate_setsize` (or, alternatively, the combination of `i_size_write` and `pagecache_isize_extended`). Furthermore, any operation on the pagecache must be done while protecting the inode through `filemap_invalidate_lock(inode->i_mapping)`.

Thinking it through, if shrinking, `truncate_setsize` does the important stuff: first, it drops pages beyond the new size from the pagecache *and* sets the inode's `i_size`. We *must* do this *before* calling `ntfs_set_size`, so that if `ntfs_set_size` fails, the size is properly restored.

Extending is trickier! If we call `truncate_setsize` before `ntfs_set_size`, we update `i_size` but `ntfs_set_size` *could* fail, leaving us in a bad state (the pagecache might have pages beyond the new size, but on-disk allocation won't be correct).

The reason for the strict order is the pagecache! `ntfs_set_size` needs to be called *first* to ensure the disk is properly allocated. If that fails, we don't change anything in the pagecache or inode. Only if `ntfs_set_size` succeeds, we update `i_size` *and* pagecache with `truncate_setsize` (or the `i_size_write`/`pagecache_isize_extended` combination).

Regarding lock protection, the locking needs to *encompass* the size change logic (`if (newsize != oldsize)` and everything inside). It needs to be around *both* the shrinking and the extending cases, since we must protect changes to the pagecache from races. It *must* be around the entire size-change logic, as the prompt specifies, regardless of whether `newsize < oldsize` or `newsize > oldsize`.

Finally, it seems `truncate_setsize(inode, newsize)` in the extending case actually calls `truncate_pagecache(inode, newsize)`, which will be a no-op! So either way, we should use `truncate_setsize(inode, newsize)`.



412/4 2026/09/17 11:49 tool grepper
0m Args:
map[Expression:pagecache_isize_extended PathPrefix:fs/]

Results:
map[Output:fs/afs/inode.c=713=static void afs_setattr_success(struct afs_operation *op)
--
fs/afs/inode.c-725-		if (size > old_i_size)
fs/afs/inode.c:726:			pagecache_isize_extended(inode, old_i_size, size);
fs/afs/inode.c-727-	}
--
fs/btrfs/file.c=1318=ssize_t btrfs_buffered_write(struct kiocb *iocb, struct iov_iter *iter)
--
fs/btrfs/file.c-1339-	 * other buffered writes and cause incorrect call of
fs/btrfs/file.c:1340:	 * pagecache_isize_extended() to overwrite existing data.
fs/btrfs/file.c-1341-	 */
--
fs/btrfs/file.c-1363-	if (num_written > 0) {
fs/btrfs/file.c:1364:		pagecache_isize_extended(inode, old_isize, iocb->ki_pos);
fs/btrfs/file.c-1365-		iocb->ki_pos += num_written;
--
fs/btrfs/inode.c=5391=static int btrfs_setsize(struct inode *inode, struct iattr *attr)
--
fs/btrfs/inode.c-5436-		btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0);
fs/btrfs/inode.c:5437:		pagecache_isize_extended(inode, oldsize, newsize);
fs/btrfs/inode.c-5438-		ret = btrfs_update_inode(trans, BTRFS_I(inode));
--
fs/buffer.c=2188=int generic_write_end(const struct kiocb *iocb, struct address_space *mapping,
--
fs/buffer.c-2213-	if (old_size < pos)
fs/buffer.c:2214:		pagecache_isize_extended(inode, old_size, pos);
fs/buffer.c-2215-	/*
--
fs/exfat/file.c=25=static int exfat_cont_expand(struct inode *inode, loff_t size)
--
fs/exfat/file.c-87-	 * When extending file size, call truncate_pagecache() first,
fs/exfat/file.c:88:	 * then update i_size, and call pagecache_isize_extended()
fs/exfat/file.c-89-	 * to ensures the straddling folio is properly marked RO so
--
fs/exfat/file.c-91-	 */
fs/exfat/file.c:92:	pagecache_isize_extended(inode, oldsize, inode->i_size);
fs/exfat/file.c-93-
--
fs/ext4/extents.c=4598=static int ext4_alloc_file_blocks(struct file *file, loff_t offset, loff_t len,
--
fs/ext4/extents.c-4767-	if (epos > old_size)
fs/ext4/extents.c:4768:		pagecache_isize_extended(inode, old_size, epos);
fs/ext4/extents.c-4769-out:
--
fs/ext4/inode.c=1432=static int ext4_write_end(const struct kiocb *iocb,
--
fs/ext4/inode.c-1463-	if (old_size < pos && !verity)
fs/ext4/inode.c:1464:		pagecache_isize_extended(inode, old_size, pos);
fs/ext4/inode.c-1465-
--
fs/ext4/inode.c=1535=static int ext4_journalled_write_end(const struct kiocb *iocb,
--
fs/ext4/inode.c-1580-	if (old_size < pos && !verity)
fs/ext4/inode.c:1581:		pagecache_isize_extended(inode, old_size, pos);
fs/ext4/inode.c-1582-
--
fs/ext4/inode.c=3213=static int ext4_da_do_write_end(struct address_space *mapping,
--
fs/ext4/inode.c-3264-	if (pos > old_size)
fs/ext4/inode.c:3265:		pagecache_isize_extended(inode, old_size, pos);
fs/ext4/inode.c-3266-
--
fs/ext4/inode.c=6009=int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ext4/inode.c-6202-			if (!shrink) {
fs/ext4/inode.c:6203:				pagecache_isize_extended(inode, oldsize,
fs/ext4/inode.c-6204-							 inode->i_size);
--
fs/iomap/buffered-io.c=1188=static int iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i,
--
fs/iomap/buffered-io.c-1265-		if (old_size < pos && !(iter->iomap.flags & IOMAP_F_FSVERITY))
fs/iomap/buffered-io.c:1266:			pagecache_isize_extended(iter->inode, old_size, pos);
fs/iomap/buffered-io.c-1267-
--
fs/ntfs/file.c=254=static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
--
fs/ntfs/file.c-282-		i_size_write(vi, attr->ia_size);
fs/ntfs/file.c:283:		pagecache_isize_extended(vi, old_size, attr->ia_size);
fs/ntfs/file.c-284-	} else {
--
fs/ntfs/file.c=1127=static long ntfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
--
fs/ntfs/file.c-1198-		truncate_pagecache(vi, old_size);
fs/ntfs/file.c:1199:		pagecache_isize_extended(vi, old_size, offset);
fs/ntfs/file.c-1200-	}
--
fs/orangefs/inode.c=697=static int orangefs_setattr_size(struct inode *inode, struct iattr *iattr)
--
fs/orangefs/inode.c-726-	if (iattr->ia_size > orig_size)
fs/orangefs/inode.c:727:		pagecache_isize_extended(inode, orig_size, iattr->ia_size);
fs/orangefs/inode.c-728-
--
fs/smb/client/inode.c=3056=void cifs_setsize(struct inode *inode, loff_t offset)
--
fs/smb/client/inode.c-3074-	if (offset > old_size)
fs/smb/client/inode.c:3075:		pagecache_isize_extended(inode, old_size, offset);
fs/smb/client/inode.c-3076-	truncate_pagecache(inode, offset);
]

413/4 2026/09/17 11:49 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 56680
							output: 27
							thoughts: 1432
						

Thoughts:
**Analyzing the NTFS File Size Setting Logic**

Okay, so I'm diving into this `ntfs_setattr` issue. The user is directing my attention to how file size changes are handled in NTFS, specifically concerning the order of operations when truncating or extending a file. The prompt pointed me to `fs/ntfs/file.c` and other potential areas.

Initially, I reviewed the code snippet in `fs/ntfs/file.c` (lines 275-294), the provided example. It showed the existing logic, with checks for size increase/decrease, followed by calls to functions like `truncate_pagecache`, `i_size_write`, and `pagecache_isize_extended`. And the locking.

The key here is what the user said: shrinking versus extending file size. The user made it very clear in the prompt that there's a strict ordering requirement. When shrinking (`newsize < oldsize`), `truncate_setsize` *must* come before `ntfs_set_size`. Conversely, when extending (`newsize > oldsize`), `ntfs_set_size` *must* come before `truncate_setsize` or its equivalent. Always protected by the `filemap_invalidate_lock`.

I'm now thinking: the user is not just pointing out a potential bug, but a critical one! The issue is the user specifically wrote this out, so they must be assuming there's an issue with the code.

Now I'm digging into `truncate_setsize` itself. I had to clarify what happens *inside* this function, specifically if `newsize` is greater than `oldsize`. I found that `truncate_setsize` does the `i_size_write` *and* `pagecache_isize_extended` operations, essentially doing the "or" part of the prompt. That's a good thing!

I need to confirm the sequence for both shrinking and extending cases. I have to confirm `truncate_setsize` is handling both sides of the issue.

Let's summarize:

*   **Shrinking:** `truncate_setsize` updates `i_size`, and truncates the pagecache. Then, `ntfs_set_size` is called. Error handling returns the size.
*   **Extending:** `ntfs_set_size` is called. Error handling? Call `truncate_setsize`.

Ah ha! `truncate_setsize` *does* the correct steps in the extending case.

I need to determine if `truncate_setsize` is optimal in both cases, or if doing `i_size_write` + `pagecache_isize_extended` is preferred. And then I remembered something - the prompt said or, which I assumed because it said it! The user explicitly parenthesized `(or i_size_write + pagecache_isize_extended)` as an explanation of what `truncate_setsize` is.

Is `truncate_setsize` the cleaner approach? It looks like it is. It combines the operations into a single function call.

Now I need to check how other filesystems implement this logic and review any similar `ntfs_setattr` implementations.



414/4 2026/09/17 11:49 tool grepper
0m Args:
map[Expression:truncate_setsize\( PathPrefix:fs/]

Results:
map[Output:fs/9p/vfs_inode.c=1017=static int v9fs_vfs_setattr(struct mnt_idmap *idmap,
--
fs/9p/vfs_inode.c-1081-		 iattr->ia_size != i_size_read(inode)) {
fs/9p/vfs_inode.c:1082:		truncate_setsize(inode, iattr->ia_size);
fs/9p/vfs_inode.c-1083-		netfs_resize_file(netfs_inode(inode), iattr->ia_size, true);
--
fs/9p/vfs_inode_dotl.c=511=int v9fs_vfs_setattr_dotl(struct mnt_idmap *idmap,
--
fs/9p/vfs_inode_dotl.c-576-		 i_size_read(inode)) {
fs/9p/vfs_inode_dotl.c:577:		truncate_setsize(inode, iattr->ia_size);
fs/9p/vfs_inode_dotl.c-578-		netfs_resize_file(netfs_inode(inode), iattr->ia_size, true);
--
fs/adfs/inode.c=302=adfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
--
fs/adfs/inode.c-323-	if (ia_valid & ATTR_SIZE)
fs/adfs/inode.c:324:		truncate_setsize(inode, attr->ia_size);
fs/adfs/inode.c-325-
--
fs/affs/inode.c=216=affs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr)
--
fs/affs/inode.c-244-
fs/affs/inode.c:245:		truncate_setsize(inode, attr->ia_size);
fs/affs/inode.c-246-		affs_truncate(inode);
--
fs/afs/inode.c=762=int afs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/afs/inode.c-816-		    attr->ia_size > netfs_read_remote_i_size(inode)) {
fs/afs/inode.c:817:			truncate_setsize(inode, attr->ia_size);
fs/afs/inode.c-818-			netfs_resize_file(&vnode->netfs, size, false);
--
fs/aio.c=360=static void put_aio_ring_file(struct kioctx *ctx)
--
fs/aio.c-366-
fs/aio.c:367:		truncate_setsize(inode, 0);
fs/aio.c-368-
--
fs/btrfs/file.c=1526=int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
--
fs/btrfs/file.c-1809- * protect against truncate races as the page could now be beyond EOF.  Because
fs/btrfs/file.c:1810: * truncate_setsize() writes the inode size before removing pages, once we have
fs/btrfs/file.c-1811- * the page lock we can determine safely if the page is beyond EOF. If it is not
--
fs/btrfs/inode.c=5391=static int btrfs_setsize(struct inode *inode, struct iattr *attr)
--
fs/btrfs/inode.c-5460-
fs/btrfs/inode.c:5461:		truncate_setsize(inode, newsize);
fs/btrfs/inode.c-5462-
--
fs/ecryptfs/inode.c=733=static int __ecryptfs_truncate(struct dentry *dentry, const struct iattr *ia)
--
fs/ecryptfs/inode.c-784-	if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) {
fs/ecryptfs/inode.c:785:		truncate_setsize(inode, ia->ia_size);
fs/ecryptfs/inode.c-786-		lower_ia.ia_size = ia->ia_size;
--
fs/ecryptfs/inode.c-804-	}
fs/ecryptfs/inode.c:805:	truncate_setsize(inode, ia->ia_size);
fs/ecryptfs/inode.c-806-	rc = ecryptfs_write_inode_size_to_metadata(inode);
--
fs/exfat/file.c=350=int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/exfat/file.c-415-		inode_dio_wait(inode);
fs/exfat/file.c:416:		truncate_setsize(inode, attr->ia_size);
fs/exfat/file.c-417-
--
fs/exfat/file.c=754=static int exfat_extend_valid_size(struct inode *inode, loff_t new_valid_size)
--
fs/exfat/file.c-786-		if (ret) {
fs/exfat/file.c:787:			truncate_setsize(inode, old_valid_size);
fs/exfat/file.c-788-			exfat_truncate(inode);
--
fs/ext2/inode.c=1237=static int ext2_setsize(struct inode *inode, loff_t newsize)
--
fs/ext2/inode.c-1255-	filemap_invalidate_lock(inode->i_mapping);
fs/ext2/inode.c:1256:	truncate_setsize(inode, newsize);
fs/ext2/inode.c-1257-	__ext2_truncate_blocks(inode, newsize);
--
fs/f2fs/file.c=637=static int finish_preallocate_blocks(struct inode *inode)
--
fs/f2fs/file.c-657-
fs/f2fs/file.c:658:	truncate_setsize(inode, i_size_read(inode));
fs/f2fs/file.c-659-	ret = f2fs_truncate(inode);
--
fs/f2fs/file.c=1124=int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/f2fs/file.c-1235-		}
fs/f2fs/file.c:1236:		truncate_setsize(inode, attr->ia_size);
fs/f2fs/file.c-1237-
--
fs/f2fs/file.c=3879=static int f2fs_ioc_release_dev_alias(struct file *filp)
--
fs/f2fs/file.c-3929-	filemap_invalidate_lock(inode->i_mapping);
fs/f2fs/file.c:3930:	truncate_setsize(inode, 0);
fs/f2fs/file.c-3931-
--
fs/fat/file.c=517=int fat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/fat/file.c-586-		down_write(&MSDOS_I(inode)->truncate_lock);
fs/fat/file.c:587:		truncate_setsize(inode, attr->ia_size);
fs/fat/file.c-588-		fat_truncate_blocks(inode, attr->ia_size);
--
fs/gfs2/bmap.c=2095=static int do_grow(struct inode *inode, u64 size)
--
fs/gfs2/bmap.c-2138-
fs/gfs2/bmap.c:2139:	truncate_setsize(inode, size);
fs/gfs2/bmap.c-2140-	inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_current(&ip->i_inode));
--
fs/hfs/inode.c=646=int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/hfs/inode.c-686-
fs/hfs/inode.c:687:		truncate_setsize(inode, attr->ia_size);
fs/hfs/inode.c-688-		hfs_file_truncate(inode);
--
fs/hfsplus/inode.c=308=static int hfsplus_setattr(struct mnt_idmap *idmap,
--
fs/hfsplus/inode.c-326-		}
fs/hfsplus/inode.c:327:		truncate_setsize(inode, attr->ia_size);
fs/hfsplus/inode.c-328-		hfsplus_file_truncate(inode);
--
fs/hostfs/hostfs_kern.c=804=static int hostfs_setattr(struct mnt_idmap *idmap,
--
fs/hostfs/hostfs_kern.c-868-	    attr->ia_size != i_size_read(inode))
fs/hostfs/hostfs_kern.c:869:		truncate_setsize(inode, attr->ia_size);
fs/hostfs/hostfs_kern.c-870-
--
fs/hpfs/inode.c=260=int hpfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/hpfs/inode.c-287-
fs/hpfs/inode.c:288:		truncate_setsize(inode, attr->ia_size);
fs/hpfs/inode.c-289-		hpfs_truncate(inode);
--
fs/jffs2/fs.c=32=int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
--
fs/jffs2/fs.c-179-
fs/jffs2/fs.c:180:	/* We have to do the truncate_setsize() without f->sem held, since
fs/jffs2/fs.c-181-	   some pages may be locked and waiting for it in read_folio().
--
fs/jffs2/fs.c-185-	if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) {
fs/jffs2/fs.c:186:		truncate_setsize(inode, iattr->ia_size);
fs/jffs2/fs.c-187-		inode->i_blocks = (inode->i_size + 511) >> 9;
--
fs/jfs/file.c=92=int jfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/jfs/file.c-121-
fs/jfs/file.c:122:		truncate_setsize(inode, iattr->ia_size);
fs/jfs/file.c-123-		jfs_truncate(inode);
--
fs/libfs.c=916=int simple_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/libfs.c-926-	if (iattr->ia_valid & ATTR_SIZE)
fs/libfs.c:927:		truncate_setsize(inode, iattr->ia_size);
fs/libfs.c-928-	setattr_copy(idmap, inode, iattr);
--
fs/minix/file.c=26=static int minix_setattr(struct mnt_idmap *idmap,
--
fs/minix/file.c-41-
fs/minix/file.c:42:		truncate_setsize(inode, attr->ia_size);
fs/minix/file.c-43-		minix_truncate(inode);
--
fs/nilfs2/inode.c=907=int nilfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/nilfs2/inode.c-925-		inode_dio_wait(inode);
fs/nilfs2/inode.c:926:		truncate_setsize(inode, iattr->ia_size);
fs/nilfs2/inode.c-927-		nilfs_truncate(inode);
--
fs/ntfs/file.c=254=static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
--
fs/ntfs/file.c-284-	} else {
fs/ntfs/file.c:285:		truncate_setsize(vi, attr->ia_size);
fs/ntfs/file.c-286-	}
--
fs/ntfs/file.c=579=static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
--
fs/ntfs/file.c-664-		if (ni->data_size != old_data_size) {
fs/ntfs/file.c:665:			truncate_setsize(vi, old_data_size);
fs/ntfs/file.c-666-			ntfs_attr_truncate(ni, old_data_size);
--
fs/ntfs/inode.c=375=int ntfs_drop_big_inode(struct inode *inode)
--
fs/ntfs/inode.c-390-
fs/ntfs/inode.c:391:				truncate_setsize(VFS_I(ni), 0);
fs/ntfs/inode.c-392-				ntfs_truncate_vfs(VFS_I(ni), 0, 1);
--
fs/ntfs/inode.c=2410=int ntfs_extend_initialized_size(struct inode *vi, const loff_t offset,
--
fs/ntfs/inode.c-2444-	if (err)
fs/ntfs/inode.c:2445:		truncate_setsize(vi, old_init_size);
fs/ntfs/inode.c-2446-	return err;
--
fs/ntfs3/attrib.c=2009=int attr_collapse_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
--
fs/ntfs3/attrib.c-2057-		/* Simple truncate file at 'vbo'. */
fs/ntfs3/attrib.c:2058:		truncate_setsize(&ni->vfs_inode, vbo);
fs/ntfs3/attrib.c-2059-		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name,
--
fs/ntfs3/file.c=706=int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ntfs3/file.c-738-		if (newsize != oldsize) {
fs/ntfs3/file.c:739:			truncate_setsize(inode, newsize);
fs/ntfs3/file.c-740-
--
fs/omfs/file.c=341=static int omfs_setattr(struct mnt_idmap *idmap,
--
fs/omfs/file.c-355-			return error;
fs/omfs/file.c:356:		truncate_setsize(inode, attr->ia_size);
fs/omfs/file.c-357-		omfs_truncate(inode);
--
fs/ramfs/file-nommu.c=135=static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size)
--
fs/ramfs/file-nommu.c-154-
fs/ramfs/file-nommu.c:155:	truncate_setsize(inode, newsize);
fs/ramfs/file-nommu.c-156-	return 0;
--
fs/smb/client/cifsfs.c=1519=ssize_t cifs_file_copychunk_range(unsigned int xid,
--
fs/smb/client/cifsfs.c-1596-		if (rc > 0 && destoff + rc > i_size_read(target_inode)) {
fs/smb/client/cifsfs.c:1597:			truncate_setsize(target_inode, destoff + rc);
fs/smb/client/cifsfs.c-1598-			netfs_resize_file(&target_cifsi->netfs,
--
fs/smb/client/smb2ops.c=3508=static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-3568-		if (rc >= 0) {
fs/smb/client/smb2ops.c:3569:			truncate_setsize(inode, new_size);
fs/smb/client/smb2ops.c-3570-			spin_lock(&inode->i_lock);
--
fs/smb/client/smb2ops.c=4014=static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4064-
fs/smb/client/smb2ops.c:4065:	truncate_setsize(inode, new_eof);
fs/smb/client/smb2ops.c-4066-	spin_lock(&inode->i_lock);
--
fs/smb/client/smb2ops.c=4078=static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
--
fs/smb/client/smb2ops.c-4127-
fs/smb/client/smb2ops.c:4128:	truncate_setsize(inode, new_eof);
fs/smb/client/smb2ops.c-4129-	spin_lock(&inode->i_lock);
--
fs/ubifs/file.c=883=static int do_writepage(struct folio *folio, size_t len)
--
fs/ubifs/file.c-958- * same time. And the problematic one is truncation to smaller size, from where
fs/ubifs/file.c:959: * we have to call 'truncate_setsize()', which first changes @inode->i_size,
fs/ubifs/file.c-960- * then drops the truncated pages. And while dropping the pages, it takes the
fs/ubifs/file.c:961: * page lock. This means that 'do_truncation()' cannot call 'truncate_setsize()'
fs/ubifs/file.c-962- * with @ui_mutex locked, because it would deadlock with 'ubifs_writepage()'.
--
fs/ubifs/file.c=1100=static int do_truncation(struct ubifs_info *c, struct inode *inode,
--
fs/ubifs/file.c-1133-
fs/ubifs/file.c:1134:	truncate_setsize(inode, new_size);
fs/ubifs/file.c-1135-
--
fs/ubifs/file.c=1208=static int do_setattr(struct ubifs_info *c, struct inode *inode,
--
fs/ubifs/file.c-1222-		dbg_gen("size %lld -> %lld", inode->i_size, new_size);
fs/ubifs/file.c:1223:		truncate_setsize(inode, new_size);
fs/ubifs/file.c-1224-	}
--
fs/ubifs/file.c-1229-		inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
fs/ubifs/file.c:1230:		/* 'truncate_setsize()' changed @i_size, update @ui_size */
fs/ubifs/file.c-1231-		ui->ui_size = inode->i_size;
--
fs/ubifs/ubifs.h=334=struct ubifs_gced_idx_leb {
--
fs/ubifs/ubifs.h-393- * make sure @inode->i_size is always changed under @ui_mutex, because it
fs/ubifs/ubifs.h:394: * cannot call 'truncate_setsize()' with @ui_mutex locked, because it would
fs/ubifs/ubifs.h-395- * deadlock with 'ubifs_writepage()' (see file.c). All the other inode fields
--
fs/udf/inode.c=1280=int udf_setsize(struct inode *inode, loff_t newsize)
--
fs/udf/inode.c-1307-set_size:
fs/udf/inode.c:1308:		truncate_setsize(inode, newsize);
fs/udf/inode.c-1309-	} else {
--
fs/udf/inode.c-1316-			iinfo->i_lenAlloc = newsize;
fs/udf/inode.c:1317:			truncate_setsize(inode, newsize);
fs/udf/inode.c-1318-			up_write(&iinfo->i_data_sem);
--
fs/udf/inode.c-1324-			return err;
fs/udf/inode.c:1325:		truncate_setsize(inode, newsize);
fs/udf/inode.c-1326-		down_write(&iinfo->i_data_sem);
--
fs/ufs/inode.c=1167=static int ufs_truncate(struct inode *inode, loff_t size)
--
fs/ufs/inode.c-1187-
fs/ufs/inode.c:1188:	truncate_setsize(inode, size);
fs/ufs/inode.c-1189-
--
fs/xfs/xfs_iops.c=905=xfs_vn_setattr_size(
--
fs/xfs/xfs_iops.c-1008-	 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
fs/xfs/xfs_iops.c:1009:	 * complete. The truncate_setsize() call also cleans partial EOF page
fs/xfs/xfs_iops.c-1010-	 * PTEs on extending truncates and hence ensures sub-page block size
--
fs/xfs/xfs_iops.c-1025-	 */
fs/xfs/xfs_iops.c:1026:	truncate_setsize(inode, newsize);
fs/xfs/xfs_iops.c-1027-
--
fs/zonefs/file.c=203=int zonefs_file_truncate(struct inode *inode, loff_t isize)
--
fs/zonefs/file.c-261-	zonefs_update_stats(inode, isize);
fs/zonefs/file.c:262:	truncate_setsize(inode, isize);
fs/zonefs/file.c-263-	z->z_wpoffset = isize;
]

415/4 2026/09/17 11:49 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 64922
							output: 41
							thoughts: 43
						

Thoughts:
Here's my take on the thought process, as requested:

**Diving into `xfs_iops.c`**

Alright, time to dig into the XFS code, specifically `fs/xfs/xfs_iops.c`. I need to get a handle on how I/O operations are managed at a lower level within that file system. Let's zero in around line 1000. That's a reasonable place to start – hopefully, it's near some interesting function or data structure related to I/O scheduling, queueing, or perhaps even error handling. I'll be looking for clues about the interaction between the VFS layer and the XFS implementation, and trying to spot anything related to performance bottlenecks or optimizations.



416/4 2026/09/17 11:50 tool read-file
0m Args:
map[File:fs/xfs/xfs_iops.c FirstLine:1000 LineCount:40]

Results:
map[Contents:1000:			xfs_zoned_space_unreserve(mp, &ac);
1001:	
1002:		if (error)
1003:			return error;
1004:	
1005:		/*
1006:		 * We've already locked out new page faults, so now we can safely remove
1007:		 * pages from the page cache knowing they won't get refaulted until we
1008:		 * drop the XFS_MMAP_EXCL lock after the extent manipulations are
1009:		 * complete. The truncate_setsize() call also cleans partial EOF page
1010:		 * PTEs on extending truncates and hence ensures sub-page block size
1011:		 * filesystems are correctly handled, too.
1012:		 *
1013:		 * We have to do all the page cache truncate work outside the
1014:		 * transaction context as the "lock" order is page lock->log space
1015:		 * reservation as defined by extent allocation in the writeback path.
1016:		 * Hence a truncate can fail with ENOMEM from xfs_trans_alloc(), but
1017:		 * having already truncated the in-memory version of the file (i.e. made
1018:		 * user visible changes). There's not much we can do about this, except
1019:		 * to hope that the caller sees ENOMEM and retries the truncate
1020:		 * operation.
1021:		 *
1022:		 * And we update in-core i_size and truncate page cache beyond newsize
1023:		 * before writeback the [i_disk_size, newsize] range, so we're
1024:		 * guaranteed not to write stale data past the new EOF on truncate down.
1025:		 */
1026:		truncate_setsize(inode, newsize);
1027:	
1028:		/*
1029:		 * We are going to log the inode size change in this transaction so
1030:		 * any previous writes that are beyond the on disk EOF and the new
1031:		 * EOF that have not been written out need to be written here.  If we
1032:		 * do not write the data out, we expose ourselves to the null files
1033:		 * problem. Note that this includes any block zeroing we did above;
1034:		 * otherwise those blocks may not be zeroed after a crash.
1035:		 */
1036:		if (did_zeroing ||
1037:		    (newsize > ip->i_disk_size && oldsize != ip->i_disk_size)) {
1038:			error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping,
1039:							ip->i_disk_size, newsize - 1);
]

417/4 2026/09/17 11:50 llm codeexpert-compressor
0m Model:
gemini-3.8-flash

Reply:
### Summary of Investigation and Workspace State

#### 1. Goal and Problem Statement
Task: Write a patch for `ntfs_setattr` implementing the following logic:
- If `newsize < oldsize` (shrinking): `truncate_setsize` must be called before `ntfs_set_size`.
- If `newsize > oldsize` (extending): `ntfs_set_size` must be called before `truncate_setsize` (or `i_size_write` + `pagecache_isize_extended`).
- Both cases must be protected by `filemap_invalidate_lock(inode->i_mapping)` and unlocked with `filemap_invalidate_unlock(inode->i_mapping)`.

Note: `fs/ntfs3` is the target NTFS implementation (not legacy `fs/ntfs`), because `fs/ntfs3/file.c` defines `ntfs_setattr` and calls `ntfs_set_size`, whereas legacy `fs/ntfs` uses `ntfs_truncate_vfs` inside `ntfs_setattr_size`.

#### 2. Approaches Tried and Results
- Searched for `ntfs_setattr` across the tree:
  - Found in `fs/ntfs/file.c` (legacy NTFS: calls `ntfs_setattr_size` -> `ntfs_truncate_vfs`, already has partial invalidate locking from old commit).
  - Found in `fs/ntfs3/file.c` at line 706 (NTFS3: currently calls `ntfs_set_size`).
- Searched for `ntfs_set_size`:
  - Defined in `fs/ntfs3/inode.c:883` (`int ntfs_set_size(struct inode *inode, u64 new_size)`).
  - Declared in `fs/ntfs3/ntfs_fs.h:802`.
  - Used in `fs/ntfs3/file.c` (in `ntfs_fallocate`, `ntfs_setattr`, `ntfs_file_write_iter`).
  - Confirmed target of the patch is `fs/ntfs3/file.c:ntfs_setattr`.
- Examined `git-log` for recent commit history:
  - Shallow repository or single commit visible (`fd73f4a66598 Linux 7.3-rc3`). Avoid broad git-log queries.
- Examined `truncate_setsize` definition (`mm/truncate.c:816-824`):
  ```c
  void truncate_setsize(struct inode *inode, loff_t newsize)
  {
      loff_t oldsize = inode->i_size;

      i_size_write(inode, newsize);
      if (newsize > oldsize)
          pagecache_isize_extended(inode, oldsize, newsize);
      truncate_pagecache(inode, newsize);
  }
  ```
  Note: When extending (`newsize > oldsize`), `truncate_setsize(inode, newsize)` updates `i_size_write` and calls `pagecache_isize_extended(inode, oldsize, newsize)` followed by `truncate_pagecache(inode, newsize)`. Alternatively, if `ntfs_set_size` is called before `truncate_setsize`, calling `truncate_setsize(inode, newsize)` will see `oldsize = inode->i_size` (which would already be `oldsize` if inode i_size was not yet updated), or if calling `truncate_setsize(inode, newsize)` directly after `ntfs_set_size`:
  If `ntfs_set_size` succeeds, `inode->i_size` has NOT been updated yet by `ntfs_set_size` (need to inspect `ntfs_set_size`), so `truncate_setsize(inode, newsize)` can be called, OR explicitly `i_size_write(inode, newsize); pagecache_isize_extended(inode, oldsize, newsize);`.

#### 3. Key Source Code Snippets

##### `fs/ntfs3/file.c:706-775` (Current `ntfs_setattr` implementation):
```c
int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
		 struct iattr *attr)
{
	struct inode *inode = d_inode(dentry);
	struct ntfs_inode *ni = ntfs_i(inode);
	u32 ia_valid = attr->ia_valid;
	umode_t mode = inode->i_mode;
	int err;

	/* Avoid any operation if inode is bad. */
	if (unlikely(is_bad_ni(ni)))
		return -EINVAL;

	if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
		return -EIO;

	err = setattr_prepare(idmap, dentry, attr);
	if (err)
		goto out;

	if (ia_valid & ATTR_SIZE) {
		loff_t newsize, oldsize;

		if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
			/* Should never be here, see ntfs_file_open(). */
			err = -EOPNOTSUPP;
			goto out;
		}
		inode_dio_wait(inode);
		oldsize = i_size_read(inode);
		newsize = attr->ia_size;

		if (newsize != oldsize) {
			truncate_setsize(inode, newsize);

			err = ntfs_set_size(inode, newsize);
			if (err) {
				i_size_write(inode, oldsize);
				goto out;
			}

			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
			inode_set_mtime_to_ts(inode,
					      inode_set_ctime_current(inode));
		}
	}

	setattr_copy(idmap, inode, attr);
...
```

#### 4. Active Hypotheses and Details to Verify
1. **Behavior of `ntfs_set_size` (`fs/ntfs3/inode.c:883`)**:
   Need to check if `ntfs_set_size(inode, new_size)` modifies `inode->i_size` directly or leaves it to caller.
   Also check if `ntfs_fallocate` in `fs/ntfs3/file.c` does locking with `filemap_invalidate_lock`.
   Lines 519-521 in `ntfs_fallocate`:
   ```c
   inode_dio_wait(inode);
   filemap_invalidate_lock(mapping);
   ```
2. **Logic needed in `fs/ntfs3/file.c:ntfs_setattr`**:
   Around line 738:
   ```c
   if (newsize != oldsize) {
       filemap_invalidate_lock(inode->i_mapping);
       if (newsize < oldsize) {
           truncate_setsize(inode, newsize);
           err = ntfs_set_size(inode, newsize);
           if (err)
               i_size_write(inode, oldsize);
       } else {
           err = ntfs_set_size(inode, newsize);
           if (!err) {
               // either truncate_setsize(inode, newsize) or:
               // i_size_write(inode, newsize);
               // pagecache_isize_extended(inode, oldsize, newsize);
           }
       }
       filemap_invalidate_unlock(inode->i_mapping);
       if (err)
           goto out;

       ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
       ...
   }
   ```
   Need to check what error handling and unwinding happens if `ntfs_set_size` fails, and how `truncate_setsize` / `pagecache_isize_extended` is expected to be written according to the prompt specifications.

3. **Check `ntfs_set_size` in `fs/ntfs3/inode.c`**:
   Read `ntfs_set_size` to see its exact mechanics with respect to `inode->i_size` and error rollback.

#### 5. Watchouts / Dead Ends
- Do not check git history further without specific commit/tag because broad git queries timeout and the repository appears to be a shallow root commit at `fd73f4a66598`.
- Remember to call `set-results` tool once before the final reply when completing the patch.

Tokens:
							input: 41564
							output: 2021
							thoughts: 0
						

418/4 2026/09/17 11:50 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 22093
							output: 36
							thoughts: 0
						

419/4 2026/09/17 11:50 tool read-file
0m Args:
map[File:fs/ntfs/file.c FirstLine:250 LineCount:45]

Results:
map[Contents: 250:			blkdev_issue_flush(vi->i_sb->s_bdev);
 251:		return ret;
 252:	}
 253:	
 254:	static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)
 255:	{
 256:		struct ntfs_inode *ni = NTFS_I(vi);
 257:		int err;
 258:		loff_t old_size = vi->i_size;
 259:	
 260:		if (NInoCompressed(ni) || NInoEncrypted(ni) || NInoWofCompressed(ni)) {
 261:			ntfs_warning(
 262:				vi->i_sb,
 263:				"Changes in inode size are not supported yet for %s files.",
 264:				NInoEncrypted(ni) ? "encrypted" : "compressed");
 265:			return -EOPNOTSUPP;
 266:		}
 267:	
 268:		err = inode_newsize_ok(vi, attr->ia_size);
 269:		if (err)
 270:			return err;
 271:	
 272:		inode_dio_wait(vi);
 273:	
 274:		/*
 275:		 * Serialize with page faults and pagecache instantiation so that
 276:		 * readers cannot observe the size change until the attribute
 277:		 * updates below have completed.
 278:		 */
 279:		filemap_invalidate_lock(vi->i_mapping);
 280:		if (attr->ia_size > old_size) {
 281:			truncate_pagecache(vi, old_size);
 282:			i_size_write(vi, attr->ia_size);
 283:			pagecache_isize_extended(vi, old_size, attr->ia_size);
 284:		} else {
 285:			truncate_setsize(vi, attr->ia_size);
 286:		}
 287:	
 288:		err = ntfs_truncate_vfs(vi, attr->ia_size, old_size);
 289:		if (err)
 290:			i_size_write(vi, old_size);
 291:		filemap_invalidate_unlock(vi->i_mapping);
 292:	
 293:		return err;
 294:	}
]

420/4 2026/09/17 11:50 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 22814
							output: 37
							thoughts: 337
						

Thoughts:
**Analyzing the NTFS Attribute Setting Logic**

Okay, first things first, the prompt is crystal clear. It's essentially laying out the precise ordering of operations for resizing files within the NTFS filesystem. The prompt states that if `newsize < oldsize` (shrinking), then `truncate_setsize` *must* come before `ntfs_set_size`. Conversely, if `newsize > oldsize` (extending), then `ntfs_set_size` *must* come before `truncate_setsize`, or its equivalent sequence, `i_size_write` and `pagecache_isize_extended`. And, critically, both scenarios *require* protection via `filemap_invalidate_lock(inode->i_mapping)`. This is not just a suggestion; it's a hard requirement. The prompt effectively gives me the structure I need to implement.

Now, let's drill down. I need to make sure I get this exactly right for `ntfs_setattr`. The prompt is focusing on the behavior that this function implements. I've already glanced at `fs/ntfs/file.c` lines 279-291, but let's go back and carefully analyze the actual code in `fs/ntfs3/file.c:ntfs_setattr`. Specifically, I need to understand the existing logic and then meticulously incorporate the ordering and locking constraints specified in the prompt. I will go and reread `fs/ntfs3/file.c` around line 706 again for a fuller understanding. This is crucial for building the patch.



421/4 2026/09/17 11:51 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:705 LineCount:70]

Results:
map[Contents: 705:	 */
 706:	int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 707:			 struct iattr *attr)
 708:	{
 709:		struct inode *inode = d_inode(dentry);
 710:		struct ntfs_inode *ni = ntfs_i(inode);
 711:		u32 ia_valid = attr->ia_valid;
 712:		umode_t mode = inode->i_mode;
 713:		int err;
 714:	
 715:		/* Avoid any operation if inode is bad. */
 716:		if (unlikely(is_bad_ni(ni)))
 717:			return -EINVAL;
 718:	
 719:		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
 720:			return -EIO;
 721:	
 722:		err = setattr_prepare(idmap, dentry, attr);
 723:		if (err)
 724:			goto out;
 725:	
 726:		if (ia_valid & ATTR_SIZE) {
 727:			loff_t newsize, oldsize;
 728:	
 729:			if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
 730:				/* Should never be here, see ntfs_file_open(). */
 731:				err = -EOPNOTSUPP;
 732:				goto out;
 733:			}
 734:			inode_dio_wait(inode);
 735:			oldsize = i_size_read(inode);
 736:			newsize = attr->ia_size;
 737:	
 738:			if (newsize != oldsize) {
 739:				truncate_setsize(inode, newsize);
 740:	
 741:				err = ntfs_set_size(inode, newsize);
 742:				if (err) {
 743:					i_size_write(inode, oldsize);
 744:					goto out;
 745:				}
 746:	
 747:				ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 748:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 749:				inode_set_mtime_to_ts(inode,
 750:						      inode_set_ctime_current(inode));
 751:			}
 752:		}
 753:	
 754:		setattr_copy(idmap, inode, attr);
 755:	
 756:		if (!is_ni_base(ni)) {
 757:			ia_valid &= ~ATTR_SIZE;
 758:		} else if (mode != inode->i_mode) {
 759:			err = ntfs_acl_chmod(idmap, dentry);
 760:			if (err)
 761:				goto out;
 762:	
 763:			/* Linux 'w' -> Windows 'ro'. */
 764:			if (0222 & inode->i_mode)
 765:				ni->std_fa &= ~FILE_ATTRIBUTE_READONLY;
 766:			else
 767:				ni->std_fa |= FILE_ATTRIBUTE_READONLY;
 768:		}
 769:	
 770:		if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE))
 771:			ntfs_save_wsl_perm(inode, NULL);
 772:		mark_inode_dirty(inode);
 773:	out:
 774:		return err;
]

422/4 2026/09/17 11:51 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 24564
							output: 31
							thoughts: 929
						

Thoughts:
**Analyzing NTFS Attribute Setting and Size Manipulation**

Okay, let's break this down. We're looking at `ntfs_setattr` in `fs/ntfs3/file.c` and how it handles file size changes. The core of the problem boils down to correctly sequencing calls to `truncate_setsize` and `ntfs_set_size` depending on whether we're shrinking or extending a file.

The key is that if we're shrinking (`newsize < oldsize`), `truncate_setsize` *must* come before `ntfs_set_size`.  However, if we are extending (`newsize > oldsize`), `ntfs_set_size` must come before either `truncate_setsize` or its functional equivalent using `i_size_write` and `pagecache_isize_extended`, both cases require protection by `filemap_invalidate_lock(inode->i_mapping)`.

I need to understand what actually happens with `truncate_setsize` when extending a file. Let me revisit the code: `truncate_setsize` calls `i_size_write` and, if extending, `pagecache_isize_extended`. The crucial thing here is that `ntfs_set_size` *does not* directly modify `inode->i_size`. It updates internal NTFS structures, but not the generic `i_size` field immediately. This means that if we were to call `truncate_setsize` *after* `ntfs_set_size` during an extension, `truncate_setsize` would see the *original* `inode->i_size` and effectively extend it correctly with the subsequent call to `i_size_write`.

But, what if `ntfs_set_size` fails during an extension? Then we have a problem. The current logic, as indicated by line 743, does not provide a rollback mechanism, and we might end up with inconsistencies. We need to handle this failure case.

And, of course, the lock. The provided question mentions the `filemap_invalidate_lock`.  We need to make absolutely sure that we're using that lock correctly, both before and after our operations. This should protect both scenarios, shrinking or extending. I think it is important to check other usages of `filemap_invalidate_` in `fs/ntfs3` to find how to better do this.

So, in essence, the correct sequence for extending is:
1.  Acquire `filemap_invalidate_lock`.
2.  `ntfs_set_size(inode, newsize)`.
3.  `truncate_setsize(inode, newsize)`.
4.  Release `filemap_invalidate_lock`.

For shrinking, the sequence is:
1.  Acquire `filemap_invalidate_lock`.
2.  `truncate_setsize(inode, newsize)`.
3.  `ntfs_set_size(inode, newsize)`.
4.  Release `filemap_invalidate_lock`.

And, we need robust error handling. If `ntfs_set_size` fails, we'll need to revert to the old size. Now I need to write a patch that implements this logic, keeping these considerations in mind.



423/4 2026/09/17 11:51 tool grepper
0m Args:
map[Expression:filemap_invalidate_ PathPrefix:fs/ntfs3/]

Results:
map[Output:fs/ntfs3/file.c=466=static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
--
fs/ntfs3/file.c-519-		inode_dio_wait(inode);
fs/ntfs3/file.c:520:		filemap_invalidate_lock(mapping);
fs/ntfs3/file.c-521-		map_locked = true;
--
fs/ntfs3/file.c-691-	if (map_locked)
fs/ntfs3/file.c:692:		filemap_invalidate_unlock(mapping);
fs/ntfs3/file.c-693-
]

424/4 2026/09/17 11:51 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 26422
							output: 37
							thoughts: 37
						

Thoughts:
Okay, here's my interpretation of that thought process, as if I were having it:

**Diving into NTFS Falloc:**

Right, so I need to understand how `ntfs_fallocate` in the `fs/ntfs3/file.c` code handles size modifications, specifically extending, shrinking, and locking. It's a critical function, so I'm going to dig in there. I want to see exactly how it manages those operations within the NTFS file system. I need to understand the low-level details of its implementation to assess its efficiency and potential edge cases. This will inform my understanding of the fs's overall approach to allocation and how it interacts with the on-disk structures. Let's see how they've handled this; I'm expecting some interesting considerations around clusters, extents, and the NTFS metadata.



425/4 2026/09/17 11:51 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:515 LineCount:80]

Results:
map[Contents: 515:		}
 516:	
 517:		if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
 518:			    FALLOC_FL_INSERT_RANGE)) {
 519:			inode_dio_wait(inode);
 520:			filemap_invalidate_lock(mapping);
 521:			map_locked = true;
 522:		}
 523:	
 524:		if (mode & FALLOC_FL_PUNCH_HOLE) {
 525:			u32 frame_size;
 526:			loff_t mask, vbo_a, end_a, tmp, from;
 527:	
 528:			err = filemap_write_and_wait_range(mapping, vbo_down,
 529:							   LLONG_MAX);
 530:			if (err)
 531:				goto out;
 532:	
 533:			truncate_pagecache(inode, vbo_down);
 534:	
 535:			ni_lock(ni);
 536:			err = attr_punch_hole(ni, vbo, len, &frame_size);
 537:			ni_unlock(ni);
 538:			if (!err)
 539:				goto ok;
 540:	
 541:			if (err != E_NTFS_NOTALIGNED)
 542:				goto out;
 543:	
 544:			/* Process not aligned punch. */
 545:			err = 0;
 546:			if (end > i_size)
 547:				end = i_size;
 548:			mask = frame_size - 1;
 549:			vbo_a = (vbo + mask) & ~mask;
 550:			end_a = end & ~mask;
 551:	
 552:			tmp = min(vbo_a, end);
 553:			from = min_t(loff_t, ni->i_valid, vbo);
 554:			/* Zero head of punch. */
 555:			if (tmp > from) {
 556:				err = iomap_zero_range(inode, from, tmp - from, NULL,
 557:						       &ntfs_iomap_ops,
 558:						       &ntfs_iomap_folio_ops, NULL);
 559:				if (err)
 560:					goto out;
 561:			}
 562:	
 563:			/* Aligned punch_hole. Deallocate clusters. */
 564:			if (end_a > vbo_a) {
 565:				ni_lock(ni);
 566:				err = attr_punch_hole(ni, vbo_a, end_a - vbo_a, NULL);
 567:				ni_unlock(ni);
 568:				if (err)
 569:					goto out;
 570:			}
 571:	
 572:			/* Zero tail of punch. */
 573:			if (vbo < end_a && end_a < end) {
 574:				err = iomap_zero_range(inode, end_a, end - end_a, NULL,
 575:						       &ntfs_iomap_ops,
 576:						       &ntfs_iomap_folio_ops, NULL);
 577:				if (err)
 578:					goto out;
 579:			}
 580:		} else if (mode & FALLOC_FL_COLLAPSE_RANGE) {
 581:			/*
 582:			 * Write tail of the last page before removed range since
 583:			 * it will get removed from the page cache below.
 584:			 */
 585:			err = filemap_write_and_wait_range(mapping, vbo_down, vbo);
 586:			if (err)
 587:				goto out;
 588:	
 589:			/*
 590:			 * Write data that will be shifted to preserve them
 591:			 * when discarding page cache below.
 592:			 */
 593:			err = filemap_write_and_wait_range(mapping, end, LLONG_MAX);
 594:			if (err)
]

426/4 2026/09/17 11:51 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 27877
							output: 37
							thoughts: 17
						

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

**Diving Deeper into `ntfs_fallocate` and Size Adjustments**

Okay, I'm thinking we need to zero in on how `ntfs_fallocate` handles size changes, specifically. We've seen some behavior that warrants a closer look around the boundary conditions and interactions with the NTFS file system metadata. My initial analysis suggests potential areas for further exploration. I need to understand this implementation in order to ensure the integrity of the file system. Let's dig deeper into the code around size adjustments and verify my assumptions.



427/4 2026/09/17 11:52 tool read-file
0m Args:
map[File:fs/ntfs3/file.c FirstLine:660 LineCount:45]

Results:
map[Contents: 660:			if (is_supported_holes) {
 661:				CLST vcn = vbo >> cluster_bits;
 662:				CLST cend = bytes_to_cluster(sbi, end);
 663:				CLST lcn, clen;
 664:				bool new;
 665:	
 666:				/*
 667:				 * Allocate and zero new clusters.
 668:				 */
 669:				for (; vcn < cend; vcn += clen) {
 670:					err = attr_data_get_block(ni, vcn, cend - vcn,
 671:								  &lcn, &clen, &new,
 672:								  true, NULL, false);
 673:					if (err)
 674:						goto out;
 675:				}
 676:			}
 677:	
 678:			if (mode & FALLOC_FL_KEEP_SIZE) {
 679:				err = ntfs_set_size(inode, i_size);
 680:				if (err)
 681:					goto out;
 682:			}
 683:		}
 684:	
 685:	ok:
 686:		err = file_modified(file);
 687:		if (err)
 688:			goto out;
 689:	
 690:	out:
 691:		if (map_locked)
 692:			filemap_invalidate_unlock(mapping);
 693:	
 694:		if (!err) {
 695:			inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
 696:			mark_inode_dirty(inode);
 697:		}
 698:	
 699:		inode_unlock(inode);
 700:		return err;
 701:	}
 702:	
 703:	/*
 704:	 * ntfs_setattr - inode_operations::setattr
]

428/4 2026/09/17 11:52 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 28640
							output: 46
							thoughts: 58
						

Thoughts:
Here's my thought process, as if I were considering this code:

**Diving into NTFS File Writes**

Okay, so I need to understand how file size modifications are handled within the NTFS3 filesystem, specifically regarding writes. I need to pinpoint the relevant code paths in `fs/ntfs3/file.c`. My immediate focus is on how the functions `truncate_setsize`, `i_size_write`, and `pagecache_isize_extended` are utilized. These likely play a crucial role in managing the on-disk file size and metadata. I'll start by systematically searching for their calls, particularly within the context of the `ntfs_file_write_iter` function, as that's my primary entry point for write operations. I need to see exactly how these size-related functions are orchestrated within this write path. Are they used for pre-allocation, extending the file, or handling writes that necessitate a change in the overall file size? I need to understand the control flow surrounding these functions within the write process to ensure integrity. I also want to make sure I am not missing any subtle interactions across them. I will scrutinize any conditional logic or error handling that interacts with these functions. This is where the magic happens!



429/4 2026/09/17 11:52 tool grepper
0m Args:
map[Expression:(truncate_setsize|pagecache_isize_extended|i_size_write) PathPrefix:fs/ntfs3/]

Results:
map[Output:fs/ntfs3/attrib.c=430=int attr_set_size_ex(struct ntfs_inode *ni, enum ATTR_TYPE type,
--
fs/ntfs3/attrib.c-888-
fs/ntfs3/attrib.c:889:		i_size_write(&ni->vfs_inode, new_size);
fs/ntfs3/attrib.c-890-
--
fs/ntfs3/attrib.c=2009=int attr_collapse_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
--
fs/ntfs3/attrib.c-2057-		/* Simple truncate file at 'vbo'. */
fs/ntfs3/attrib.c:2058:		truncate_setsize(&ni->vfs_inode, vbo);
fs/ntfs3/attrib.c-2059-		err = attr_set_size(ni, ATTR_DATA, ni->file.ads.name,
--
fs/ntfs3/attrib.c-2285-	ni->i_valid = valid_size;
fs/ntfs3/attrib.c:2286:	i_size_write(&ni->vfs_inode, data_size);
fs/ntfs3/attrib.c-2287-	inode_set_bytes(&ni->vfs_inode, total_size);
--
fs/ntfs3/attrib.c=2527=int attr_insert_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
--
fs/ntfs3/attrib.c-2719-done:
fs/ntfs3/attrib.c:2720:	i_size_write(&ni->vfs_inode, ni->vfs_inode.i_size + bytes);
fs/ntfs3/attrib.c-2721-	ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
--
fs/ntfs3/file.c=706=int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
--
fs/ntfs3/file.c-738-		if (newsize != oldsize) {
fs/ntfs3/file.c:739:			truncate_setsize(inode, newsize);
fs/ntfs3/file.c-740-
--
fs/ntfs3/file.c-742-			if (err) {
fs/ntfs3/file.c:743:				i_size_write(inode, oldsize);
fs/ntfs3/file.c-744-				goto out;
--
fs/ntfs3/file.c=984=static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
--
fs/ntfs3/file.c-1199-	if (iocb->ki_pos > i_size)
fs/ntfs3/file.c:1200:		i_size_write(inode, iocb->ki_pos);
fs/ntfs3/file.c-1201-
--
fs/ntfs3/index.c=1474=static int indx_create_allocate(struct ntfs_index *indx, struct ntfs_inode *ni,
--
fs/ntfs3/index.c-1507-	if (in->name == I30_NAME) {
fs/ntfs3/index.c:1508:		i_size_write(&ni->vfs_inode, data_size);
fs/ntfs3/index.c-1509-		inode_set_bytes(&ni->vfs_inode, alloc_size);
--
fs/ntfs3/index.c=1532=static int indx_add_allocate(struct ntfs_index *indx, struct ntfs_inode *ni,
--
fs/ntfs3/index.c-1605-	if (in->name == I30_NAME)
fs/ntfs3/index.c:1606:		i_size_write(&ni->vfs_inode, data_size);
fs/ntfs3/index.c-1607-
--
fs/ntfs3/index.c=2152=static int indx_shrink(struct ntfs_index *indx, struct ntfs_inode *ni,
--
fs/ntfs3/index.c-2203-	if (in->name == I30_NAME)
fs/ntfs3/index.c:2204:		i_size_write(&ni->vfs_inode, new_data);
fs/ntfs3/index.c-2205-
--
fs/ntfs3/index.c=2369=int indx_delete_entry(struct ntfs_index *indx, struct ntfs_inode *ni,
--
fs/ntfs3/index.c-2705-		if (in->name == I30_NAME)
fs/ntfs3/index.c:2706:			i_size_write(&ni->vfs_inode, 0);
fs/ntfs3/index.c-2707-
]

430/4 2026/09/17 11:52 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 30315
							output: 37
							thoughts: 22
						

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

**Diving into the NTFS3 Attribute Code**

Okay, time to get my hands dirty. I'm suspecting a potential issue with attribute handling in the NTFS3 driver. Given my experience, the general area where attribute modifications tend to happen, especially around potential size calculations or allocation, often manifests around the attribute list handling. My instinct points me to the `fs/ntfs3/attrib.c` file. Specifically, I'm going to jump straight into the vicinity of line 889. That location seems like a logical place to start digging deeper to understand the code responsible for managing, potentially modify attributes. Time to go check it out!



431/4 2026/09/17 11:53 tool read-file
0m Args:
map[File:fs/ntfs3/attrib.c FirstLine:880 LineCount:25]

Results:
map[Contents: 880:	
 881:		if ((type == ATTR_DATA || (type == ATTR_ALLOC && name == I30_NAME))) {
 882:			/* Update inode_set_bytes. */
 883:			if (attr_b->non_res &&
 884:			    inode_get_bytes(&ni->vfs_inode) != new_alloc) {
 885:				inode_set_bytes(&ni->vfs_inode, new_alloc);
 886:				dirty = true;
 887:			}
 888:	
 889:			i_size_write(&ni->vfs_inode, new_size);
 890:	
 891:			/* Don't forget to update duplicate information in parent. */
 892:			if (dirty) {
 893:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 894:				mark_inode_dirty(&ni->vfs_inode);
 895:			}
 896:		}
 897:	
 898:		return 0;
 899:	
 900:	undo_2:
 901:		vcn -= alen;
 902:		attr_b->nres.data_size = cpu_to_le64(old_size);
 903:		attr_b->nres.valid_size = cpu_to_le64(old_valid);
 904:		attr_b->nres.alloc_size = cpu_to_le64(old_alloc);
]

432/4 2026/09/17 11:53 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 30948
							output: 38
							thoughts: 75
						

Thoughts:
Okay, here's the summary of my thought process, as if I'm navigating this code:

**Diving into the File Attribute Size Adjustment**

Right, hold on a second. I need to take a closer look at something here. Let me zoom in on `fs/ntfs3/attrib.c:889`. Specifically, I see `attr_set_size_ex` within that file – which is being called by `attr_set_size`.

Hang on... I'm just quickly confirming my understanding here; Is `attr_set_size` the function that's calling `attr_set_size_ex`? Just double-checking the call graph to confirm the relationship... Time to check the source code for `attr_set_size`. I need to verify that call.



433/4 2026/09/17 11:53 tool codesearch-definition-source
0m Args:
map[ContextFile:fs/ntfs3/inode.c Name:attr_set_size]

Results:
map[SourceCode: 473:	static inline int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
 474:					const __le16 *name, u8 name_len,
 475:					struct runs_tree *run, u64 new_size,
 476:					const u64 *new_valid, bool keep_prealloc)
 477:	{
 478:		return attr_set_size_ex(ni, type, name, name_len, run, new_size,
 479:					new_valid, keep_prealloc, NULL, false);
 480:	}
 SourceFile:fs/ntfs3/ntfs_fs.h]

434/4 2026/09/17 11:53 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 31431
							output: 37
							thoughts: 957
						

Thoughts:
**Analyzing `ntfs_setattr` and File Size Updates**

Okay, let's break this down. First, I noticed that `attr_set_size_ex` within this system *does* indeed call `i_size_write(&ni->vfs_inode, new_size)`. But, is this the only path? I had to trace it. Based on the logic in `ntfs_set_size` and the conditional at line 881, specifically the conditions where `type` is `ATTR_DATA`, it confirms `attr_set_size_ex` is the execution path. This means that after a call to `ntfs_set_size(inode, newsize)`, the inode's size, `inode->i_size` *should* already be updated to `newsize`.

Now, if that's the case, calling `truncate_setsize(inode, newsize)` immediately after is critical. I had to confirm what `truncate_setsize` does. Looking at the code for `truncate_setsize`, it retrieves the `oldsize` from `inode->i_size`, then calls `i_size_write(inode, newsize)`. But, since `ntfs_set_size` has already updated `inode->i_size` to `newsize`, the initial `oldsize` will be equivalent to `newsize`. Therefore, the condition `newsize > oldsize` becomes `newsize > newsize`, which is false. This means that `pagecache_isize_extended` will *not* be called. This explains the prompt's condition.

The prompt specifically states that: if `newsize` is less than `oldsize` (shrinking), then `truncate_setsize` needs to be called before `ntfs_set_size`. If `newsize` is greater than `oldsize` (extending), then `ntfs_set_size` needs to be called before `truncate_setsize` (or rather, before `i_size_write` and `pagecache_isize_extended`, the implicit functions called after `ntfs_set_size`). And, crucially, both cases must be protected by `filemap_invalidate_lock(inode->i_mapping)`.

I need to create a patch for `ntfs_setattr` that correctly implements this sequencing and locking based on the comparison of the old and new sizes, making sure that there is no data corruption. The key is in the order of the calls and the condition in the size comparison, especially in light of the fact that `ntfs_set_size` directly modifies the inode's size.



435/4 2026/09/17 11:53 tool read-file
0m Args:
map[File:fs/ntfs3/attrib.c FirstLine:870 LineCount:45]

Results:
map[Contents: 870:	
 871:			if (attr_b->nres.valid_size != valid) {
 872:				attr_b->nres.valid_size = valid;
 873:				mi_b->dirty = true;
 874:			}
 875:		}
 876:	
 877:	ok1:
 878:		if (ret)
 879:			*ret = attr_b;
 880:	
 881:		if ((type == ATTR_DATA || (type == ATTR_ALLOC && name == I30_NAME))) {
 882:			/* Update inode_set_bytes. */
 883:			if (attr_b->non_res &&
 884:			    inode_get_bytes(&ni->vfs_inode) != new_alloc) {
 885:				inode_set_bytes(&ni->vfs_inode, new_alloc);
 886:				dirty = true;
 887:			}
 888:	
 889:			i_size_write(&ni->vfs_inode, new_size);
 890:	
 891:			/* Don't forget to update duplicate information in parent. */
 892:			if (dirty) {
 893:				ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 894:				mark_inode_dirty(&ni->vfs_inode);
 895:			}
 896:		}
 897:	
 898:		return 0;
 899:	
 900:	undo_2:
 901:		vcn -= alen;
 902:		attr_b->nres.data_size = cpu_to_le64(old_size);
 903:		attr_b->nres.valid_size = cpu_to_le64(old_valid);
 904:		attr_b->nres.alloc_size = cpu_to_le64(old_alloc);
 905:	
 906:		/* Restore 'attr' and 'mi'. */
 907:		if (attr)
 908:			goto restore_run;
 909:	
 910:		if (le64_to_cpu(attr_b->nres.svcn) <= svcn &&
 911:		    svcn <= le64_to_cpu(attr_b->nres.evcn)) {
 912:			attr = attr_b;
 913:			le = le_b;
 914:			mi = mi_b;
]

436/4 2026/09/17 11:53 llm codeexpert
0m Model:
gemini-3.8-flash

Tokens:
							input: 33803
							output: 968
							thoughts: 5890
						

Thoughts:
**Refactoring `ntfs_setattr` for Size Updates**

Okay, here's the breakdown of the changes needed for `ntfs_setattr`, incorporating the provided guidelines. I've been carefully reviewing this to ensure we're aligning with the principles for handling file size updates within the NTFS3 filesystem, particularly regarding the proper sequencing of `truncate_setsize`, `ntfs_set_size`, and the page cache.

The core of the issue revolves around ensuring data consistency and cache coherency when either shrinking or extending a file's size.  We need to use `filemap_invalidate_lock` and `filemap_invalidate_unlock` to guarantee exclusive access to the inode's mapping during these critical operations, as the prompt specifies.

Here’s the adjusted logic:

1.  **Locking:** We begin by acquiring the `filemap_invalidate_lock(inode->i_mapping)` before any size modifications and release it with `filemap_invalidate_unlock(inode->i_mapping)`. This provides the necessary protection against race conditions.

2.  **Shrinking (`newsize < oldsize`):**
    *   Call `truncate_setsize(inode, newsize)` *first*. This prepares the underlying blocks for the reduction.
    *   Then, call `err = ntfs_set_size(inode, newsize)`.
    *   If `ntfs_set_size` fails (returns a non-zero error), we *must* restore the original size using `i_size_write(inode, oldsize)`. This is essential for maintaining data integrity.

3.  **Extending (`newsize > oldsize`):**
    *   Call `err = ntfs_set_size(inode, newsize)`. This step modifies the NTFS data structures to reflect the new size.
    *   Here's where the nuance lies: since `ntfs_set_size` internally calls `i_size_write(&ni->vfs_inode, new_size);`, calling `truncate_setsize(inode, newsize)` *after* `ntfs_set_size` would result in a no-op call to `pagecache_isize_extended`. Thus:
        *   Option A (recommended and strictly correct): We need to *explicitly* handle the page cache extension: `i_size_write(inode, newsize); pagecache_isize_extended(inode, oldsize, newsize)`. These two combined handle cases where `ntfs_set_size` did, or did not, update the `inode->i_size` properly; the point is to *guarantee* `pagecache_isize_extended` is called with the *original* `oldsize` and the new `newsize`.
        *   Option B (Alternative, and potentially a no-op if the code correctly updates `inode->i_size`):  The user prompt specifies:  `ntfs_set_size` must be called before `truncate_setsize` (or `i_size_write` + `pagecache_isize_extended`). So the second valid variant for implementing is to call `truncate_setsize(inode, newsize)` in case `ntfs_set_size` did *not* update the size.

4.  **Error Handling:** In both shrinking and extending cases, if `ntfs_set_size` fails, we jump to `out;` after unlocking, reverting any changes as needed to ensure data integrity.

*   **Caveat:** This implementation assumes `ntfs_set_size` handles the actual data allocation on the NTFS volume, and we're coordinating the VFS and page cache aspects. Also, as this is a refactoring, there is a possibility that some subtle interaction might be missed because the original upstream commit was not verified directly, but the logic is sound and conforms to kernel conventions.

The changes are implemented in the diff below.

```diff
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -736,12 +736,21 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		newsize = attr->ia_size;
 
 		if (newsize != oldsize) {
-			truncate_setsize(inode, newsize);
+			filemap_invalidate_lock(inode->i_mapping);
+			if (newsize < oldsize) {
+				truncate_setsize(inode, newsize);
+				err = ntfs_set_size(inode, newsize);
+				if (err)



437/4 2026/09/17 11:54 tool set-results
0m Args:
map[Answer:Here is the patch for `fs/ntfs3/file.c` implementing the requested logic in `ntfs_setattr`:

```diff
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -736,12 +736,21 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		newsize = attr->ia_size;
 
 		if (newsize != oldsize) {
-			truncate_setsize(inode, newsize);
+			filemap_invalidate_lock(inode->i_mapping);
+			if (newsize < oldsize) {
+				truncate_setsize(inode, newsize);
+				err = ntfs_set_size(inode, newsize);
+				if (err)
+					i_size_write(inode, oldsize);
+			} else {
+				err = ntfs_set_size(inode, newsize);
+				if (!err) {
+					i_size_write(inode, newsize);
+					pagecache_isize_extended(inode, oldsize,
+								 newsize);
+				}
+			}
+			filemap_invalidate_unlock(inode->i_mapping);
+			if (err)
+				goto out;
 
-			err = ntfs_set_size(inode, newsize);
-			if (err) {
-				i_size_write(inode, oldsize);
-				goto out;
-			}
-
 			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 			inode_set_mtime_to_ts(inode,
```

### Explanation & Verification Notes

1. **Shrinking (`newsize < oldsize`)**:
   - `truncate_setsize(inode, newsize)` is invoked first to update `i_size` and drop truncated page cache folios, preventing readers from seeing stale data past the new EOF.
   - `ntfs_set_size(inode, newsize)` is then called to deallocate/shrink on-disk clusters.
   - If `ntfs_set_size` fails, `i_size_write(inode, oldsize)` restores the in-memory inode size.

2. **Extending (`newsize > oldsize`)**:
   - `ntfs_set_size(inode, newsize)` is called first to allocate the necessary metadata/clusters.
   - If `ntfs_set_size` succeeds, `i_size_write(inode, newsize)` and `pagecache_isize_extended(inode, oldsize, newsize)` are called.
   - *Note*: Inside `ntfs_set_size` -> `attr_set_size` -> `attr_set_size_ex`, `i_size_write(&ni->vfs_inode, new_size)` is executed. Calling `truncate_setsize(inode, newsize)` afterwards would see `inode->i_size == newsize` and skip calling `pagecache_isize_extended(inode, oldsize, newsize)`. Therefore, using `i_size_write(inode, newsize); pagecache_isize_extended(inode, oldsize, newsize);` ensures `pagecache_isize_extended` is invoked with the proper `oldsize` and `newsize`. (If preferred, `truncate_setsize(inode, newsize)` can be used instead if `i_size_write` is omitted from `attr_set_size_ex`).

3. **Locking**:
   - Both shrinking and extending operations are serialized against concurrent page faults and page cache instantiations using `filemap_invalidate_lock(inode->i_mapping)` and `filemap_invalidate_unlock(inode->i_mapping)`.

### Caveats and Unverified Parts
- Because the repository history in the workspace is shallow, the exact upstream commit or mailing list discussion introducing this specific change could not be verified against `git log`.
- Regression testing via `xfstests` / NTFS test suites was not run within this environment.]

Results:
map[Answer:Here is the patch for `fs/ntfs3/file.c` implementing the requested logic in `ntfs_setattr`:

```diff
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -736,12 +736,21 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 		newsize = attr->ia_size;
 
 		if (newsize != oldsize) {
-			truncate_setsize(inode, newsize);
+			filemap_invalidate_lock(inode->i_mapping);
+			if (newsize < oldsize) {
+				truncate_setsize(inode, newsize);
+				err = ntfs_set_size(inode, newsize);
+				if (err)
+					i_size_write(inode, oldsize);
+			} else {
+				err = ntfs_set_size(inode, newsize);
+				if (!err) {
+					i_size_write(inode, newsize);
+					pagecache_isize_extended(inode, oldsize,
+								 newsize);
+				}
+			}
+			filemap_invalidate_unlock(inode->i_mapping);
+			if (err)
+				goto out;
 
-			err = ntfs_set_size(inode, newsize);
-			if (err) {
-				i_size_write(inode, oldsize);
-				goto out;
-			}
-
 			ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE;
 			ni->ni_flags |= NI_FLAG_UPDATE_PARENT;
 			inode_set_mtime_to_ts(inode,
```

### Explanation & Verification Notes

1. **Shrinking (`newsize < oldsize`)**:
   - `truncate_setsize(inode, newsize)` is invoked first to update `i_size` and drop truncated page cache folios, preventing readers from seeing stale data past the new EOF.
   - `ntfs_set_size(inode, newsize)` is then called to deallocate/shrink on-disk clusters.
   - If `ntfs_set_size` fails, `i_size_write(inode, oldsize)` restores the in-memory inode size.

2. **Extending (`newsize > oldsize`)**:
   - `ntfs_set_size(inode, newsize)` is called first to allocate the necessary metadata/clusters.
   - If `ntfs_set_size` succeeds, `i_size_write(inode, newsize)` and `pagecache_isize_extended(inode, oldsize, newsize)` are called.
   - *Note*: Inside `ntfs_set_size` -> `attr_set_size` -> `attr_set_size_ex`, `i_size_write(&ni->vfs_inode, new_size)` is executed. Calling `truncate_setsize(inode, newsize)` afterwards would see `inode->i_size == newsize` and skip calling `pagecache_isize_extended(inode, oldsize, newsize)`. Therefore, using `i_size_write(inode, newsize); pagecache_isize_extended(inode, oldsize, newsize);` ensures `pagecache_isize_extended` is invoked with the proper `oldsize` and `newsize`. (If preferred, `truncate_setsize(inode, newsize)` can be used instead if `i_size_write` is omitted from `attr_set_size_ex`).

3. **Locking**:
   - Both shrinking and extending operations are serialized against concurrent page faults and page cache instantiations using `filemap_invalidate_lock(inode->i_mapping)` and `filemap_invalidate_unlock(inode->i_mapping)`.

### Caveats and Unverified Parts
- Because the repository history in the workspace is shallow, the exact upstream commit or mailing list discussion introducing this specific change could not be verified against `git log`.
- Regression testing via `xfstests` / NTFS test suites was not run within this environment.]

438/2 2026/09/17 11:54 llm debugger
0m Model:
gemini-3.1-pro-preview

Tokens:
							input: 70942
							output: 402
							thoughts: 0
						

439/2 2026/09/17 11:54 tool codeexpert
0m Error:
log-in to see details

Args:
map[Question:Wait, `truncate_setsize` does:
```c
void truncate_setsize(struct inode *inode, loff_t newsize)
{
	loff_t oldsize = inode->i_size;

	i_size_write(inode, newsize);
	if (newsize > oldsize)
		pagecache_isize_extended(inode, oldsize, newsize);
	truncate_pagecache(inode, newsize);
}
```
If `ntfs_set_size` already updated `inode->i_size` to `newsize`, then `oldsize` in `truncate_setsize` will be `newsize`, so `pagecache_isize_extended` will NOT be called.
Is that a problem?
Should we just use `pagecache_isize_extended` manually, or should we remove `i_size_write` from `attr_set_size_ex`?
Wait, if `attr_set_size_ex` updates `i_size_write`, then `pagecache_isize_extended` is skipped. But `attr_set_size_ex` is used in many places.
Let's check if `pagecache_isize_extended` is needed.
If we use `pagecache_isize_extended(inode, oldsize, newsize)` manually, we should also call `truncate_pagecache(inode, newsize)`? No, extending doesn't need `truncate_pagecache`.
Wait, `truncate_setsize` is fine if we just call it, but if `i_size` is already updated, it won't call `pagecache_isize_extended`.
Let's check if `ntfs_set_size` updates `i_size`.]

440/3 2026/09/17 11:54 agent codeexpert
0m Model:
core

Error:
log-in to see details

Instruction:
You are a capable Linux kernel developer tasked with researching complex questions
about kernel source code. You will be given a concrete question, and need to provide
a concrete answer.
Research the question using targeted, efficient tool calls. Don't make assumptions,
or rely on your previous knowledge about the kernel source code, use available tools
to access the actual source code. Keep your tool calls focused and limited to the
scope of the question. Do not explore tangential code paths or perform unbounded searches.
Use all available sources of information:
 - kernel source code
 - documentation in the Documentation dir in the source tree
 - git commits descriptions, git blame

Do not guess file names or file paths and attempt to read them without
verifying their existence first using content search or directory listing tools.
If a file, symbol, or directory is not found via content search (grepper) or
directory listing (codesearch-dir-index), treat it as completely absent.
Do not attempt to guess alternative names, extensions, or directories.

Tool Selection Guidelines:
1. For C functions, structs, and variables: Prefer codesearch-definition-source
   or codesearch-struct-layout FIRST to retrieve clean, exact definitions
   without line-number guessing.
2. If symbol lookup fails (e.g., preprocessor macros, macro-generated code, or
   disabled #ifdef branches), fall back to read-file or grepper.
3. For file headers, #include directives, preprocessor macro definitions, and
   non-C files (Kconfig, Makefiles, docs): Use read-file or grepper directly.
4. Be concise and targeted. Answer the question as directly and concisely as possible
   once you have located the relevant code or definitions. If a symbol or function cannot
   be found after targeted searches, conclude with the best available information rather
   than continuing repetitive searches.
Do NOT use git-log to search for the presence or existence of files in the
repository. git-log is only for tracing commit history of files that are
already present in the current checkout. If a file does not exist in the
current checkout, it cannot be used for reproduction.

Avoid running broad git-log queries (such as searches on the entire repo)
without a specific 'PathPrefix' to restrict the scope, as these are very
expensive and will time out.
If a git-log tool call times out, do not retry the query with the same broad
scope. You must specify a tighter, narrower 'PathPrefix' for subsequent queries.

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:
Wait, `truncate_setsize` does:
```c
void truncate_setsize(struct inode *inode, loff_t newsize)
{
	loff_t oldsize = inode->i_size;

	i_size_write(inode, newsize);
	if (newsize > oldsize)
		pagecache_isize_extended(inode, oldsize, newsize);
	truncate_pagecache(inode, newsize);
}
```
If `ntfs_set_size` already updated `inode->i_size` to `newsize`, then `oldsize` in `truncate_setsize` will be `newsize`, so `pagecache_isize_extended` will NOT be called.
Is that a problem?
Should we just use `pagecache_isize_extended` manually, or should we remove `i_size_write` from `attr_set_size_ex`?
Wait, if `attr_set_size_ex` updates `i_size_write`, then `pagecache_isize_extended` is skipped. But `attr_set_size_ex` is used in many places.
Let's check if `pagecache_isize_extended` is needed.
If we use `pagecache_isize_extended(inode, oldsize, newsize)` manually, we should also call `truncate_pagecache(inode, newsize)`? No, extending doesn't need `truncate_pagecache`.
Wait, `truncate_setsize` is fine if we just call it, but if `i_size` is already updated, it won't call `pagecache_isize_extended`.
Let's check if `ntfs_set_size` updates `i_size`.

441/4 2026/09/17 11:54 llm codeexpert
0m Model:
gemini-3.8-flash

Error:
log-in to see details

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)