From owner-freebsd-fs@freebsd.org Sun Apr 11 21:00:35 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47D535DC8CC for ; Sun, 11 Apr 2021 21:00:35 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FJPQq0jRDz4ZlC for ; Sun, 11 Apr 2021 21:00:35 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id 15FF45DC94C; Sun, 11 Apr 2021 21:00:35 +0000 (UTC) Delivered-To: fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F317E5DCBC9 for ; Sun, 11 Apr 2021 21:00:34 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FJPQp3wdJz4Ztj for ; Sun, 11 Apr 2021 21:00:34 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71B78287F for ; Sun, 11 Apr 2021 21:00:34 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 13BL0YOf058494 for ; Sun, 11 Apr 2021 21:00:34 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 13BL0Y4C058486 for fs@FreeBSD.org; Sun, 11 Apr 2021 21:00:34 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <202104112100.13BL0Y4C058486@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: fs@FreeBSD.org Subject: Problem reports for fs@FreeBSD.org that need special attention Date: Sun, 11 Apr 2021 21:00:34 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2021 21:00:35 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- New | 203492 | mount_unionfs -o below causes panic Open | 144447 | [zfs] sharenfs fsunshare() & fsshare_main() non f Open | 211491 | System hangs after "Uptime" on reboot with ZFS Open | 221909 | [ZFS] Add a sysctl to toggle send_corrupt_data Open | 237067 | ZFS: Crash in vdev_dtl_reassess when using GELI w Open | 240831 | zfs: Panic during snapshot on 12.1-STABLE r352648 Open | 243973 | [zfs] rollback segmentation fault Open | 244656 | zfs: resilver doesn't provide enough information Open | 244692 | gjournal: Does not support TRIM Open | 244899 | [PATCH] zfs: xattr on a symlink target > 136 caus Open | 251035 | [zfs] Allow 64 bit ZFS to support 32 bit ioctls ( 11 problems total for which you should take action. From owner-freebsd-fs@freebsd.org Mon Apr 12 21:19:09 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0BEC5DEF9F for ; Mon, 12 Apr 2021 21:19:09 +0000 (UTC) (envelope-from alexander.lochmann@tu-dortmund.de) Received: from unimail.uni-dortmund.de (mx1.hrz.uni-dortmund.de [129.217.128.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "unimail.tu-dortmund.de", Issuer "DFN-Verein Global Issuing CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FK1nm6Fm9z4v38 for ; Mon, 12 Apr 2021 21:19:08 +0000 (UTC) (envelope-from alexander.lochmann@tu-dortmund.de) Received: from [192.168.111.113] (p4fd97a03.dip0.t-ipconnect.de [79.217.122.3]) (authenticated bits=0) by unimail.uni-dortmund.de (8.16.1/8.16.1) with ESMTPSA id 13CLJ5T1020613 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 12 Apr 2021 23:19:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tu-dortmund.de; s=unimail; t=1618262346; bh=JUH0raRnJy49kKCBj9wKVEhccivQuRb8tP/DGSFRC7U=; h=To:From:Subject:Date; b=M1ecCoxARcwlft0ErR1MfyeFpP1RmSWpGwNg5iA76aOW0rntnGkuDJrvds0mEAF08 gBqtTLdlxmSHVf1TqtURPM+k4WpBktxh8JQlcFf6aww0Hry8O50FRNN+sBxFDvPqKb T1QTV2ZeTSjecJsLqPWbWgkOZmtqmH9pxon4cw0Y= To: freebsd-fs@freebsd.org From: Alexander Lochmann Subject: [struct buf] Unlocked access to b_vflags? Message-ID: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> Date: Mon, 12 Apr 2021 23:19:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Xz9eTg4I9kRVYnhegqAunRptWFws7ufoi" X-Rspamd-Queue-Id: 4FK1nm6Fm9z4v38 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tu-dortmund.de header.s=unimail header.b=M1ecCoxA; dmarc=none; spf=pass (mx1.freebsd.org: domain of alexander.lochmann@tu-dortmund.de designates 129.217.128.51 as permitted sender) smtp.mailfrom=alexander.lochmann@tu-dortmund.de X-Spamd-Result: default: False [-4.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[129.217.128.51:from]; R_SPF_ALLOW(-0.20)[+ip4:129.217.128.0/24]; HAS_ATTACHMENT(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCVD_IN_DNSWL_MED(-0.20)[129.217.128.51:from]; DKIM_TRACE(0.00)[tu-dortmund.de:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:680, ipnet:129.217.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[79.217.122.3:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[tu-dortmund.de:s=unimail]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-fs@freebsd.org]; DMARC_NA(0.00)[tu-dortmund.de]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[tu-dortmund.de:dkim]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-fs] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2021 21:19:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Xz9eTg4I9kRVYnhegqAunRptWFws7ufoi Content-Type: multipart/mixed; boundary="OaWKHepOEHtS7AaXTO6zf8SCoFordbWxv"; protected-headers="v1" From: Alexander Lochmann To: freebsd-fs@freebsd.org Message-ID: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> Subject: [struct buf] Unlocked access to b_vflags? --OaWKHepOEHtS7AaXTO6zf8SCoFordbWxv Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi folks, I'm was digging through our data set when I encountered a strange situati= on: According to the code in trunc_dependencies() in sys/ufs/ffs/ffs_softdep.= c, the bo_lock should be held. At least that's how I read the code. However, we see several thousands of accesses to b_vflags without the=20 bo_lock held. At least the own b_lock is acquired. The access happens in line 7549: bp->b_vflags |=3D BV_SCANNED; [1] Can you please shed some light on this situation? Is the b_lock sufficeint, and somehow overrules the bo_lock? Am I missing something? FYI, some information about the greater context: I'm still trying to=20 understand FreeBSD's locking. This is needed to properly port our=20 approach. LockDoc, at the moment, seems to miss some cases on FreeBSD. Regards, Alex [1]=20 https://github.com/freebsd/freebsd-src/blob/main/sys/ufs/ffs/ffs_softdep.= c#L7549 --=20 Technische Universit=C3=A4t Dortmund Alexander Lochmann PGP key: 0xBC3EF6FD Otto-Hahn-Str. 16 phone: +49.231.7556141 D-44227 Dortmund fax: +49.231.7556116 http://ess.cs.tu-dortmund.de/Staff/al --OaWKHepOEHtS7AaXTO6zf8SCoFordbWxv-- --Xz9eTg4I9kRVYnhegqAunRptWFws7ufoi Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEElhZsUHzVP0dbkjCRWT7tBbw+9v0FAmB0uUkFAwAAAAAACgkQWT7tBbw+9v3g Ng//d7n02bCqGpTXFLktsM2AWic4waI9AfGBcbZfxeNDMjVML/IMkLg7HDR7z5HE1QfXs2V2F12R yVypFjrtlFyKbilVhiBz8IJ88toonNPwzW121JpanJ2OVr+C4ZYz7y/3KiUMRnGsP0A6S+Ii1r4X 0/FR7N5bP2o3bII72LPnjnkNMwq7dm7pCOFFvO271m+/bbhyITGpC6UVdfpB3SvtBjMkV3wctcFE GAzVk+OwPWDMYtimSOe9tmcQsjFl/t3+WUIHNvg+yW2YcolDqmQ+beCjCB33IUCzmH4FLMycl3Pp oVCXrfRg2GRiUCBAUJy3X2yLc7izxPdURXGZR1zsZ4qaOnA6RqDnSFUURx29Fxp/8f6/xW+NhtQR AXY8gPixFHbAz/fzt5t/f+L1wmBixBrUEH77qpTUPusRy8ZpDNVWvkHtfx0nAcMV/iAaGjZhbVl4 Sst8IIiLUZYWPZu8dRk2sYrdPJPuzrqwsaHKab/V9M/pfVtXbNY0sdS7yyFg866di72qUjaGsVbd CWT/gkghF2nDqmz/6YaI9EpQcGL8qNYrSV66TRC3YqZ7JXTSAuzR0E1+AIUkM8IpQRbrnUhNRnEu O1SnrO2er65SiBo8DySV9lNObbm7Eg+tP068jc9ZF9nSBtB3D8rwWk0gdlUay4GbRUmxue9yqOh1 ajI= =YaYS -----END PGP SIGNATURE----- --Xz9eTg4I9kRVYnhegqAunRptWFws7ufoi-- From owner-freebsd-fs@freebsd.org Tue Apr 13 00:22:42 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17BE65E3013 for ; Tue, 13 Apr 2021 00:22:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FK5sZ00H0z3L0r for ; Tue, 13 Apr 2021 00:22:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id F3C695E2D32; Tue, 13 Apr 2021 00:22:41 +0000 (UTC) Delivered-To: fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F26725E3160 for ; Tue, 13 Apr 2021 00:22:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FK5sY6Pd6z3Kk2 for ; Tue, 13 Apr 2021 00:22:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF756210B5 for ; Tue, 13 Apr 2021 00:22:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 13D0Mfre008863 for ; Tue, 13 Apr 2021 00:22:41 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 13D0Mf3f008862 for fs@FreeBSD.org; Tue, 13 Apr 2021 00:22:41 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: fs@FreeBSD.org Subject: [Bug 254682] quota enabled filesystem doesn't show enabled running mount command Date: Tue, 13 Apr 2021 00:22:41 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: mckusick@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: 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-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 00:22:42 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254682 Kirk McKusick changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mckusick@FreeBSD.org --- Comment #2 from Kirk McKusick --- Created attachment 224070 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D224070&action= =3Dedit Proposed fix for bug. See if this patch solves your problem. It should apply to a 12-stable with possibly a line or two of "fuzz". --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-fs@freebsd.org Tue Apr 13 00:23:17 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D8C45E2C47 for ; Tue, 13 Apr 2021 00:23:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4FK5tF2Tb2z3L8B for ; Tue, 13 Apr 2021 00:23:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 552A05E2C46; Tue, 13 Apr 2021 00:23:17 +0000 (UTC) Delivered-To: fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54F625E2D57 for ; Tue, 13 Apr 2021 00:23:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FK5tF1vwmz3Kq0 for ; Tue, 13 Apr 2021 00:23:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34D17210B6 for ; Tue, 13 Apr 2021 00:23:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 13D0NHcm008981 for ; Tue, 13 Apr 2021 00:23:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 13D0NHvE008980 for fs@FreeBSD.org; Tue, 13 Apr 2021 00:23:17 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: fs@FreeBSD.org Subject: [Bug 254682] quota enabled filesystem doesn't show enabled running mount command Date: Tue, 13 Apr 2021 00:23:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: mckusick@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status Message-ID: In-Reply-To: References: 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-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 00:23:17 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254682 Kirk McKusick changed: What |Removed |Added ---------------------------------------------------------------------------- Status|New |Open --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-fs@freebsd.org Tue Apr 13 10:25:16 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DEEE5DAF6A for ; Tue, 13 Apr 2021 10:25:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FKMDp6XFcz4Xn1 for ; Tue, 13 Apr 2021 10:25:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 13DAP0ci024487 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 13 Apr 2021 13:25:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 13DAP0ci024487 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 13DAP0CX024484; Tue, 13 Apr 2021 13:25:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Apr 2021 13:25:00 +0300 From: Konstantin Belousov To: Alexander Lochmann Cc: freebsd-fs@freebsd.org Subject: Re: [struct buf] Unlocked access to b_vflags? Message-ID: References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4FKMDp6XFcz4Xn1 X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [3.90 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_SPAM_SHORT(1.00)[1.000]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:470:d5e7:1::1:from]; R_SPF_SOFTFAIL(0.00)[~all]; NEURAL_SPAM_MEDIUM(0.90)[0.900]; SPAMHAUS_ZRD(0.00)[2001:470:d5e7:1::1:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(1.00)[1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MAILMAN_DEST(0.00)[freebsd-fs]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 10:25:16 -0000 On Mon, Apr 12, 2021 at 11:19:05PM +0200, Alexander Lochmann wrote: > Hi folks, > > I'm was digging through our data set when I encountered a strange situation: > According to the code in trunc_dependencies() in sys/ufs/ffs/ffs_softdep.c, > the bo_lock should be held. At least that's how I read the code. > However, we see several thousands of accesses to b_vflags without the > bo_lock held. > At least the own b_lock is acquired. > The access happens in line 7549: bp->b_vflags |= BV_SCANNED; [1] > Can you please shed some light on this situation? > Is the b_lock sufficeint, and somehow overrules the bo_lock? > Am I missing something? I think you found a valid race. There is one more place where BV_SCANNED was manipulated without owning bufobj lock. Patch below should fix both. commit a678470b1307542c5a46b930c119b2358863e0d2 Author: Konstantin Belousov Date: Tue Apr 13 13:22:56 2021 +0300 b_vflags update requries bufobj lock Reported by: Alexander Lochmann (trunc_dependencies()) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 0091b5dcd3b8..23c0cf6e128b 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -7546,7 +7546,9 @@ trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags) BO_LOCK(bo); goto cleanrestart; } + BO_LOCK(bo); bp->b_vflags |= BV_SCANNED; + BO_UNLOCK(bo); bremfree(bp); if (blkoff != 0) { allocbuf(bp, blkoff); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index dc638595eb7b..05eb19c0ee13 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -321,8 +321,9 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags) if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo)) != 0) { + BO_LOCK(bo); bp->b_vflags &= ~BV_SCANNED; - goto next; + goto next_locked; } } else continue; @@ -385,6 +386,7 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags) * to start from a known point. */ BO_LOCK(bo); +next_locked: nbp = TAILQ_FIRST(&bo->bo_dirty.bv_hd); } if (waitfor != MNT_WAIT) { From owner-freebsd-fs@freebsd.org Tue Apr 13 11:44:18 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78CB25DC9EA for ; Tue, 13 Apr 2021 11:44:18 +0000 (UTC) (envelope-from alexander.lochmann@tu-dortmund.de) Received: from unimail.uni-dortmund.de (mx1.hrz.uni-dortmund.de [129.217.128.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "unimail.tu-dortmund.de", Issuer "DFN-Verein Global Issuing CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FKP015lxmz4c4M for ; Tue, 13 Apr 2021 11:44:17 +0000 (UTC) (envelope-from alexander.lochmann@tu-dortmund.de) Received: from [192.168.111.113] (p4fd97541.dip0.t-ipconnect.de [79.217.117.65]) (authenticated bits=0) by unimail.uni-dortmund.de (8.16.1/8.16.1) with ESMTPSA id 13DBiEnr008607 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT); Tue, 13 Apr 2021 13:44:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tu-dortmund.de; s=unimail; t=1618314255; bh=LJujmBnPnIvO5G3vXUmOrbfhzvQoGulTX7x5Zo3KeFk=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=CukGQNDvrMViIIZu9CiFg4HGAdevoMyHFi/eWFu9kdSriEV3ElZBejkdoMqBSI0VP +t35MKIt+6cfcuwsU90H0ebFL/hDR8p9ythCV5N9Lfaha7BhNjeu9/QiNX+MonfP6w WhYdvdvUXX1z6Oxmd/9txtJb/GSSW8heNq+1JeTQ= Subject: Re: [struct buf] Unlocked access to b_vflags? To: Konstantin Belousov Cc: freebsd-fs@freebsd.org References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> From: Alexander Lochmann Message-ID: Date: Tue, 13 Apr 2021 13:44:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AmhoOYiNmm1rPl3BVA7mX8Pd6hdZG3E9A" X-Rspamd-Queue-Id: 4FKP015lxmz4c4M X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tu-dortmund.de header.s=unimail header.b=CukGQNDv; dmarc=none; spf=pass (mx1.freebsd.org: domain of alexander.lochmann@tu-dortmund.de designates 129.217.128.51 as permitted sender) smtp.mailfrom=alexander.lochmann@tu-dortmund.de X-Spamd-Result: default: False [-4.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:129.217.128.0/24]; HAS_ATTACHMENT(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RWL_MAILSPIKE_GOOD(0.00)[129.217.128.51:from]; DKIM_TRACE(0.00)[tu-dortmund.de:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_MED(-0.20)[129.217.128.51:from]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:680, ipnet:129.217.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[79.217.117.65:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[tu-dortmund.de:s=unimail]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; DMARC_NA(0.00)[tu-dortmund.de]; DWL_DNSWL_LOW(-1.00)[tu-dortmund.de:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-fs] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 11:44:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --AmhoOYiNmm1rPl3BVA7mX8Pd6hdZG3E9A Content-Type: multipart/mixed; boundary="4jgzcgYTERslCHmALQ79z7QVANtJcJVrI"; protected-headers="v1" From: Alexander Lochmann To: Konstantin Belousov Cc: freebsd-fs@freebsd.org Message-ID: Subject: Re: [struct buf] Unlocked access to b_vflags? References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> In-Reply-To: --4jgzcgYTERslCHmALQ79z7QVANtJcJVrI Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: quoted-printable Thx! Do you mind adding "Found by LockDoc" to the Commit-Msg? Cheers, Alex On 13.04.21 12:25, Konstantin Belousov wrote: > On Mon, Apr 12, 2021 at 11:19:05PM +0200, Alexander Lochmann wrote: >> Hi folks, >> >> I'm was digging through our data set when I encountered a strange situ= ation: >> According to the code in trunc_dependencies() in sys/ufs/ffs/ffs_softd= ep.c, >> the bo_lock should be held. At least that's how I read the code. >> However, we see several thousands of accesses to b_vflags without the >> bo_lock held. >> At least the own b_lock is acquired. >> The access happens in line 7549: bp->b_vflags |=3D BV_SCANNED; [1] >> Can you please shed some light on this situation? >> Is the b_lock sufficeint, and somehow overrules the bo_lock? >> Am I missing something? > I think you found a valid race. There is one more place where BV_SCANN= ED > was manipulated without owning bufobj lock. Patch below should fix bot= h. >=20 > commit a678470b1307542c5a46b930c119b2358863e0d2 > Author: Konstantin Belousov > Date: Tue Apr 13 13:22:56 2021 +0300 >=20 > b_vflags update requries bufobj lock > =20 > Reported by: Alexander Lochmann (trunc_dependencies()) >=20 > diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c > index 0091b5dcd3b8..23c0cf6e128b 100644 > --- a/sys/ufs/ffs/ffs_softdep.c > +++ b/sys/ufs/ffs/ffs_softdep.c > @@ -7546,7 +7546,9 @@ trunc_dependencies(ip, freeblks, lastlbn, lastoff= , flags) > BO_LOCK(bo); > goto cleanrestart; > } > + BO_LOCK(bo); > bp->b_vflags |=3D BV_SCANNED; > + BO_UNLOCK(bo); > bremfree(bp); > if (blkoff !=3D 0) { > allocbuf(bp, blkoff); > diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c > index dc638595eb7b..05eb19c0ee13 100644 > --- a/sys/ufs/ffs/ffs_vnops.c > +++ b/sys/ufs/ffs/ffs_vnops.c > @@ -321,8 +321,9 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int fl= ags) > if (BUF_LOCK(bp, > LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, > BO_LOCKPTR(bo)) !=3D 0) { > + BO_LOCK(bo); > bp->b_vflags &=3D ~BV_SCANNED; > - goto next; > + goto next_locked; > } > } else > continue; > @@ -385,6 +386,7 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int fl= ags) > * to start from a known point. > */ > BO_LOCK(bo); > +next_locked: > nbp =3D TAILQ_FIRST(&bo->bo_dirty.bv_hd); > } > if (waitfor !=3D MNT_WAIT) { >=20 --=20 Technische Universit=C3=A4t Dortmund Alexander Lochmann PGP key: 0xBC3EF6FD Otto-Hahn-Str. 16 phone: +49.231.7556141 D-44227 Dortmund fax: +49.231.7556116 http://ess.cs.tu-dortmund.de/Staff/al --4jgzcgYTERslCHmALQ79z7QVANtJcJVrI-- --AmhoOYiNmm1rPl3BVA7mX8Pd6hdZG3E9A Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEElhZsUHzVP0dbkjCRWT7tBbw+9v0FAmB1hA4FAwAAAAAACgkQWT7tBbw+9v1h Zg//RSp7wM6yeF/eLw5Z7nFW+cCiK6wPheiURqJmMzlYbZRsceqrtROJmvH4cqmNsHBO9l40Byqu Iy2PFJc3PpmDScS0JiT6P94+oGP3vPVX+qkOAiiuBfQeHnjc5XUUNycndEI7Q6+jfCY+kmMKvMQa P4WGf47v0EFrQVZFlMy4yZ7oatDzC/QtLznFz7OYBOeTsjd5QlUXiWj3sAhap/09VZ0+GOGmsgPU Je4HQZpq+fu85uzuv8kieX+Ww/uQXO1auFKZQ1NJVBMQwgQKyyXCQcszqPUoAjv1xCrT4OGkHKLQ SZKLzphfvNbFGa9spL6cwXGAa64NrdnNeHzmDc0ohhLEZ2hBHUPgv4YktK/xCPjwtPSw1PrrtQWV L/npNoLYefhWTPLLQEEhCbaiEW38qbupvv2+kMUO7UC8P8s8YGPUgsqtuQRQFCs3smprcjwCYKaR SC92X6Dbp7H8DRju3Tz2wiRpixvMKol6wEfOHgqfG9IPfGP3Cq9YNIDQ2SwQoFXONu9E+/u/J2H6 MZ9x5RtVhJMFBfyZEVO3ENUc0/37LO2zU3R/14zm3TIuK6PJ4DYXDCS3s72kGDiHOneC2CYWxnF/ 2x6kVjyzJBpUOPap4rEtYkOxK5bBsGgeOxw8mdroLu2DTwt/dY/ZCJwbDMKDjhZv1nW0Ym3gkKmE cpc= =wjdN -----END PGP SIGNATURE----- --AmhoOYiNmm1rPl3BVA7mX8Pd6hdZG3E9A-- From owner-freebsd-fs@freebsd.org Tue Apr 13 11:55:17 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A90925DCCF1 for ; Tue, 13 Apr 2021 11:55:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FKPDj0Kpjz4c3P for ; Tue, 13 Apr 2021 11:55:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 13DBt9du046053 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 13 Apr 2021 14:55:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 13DBt9du046053 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 13DBt9ug046051; Tue, 13 Apr 2021 14:55:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Apr 2021 14:55:09 +0300 From: Konstantin Belousov To: Alexander Lochmann Cc: freebsd-fs@freebsd.org Subject: Re: [struct buf] Unlocked access to b_vflags? Message-ID: References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4FKPDj0Kpjz4c3P X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [3.87 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_SPAM_SHORT(1.00)[1.000]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:470:d5e7:1::1:from]; R_SPF_SOFTFAIL(0.00)[~all:c]; NEURAL_SPAM_MEDIUM(0.87)[0.872]; SPAMHAUS_ZRD(0.00)[2001:470:d5e7:1::1:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(1.00)[1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MAILMAN_DEST(0.00)[freebsd-fs]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 11:55:17 -0000 On Tue, Apr 13, 2021 at 01:44:14PM +0200, Alexander Lochmann wrote: > Thx! > Do you mind adding "Found by LockDoc" to the Commit-Msg? I do not, but I have no idea what LockDoc is. Can you provide the complete attribution sentence, perhaps including the URL to the relevant web page? > > Cheers, > Alex > > On 13.04.21 12:25, Konstantin Belousov wrote: > > On Mon, Apr 12, 2021 at 11:19:05PM +0200, Alexander Lochmann wrote: > > > Hi folks, > > > > > > I'm was digging through our data set when I encountered a strange situation: > > > According to the code in trunc_dependencies() in sys/ufs/ffs/ffs_softdep.c, > > > the bo_lock should be held. At least that's how I read the code. > > > However, we see several thousands of accesses to b_vflags without the > > > bo_lock held. > > > At least the own b_lock is acquired. > > > The access happens in line 7549: bp->b_vflags |= BV_SCANNED; [1] > > > Can you please shed some light on this situation? > > > Is the b_lock sufficeint, and somehow overrules the bo_lock? > > > Am I missing something? > > I think you found a valid race. There is one more place where BV_SCANNED > > was manipulated without owning bufobj lock. Patch below should fix both. > > > > commit a678470b1307542c5a46b930c119b2358863e0d2 > > Author: Konstantin Belousov > > Date: Tue Apr 13 13:22:56 2021 +0300 > > > > b_vflags update requries bufobj lock > > Reported by: Alexander Lochmann (trunc_dependencies()) > > > > diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c > > index 0091b5dcd3b8..23c0cf6e128b 100644 > > --- a/sys/ufs/ffs/ffs_softdep.c > > +++ b/sys/ufs/ffs/ffs_softdep.c > > @@ -7546,7 +7546,9 @@ trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags) > > BO_LOCK(bo); > > goto cleanrestart; > > } > > + BO_LOCK(bo); > > bp->b_vflags |= BV_SCANNED; > > + BO_UNLOCK(bo); > > bremfree(bp); > > if (blkoff != 0) { > > allocbuf(bp, blkoff); > > diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c > > index dc638595eb7b..05eb19c0ee13 100644 > > --- a/sys/ufs/ffs/ffs_vnops.c > > +++ b/sys/ufs/ffs/ffs_vnops.c > > @@ -321,8 +321,9 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags) > > if (BUF_LOCK(bp, > > LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, > > BO_LOCKPTR(bo)) != 0) { > > + BO_LOCK(bo); > > bp->b_vflags &= ~BV_SCANNED; > > - goto next; > > + goto next_locked; > > } > > } else > > continue; > > @@ -385,6 +386,7 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags) > > * to start from a known point. > > */ > > BO_LOCK(bo); > > +next_locked: > > nbp = TAILQ_FIRST(&bo->bo_dirty.bv_hd); > > } > > if (waitfor != MNT_WAIT) { > > > > -- > Technische Universität Dortmund > Alexander Lochmann PGP key: 0xBC3EF6FD > Otto-Hahn-Str. 16 phone: +49.231.7556141 > D-44227 Dortmund fax: +49.231.7556116 > http://ess.cs.tu-dortmund.de/Staff/al > From owner-freebsd-fs@freebsd.org Tue Apr 13 12:14:00 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E09DF5DE61E for ; Tue, 13 Apr 2021 12:14:00 +0000 (UTC) (envelope-from alexander.lochmann@tu-dortmund.de) Received: from unimail.uni-dortmund.de (mx1.hrz.uni-dortmund.de [129.217.128.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "unimail.tu-dortmund.de", Issuer "DFN-Verein Global Issuing CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FKPfJ1k8yz4dY6 for ; Tue, 13 Apr 2021 12:13:59 +0000 (UTC) (envelope-from alexander.lochmann@tu-dortmund.de) Received: from [192.168.111.113] (p4fd97541.dip0.t-ipconnect.de [79.217.117.65]) (authenticated bits=0) by unimail.uni-dortmund.de (8.16.1/8.16.1) with ESMTPSA id 13DCDw44025269 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT); Tue, 13 Apr 2021 14:13:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tu-dortmund.de; s=unimail; t=1618316038; bh=s7kI1roVAGPChMYjcPhM8DhTfdBfLLvW5VB3EwsJwNI=; h=To:Cc:References:From:Subject:Date:In-Reply-To; b=ZOLM6HniMLQzK0sYge+llPXldwyE3eTkzyhTqgXqEW71TvWG+ZhlxUOZrOKhgKc8K /wZw6fcM5wj/Q5c7xZo2wdgu4rbFjYhj0h3zvsHs50TIts4hSPXdUuOi73r3H9zwY8 +BvOoamhL8Bo+sSBoIY+R1nW12rwMYhW72n0e6Hg= To: Konstantin Belousov Cc: freebsd-fs@freebsd.org References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> From: Alexander Lochmann Subject: Re: [struct buf] Unlocked access to b_vflags? Message-ID: <291727c7-df2e-3fa6-ebb0-597b8deff461@tu-dortmund.de> Date: Tue, 13 Apr 2021 14:13:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JsYBnVdg0kdU61b0iOAdNBxdKSkygvK5X" X-Rspamd-Queue-Id: 4FKPfJ1k8yz4dY6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tu-dortmund.de header.s=unimail header.b=ZOLM6Hni; dmarc=none; spf=pass (mx1.freebsd.org: domain of alexander.lochmann@tu-dortmund.de designates 129.217.128.51 as permitted sender) smtp.mailfrom=alexander.lochmann@tu-dortmund.de X-Spamd-Result: default: False [-4.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:129.217.128.0/24:c]; HAS_ATTACHMENT(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RWL_MAILSPIKE_GOOD(0.00)[129.217.128.51:from]; DKIM_TRACE(0.00)[tu-dortmund.de:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_MED(-0.20)[129.217.128.51:from]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:680, ipnet:129.217.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[79.217.117.65:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[tu-dortmund.de:s=unimail]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; DMARC_NA(0.00)[tu-dortmund.de]; DWL_DNSWL_LOW(-1.00)[tu-dortmund.de:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-fs] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 12:14:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JsYBnVdg0kdU61b0iOAdNBxdKSkygvK5X Content-Type: multipart/mixed; boundary="A7LT9BDevmksK34wvEmI1pFGEmzWb5gk9"; protected-headers="v1" From: Alexander Lochmann To: Konstantin Belousov Cc: freebsd-fs@freebsd.org Message-ID: <291727c7-df2e-3fa6-ebb0-597b8deff461@tu-dortmund.de> Subject: Re: [struct buf] Unlocked access to b_vflags? References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> In-Reply-To: --A7LT9BDevmksK34wvEmI1pFGEmzWb5gk9 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable "The bug was found by analyzing the memory accesses to certain data=20 types and lock operations while running a load. The whole workflow is=20 called LockDoc." or "The bug was found by performing lock analysis using LockDoc." Is this enough, or shall I explain it in more detail? Unfortunately, we do not have a project page yet. I, however, have the link to our paper:=20 https://doi.org/10.1145/3302424.3303948 - Alex On 13.04.21 13:55, Konstantin Belousov wrote: > On Tue, Apr 13, 2021 at 01:44:14PM +0200, Alexander Lochmann wrote: >> Thx! >> Do you mind adding "Found by LockDoc" to the Commit-Msg? > I do not, but I have no idea what LockDoc is. Can you provide the comp= lete > attribution sentence, perhaps including the URL to the relevant web pag= e? >=20 >> >> Cheers, >> Alex >> >> On 13.04.21 12:25, Konstantin Belousov wrote: >>> On Mon, Apr 12, 2021 at 11:19:05PM +0200, Alexander Lochmann wrote: >>>> Hi folks, >>>> >>>> I'm was digging through our data set when I encountered a strange si= tuation: >>>> According to the code in trunc_dependencies() in sys/ufs/ffs/ffs_sof= tdep.c, >>>> the bo_lock should be held. At least that's how I read the code. >>>> However, we see several thousands of accesses to b_vflags without th= e >>>> bo_lock held. >>>> At least the own b_lock is acquired. >>>> The access happens in line 7549: bp->b_vflags |=3D BV_SCANNED; [1] >>>> Can you please shed some light on this situation? >>>> Is the b_lock sufficeint, and somehow overrules the bo_lock? >>>> Am I missing something? >>> I think you found a valid race. There is one more place where BV_SCA= NNED >>> was manipulated without owning bufobj lock. Patch below should fix b= oth. >>> >>> commit a678470b1307542c5a46b930c119b2358863e0d2 >>> Author: Konstantin Belousov >>> Date: Tue Apr 13 13:22:56 2021 +0300 >>> >>> b_vflags update requries bufobj lock >>> Reported by: Alexander Lochmann (trunc_dependencies()) >>> >>> diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c >>> index 0091b5dcd3b8..23c0cf6e128b 100644 >>> --- a/sys/ufs/ffs/ffs_softdep.c >>> +++ b/sys/ufs/ffs/ffs_softdep.c >>> @@ -7546,7 +7546,9 @@ trunc_dependencies(ip, freeblks, lastlbn, lasto= ff, flags) >>> BO_LOCK(bo); >>> goto cleanrestart; >>> } >>> + BO_LOCK(bo); >>> bp->b_vflags |=3D BV_SCANNED; >>> + BO_UNLOCK(bo); >>> bremfree(bp); >>> if (blkoff !=3D 0) { >>> allocbuf(bp, blkoff); >>> diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c >>> index dc638595eb7b..05eb19c0ee13 100644 >>> --- a/sys/ufs/ffs/ffs_vnops.c >>> +++ b/sys/ufs/ffs/ffs_vnops.c >>> @@ -321,8 +321,9 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int = flags) >>> if (BUF_LOCK(bp, >>> LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, >>> BO_LOCKPTR(bo)) !=3D 0) { >>> + BO_LOCK(bo); >>> bp->b_vflags &=3D ~BV_SCANNED; >>> - goto next; >>> + goto next_locked; >>> } >>> } else >>> continue; >>> @@ -385,6 +386,7 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int = flags) >>> * to start from a known point. >>> */ >>> BO_LOCK(bo); >>> +next_locked: >>> nbp =3D TAILQ_FIRST(&bo->bo_dirty.bv_hd); >>> } >>> if (waitfor !=3D MNT_WAIT) { >>> >> >> --=20 >> Technische Universit=C3=A4t Dortmund >> Alexander Lochmann PGP key: 0xBC3EF6FD >> Otto-Hahn-Str. 16 phone: +49.231.7556141 >> D-44227 Dortmund fax: +49.231.7556116 >> http://ess.cs.tu-dortmund.de/Staff/al >> >=20 >=20 >=20 --=20 Technische Universit=C3=A4t Dortmund Alexander Lochmann PGP key: 0xBC3EF6FD Otto-Hahn-Str. 16 phone: +49.231.7556141 D-44227 Dortmund fax: +49.231.7556116 http://ess.cs.tu-dortmund.de/Staff/al --A7LT9BDevmksK34wvEmI1pFGEmzWb5gk9-- --JsYBnVdg0kdU61b0iOAdNBxdKSkygvK5X Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEElhZsUHzVP0dbkjCRWT7tBbw+9v0FAmB1iwUFAwAAAAAACgkQWT7tBbw+9v0j Dg//dvCbnMOFMkqo+i/gs1tNNUBs15lGI4b99qqVUu+yKmeGq9BEJl+MKktGYqhtt2V9rJff+L+d omHEnDzAE74wXwJ1vx8PRJNYbkX66AFZ3k1KZwI/Hdk6JrvElunKE284HW331pPtELZwxZXlGVpP LCPPajbds1BmV+Yj5Q4a/WMdiYMXtm0xeY4dguwf0qKxSniV//OpHS6bqfozAHZIpYvx/d6zY8NW 0UQfAuWrjxkRN2OegKRZwpOSxubjQvyeUHoacxxlfvhDm2AJvpUaYLzmrcmuhS/TdgOee1b4j+cO AhOWwYTawlhVjCl9nVvA53IotX18jBLeRLUY0Ar583AQQxtRHW2UTbPB+TlSMRXAUtKs1CqZZ+6L lTWfbyd7kc4exMOUoWWmCdTUXaREm+Z7viYSFQeKWlV9yiOoOCj5eIuTnOlKsp/x3XL214fBMiex uzY+MTYthqAWlcKShaR/Cv+3iJVKWK8j625IWnuMqZKq6oeDSX0gRQ8qcmHtg+qceGeGdJk1Yxys GCQNzK6zrq25DyyI3npdQ0uOVN10XLv07/sBW76t4jK3u6sQBNBbTcA+KNNSZsdwxVZ7odtZ05fa jZwEZNyT9NFb0k0/a1kMJL65Z7tLsg2Mrjm4a4whHBLfUl2O5UkaXFQB6EUfIpudmLLxbBseP4Mi DYY= =OeeC -----END PGP SIGNATURE----- --JsYBnVdg0kdU61b0iOAdNBxdKSkygvK5X-- From owner-freebsd-fs@freebsd.org Tue Apr 13 12:35:34 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 929C65DEEF7 for ; Tue, 13 Apr 2021 12:35:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FKQ793VrFz4fjm for ; Tue, 13 Apr 2021 12:35:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 13DCZOHO055962 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 13 Apr 2021 15:35:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 13DCZOHO055962 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 13DCZObV055960; Tue, 13 Apr 2021 15:35:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Apr 2021 15:35:24 +0300 From: Konstantin Belousov To: Alexander Lochmann Cc: freebsd-fs@freebsd.org Subject: Re: [struct buf] Unlocked access to b_vflags? Message-ID: References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> <291727c7-df2e-3fa6-ebb0-597b8deff461@tu-dortmund.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <291727c7-df2e-3fa6-ebb0-597b8deff461@tu-dortmund.de> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4FKQ793VrFz4fjm X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [3.87 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_SPAM_SHORT(1.00)[0.999]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:470:d5e7:1::1:from]; R_SPF_SOFTFAIL(0.00)[~all]; NEURAL_SPAM_MEDIUM(0.87)[0.868]; SPAMHAUS_ZRD(0.00)[2001:470:d5e7:1::1:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(1.00)[1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MAILMAN_DEST(0.00)[freebsd-fs]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 12:35:34 -0000 On Tue, Apr 13, 2021 at 02:13:57PM +0200, Alexander Lochmann wrote: > "The bug was found by analyzing the memory accesses to certain data types > and lock operations while running a load. The whole workflow is called > LockDoc." > or > "The bug was found by performing lock analysis using LockDoc." > Is this enough, or shall I explain it in more detail? > > Unfortunately, we do not have a project page yet. > I, however, have the link to our paper: > https://doi.org/10.1145/3302424.3303948 But it is beyond the paywall? > > - Alex > > On 13.04.21 13:55, Konstantin Belousov wrote: > > On Tue, Apr 13, 2021 at 01:44:14PM +0200, Alexander Lochmann wrote: > > > Thx! > > > Do you mind adding "Found by LockDoc" to the Commit-Msg? > > I do not, but I have no idea what LockDoc is. Can you provide the complete > > attribution sentence, perhaps including the URL to the relevant web page? > > > > > > > > Cheers, > > > Alex > > > > > > On 13.04.21 12:25, Konstantin Belousov wrote: > > > > On Mon, Apr 12, 2021 at 11:19:05PM +0200, Alexander Lochmann wrote: > > > > > Hi folks, > > > > > > > > > > I'm was digging through our data set when I encountered a strange situation: > > > > > According to the code in trunc_dependencies() in sys/ufs/ffs/ffs_softdep.c, > > > > > the bo_lock should be held. At least that's how I read the code. > > > > > However, we see several thousands of accesses to b_vflags without the > > > > > bo_lock held. > > > > > At least the own b_lock is acquired. > > > > > The access happens in line 7549: bp->b_vflags |= BV_SCANNED; [1] > > > > > Can you please shed some light on this situation? > > > > > Is the b_lock sufficeint, and somehow overrules the bo_lock? > > > > > Am I missing something? > > > > I think you found a valid race. There is one more place where BV_SCANNED > > > > was manipulated without owning bufobj lock. Patch below should fix both. > > > > > > > > commit a678470b1307542c5a46b930c119b2358863e0d2 > > > > Author: Konstantin Belousov > > > > Date: Tue Apr 13 13:22:56 2021 +0300 > > > > > > > > b_vflags update requries bufobj lock > > > > Reported by: Alexander Lochmann (trunc_dependencies()) > > > > > > > > diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c > > > > index 0091b5dcd3b8..23c0cf6e128b 100644 > > > > --- a/sys/ufs/ffs/ffs_softdep.c > > > > +++ b/sys/ufs/ffs/ffs_softdep.c > > > > @@ -7546,7 +7546,9 @@ trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags) > > > > BO_LOCK(bo); > > > > goto cleanrestart; > > > > } > > > > + BO_LOCK(bo); > > > > bp->b_vflags |= BV_SCANNED; > > > > + BO_UNLOCK(bo); > > > > bremfree(bp); > > > > if (blkoff != 0) { > > > > allocbuf(bp, blkoff); > > > > diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c > > > > index dc638595eb7b..05eb19c0ee13 100644 > > > > --- a/sys/ufs/ffs/ffs_vnops.c > > > > +++ b/sys/ufs/ffs/ffs_vnops.c > > > > @@ -321,8 +321,9 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags) > > > > if (BUF_LOCK(bp, > > > > LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, > > > > BO_LOCKPTR(bo)) != 0) { > > > > + BO_LOCK(bo); > > > > bp->b_vflags &= ~BV_SCANNED; > > > > - goto next; > > > > + goto next_locked; > > > > } > > > > } else > > > > continue; > > > > @@ -385,6 +386,7 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags) > > > > * to start from a known point. > > > > */ > > > > BO_LOCK(bo); > > > > +next_locked: > > > > nbp = TAILQ_FIRST(&bo->bo_dirty.bv_hd); > > > > } > > > > if (waitfor != MNT_WAIT) { > > > > > > > > > > -- > > > Technische Universität Dortmund > > > Alexander Lochmann PGP key: 0xBC3EF6FD > > > Otto-Hahn-Str. 16 phone: +49.231.7556141 > > > D-44227 Dortmund fax: +49.231.7556116 > > > http://ess.cs.tu-dortmund.de/Staff/al > > > > > > > > > > > -- > Technische Universität Dortmund > Alexander Lochmann PGP key: 0xBC3EF6FD > Otto-Hahn-Str. 16 phone: +49.231.7556141 > D-44227 Dortmund fax: +49.231.7556116 > http://ess.cs.tu-dortmund.de/Staff/al > From owner-freebsd-fs@freebsd.org Tue Apr 13 13:08:15 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C67CB5DFBA2 for ; Tue, 13 Apr 2021 13:08:15 +0000 (UTC) (envelope-from alexander.lochmann@tu-dortmund.de) Received: from unimail.uni-dortmund.de (mx1.hrz.uni-dortmund.de [129.217.128.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "unimail.tu-dortmund.de", Issuer "DFN-Verein Global Issuing CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FKQrv0Lz0z4gj6 for ; Tue, 13 Apr 2021 13:08:14 +0000 (UTC) (envelope-from alexander.lochmann@tu-dortmund.de) Received: from [192.168.111.113] (p4fd97541.dip0.t-ipconnect.de [79.217.117.65]) (authenticated bits=0) by unimail.uni-dortmund.de (8.16.1/8.16.1) with ESMTPSA id 13DD8C89004446 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT); Tue, 13 Apr 2021 15:08:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tu-dortmund.de; s=unimail; t=1618319293; bh=MdWTljgKiF54VY9lwRBvQBDzjruB17b6mCOXJeMjLcw=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=UBwvQ935hR2nURyTYWZFuy9sy87LevqQQNP1XaL9WYUUSwzIRrHykIb+FsZ4He3H1 rDIHv5bshdg0Zo1fpBLjUx+O/BzDz6PJa/xkv5QArw8VsbTxfnnZ9d9vAGzemob+Je Uu3uyqT+NNFc2pUAIfJbvClR4KSgKpxqII/N+CDU= Subject: Re: [struct buf] Unlocked access to b_vflags? To: Konstantin Belousov Cc: freebsd-fs@freebsd.org References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> <291727c7-df2e-3fa6-ebb0-597b8deff461@tu-dortmund.de> From: Alexander Lochmann Message-ID: <1761e31d-d77e-bffe-49c3-fb589530e1e8@tu-dortmund.de> Date: Tue, 13 Apr 2021 15:08:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iH6CXz1BapfZEu7ol3B4CbSgqvsJA4rzw" X-Rspamd-Queue-Id: 4FKQrv0Lz0z4gj6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tu-dortmund.de header.s=unimail header.b=UBwvQ935; dmarc=none; spf=pass (mx1.freebsd.org: domain of alexander.lochmann@tu-dortmund.de designates 129.217.128.51 as permitted sender) smtp.mailfrom=alexander.lochmann@tu-dortmund.de X-Spamd-Result: default: False [-4.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:129.217.128.0/24]; HAS_ATTACHMENT(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RWL_MAILSPIKE_GOOD(0.00)[129.217.128.51:from]; DKIM_TRACE(0.00)[tu-dortmund.de:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_MED(-0.20)[129.217.128.51:from]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:680, ipnet:129.217.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[79.217.117.65:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[tu-dortmund.de:s=unimail]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; DMARC_NA(0.00)[tu-dortmund.de]; DWL_DNSWL_LOW(-1.00)[tu-dortmund.de:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-fs] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 13:08:15 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iH6CXz1BapfZEu7ol3B4CbSgqvsJA4rzw Content-Type: multipart/mixed; boundary="FhLYkotMpDYqiksepahnGdkvZKo2ocSlt"; protected-headers="v1" From: Alexander Lochmann To: Konstantin Belousov Cc: freebsd-fs@freebsd.org Message-ID: <1761e31d-d77e-bffe-49c3-fb589530e1e8@tu-dortmund.de> Subject: Re: [struct buf] Unlocked access to b_vflags? References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> <291727c7-df2e-3fa6-ebb0-597b8deff461@tu-dortmund.de> In-Reply-To: --FhLYkotMpDYqiksepahnGdkvZKo2ocSlt Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: quoted-printable On 13.04.21 14:35, Konstantin Belousov wrote: > On Tue, Apr 13, 2021 at 02:13:57PM +0200, Alexander Lochmann wrote: >> "The bug was found by analyzing the memory accesses to certain data ty= pes >> and lock operations while running a load. The whole workflow is called= >> LockDoc." >> or >> "The bug was found by performing lock analysis using LockDoc." >> Is this enough, or shall I explain it in more detail? >> >> Unfortunately, we do not have a project page yet. >> I, however, have the link to our paper: >> https://doi.org/10.1145/3302424.3303948 > But it is beyond the paywall? Oh. Yes, it is. I put a version of the paper on my personal website:=20 https://ess.cs.tu-dortmund.de/Staff/al/Publications/index.html I don't know how long this website will be available after I leave=20 university. :( - Alex >=20 >> >> - Alex >> >> On 13.04.21 13:55, Konstantin Belousov wrote: >>> On Tue, Apr 13, 2021 at 01:44:14PM +0200, Alexander Lochmann wrote: >>>> Thx! >>>> Do you mind adding "Found by LockDoc" to the Commit-Msg? >>> I do not, but I have no idea what LockDoc is. Can you provide the co= mplete >>> attribution sentence, perhaps including the URL to the relevant web p= age? >>> >>>> >>>> Cheers, >>>> Alex >>>> >>>> On 13.04.21 12:25, Konstantin Belousov wrote: >>>>> On Mon, Apr 12, 2021 at 11:19:05PM +0200, Alexander Lochmann wrote:= >>>>>> Hi folks, >>>>>> >>>>>> I'm was digging through our data set when I encountered a strange = situation: >>>>>> According to the code in trunc_dependencies() in sys/ufs/ffs/ffs_s= oftdep.c, >>>>>> the bo_lock should be held. At least that's how I read the code. >>>>>> However, we see several thousands of accesses to b_vflags without = the >>>>>> bo_lock held. >>>>>> At least the own b_lock is acquired. >>>>>> The access happens in line 7549: bp->b_vflags |=3D BV_SCANNED; [1]= >>>>>> Can you please shed some light on this situation? >>>>>> Is the b_lock sufficeint, and somehow overrules the bo_lock? >>>>>> Am I missing something? >>>>> I think you found a valid race. There is one more place where BV_S= CANNED >>>>> was manipulated without owning bufobj lock. Patch below should fix=20 both. >>>>> >>>>> commit a678470b1307542c5a46b930c119b2358863e0d2 >>>>> Author: Konstantin Belousov >>>>> Date: Tue Apr 13 13:22:56 2021 +0300 >>>>> >>>>> b_vflags update requries bufobj lock >>>>> Reported by: Alexander Lochmann (trunc_dependencies()) >>>>> >>>>> diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c >>>>> index 0091b5dcd3b8..23c0cf6e128b 100644 >>>>> --- a/sys/ufs/ffs/ffs_softdep.c >>>>> +++ b/sys/ufs/ffs/ffs_softdep.c >>>>> @@ -7546,7 +7546,9 @@ trunc_dependencies(ip, freeblks, lastlbn, las= toff, flags) >>>>> BO_LOCK(bo); >>>>> goto cleanrestart; >>>>> } >>>>> + BO_LOCK(bo); >>>>> bp->b_vflags |=3D BV_SCANNED; >>>>> + BO_UNLOCK(bo); >>>>> bremfree(bp); >>>>> if (blkoff !=3D 0) { >>>>> allocbuf(bp, blkoff); >>>>> diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c >>>>> index dc638595eb7b..05eb19c0ee13 100644 >>>>> --- a/sys/ufs/ffs/ffs_vnops.c >>>>> +++ b/sys/ufs/ffs/ffs_vnops.c >>>>> @@ -321,8 +321,9 @@ ffs_syncvnode(struct vnode *vp, int waitfor, in= t flags) >>>>> if (BUF_LOCK(bp, >>>>> LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, >>>>> BO_LOCKPTR(bo)) !=3D 0) { >>>>> + BO_LOCK(bo); >>>>> bp->b_vflags &=3D ~BV_SCANNED; >>>>> - goto next; >>>>> + goto next_locked; >>>>> } >>>>> } else >>>>> continue; >>>>> @@ -385,6 +386,7 @@ ffs_syncvnode(struct vnode *vp, int waitfor, in= t flags) >>>>> * to start from a known point. >>>>> */ >>>>> BO_LOCK(bo); >>>>> +next_locked: >>>>> nbp =3D TAILQ_FIRST(&bo->bo_dirty.bv_hd); >>>>> } >>>>> if (waitfor !=3D MNT_WAIT) { >>>>> >>>> >>>> --=20 >>>> Technische Universit=C3=A4t Dortmund >>>> Alexander Lochmann PGP key: 0xBC3EF6FD >>>> Otto-Hahn-Str. 16 phone: +49.231.7556141 >>>> D-44227 Dortmund fax: +49.231.7556116 >>>> http://ess.cs.tu-dortmund.de/Staff/al >>>> >>> >>> >>> >> >> --=20 >> Technische Universit=C3=A4t Dortmund >> Alexander Lochmann PGP key: 0xBC3EF6FD >> Otto-Hahn-Str. 16 phone: +49.231.7556141 >> D-44227 Dortmund fax: +49.231.7556116 >> http://ess.cs.tu-dortmund.de/Staff/al >> >=20 >=20 >=20 --=20 Technische Universit=C3=A4t Dortmund Alexander Lochmann PGP key: 0xBC3EF6FD Otto-Hahn-Str. 16 phone: +49.231.7556141 D-44227 Dortmund fax: +49.231.7556116 http://ess.cs.tu-dortmund.de/Staff/al --FhLYkotMpDYqiksepahnGdkvZKo2ocSlt-- --iH6CXz1BapfZEu7ol3B4CbSgqvsJA4rzw Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEElhZsUHzVP0dbkjCRWT7tBbw+9v0FAmB1l7wFAwAAAAAACgkQWT7tBbw+9v1Q nRAAxn6CEcICLw+rW9qnidNb5l0zqPE2H6oQy/vr9kQDzn1tP6cb/IszLqqpyCB35byYIyNVFJQj IyKB891UwyHTW/CNkRNnq/vRrB3J84MMLg0U1mqGbY+IjfC5N1lZIK8I/1nVea7koczq9Wc+ouvw zdofH9Q+UTs4QqvxaXITdMA0GwxuhfvJLoiaDwiK0VXDdI7kd6eeAXZUw46VyQn44hjivfyJJVei FAu7p4itQKUSGs5kd2zsMlYKwAIjliYBGZK1gQWFFN/RyWrkMdG/aSqelCi1K7p8DxHZ1028whQn 7tEViKVR8mnqCHLkMBjU3iluub/Ls4ZuCvw6twDMBeMiCqRQUdvDLt/WOWGTfNmAClQqqHIjotv/ BDin9Mmq1lyeTPtsc0xauIaK8fbrcJvuzxHWHG+eUZb3qZWZU0SrXZaoPjA/gQwklLX0rGJj0lgM SzoikD276xgQ26u/EP/UofR55r3+mYZg8HEhbAsgpmjB4tNijRppGoPffLTCGMiTHBjt4gcBFYkn ILg9UBc1ywaUITeYmqpM6vF16Y7HJxjxoBK7lOCvxf1hzJ3p1WZoqLGxbcoqwZ2cc82ZH/szcReZ kUtLJ6mV/OfxKdhksYIfJINltg4mZSYUNw9YBgVp6eywzyBGzmSYj0/yBFSmUYGRnL9bvgOPZJSd Ovo= =5A6j -----END PGP SIGNATURE----- --iH6CXz1BapfZEu7ol3B4CbSgqvsJA4rzw-- From owner-freebsd-fs@freebsd.org Tue Apr 13 13:15:20 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 076435DFCFE for ; Tue, 13 Apr 2021 13:15:20 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FKR136d4Fz4h4y; Tue, 13 Apr 2021 13:15:19 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300cd5f14ca0094cd5679b406b31b.dip0.t-ipconnect.de [IPv6:2003:cd:5f14:ca00:94cd:5679:b406:b31b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 5551D2C4AA; Tue, 13 Apr 2021 13:15:19 +0000 (UTC) (envelope-from se@freebsd.org) To: Konstantin Belousov Cc: freebsd-fs@freebsd.org, Alexander Lochmann References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> <291727c7-df2e-3fa6-ebb0-597b8deff461@tu-dortmund.de> From: Stefan Esser Subject: Re: [struct buf] Unlocked access to b_vflags? Message-ID: <3a3cfaa1-c240-c94b-2e2f-15ce05eaac4f@freebsd.org> Date: Tue, 13 Apr 2021 15:15:17 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4LODb3wWheP8m5Gl4JKjxTFD0pc1JGlLk" X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 13:15:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4LODb3wWheP8m5Gl4JKjxTFD0pc1JGlLk Content-Type: multipart/mixed; boundary="mPL7mUYRmTWZmQEESdzTYmiVh4HtvPgNC"; protected-headers="v1" From: Stefan Esser To: Konstantin Belousov Cc: freebsd-fs@freebsd.org, Alexander Lochmann Message-ID: <3a3cfaa1-c240-c94b-2e2f-15ce05eaac4f@freebsd.org> Subject: Re: [struct buf] Unlocked access to b_vflags? References: <792c8a3d-8ea6-073f-3fda-b3eb793ef2b9@tu-dortmund.de> <291727c7-df2e-3fa6-ebb0-597b8deff461@tu-dortmund.de> In-Reply-To: --mPL7mUYRmTWZmQEESdzTYmiVh4HtvPgNC Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 13.04.21 um 14:35 schrieb Konstantin Belousov: > On Tue, Apr 13, 2021 at 02:13:57PM +0200, Alexander Lochmann wrote: >> "The bug was found by analyzing the memory accesses to certain data ty= pes >> and lock operations while running a load. The whole workflow is called= >> LockDoc." >> or >> "The bug was found by performing lock analysis using LockDoc." >> Is this enough, or shall I explain it in more detail? >> >> Unfortunately, we do not have a project page yet. >> I, however, have the link to our paper: >> https://doi.org/10.1145/3302424.3303948 > But it is beyond the paywall? Since I have been interested in these papers, too, I have looked for alternate download sites: https://ess.cs.tu-dortmund.de/Staff/al/Publications/files/eurosys-2019-lo= ckdoc-lochmann.pdf And a newer follow-up paper: https://dl.gi.de/bitstream/handle/20.500.12116/34350/Paper01.pdf Regards, STefan --mPL7mUYRmTWZmQEESdzTYmiVh4HtvPgNC-- --4LODb3wWheP8m5Gl4JKjxTFD0pc1JGlLk Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmB1mWUFAwAAAAAACgkQR+u171r99UT5 gwf9FhaXfbpomLnJJDruQbhw6UDgAggfVoSnJgOyj1ZXHwQLXLk+4tAz8hiONB4j8yMBiVUY70sX ufaLPy4gLOcnbc6+/CETlg+dX42M/jP3pvqyokbgqm8PoF5xRtpHmqpNxfvrp4ATEaVbM1z/6sY8 Vo4eB0iKlGNz3b3E6ZevbjNhCuilLmI6/XPZp1cpl8T0zGsmTw6r+UXsLWQ6Dmq9RMdGErl+0Xlj gcWnmJ+Vat3SxAYBCwC6Tx2UfutCwozmhdyTThbRhWjJQX4ZSRDPz8IKGv77Z+LjfCdbh1pI8LXS D56MD3Cnkh0vYCeova/5L/xwWIj5gHKUeie7me5BoQ== =AGk/ -----END PGP SIGNATURE----- --4LODb3wWheP8m5Gl4JKjxTFD0pc1JGlLk-- From owner-freebsd-fs@freebsd.org Wed Apr 14 07:38:20 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDA525CCDED for ; Wed, 14 Apr 2021 07:38:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FKvTm6DV9z4gFk for ; Wed, 14 Apr 2021 07:38:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id D3F3D5CCDEC; Wed, 14 Apr 2021 07:38:20 +0000 (UTC) Delivered-To: fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2A355CCDEB for ; Wed, 14 Apr 2021 07:38:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FKvTm5MMxz4fty for ; Wed, 14 Apr 2021 07:38:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A730519DBE for ; Wed, 14 Apr 2021 07:38:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 13E7cKc3020695 for ; Wed, 14 Apr 2021 07:38:20 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 13E7cK83020694 for fs@FreeBSD.org; Wed, 14 Apr 2021 07:38:20 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: fs@FreeBSD.org Subject: [Bug 254682] quota enabled filesystem doesn't show enabled running mount command Date: Wed, 14 Apr 2021 07:38:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: chris@cretaforce.gr X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2021 07:38:21 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254682 --- Comment #3 from Christos Chatzaras --- (In reply to Kirk McKusick from comment #2) Yes this patch solves the problem. I test it with releng/13.0. Can you MFC = it to stable/13 ? Thank you. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-fs@freebsd.org Wed Apr 14 22:21:44 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 384D85D310A for ; Wed, 14 Apr 2021 22:21:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FLH540tfnz4XVJ for ; Wed, 14 Apr 2021 22:21:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 1E3215D2DA6; Wed, 14 Apr 2021 22:21:44 +0000 (UTC) Delivered-To: fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C7385D2DA5 for ; Wed, 14 Apr 2021 22:21:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FLH54056Cz4XX2 for ; Wed, 14 Apr 2021 22:21:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8DAF25C6C for ; Wed, 14 Apr 2021 22:21:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 13EMLh41096372 for ; Wed, 14 Apr 2021 22:21:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 13EMLhh0096371 for fs@FreeBSD.org; Wed, 14 Apr 2021 22:21:43 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: fs@FreeBSD.org Subject: [Bug 254682] quota enabled filesystem doesn't show enabled running mount command Date: Wed, 14 Apr 2021 22:21:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2021 22:21:44 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254682 --- Comment #4 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D14d0cd7225e250015eb6d9c79a7eb4e94= 4211b23 commit 14d0cd7225e250015eb6d9c79a7eb4e944211b23 Author: Kirk McKusick AuthorDate: 2021-04-14 22:22:12 +0000 Commit: Kirk McKusick CommitDate: 2021-04-14 22:25:08 +0000 Ensure that the mount command shows "with quotas" when quotas are enabl= ed. When quotas are enabled with the quotaon(8) command, it sets the MNT_QUOTA flag in the mount structure mnt_flag field. The mount structure holds a cached copy of the filesystem statfs structure in mnt_stat that includes a copy of the mnt_flag field in mnt_stat.f_flags. The mnt_stat structure may not be updated for hours. Since the mount command requests mount details using the MNT_NOWAIT option, it gets the mount's mnt_stat statfs structure whose f_flags field does not yet show the MNT_QUOTA flag being set in mnt_flag. The fix is to have quotaon(8) set the MNT_QUOTA flag in both mnt_flag and in mnt_stat.f_flags so that it will be immediately visible to callers of statfs(2). Reported by: Christos Chatzaras Tested by: Christos Chatzaras PR: 254682 MFC after: 3 days Sponsored by: Netflix sys/ufs/ufs/ufs_quota.c | 2 ++ 1 file changed, 2 insertions(+) --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-fs@freebsd.org Wed Apr 14 22:28:19 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D623A5D31FA for ; Wed, 14 Apr 2021 22:28:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FLHDg5Xs0z4Xyv for ; Wed, 14 Apr 2021 22:28:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id BC9535D31F9; Wed, 14 Apr 2021 22:28:19 +0000 (UTC) Delivered-To: fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC5CB5D31F8 for ; Wed, 14 Apr 2021 22:28:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FLHDg4s8Vz4Y8t for ; Wed, 14 Apr 2021 22:28:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95DFA2594C for ; Wed, 14 Apr 2021 22:28:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 13EMSJk2099763 for ; Wed, 14 Apr 2021 22:28:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 13EMSJnF099762 for fs@FreeBSD.org; Wed, 14 Apr 2021 22:28:19 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: fs@FreeBSD.org Subject: [Bug 254682] quota enabled filesystem doesn't show enabled running mount command Date: Wed, 14 Apr 2021 22:28:19 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: mckusick@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status Message-ID: In-Reply-To: References: 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-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2021 22:28:19 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254682 Kirk McKusick changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Open |In Progress --- Comment #5 from Kirk McKusick --- Will be MFC'ed to stable/12 and stable/13 in three days if no problems are reported with it. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-fs@freebsd.org Wed Apr 14 22:44:04 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3487B5D3AB2 for ; Wed, 14 Apr 2021 22:44:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FLHZr0rcZz4YlJ for ; Wed, 14 Apr 2021 22:44:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 1B5E05D39C2; Wed, 14 Apr 2021 22:44:04 +0000 (UTC) Delivered-To: fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B2655D3AB1 for ; Wed, 14 Apr 2021 22:44:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FLHZr073zz4Yhc for ; Wed, 14 Apr 2021 22:44:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB62E25F46 for ; Wed, 14 Apr 2021 22:44:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 13EMi3Nh010543 for ; Wed, 14 Apr 2021 22:44:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 13EMi3R0010542 for fs@FreeBSD.org; Wed, 14 Apr 2021 22:44:03 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: fs@FreeBSD.org Subject: [Bug 254682] quota enabled filesystem doesn't show enabled running mount command Date: Wed, 14 Apr 2021 22:44:04 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: chris@cretaforce.gr X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2021 22:44:04 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254682 --- Comment #6 from Christos Chatzaras --- (In reply to Kirk McKusick from comment #5) Thank you. I am not 100% sure but I didn't notice this problem with 12.2. At least Monit didn't report filesystem flags changes with 12.2. But I have no= t a system with 12.2 any more to check it. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-fs@freebsd.org Sat Apr 17 12:39:32 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9427B5D4A58 for ; Sat, 17 Apr 2021 12:39:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FMt1w3dBDz4fcY for ; Sat, 17 Apr 2021 12:39:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 7C7D15D4B6D; Sat, 17 Apr 2021 12:39:32 +0000 (UTC) Delivered-To: fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C4605D48E9 for ; Sat, 17 Apr 2021 12:39:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FMt1w339Rz4ffk for ; Sat, 17 Apr 2021 12:39:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B6861815D for ; Sat, 17 Apr 2021 12:39:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 13HCdWZt095532 for ; Sat, 17 Apr 2021 12:39:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 13HCdWQW095531 for fs@FreeBSD.org; Sat, 17 Apr 2021 12:39:32 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: fs@FreeBSD.org Subject: [Bug 249985] kernel panic at shutdown in zfs_acl_free() and list_remove() Date: Sat, 17 Apr 2021 12:39:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed 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 Only Me X-Bugzilla-Who: madpilot@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2021 12:39:32 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D249985 --- Comment #6 from Guido Falsi --- By chance I discovered something interesting. Now the machine is regularly down this: # zfs list -t snapshot internal error: cannot iterate filesystems: Invalid argument Abort (core dumped) (backtrace at the end of this comment, but I don't think this one is interesting) I tracked this down to a single snapshot that looks corrupted, if I try to analyze it with zfs zfs crashes,=20 If I try to destroy that snashot with: zfs destroy zroot/var/mail@2021-03-14_18.00.00--1w I cause a kernel panic, backtrace also at end of message. What I gather from this panic is that the openzfs code is returning EINVAL = at=20 I cause a kernel panic, backtrace also at end of message. I don't know enou= gh about ZFS to understand more than this, unluckily. Some more information: > uname -a FreeBSD ubik.madpilot.net 14.0-CURRENT FreeBSD 14.0-CURRENT main-n246069-112f007e128 MPNET amd64 The machine is an acer laptop, the disk is an nvd(4) device, and I'm runnin= g it eli encrypted, the disk layout was created by the installer when 13 was sti= ll current. I'm actually curious if there is a way to recover from this condition. I'll= try experimenting with zdb to see if I can gather some details about why this snapshot causes a crash. ----- zfs.core backtrace: #0 0x00000008015dd4ba in thr_kill () from /lib/libc.so.7 #1 0x0000000801552de4 in raise () from /lib/libc.so.7 #2 0x0000000801606dc9 in abort () from /lib/libc.so.7 #3 0x000000080112e75e in zfs_standard_error_fmt () from /lib/libzfs.so.4 #4 0x000000080112e2b5 in zfs_standard_error () from /lib/libzfs.so.4 #5 0x00000008011175a3 in zfs_iter_snapshots () from /lib/libzfs.so.4 #6 0x0000000001031182 in ?? () #7 0x00000008011172c2 in zfs_iter_filesystems () from /lib/libzfs.so.4 #8 0x000000000103114d in ?? () #9 0x00000008011172c2 in zfs_iter_filesystems () from /lib/libzfs.so.4 #10 0x000000000103114d in ?? () #11 0x00000008011092f9 in zfs_iter_root () from /lib/libzfs.so.4 #12 0x0000000001030968 in ?? () #13 0x000000000103454c in ?? () #14 0x000000000103145e in ?? () #15 0x00000000010303df in ?? () #16 0x0000000001030300 in ?? () #17 0x0000000000000000 in ?? () ----- kernel panic backtrace panic: VERIFY3(0 =3D=3D dsl_dataset_hold_obj(dp, dsl_dataset_phys(ds_next)->ds_next_snap_obj, FTAG, &ds_nextnext)) failed (0= =3D=3D 22) cpuid =3D 7 time =3D 1618658184 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00b55e2= 2b0 vpanic() at vpanic+0x181/frame 0xfffffe00b55e2300 spl_panic() at spl_panic+0x3a/frame 0xfffffe00b55e2360 dsl_destroy_snapshot_sync_impl() at dsl_destroy_snapshot_sync_impl+0xbf6/fr= ame 0xfffffe00b55e2440 dsl_destroy_snapshot_sync() at dsl_destroy_snapshot_sync+0x4e/frame 0xfffffe00b55e2480 zcp_synctask_destroy() at zcp_synctask_destroy+0xb0/frame 0xfffffe00b55e24c0 zcp_synctask_wrapper() at zcp_synctask_wrapper+0xee/frame 0xfffffe00b55e2510 luaD_precall() at luaD_precall+0x25f/frame 0xfffffe00b55e25e0 luaV_execute() at luaV_execute+0xf88/frame 0xfffffe00b55e2660 luaD_call() at luaD_call+0x1b3/frame 0xfffffe00b55e26a0 luaD_rawrunprotected() at luaD_rawrunprotected+0x53/frame 0xfffffe00b55e2740 luaD_pcall() at luaD_pcall+0x37/frame 0xfffffe00b55e2790 lua_pcallk() at lua_pcallk+0xa6/frame 0xfffffe00b55e27d0 zcp_eval_impl() at zcp_eval_impl+0xbc/frame 0xfffffe00b55e2800 dsl_sync_task_sync() at dsl_sync_task_sync+0xb4/frame 0xfffffe00b55e2830 dsl_pool_sync() at dsl_pool_sync+0x43b/frame 0xfffffe00b55e28b0 spa_sync() at spa_sync+0xafe/frame 0xfffffe00b55e2ae0 txg_sync_thread() at txg_sync_thread+0x3b3/frame 0xfffffe00b55e2bb0 fork_exit() at fork_exit+0x7d/frame 0xfffffe00b55e2bf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00b55e2bf0 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- KDB: enter: panic --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-fs@freebsd.org Sat Apr 17 12:40:00 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E11B35D4DB4 for ; Sat, 17 Apr 2021 12:40:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4FMt2S5qvgz4fJC for ; Sat, 17 Apr 2021 12:40:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id C82FE5D4E20; Sat, 17 Apr 2021 12:40:00 +0000 (UTC) Delivered-To: fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7F855D4CC2 for ; Sat, 17 Apr 2021 12:40:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FMt2S5CrWz4fZB for ; Sat, 17 Apr 2021 12:40:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A593C1805D for ; Sat, 17 Apr 2021 12:40:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 13HCe00M095673 for ; Sat, 17 Apr 2021 12:40:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 13HCe0NB095672 for fs@FreeBSD.org; Sat, 17 Apr 2021 12:40:00 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: fs@FreeBSD.org Subject: [Bug 249985] kernel panic at shutdown in zfs_acl_free() and list_remove(), related crash at snapshot removal Date: Sat, 17 Apr 2021 12:40:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed 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 Only Me X-Bugzilla-Who: madpilot@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc Message-ID: In-Reply-To: References: 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-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2021 12:40:00 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D249985 Guido Falsi changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|kernel panic at shutdown in |kernel panic at shutdown in |zfs_acl_free() and |zfs_acl_free() and |list_remove() |list_remove(), related | |crash at snapshot removal --=20 You are receiving this mail because: You are the assignee for the bug.=