On 2024/05/15 21:46, Sam Sun wrote: >> What happens if you disable >> >> sysfd = write(sysfd, input, hash - input + 1); >> >> line (i.e. stop updating sg_allow_dio value) in the reproducer? >> > > I tried to change the value of /sys/module/sg/parameters/allow_dio to > 0 and remove write() call, both still triggers task hang report and > kernel panic. I think this write is not the call crashing the kernel. > Kernel panic by general protection fault upon calling trigger_all_cpu_backtrace() is a different bug. Please be sure to keep /proc/sys/kernel/hung_task_all_cpu_backtrace 0 while investigating this hung task problem. This hung task problem happens without touching /sys/module/sg/parameters/allow_dio , doesn't it? scsi_rescan_device() is reliably printed when this hung task problem happens, isn't it? Then, it is strange that scsi_rescan_device() is called despite the reproducer is almost no-op. Maybe you can trigger scsi_rescan_device() without using the reproducer. Can you simplify steps to reproduce? For example, doing a lot of write().