From owner-cvs-all Wed Mar 6 11:53:12 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D04A137B404; Wed, 6 Mar 2002 11:53:08 -0800 (PST) Received: (from dillon@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g26Jr8w94263; Wed, 6 Mar 2002 11:53:08 -0800 (PST) (envelope-from dillon) Message-Id: <200203061953.g26Jr8w94263@freefall.freebsd.org> From: Matt Dillon Date: Wed, 6 Mar 2002 11:53:08 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/ufs/ufs ufs_readwrite.c X-FreeBSD-CVS-Branch: RELENG_4 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG dillon 2002/03/06 11:53:08 PST Modified files: (Branch: RELENG_4) sys/ufs/ufs ufs_readwrite.c Log: MFC b_resid KASSERT from 1.85. This is a safety check to make sure that b_resid is the expected 0 value in preparation for a future commit that will remove the b_resid calculation entirely. It turns out that b_resid WILL always be 0 except for the case where a write fails. But in the write failure case the buffer is still valid for reading and we still want to treat it as such (as if b_resid were 0, even though it isn't). The filesystem code should not use b_resid in any calculations except those involving short-read situations, and even then b_resid will not be persistent for a VMIO backed buffer since the buffer may be destroyed and later reconstituted, resetting b_resid to 0. short-reads are not used by most filesystems. They are used by NFS only when reading softlinks (using a non VMIO buffer). Joy. Revision Changes Path 1.65.2.10 +6 -0 src/sys/ufs/ufs/ufs_readwrite.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message