From nobody Mon Feb 13 22:31:40 2023 X-Original-To: dev-commits-src-all@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 4PFzbK0kTpz3qVnY; Mon, 13 Feb 2023 22:31:41 +0000 (UTC) (envelope-from git@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 4PFzbK0HSQz3FJ4; Mon, 13 Feb 2023 22:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676327501; 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; bh=mfPMFJ/flNYv5ELplkFlSQWCSHjcqqcF1vFeYRUgvX0=; b=n3FBqBz5J9IwiTggrlg5FpTCG3jBjFHllBZNx1rUVbfsCyqbZIK5i+5XNtRi2iLX03Br1a jBDtqlux2xW2zy3VCfgCiFWY2bnU/oIM1A/GiW3TmT05+8725Rg+ItjAUp0/cQY9Hz2nkN 7rq5CLGsidVI42Pntg9yo4h3qY64C0Lmd+TZSwe1S26BFV3MOJvKKjNxAZMUYfk0yXqhbm yBLYwR+i8poQrLktxDS01RYFwagROyBk1fDb4WMbVJmkrLblRCAPhzL6d96oR+GjXHThRl AhQpdyifIjzN9WGbzOobkVz9XqDwydKt19vqfSzHRrlzJEgpLi3j/tB/p9iUJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676327501; 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; bh=mfPMFJ/flNYv5ELplkFlSQWCSHjcqqcF1vFeYRUgvX0=; b=Sv8K949umjTyiLFUXsYf2qqBH+w9dFth0yTZhLl04ravf/uomt2hfuqc+sL8N8I1zOh15t 1ozIcbMJSMrE4fGZDatY7qlHfLBuqPtT4BYVHhObrQ+JOAKCt/a5nZpvt2aoMdoOSWQEWG iYoHaWkakxyqNcxxf9auDciVJq+FsXEC3Fx3dvNU1HE7FfcQ4kuTujpFLzF2TwF0wFzBoh iUZ5TYLW+ZsEESYlEYQbRnW2GZBhQv1aqPLSDB6h17kDA8lT/ycpz+xNDZRlq3oVz8Lilg qjZbxaZp/1fs3u/CrbeSKYNcykjb/3ufAIQiO6W4rW695O7CJZ1/DE86oDWRtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676327501; a=rsa-sha256; cv=none; b=PYzUhXCltrI+xsACZWjP4ffk0y1l046Mruz8trIfj1UR8GIAapI5LqW5hxBUFT+cbVpnYB wX6orxKLY9CmMsLGHoNybXNG2BJCCv2germ5YKw5a9VV9cQjRHE9GappA7Q8vb7N3vc7kX iPG14TxMApxBW/KT0GtHWlS17Cr7aA6Oh95I3pd/NXT7iIs3gofHcY0RlhlwSLhogx6h3w NPeRXL83xKpmz4k7yzRjNsBqo2O91h0wOJhdxizsH70Ib/tWp8STb8ZW0bHOO6U6nMPZxM kTjaiNKj9zgKugdGsxP9ZrOLUXQmjbmLJgLxF/44LwW6DvF6u/BvJSGTe2kl6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4PFzbJ6VN9zbcs; Mon, 13 Feb 2023 22:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31DMVefv080726; Mon, 13 Feb 2023 22:31:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DMVeKE080725; Mon, 13 Feb 2023 22:31:40 GMT (envelope-from git) Date: Mon, 13 Feb 2023 22:31:40 GMT Message-Id: <202302132231.31DMVeKE080725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e59180ea09a1 - main - msdosfs: correct handling of vnode pager size on file extension error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e59180ea09a1d1d1463f2a269e94efa0f0b677c5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e59180ea09a1d1d1463f2a269e94efa0f0b677c5 commit e59180ea09a1d1d1463f2a269e94efa0f0b677c5 Author: Konstantin Belousov AuthorDate: 2023-02-10 04:58:43 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-13 22:29:19 +0000 msdosfs: correct handling of vnode pager size on file extension error If extension fails, vnode pager recorded size might be left increased. Only update vnode pager when extension is past the point of no rollback. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38549 --- sys/fs/msdosfs/msdosfs_denode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 9a9916e39a67..6c38481681de 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -386,10 +386,8 @@ detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred) return (EINVAL); } - if (dep->de_FileSize < length) { - vnode_pager_setsize(DETOV(dep), length); + if (dep->de_FileSize < length) return (deextend(dep, length, cred)); - } /* * If the desired length is 0 then remember the starting cluster of @@ -530,6 +528,7 @@ deextend(struct denode *dep, u_long length, struct ucred *cred) return (error); } } + vnode_pager_setsize(DETOV(dep), length); dep->de_FileSize = length; dep->de_flag |= DE_UPDATE | DE_MODIFIED; return (deupdat(dep, !DOINGASYNC(DETOV(dep))));