View | Details | Raw Unified | Return to bug 236977
Collapse All | Expand All

(-)b/sys/fs/msdosfs/msdosfs_denode.c (-10 / +12 lines)
Lines 405-423 detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred) Link Here
405
			bn = cntobn(pmp, eofentry);
405
			bn = cntobn(pmp, eofentry);
406
			error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster,
406
			error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster,
407
			    NOCRED, &bp);
407
			    NOCRED, &bp);
408
			if (error) {
408
		} else {
409
				brelse(bp);
409
			error = bread(DETOV(dep), de_cluster(pmp, length),
410
			    pmp->pm_bpcluster, cred, &bp);
411
		}
412
		if (error) {
410
#ifdef MSDOSFS_DEBUG
413
#ifdef MSDOSFS_DEBUG
411
				printf("detrunc(): bread fails %d\n", error);
414
			printf("detrunc(): bread fails %d\n", error);
412
#endif
415
#endif
413
				return (error);
416
			return (error);
414
			}
415
			memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff);
416
			if (flags & IO_SYNC)
417
				bwrite(bp);
418
			else
419
				bdwrite(bp);
420
		}
417
		}
418
		memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff);
419
		if ((flags & IO_SYNC) != 0)
420
			bwrite(bp);
421
		else
422
			bdwrite(bp);
421
	}
423
	}
422
424
423
	/*
425
	/*

Return to bug 236977