From owner-cvs-all Mon Jan 14 23:17:19 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 86C2837B404; Mon, 14 Jan 2002 23:17:13 -0800 (PST) Received: (from mckusick@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0F7HDk80248; Mon, 14 Jan 2002 23:17:13 -0800 (PST) (envelope-from mckusick) Message-Id: <200201150717.g0F7HDk80248@freefall.freebsd.org> From: Kirk McKusick Date: Mon, 14 Jan 2002 23:17:13 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern vfs_subr.c src/sys/ufs/ffs ffs_inode.c ffs_vfsops.c src/sys/ufs/ufs ufs_inode.c ufs_vnops.c X-FreeBSD-CVS-Branch: HEAD 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 mckusick 2002/01/14 23:17:13 PST Modified files: sys/kern vfs_subr.c sys/ufs/ffs ffs_inode.c ffs_vfsops.c sys/ufs/ufs ufs_inode.c ufs_vnops.c Log: When downgrading a filesystem from read-write to read-only, operations involving file removal or file update were not always being fully committed to disk. The result was lost files or corrupted file data. This change ensures that the filesystem is properly synced to disk before the filesystem is down-graded. This delta also fixes a long standing bug in which a file open for reading has been unlinked. When the last open reference to the file is closed, the inode is reclaimed by the filesystem. Previously, if the filesystem had been down-graded to read-only, the inode could not be reclaimed, and thus was lost and had to be later recovered by fsck. With this change, such files are found at the time of the down-grade. Normally they will result in the filesystem down-grade failing with `device busy'. If a forcible down-grade is done, then the affected files will be revoked causing the inode to be released and the open file descriptors to begin failing on attempts to read. Submitted by: "Sam Leffler" Revision Changes Path 1.338 +7 -2 src/sys/kern/vfs_subr.c 1.74 +4 -2 src/sys/ufs/ffs/ffs_inode.c 1.167 +8 -0 src/sys/ufs/ffs/ffs_vfsops.c 1.40 +2 -2 src/sys/ufs/ufs/ufs_inode.c 1.182 +4 -5 src/sys/ufs/ufs/ufs_vnops.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message