Remove an incorrect assertion.

Just issue a readahead near the end of the vnode and enqueue an async read.
Now let nfs_setattr() truncate the vnode, set its new size and
nfs_vinvalbuf() waits for the pages from the readahead to become unbusy.

The async read gets processed and returns with uio_resid > 0 because there
is a hole and no write after the hole has been pushed yet.  As the vnode
size already got truncated to the new size the KASSERT() incorrectly fires.
This commit is contained in:
hannken 2022-06-24 16:50:00 +00:00
parent ba4e23c9ed
commit 2b69930f08
1 changed files with 2 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_bio.c,v 1.200 2021/10/20 03:08:18 thorpej Exp $ */
/* $NetBSD: nfs_bio.c,v 1.201 2022/06/24 16:50:00 hannken Exp $ */
/*
* Copyright (c) 1989, 1993
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.200 2021/10/20 03:08:18 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.201 2022/06/24 16:50:00 hannken Exp $");
#ifdef _KERNEL_OPT
#include "opt_nfs.h"
@ -878,8 +878,6 @@ nfs_doio_read(struct buf *bp, struct uio *uiop)
* Just zero fill the rest of the valid area.
*/
KASSERT(vp->v_size >=
uiop->uio_offset + uiop->uio_resid);
diff = bp->b_bcount - uiop->uio_resid;
len = uiop->uio_resid;
memset((char *)bp->b_data + diff, 0, len);