aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2020-11-24 09:28:42 -0800
committerGitHub <[email protected]>2020-11-24 09:28:42 -0800
commit04a82e043d067181a8b352921ef6a3c3ac875b59 (patch)
tree7b7bbdc0272ecbc05f13fdaa6946cfcf9b0a038d
parent6f5aac3ca057731d106b801bfdf060119571393c (diff)
Remove incorrect assertion
Commit 85703f6 added a new ASSERT to zfs_write() as part of the cleanup which isn't correct in the case where multiple processes are concurrently extending a file. The `zp->z_size` is updated atomically while holding a range lock on only a portion of the file. Therefore, it's possible for the file size to increase after a same check is performed earlier in the loop causing this ASSERT to fail. The code itself handles this case correctly so only the invalid ASSERT needs to be removed. Reviewed-by: Brian Atkinson <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11235
-rw-r--r--module/zfs/zfs_vnops.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index ab7d9a0bc..1f78b8cee 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -559,7 +559,6 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
} else {
/* Implied by abuf != NULL: */
ASSERT3S(n, >=, max_blksz);
- ASSERT3S(woff, >=, zp->z_size);
ASSERT0(P2PHASE(woff, max_blksz));
/*
* We can simplify nbytes to MIN(n, max_blksz) since