freebsd-dev/sys
Kirk McKusick e268f54cb4 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
2010-01-11 20:44:05 +00:00
..
amd64 Use io(4) for I/O port access on ia64, rather than through sysarch(2). 2010-01-11 18:10:13 +00:00
arm Merge from head at r201628. 2010-01-06 05:58:07 +00:00
boot Remove debugging printf(). There's no need to print the image 2010-01-10 00:14:04 +00:00
bsm Add audit events for process descriptor system calls, which will appear in 2009-09-29 21:25:59 +00:00
cam - Report SATA in legacy emulation mode still as SATA. 2010-01-10 09:20:56 +00:00
cddl Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD 2010-01-07 20:10:22 +00:00
compat Background: 2010-01-11 20:44:05 +00:00
conf Use io(4) for I/O port access on ia64, rather than through sysarch(2). 2010-01-11 18:10:13 +00:00
contrib Fix array overflow. 2010-01-08 19:56:37 +00:00
crypto Changed to M_NOWAIT when reallocing psc_buf in padlock_sha_update(), 2009-05-27 09:52:12 +00:00
ddb Replace several instances of 'if (!a & b)' with 'if (!(a &b))' in order 2010-01-08 15:44:49 +00:00
dev Use io(4) for I/O port access on ia64, rather than through sysarch(2). 2010-01-11 18:10:13 +00:00
fs Update the comment on printing group membership to reflect that fact 2010-01-09 23:23:52 +00:00
gdb
geom Sync to r201658 on head. 2010-01-06 18:21:22 +00:00
gnu Remove extraneous semicolons, no functional changes. 2010-01-07 21:01:37 +00:00
i386 Use io(4) for I/O port access on ia64, rather than through sysarch(2). 2010-01-11 18:10:13 +00:00
ia64 Use io(4) for I/O port access on ia64, rather than through sysarch(2). 2010-01-11 18:10:13 +00:00
isa Remove extraneous semicolons, no functional changes. 2010-01-07 21:01:37 +00:00
kern Background: 2010-01-11 20:44:05 +00:00
kgssapi When the KOBJMETHOD() macro was updated, it resulted in the 2009-06-14 17:33:46 +00:00
libkern Merge from head at r201628. 2010-01-06 05:58:07 +00:00
mips Correct a path in an include I missed earlier 2010-01-11 17:29:20 +00:00
modules Add epic(4), a driver for the front panel LEDs in Sun Fire V215/V245. 2010-01-10 15:44:48 +00:00
net Correct a typo. 2010-01-10 12:03:53 +00:00
net80211 Fix #ifdefs so that GCC 4.4 doesn't complain about it. 2010-01-08 15:41:24 +00:00
netatalk Reverse misordered unlock and lock in at_control for netatalk phase I 2009-08-12 10:44:13 +00:00
netgraph Send link state change control messages to "orphans" hook as well. 2010-01-09 19:03:48 +00:00
netinet Ensure an address is removed from the interface address 2010-01-08 17:49:24 +00:00
netinet6 Replace several instances of 'if (!a & b)' with 'if (!(a &b))' in order 2010-01-08 15:44:49 +00:00
netipsec Enable IPcomp by default. 2009-11-29 20:47:43 +00:00
netipx Use queue(9) instead of hand-crafted link lists for the global IPX 2009-06-24 20:57:50 +00:00
netnatm Reimplement the netisr framework in order to support parallel netisr 2009-06-01 10:41:38 +00:00
netncp
netsmb Don't print out a message on loading a module. 'kldload -v' and 'kldstat 2009-09-10 18:33:08 +00:00
nfs Revert rev 192323 (nfs_common.c only): 2009-07-12 03:53:52 +00:00
nfsclient Reduce recursions on curvnet and thus spamming the console with warning 2010-01-09 14:56:38 +00:00
nfsserver Some style(9) fixes in order to fabricate a commit to denote that 2010-01-09 15:59:15 +00:00
nlm Handle GRANTED_RES messages more gracefully: Send along a grant cookie 2009-10-07 19:50:14 +00:00
opencrypto Add comments trying to explain what bad things happen here, i.e. 2010-01-09 15:43:47 +00:00
pc98 Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. 2010-01-10 17:44:22 +00:00
pci Remove extraneous semicolons, no functional changes. 2010-01-07 21:01:37 +00:00
powerpc Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. 2010-01-10 17:44:22 +00:00
rpc Make options KGSSAPI build and add it to NOTES. 2010-01-08 23:26:10 +00:00
security Make mac_lomac(4) able to interpret NFSv4 access bits. 2010-01-03 17:19:14 +00:00
sparc64 When setting up MSIs with a filter ensure that the event queue interrupt 2010-01-10 18:39:29 +00:00
sun4v Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. 2010-01-10 17:44:22 +00:00
sys Background: 2010-01-11 20:44:05 +00:00
teken MFC @199204 2009-11-12 00:36:22 +00:00
tools Output a comment on top of each generated file explaining where it came 2009-10-25 09:48:21 +00:00
ufs Background: 2010-01-11 20:44:05 +00:00
vm Update d_mmap() to accept vm_ooffset_t and vm_memattr_t. 2009-12-29 21:51:28 +00:00
xdr Add a check for a NULL mbuf ptr at the beginning of xdrmbuf_inline() 2009-08-12 16:27:51 +00:00
xen Remove extraneous semicolons, no functional changes. 2010-01-07 21:01:37 +00:00
Makefile