[bug report] f2fs mount failure on zoned block devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With kernel v6.5-rc1, I observed failure of a blktests test case zbd/010, which
mounts f2fs on zoned null_blk and scsi_debug devices. This mount failure can be
recreated just executing "mkfs.f2fs -m" and "mount" commands on various zoned
block devices. The mount failure is not observed with non-zoned regular block
devices. I bisected and found the commit 87efb39075be ("fs: add a method to shut
down the file system") is the trigger.

At the failure, kernel prints a WARN [1] for "bdev->bd_holder_ops != hops"
check in bd_may_claim(). I think this WARN is printed because,

- f2fs_mount() calls mount_bdev() and sets bdev->bd_holder_ops = &fs_holder_ops.
- f2fs_scan_devices() calls blkdev_get_by_*() for zoned block devices
  specifying hops = NULL

Advises for fix will be appreciated. The commit message of the trigger commit
says "File systems their own get_tree method or opening additional devices will
need to set up their own blk_holder_ops.". Do we need blk_holder_ops for f2fs?

[1]

[  330.649528] ------------[ cut here ]------------
[  330.650297] WARNING: CPU: 1 PID: 1083 at block/bdev.c:487 bd_may_claim+0x196/0x1d0
[  330.651247] Modules linked in: scsi_debug null_blk f2fs crc32_generic nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 rfkill ip_set nf_tables nfnetlink qrtr intel_rapl_msr intel_rapl_common kvm_intel ppdev sunrpc kvm irqbypass rapl parport_pc i2c_piix4 parport joydev fuse loop zram xfs crct10dif_pclmul crc32_pclmul crc32c_intel polyval_clmulni polyval_generic bochs drm_vram_helper drm_kms_helper drm_ttm_helper ghash_clmulni_intel ttm nvme sha512_ssse3 drm sym53c8xx nvme_core scsi_transport_spi e1000 nvme_common serio_raw ata_generic pata_acpi scsi_dh_rdac scsi_dh_emc scsi_dh_alua dm_multipath qemu_fw_cfg [last unloaded: null_blk]
[  330.659173] CPU: 1 PID: 1083 Comm: mount Not tainted 6.5.0-rc1-kts #1
[  330.659966] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014
[  330.661296] RIP: 0010:bd_may_claim+0x196/0x1d0
[  330.661919] Code: 41 5d 0f 95 c0 48 81 fa 80 ed 1f 98 0f 95 c2 21 d0 83 f0 01 c3 cc cc cc cc 48 c7 c7 70 ab 57 9b e8 0f 32 8e ff e9 fc fe ff ff <0f> 0b e9 32 ff ff ff e8 2e 32 8e ff e9 90 fe ff ff e8 24 32 8e ff
[  330.663974] RSP: 0018:ffff888113e17940 EFLAGS: 00010282
[  330.664679] RAX: dffffc0000000000 RBX: ffff888100457300 RCX: 0000000000000000
[  330.665520] RDX: 1ffff1102008ae74 RSI: ffffffff9aa148e8 RDI: ffff8881004573a0
[  330.666408] RBP: ffffffffc1ba5220 R08: 0000000000000001 R09: fffffbfff36ae75c
[  330.667232] R10: ffff888113e17968 R11: ffff888114cd8000 R12: 0000000000000000
[  330.668116] R13: ffff888100457300 R14: ffff888100457300 R15: ffff888100457300
[  330.669008] FS:  00007f8348dc4b80(0000) GS:ffff8881f6e80000(0000) knlGS:0000000000000000
[  330.669950] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  330.670693] CR2: 00007f8348e1c620 CR3: 0000000184fc6006 CR4: 0000000000170ee0
[  330.671575] Call Trace:
[  330.671931]  <TASK>
[  330.672242]  ? __warn+0xcd/0x2b0
[  330.672697]  ? bd_may_claim+0x196/0x1d0
[  330.673236]  ? report_bug+0x26b/0x2e0
[  330.673743]  ? handle_bug+0x79/0xa0
[  330.674200]  ? exc_invalid_op+0x17/0x40
[  330.674758]  ? asm_exc_invalid_op+0x1a/0x20
[  330.675307]  ? bd_may_claim+0x196/0x1d0
[  330.675872]  bd_prepare_to_claim+0x1a4/0x260
[  330.676420]  ? __pfx_bd_prepare_to_claim+0x10/0x10
[  330.677024]  ? kobject_get_unless_zero+0xca/0x160
[  330.677634]  ? _atomic_dec_and_lock+0x18/0x90
[  330.678169]  ? iput.part.0+0x5a/0x620
[  330.678705]  blkdev_get_by_dev.part.0+0x67/0xa00
[  330.679252]  ? devcgroup_check_permission+0x12d/0x310
[  330.679924]  blkdev_get_by_path+0x170/0x240
[  330.680431]  ? __pfx_blkdev_get_by_path+0x10/0x10
[  330.680971]  ? __kasan_kmalloc+0xaa/0xb0
[  330.681501]  f2fs_fill_super+0x531d/0x8d50 [f2fs]
[  330.682126]  ? snprintf+0xab/0xe0
[  330.682555]  ? __pfx_f2fs_fill_super+0x10/0x10 [f2fs]
[  330.683196]  ? sget+0x2db/0x560
[  330.683616]  ? __pfx_f2fs_fill_super+0x10/0x10 [f2fs]
[  330.684272]  mount_bdev+0x25d/0x310
[  330.684752]  ? __pfx_f2fs_mount+0x10/0x10 [f2fs]
[  330.685306]  legacy_get_tree+0x106/0x200
[  330.685818]  ? __pfx_bpf_lsm_capable+0x10/0x10
[  330.686317]  vfs_get_tree+0x8d/0x330
[  330.686804]  __do_sys_fsconfig+0x7b3/0xad0
[  330.687273]  ? __pfx___do_sys_fsconfig+0x10/0x10
[  330.687818]  ? lockdep_hardirqs_on_prepare+0x27f/0x3f0
[  330.688432]  ? lockdep_hardirqs_on_prepare+0x27f/0x3f0
[  330.688988]  do_syscall_64+0x60/0x90
[  330.689413]  ? lockdep_hardirqs_on_prepare+0x27f/0x3f0
[  330.690010]  ? do_syscall_64+0x6c/0x90
[  330.690455]  ? do_syscall_64+0x6c/0x90
[  330.690889]  ? do_syscall_64+0x6c/0x90
[  330.691335]  ? lockdep_hardirqs_on_prepare+0x27f/0x3f0
[  330.691916]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[  330.692521] RIP: 0033:0x7f8348ed98be
[  330.692943] Code: 73 01 c3 48 8b 0d 4a 05 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 49 89 ca b8 af 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1a 05 0c 00 f7 d8 64 89 01 48
[  330.941768] RSP: 002b:00007fff70300468 EFLAGS: 00000246 ORIG_RAX: 00000000000001af
[  331.027163] RAX: ffffffffffffffda RBX: 00000000006766a0 RCX: 00007f8348ed98be
[  331.027937] RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000003
[  331.028669] RBP: 0000000000677820 R08: 0000000000000000 R09: 0000000000000001
[  331.029413] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
[  331.030099] R13: 00007f8349071f04 R14: 00007f8349070540 R15: 00000000006767e0
[  331.030889]  </TASK>
[  331.031148] irq event stamp: 12117
[  331.031542] hardirqs last  enabled at (12127): [<ffffffff973f056e>] __up_console_sem+0x5e/0x70
[  331.032436] hardirqs last disabled at (12136): [<ffffffff973f0553>] __up_console_sem+0x43/0x70
[  331.033234] softirqs last  enabled at (12058): [<ffffffff9723cfa6>] __irq_exit_rcu+0x146/0x190
[  331.034130] softirqs last disabled at (12049): [<ffffffff9723cfa6>] __irq_exit_rcu+0x146/0x190
[  331.035019] ---[ end trace 0000000000000000 ]---
[  331.035513] F2FS-fs (nullb0): Failed to find devices



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux