summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c3
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
index bcf5ca7..9660d4e 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
@@ -23,6 +23,8 @@
* Use is subject to license terms.
*/
+/* Portions Copyright 2007 Jeremy Teo */
+
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/types.h>
@@ -1280,7 +1282,6 @@ top:
* Truncate regular files if requested.
*/
if ((ZTOV(zp)->v_type == VREG) &&
- (zp->z_phys->zp_size != 0) &&
(vap->va_mask & AT_SIZE) && (vap->va_size == 0)) {
error = zfs_freesp(zp, 0, 0, mode, TRUE);
if (error == ERESTART &&
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
index 3393083..d9eec31 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
@@ -23,6 +23,8 @@
* Use is subject to license terms.
*/
+/* Portions Copyright 2007 Jeremy Teo */
+
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef _KERNEL
@@ -830,7 +832,7 @@ zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
* Nothing to do if file already at desired length.
*/
size = zp->z_phys->zp_size;
- if (len == 0 && size == off) {
+ if (len == 0 && size == off && off != 0) {
zfs_range_unlock(rl);
return (0);
}
OpenPOWER on IntegriCloud