Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zpl_test_super race with zfs_umount #15077

Merged
merged 1 commit into from
Jul 20, 2023

Commits on Jul 17, 2023

  1. Fix zpl_test_super race with zfs_umount

    We cannot call zpl_enter in zpl_test_super, because zpl_test_super is
    under spinlock so we can't sleep, and also because zpl_test_super is
    called without sb->s_umount taken, so it's possible we would race with
    zfs_umount and call zpl_enter on freed zfsvfs.
    
    Here's an stack trace when this happens:
    [ 2379.114837] VERIFY(cvp->cv_magic == CV_MAGIC) failed
    [ 2379.114845] PANIC at spl-condvar.c:497:__cv_broadcast()
    [ 2379.114854] Kernel panic - not syncing: VERIFY(cvp->cv_magic == CV_MAGIC) failed
    [ 2379.115012] Call Trace:
    [ 2379.115019]  dump_stack+0x74/0x96
    [ 2379.115024]  panic+0x114/0x2f6
    [ 2379.115035]  spl_panic+0xcf/0xfc [spl]
    [ 2379.115477]  __cv_broadcast+0x68/0xa0 [spl]
    [ 2379.115585]  rrw_exit+0xb8/0x310 [zfs]
    [ 2379.115696]  rrm_exit+0x4a/0x80 [zfs]
    [ 2379.115808]  zpl_test_super+0xa9/0xd0 [zfs]
    [ 2379.115920]  sget+0xd1/0x230
    [ 2379.116033]  zpl_mount+0xdc/0x230 [zfs]
    [ 2379.116037]  legacy_get_tree+0x28/0x50
    [ 2379.116039]  vfs_get_tree+0x27/0xc0
    [ 2379.116045]  path_mount+0x2fe/0xa70
    [ 2379.116048]  do_mount+0x80/0xa0
    [ 2379.116050]  __x64_sys_mount+0x8b/0xe0
    [ 2379.116052]  do_syscall_64+0x35/0x50
    [ 2379.116054]  entry_SYSCALL_64_after_hwframe+0x61/0xc6
    [ 2379.116057] RIP: 0033:0x7f9912e8b26a
    
    Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
    davidchenntnx committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    41c8bc5 View commit details
    Browse the repository at this point in the history