git: 8b95f9fe925e - stable/12 - msdosfs: correct handling of vnode pager size on file extension error
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 Sep 2023 18:50:25 UTC
The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8b95f9fe925e844e5e763e50b592c4dddd113310 commit 8b95f9fe925e844e5e763e50b592c4dddd113310 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2023-02-10 04:58:43 +0000 Commit: Ed Maste <emaste@FreeBSD.org> 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))));