From owner-freebsd-bugs@freebsd.org Fri Jun 14 18:05:44 2019 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74B6B15AE1C8 for ; Fri, 14 Jun 2019 18:05:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 0AB5073A38 for ; Fri, 14 Jun 2019 18:05:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id BC26315AE1C7; Fri, 14 Jun 2019 18:05:43 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9981E15AE1C5 for ; Fri, 14 Jun 2019 18:05:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DEC273A36 for ; Fri, 14 Jun 2019 18:05:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 527E7162B for ; Fri, 14 Jun 2019 18:05:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x5EI5g79057060 for ; Fri, 14 Jun 2019 18:05:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x5EI5gXY057059 for bugs@FreeBSD.org; Fri, 14 Jun 2019 18:05:42 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 238565] panic: vinvalbuf: dirty bufs during unmount if clustered writes return errors Date: Fri, 14 Jun 2019 18:05:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: asomers@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jun 2019 18:05:44 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238565 Bug ID: 238565 Summary: panic: vinvalbuf: dirty bufs during unmount if clustered writes return errors Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: asomers@FreeBSD.org It seems that if a clustered write experiences an error while fsyncing duri= ng unmount, vinvalbuf will panic. This only happens with clustered writes, not normal writes. So far I've only been able to reproduce it on fusefs, but I suspect that all file systems which use clustering (UFS, ext2, msdosfs, fus= efs) are affected. The problem is easiest to reproduce with fusefs just because fuse makes it easy to inject errors at any point. The panic can be reproduced on the projects/fuse2 branch by doing the following: $ sudo sysctl sysctl vfs.fusefs.data_cache_mode=3D2 $ cd /usr/tests/sys/fs/fusefs $ ./write --gtest_also_run_disabled_tests=20 --gtest_filter=3DWriteCluster.DISABLED_cluster_write_err -v fsync: giving up on dirty (error =3D 5) 0xfffff80049732960: tag fuse, type = VREG usecount 0, writecount 0, refcount 5 flags (VI_ACTIVE|VI_DOINGINACT) v_object 0xfffff80049318900 ref 0 pages 48 cleanbuf 0 dirtybuf 3 lock type fuse: EXCL by thread 0xfffff8000337f5a0 (pid 3944, write, tid 100085) nodeid: 42, parent nodeid: 0, nlookup: 1, flag: 0 panic: vinvalbuf: dirty bufs cpuid =3D 0 time =3D 1560534385 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0031dd8= 4c0 vpanic() at vpanic+0x19d/frame 0xfffffe0031dd8510 panic() at panic+0x43/frame 0xfffffe0031dd8570 bufobj_invalbuf() at bufobj_invalbuf+0x2ca/frame 0xfffffe0031dd85d0 vgonel() at vgonel+0x15e/frame 0xfffffe0031dd8640 vflush() at vflush+0x22c/frame 0xfffffe0031dd8790 fuse_vfsop_unmount() at fuse_vfsop_unmount+0xad/frame 0xfffffe0031dd8800 dounmount() at dounmount+0x4ae/frame 0xfffffe0031dd8860 sys_unmount() at sys_unmount+0x300/frame 0xfffffe0031dd8990 amd64_syscall() at amd64_syscall+0x276/frame 0xfffffe0031dd8ab0 fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0031dd8ab0 --- syscall (22, FreeBSD ELF64, sys_unmount), rip =3D 0x80052d9aa, rsp =3D 0x7fffffffe6e8, rbp =3D 0x7fffffffe700 --- KDB: enter: panic --=20 You are receiving this mail because: You are the assignee for the bug.=