Skip to content

Commit

Permalink
Remove incorrect assertion
Browse files Browse the repository at this point in the history
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 <batkinson@lanl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11235
  • Loading branch information
behlendorf authored Nov 24, 2020
1 parent 6f5aac3 commit 04a82e0
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion module/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 04a82e0

Please sign in to comment.