FreeBSD Bugzilla – Attachment 203344 Details for
Bug 236977
[msdosfs] returns cached truncated data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
msdosfs: zero tail of the last block on truncation for VREG vnodes as well.
1.patch (text/plain), 1014 bytes, created by
Konstantin Belousov
on 2019-04-03 12:38:56 UTC
(
hide
)
Description:
msdosfs: zero tail of the last block on truncation for VREG vnodes as well.
Filename:
MIME Type:
Creator:
Konstantin Belousov
Created:
2019-04-03 12:38:56 UTC
Size:
1014 bytes
patch
obsolete
>diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c >index 417e500b756..990cd1ff7ee 100644 >--- a/sys/fs/msdosfs/msdosfs_denode.c >+++ b/sys/fs/msdosfs/msdosfs_denode.c >@@ -405,19 +405,21 @@ detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred) > 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); >- } >- memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff); >- if (flags & IO_SYNC) >- bwrite(bp); >- else >- bdwrite(bp); >+ return (error); > } >+ memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff); >+ if ((flags & IO_SYNC) != 0) >+ bwrite(bp); >+ else >+ bdwrite(bp); > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 236977
: 203344