From 7cf4cd8246beb511a287705b3fbbc0431f6256ba Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 24 Nov 2020 09:28:42 -0800 Subject: [PATCH] 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 Reviewed-by: Ryan Moeller Signed-off-by: Brian Behlendorf Closes #11235 --- module/zfs/zfs_vnops.c | 1 - 1 file changed, 1 deletion(-) diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 2e37107515..f3c894cfd0 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -467,7 +467,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