Date: Wed, 10 Apr 2019 10:50:49 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346077 - stable/11/sys/fs/msdosfs Message-ID: <201904101050.x3AAonWJ039912@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Apr 10 10:50:48 2019 New Revision: 346077 URL: https://svnweb.freebsd.org/changeset/base/346077 Log: MFC r345847: msdosfs: zero tail of the last block on truncation for VREG vnodes as well. Modified: stable/11/sys/fs/msdosfs/msdosfs_denode.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- stable/11/sys/fs/msdosfs/msdosfs_denode.c Wed Apr 10 10:21:14 2019 (r346076) +++ stable/11/sys/fs/msdosfs/msdosfs_denode.c Wed Apr 10 10:50:48 2019 (r346077) @@ -403,19 +403,21 @@ detrunc(struct denode *dep, u_long length, int flags, bn = cntobn(pmp, eofentry); error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster, NOCRED, &bp); - if (error) { - brelse(bp); + } else { + error = bread(DETOV(dep), de_cluster(pmp, length), + pmp->pm_bpcluster, cred, &bp); + } + if (error) { #ifdef MSDOSFS_DEBUG - printf("detrunc(): bread fails %d\n", error); + printf("detrunc(): bread fails %d\n", error); #endif - return (error); - } - bzero(bp->b_data + boff, pmp->pm_bpcluster - boff); - if (flags & IO_SYNC) - bwrite(bp); - else - bdwrite(bp); + return (error); } + bzero(bp->b_data + boff, pmp->pm_bpcluster - boff); + if ((flags & IO_SYNC) != 0) + bwrite(bp); + else + bdwrite(bp); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904101050.x3AAonWJ039912>