================================================================== BUG: KCSAN: data-race in bdev_disk_changed / set_capacity_and_notify write to 0xffff8881023d56c8 of 8 bytes by task 2104 on cpu 0: set_capacity block/genhd.c:64 [inline] set_capacity_and_notify+0xab/0x1d0 block/genhd.c:78 loop_set_size+0x2e/0x70 drivers/block/loop.c:237 loop_configure+0xb1b/0xc30 drivers/block/loop.c:1095 lo_ioctl+0x641/0x1290 blkdev_ioctl+0x20e/0x440 block/ioctl.c:614 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xcb/0x140 fs/ioctl.c:856 __x64_sys_ioctl+0x3f/0x50 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read to 0xffff8881023d56c8 of 8 bytes by task 1903 on cpu 1: bdev_nr_sectors include/linux/blkdev.h:790 [inline] get_capacity include/linux/blkdev.h:800 [inline] bdev_disk_changed+0x1b9/0xc30 block/partitions/core.c:684 blkdev_get_whole+0x256/0x270 block/bdev.c:684 blkdev_get_by_dev+0x248/0x650 block/bdev.c:821 blkdev_open+0xac/0x140 block/fops.c:485 do_dentry_open+0x51a/0x8b0 fs/open.c:878 vfs_open+0x43/0x50 fs/open.c:1014 do_open fs/namei.c:3557 [inline] path_openat+0x169d/0x1b00 fs/namei.c:3691 do_filp_open+0x105/0x220 fs/namei.c:3718 do_sys_openat2+0xb5/0x2a0 fs/open.c:1311 do_sys_open fs/open.c:1327 [inline] __do_sys_openat fs/open.c:1343 [inline] __se_sys_openat fs/open.c:1338 [inline] __x64_sys_openat+0xef/0x110 fs/open.c:1338 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x0000000000000000 -> 0x0000000000040800 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 1903 Comm: udevd Not tainted 6.0.0-rc1-syzkaller-00409-ge3f259d33c0e-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 ================================================================== buffer_io_error: 32 callbacks suppressed Buffer I/O error on dev loop2, logical block 0, async page read loop2: unable to read partition table loop2: partition table beyond EOD, truncated Buffer I/O error on dev loop2, logical block 0, async page read Buffer I/O error on dev loop2, logical block 0, async page read loop2: unable to read partition table loop2: partition table beyond EOD, truncated Buffer I/O error on dev loop2, logical block 0, async page read loop2: unable to read partition table loop2: partition table beyond EOD, truncated blk_print_req_error: 35 callbacks suppressed I/O error, dev loop2, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Buffer I/O error on dev loop2, logical block 0, async page read loop2: unable to read partition table loop2: partition table beyond EOD, truncated I/O error, dev loop2, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Buffer I/O error on dev loop2, logical block 0, async page read loop2: unable to read partition table loop2: partition table beyond EOD, truncated I/O error, dev loop2, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Buffer I/O error on dev loop2, logical block 0, async page read I/O error, dev loop2, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Buffer I/O error on dev loop2, logical block 0, async page read loop2: unable to read partition table I/O error, dev loop2, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Buffer I/O error on dev loop2, logical block 0, async page read I/O error, dev loop2, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Buffer I/O error on dev loop2, logical block 0, async page read loop2: unable to read partition table I/O error, dev loop2, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 loop2: unable to read partition table loop2: partition table beyond EOD, truncated I/O error, dev loop2, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 loop2: unable to read partition table loop2: partition table beyond EOD, truncated loop2: unable to read partition table loop2: unable to read partition table loop2: unable to read partition table loop2: partition table beyond EOD, truncated loop2: unable to read partition table loop1: unable to read partition table loop1: partition table beyond EOD, truncated Buffer I/O error on dev loop1, logical block 0, async page read loop1: unable to read partition table loop1: partition table beyond EOD, truncated I/O error, dev loop1, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 loop1: unable to read partition table loop1: partition table beyond EOD, truncated loop2: unable to read partition table loop2: partition table beyond EOD, truncated loop2: unable to read partition table loop2: unable to read partition table loop2: partition table beyond EOD, truncated loop2: unable to read partition table loop2: partition table beyond EOD, truncated loop2: unable to read partition table loop2: unable to read partition table loop2: partition table beyond EOD, truncated