Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/nfs Remove an incorrect assertion.



details:   https://anonhg.NetBSD.org/src/rev/c77c364d7c9b
branches:  trunk
changeset: 368110:c77c364d7c9b
user:      hannken <hannken%NetBSD.org@localhost>
date:      Fri Jun 24 16:50:00 2022 +0000

description:
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.

diffstat:

 sys/nfs/nfs_bio.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r 98670db46a8b -r c77c364d7c9b sys/nfs/nfs_bio.c
--- a/sys/nfs/nfs_bio.c Fri Jun 24 13:11:44 2022 +0000
+++ b/sys/nfs/nfs_bio.c Fri Jun 24 16:50:00 2022 +0000
@@ -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 @@
                         * 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);



Home | Main Index | Thread Index | Old Index