From owner-cvs-src-old@FreeBSD.ORG Mon Jan 11 20:44:47 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 375BA106568F for ; Mon, 11 Jan 2010 20:44:47 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 233B28FC1A for ; Mon, 11 Jan 2010 20:44:47 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o0BKilnT017590 for ; Mon, 11 Jan 2010 20:44:47 GMT (envelope-from mckusick@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o0BKilUa017589 for cvs-src-old@freebsd.org; Mon, 11 Jan 2010 20:44:47 GMT (envelope-from mckusick@repoman.freebsd.org) Message-Id: <201001112044.o0BKilUa017589@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to mckusick@repoman.freebsd.org using -f From: Kirk McKusick Date: Mon, 11 Jan 2010 20:44:05 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/compat/linux linux_file.c src/sys/kern vfs_syscalls.c src/sys/sys syscallsubr.h src/sys/ufs/ffs ffs_alloc.c fs.h src/sys/ufs/ufs ufs_lookup.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 20:44:47 -0000 mckusick 2010-01-11 20:44:05 UTC FreeBSD src repository Modified files: sys/compat/linux linux_file.c sys/kern vfs_syscalls.c sys/sys syscallsubr.h sys/ufs/ffs ffs_alloc.c fs.h sys/ufs/ufs ufs_lookup.c Log: SVN rev 202113 on 2010-01-11 20:44:05Z by mckusick Background: When renaming a directory it passes through several intermediate states. First its new name will be created causing it to have two names (from possibly different parents). Next, if it has different parents, its value of ".." will be changed from pointing to the old parent to pointing to the new parent. Concurrently, its old name will be removed bringing it back into a consistent state. When fsck encounters an extra name for a directory, it offers to remove the "extraneous hard link"; when it finds that the names have been changed but the update to ".." has not happened, it offers to rewrite ".." to point at the correct parent. Both of these changes were considered unexpected so would cause fsck in preen mode or fsck in background mode to fail with the need to run fsck manually to fix these problems. Fsck running in preen mode or background mode now corrects these expected inconsistencies that arise during directory rename. The functionality added with this update is used by fsck running in background mode to make these fixes. Solution: This update adds three new fsck sysctl commands to support background fsck in correcting expected inconsistencies that arise from incomplete directory rename operations. They are: setcwd(dirinode) - set the current directory to dirinode in the filesystem associated with the snapshot. setdotdot(oldvalue, newvalue) - Verify that the inode number for ".." in the current directory is oldvalue then change it to newvalue. unlink(nameptr, oldvalue) - Verify that the inode number associated with nameptr in the current directory is oldvalue then unlink it. As with all other fsck sysctls, these new ones may only be used by processes with appropriate priviledge. Reported by: jeff Security issues: rwatson Revision Changes Path 1.120 +1 -1 src/sys/compat/linux/linux_file.c 1.491 +11 -5 src/sys/kern/vfs_syscalls.c 1.61 +1 -1 src/sys/sys/syscallsubr.h 1.154 +124 -8 src/sys/ufs/ffs/ffs_alloc.c 1.52 +4 -1 src/sys/ufs/ffs/fs.h 1.101 +5 -0 src/sys/ufs/ufs/ufs_lookup.c