From nobody Sun Feb 5 22:47:06 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P94Jq1TNyz3mwRr for ; Sun, 5 Feb 2023 22:47:07 +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 4P94Jp6xhKz3nr5 for ; Sun, 5 Feb 2023 22:47:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675637227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jNt/28JPLT/lpGpwZXf2O6u/3/ZpDIpQQx4iCFRxW6c=; b=D+nLmUt9TIIJIn7bVN+FAWyv0QlxzvIxQtps4rpvJ88iGg0sR4qhhPOmO/I6X8WQIL/E4i JN4mx/+0c+fU60PRCBTQtljfmcV0urs2Rk6eV/Yb8k5FZReiPfdasLF9hFlZAwGujK39C0 t9UUREX91AFk1Lybt+ZKgjVEa5LHpBWTwyg6QXPqOoe73Yv3eJOQa4xZs4ya5AhYMGMnTS w/GfOrGzEc6qM1ORIQsi7j93UCfeqh6R+woH9MGn/xWmJ0jXUGV0FsVsoOGbaaQAnsDV3S HabkxJjtQb7nkmkqtuvU3P76fAe8w8hAyboODZnIlqxpwVGI0pZxnV8Fp98YCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675637227; a=rsa-sha256; cv=none; b=tJKNV+hbUChNfkbHSiKbatbeysmQMoTKAhZrcl59kMhAkuPbmt9WQiz/1u4D9dthLCkfHB +TdGpjTIUM3B4+9MFLPTWgf91EvtZ4/VUnAUKtoTRXYV9XG7Vv2Rht+10Crb+73O9UTRB7 6zhln8X4urwJB2vVxzA33SBH08Qq11YTG4fqREhow993hmxv27Vmx97xMbkYAFaSqNYTaO TwtwgJV0d7qwjtLtBXFqSWVTYQVp2Bo6f8WyCI+R6FzNkgPVsCthWZJF29Yy/ShpPlF51J LkgLJSTvw2eZXsgTgn820rHISBV+BHXKhnyHj7GQhoVhqph4vaVjMr5Zs6Yl1g== 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 4P94Jp5whTz1Bg2 for ; Sun, 5 Feb 2023 22:47:06 +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 315Ml6nB076172 for ; Sun, 5 Feb 2023 22:47:06 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 315Ml6j5076171 for bugs@FreeBSD.org; Sun, 5 Feb 2023 22:47:06 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 269328] nfs client: data corruption using fspacectl and mmap Date: Sun, 05 Feb 2023 22:47:06 +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 Many People X-Bugzilla-Who: kib@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269328 Konstantin Belousov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pho@FreeBSD.org --- Comment #3 from Konstantin Belousov --- It would be somewhat interesting to see where the corruption occurs, on cli= ent or on server. My intuition is that the problem happens on client, esp. bec= ause server does not have fspacectl() at all. >From the code reading, nfs client does enough page flushing both in nfs_deallocate() and in ncl_vinvalbuf(). At least, it is not obvious what is missed and why msync(2) before deallocation helps. The sequence seems to be, from nfs_deallocate() for NFSv4.2: ncl_vinvalbuf(V_SAVE) vm_object_page_clean(OBJPC_SYNC) <- sync pages synchronously vinvalbuf(V_SAVE) vm_object_page_remove(OBJPR_CLEANONLY) <- only remove clean pages vnode_pager_purge_range() vm_object_page_remove(0) nfsrpc_deallocate() It might be that a clean page somehow avoided being removed from the queue, but as I said, I do not see how this could occur. Or it might be the handl= ing of the partially deallocated pages is somewhat wrong. --=20 You are receiving this mail because: You are the assignee for the bug.=