Skip to content

Commit 04a82e0

Browse files
authored
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
1 parent 6f5aac3 commit 04a82e0

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

module/zfs/zfs_vnops.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,6 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
559559
} else {
560560
/* Implied by abuf != NULL: */
561561
ASSERT3S(n, >=, max_blksz);
562-
ASSERT3S(woff, >=, zp->z_size);
563562
ASSERT0(P2PHASE(woff, max_blksz));
564563
/*
565564
* We can simplify nbytes to MIN(n, max_blksz) since

0 commit comments

Comments
 (0)