Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2010 20:44:05 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        cvs-src-old@freebsd.org
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
Message-ID:  <201001112044.o0BKilUa017589@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001112044.o0BKilUa017589>