From nobody Mon Sep 11 18:50:25 2023 X-Original-To: dev-commits-src-branches@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 4Rkwl536RPz4tL1d; Mon, 11 Sep 2023 18:50:25 +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 4Rkwl52g4rz3RCZ; Mon, 11 Sep 2023 18:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694458225; 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=aF/jRpvR2zT+qX8eBzyP52CgiDFaPzjw4ha4iaVAz5g=; b=vTOVN5JUAU5EDKgMmldvzzUGnWEBfYjDICiQ47nQ8ScxKlfj3CAQCIwuBFPozt3EC6r3mm 4JNPuZHgZH7P4PH8QgET0xo8LM523JtV6kTlBWzwvXtNufvHqJJs1+X2Xrxs2CTTVnuYTh OMqUbv9g2HrA64KA074cTLLabASBPZwncr2A5rlwy30q/fKZgpqHdvf5WKuFNUYPu73mNA xTEGG5i8JSCJ55qxgPs1k0dFhODiR6t6lhTJOVWCDTfFp4/bVdFkpJdviqlwGGM7lN2pHf V5c2hXDP8howIfVm4oEwzj5/BT4iIgqlhokGLj8VDv0uk6pG2A+QGWtVtfcbpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694458225; a=rsa-sha256; cv=none; b=YfESWZZHp1MxSbyRuX1y5kFxBD473iq6onbJgpahPvc/CdBtSTEPBmWbrYkU7TjIl4K9iI Rvyxdf1e/x2Sb02FCMupmZVqaMBnYsnMfTnGwwAU+nwyKz5cUsh8Gbz+veZYglV/9me5zD 6M7CxzjLtWIz32bgnIIKLOCuganfN9UcyA/fz2z1sFRtgtScffNL1AcN46kla6eNfNjgpZ fVfTpv1YZwIkRNXf+07X9EZhKRmEuRVYXE4pPvoFI9UKvmW+d4H2lYUlFsxfCfM/y8NjQy pr1sXGqy49goOCwEmwL5rACQVZDFLD2sk8gtffZpHzvQnuYaTlOSLmPDpFKJbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694458225; 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=aF/jRpvR2zT+qX8eBzyP52CgiDFaPzjw4ha4iaVAz5g=; b=Xwr6M9QjLJE2cpQF+H3BWJzPUErm1XYAnP6Cz6J0r9XihHYCUcmNnwWOv53qjblfpi6rNH 79In8vUti9iEfQ2BbeDl+mLpWdLImfniqZfy7eRJGeyqFTNaqTJ0AaAW9aMb/l0lk1JR31 +ok3q7e5h0RlJDAgVRhHexcAmG+pfQ6cIjpsOFralHz1NxQujXjE6tUFyMIyBt9PY/Zn/D todZjr02+OLH4TtnLXT9w0f+fPFq56TykJy65XTHqSymjyxRXiMwbP6cKvFm4zHVTe1xjU 5th01WQXOqRsR3GJ0UAf46ggDAT95kXVkyEkENrPMUIhGzvNwPDbgcPFRh42tA== 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 4Rkwl51l4gz11C5; Mon, 11 Sep 2023 18:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38BIoPPG083120; Mon, 11 Sep 2023 18:50:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38BIoPDX083117; Mon, 11 Sep 2023 18:50:25 GMT (envelope-from git) Date: Mon, 11 Sep 2023 18:50:25 GMT Message-Id: <202309111850.38BIoPDX083117@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 8b95f9fe925e - stable/12 - msdosfs: correct handling of vnode pager size on file extension error List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8b95f9fe925e844e5e763e50b592c4dddd113310 Auto-Submitted: auto-generated The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8b95f9fe925e844e5e763e50b592c4dddd113310 commit 8b95f9fe925e844e5e763e50b592c4dddd113310 Author: Konstantin Belousov AuthorDate: 2023-02-10 04:58:43 +0000 Commit: Ed Maste CommitDate: 2023-09-11 18:04:29 +0000 msdosfs: correct handling of vnode pager size on file extension error (cherry picked from commit e59180ea09a1d1d1463f2a269e94efa0f0b677c5) (cherry picked from commit 64152225022bea784ca1948a67e7c040a8bb040a) --- 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 db9e0712d2b1..beb615ec7a34 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -365,10 +365,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 @@ -509,6 +507,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))));