Permalink
Commits on May 7, 2009
  1. Roll DragonFly 2.3.1

    corecode committed May 7, 2009
  2. Replace Debugger() entry with a kprintf().

    Reported-by: trevorjk
    Matthew Dillon committed May 7, 2009
  3. Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git…

    …/dragonfly
    Matthew Dillon committed May 7, 2009
  4. Fix O_NOFOLLOW and do not follow softlinks if O_EXCL.

    A bug in sys_open() set NLC_FOLLOW bit for the nlookup() call unconditionally.
    Removing the setting allows vn_open() to properly set NLC_FOLLOW conditionally
    when both O_EXCL and O_NOFOLLOW are not set.
    Matthew Dillon committed May 7, 2009
  5. HAMMER VFS - Limit recursion for long directory chains, update mtime/…

    …ctime
    
    A long chain of directory dependencies can blow out the kernel stack.  Limit
    the recursion to 20 levels.  If the depth is exceeded the flushing of the
    deep inodes is delayed until the higher dependencies are taken care of.
    
    Update mtime/ctime accordingly based on the fstest stress test from FreeBSD.
    Note however that we cannot update the ctime on directories for file creates,
    renames, and deletes within the directory without rolling a new inode,
    which is too expensive to do for that situation.  We can, and do, update the
    mtime.
    Matthew Dillon committed May 7, 2009
Commits on May 6, 2009
  1. fstest regression fixes - POSIX error codes.

    Deal with most of the issues found by FreeBSD's fstest regression test:
        * Limit path components to 255 characters.  Return ENAMETOOLONG if
          the limit is exceeded.
    
        * Return EEXIST, EINVAL, and ENOTEMPTY as appropriate when the user
          attempts to create, delete, or rename "." or "..", instead of EINVAL.
    
        * Return EISDIR if an attempt is made to open a directory for writing,
          instead of EINVAL.
    
        * Return EACCES if an attempt is made to open a file O_TRUNC without
          O_RDWR or O_WRONLY, instead of silently dropping the O_TRUNC.
    
        * Implement O_NOFOLLOW semantics generally instead of just with O_EXCL.
    
    Not dealt with:
        * DragonFly clears SGID AND SUID on uid or gid change, if not root.
          If root is doing the operation SGID/SUID is not cleared.
    
        * HAMMER cannot modify the ctime without rolling a new inode, which
          is very expensive, and does not do so when entries are added or
          removed from a directory.  mtime is modified.
    Matthew Dillon committed May 6, 2009
  2. ncal: specify month with -m month argument

    Ncal only supports specification of a month together with a year, which is
    silly.  Using the -m argument, you can now specify a month in the current
    year.
    
    Obtained-from:  FreeBSD
    corecode committed May 6, 2009
  3. ncal: interpret a `.' as current year

    There doesn't seem to be an easy way to refer to the current year, for
    instance if I wanted to show the calendar of this year's June.  Now
    there is:  ncal 6 .
    corecode committed May 6, 2009
  4. ncal: always generate full lines to enable today hilight in year view

    Ncal would only fill lines up to the last day in a month and use a printf
    padding later to align all output nicely (when using year view).  This
    breaks when using a hilight, because the ANSI sequences consume additional
    characters which are of zero print width.  Instead of letting printf do
    the padding, generate padded lines ourselves.
    
    Also avoid code duplication in the hilight code and switch on hilighting
    for the year view.
    corecode committed May 6, 2009
  5. ncal: hilight current day

    This lets ncal and cal hilight the current day in the month view, if its
    output is connected to a terminal.  The year view can not yet use
    highlighting.
    
    Obtained-from: FreeBSD
    corecode committed May 5, 2009
  6. Allow USCHED_DEL_CPU for non-superuser processes

    Aggelos Economopoulos committed May 6, 2009
  7. HAMMER VFS - Refactor merged search function to try to avoid missed e…

    …ntries
    
    Refactor the merged B-Tree + In-Memory search function to try to avoid races
    where an in-memory record is flushed to the media during a search, causing
    the search to miss the record.
    
    Add another flag to hammer_record_t to indicate that the record was deleted
    because it was committed to the media (verses simply being deleted).
    
    Better-separate HAMMER_RECF_DELETED_FE and HAMMER_RECF_DELETED_BE.  These
    flags indicate whether the frontend or backend deleted an in-memory record.
    The backend ignores frontend deletions that occur after the record has been
    associated with a flush group.
    
    Remove some console Warnings that are no longer applicable.
    Matthew Dillon committed May 6, 2009
  8. Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git…

    …/dragonfly
    Matthew Dillon committed May 6, 2009
  9. Add kernel-layer support for chflags checks, remove (most) from the V…

    …FS layer.
    
    Give nlookup() and nlookup_va() the tools to do nearly all chflags related
    activities.  Here are the rules:
    
    Immutable (uchg, schg)
    
        If set on a directory no files associated with the directory may
        be created, deleted, linked, or renamed.  In addition, any files open()ed
        via the directory will be immutable whether they are flagged that
        way or not.
    
        If set on a file or directory the file or directory may not be
        written to, chmodded, chowned, chgrped, or renamed.  The file can
        still be hardlinked and the file/directory can still be chflagged.
        If you do not wish the file to be linkable then set the immutable bit
        on all directories containing a link of the file.  Once you form
        this closure no further links will be possible.
    
        NOTE ON REASONING:  Security scripts should check link counts anyway,
        depending on a file flag which can be changed as a replacement for
        checking the link count is stupid.  If you are secure then your closures
        will hold.  If you aren't then nothing will save you.
    
        This feature is not recursive.  If the directory contains
        subdirectories they must be flagged immutable as well.
    
    Undeletable (uunlnk, sunlnk)
    
        If set on a file or directory that file or directory cannot be removed
        or renamed.  The file can still otherwise be manipulated, linked, and
        so forth.  However, it should be noted that any hardlinks you create
        will also not be deletable :-)
    
        If set on a directory this flag has no effect on the contents
        of the directory (yet).  See APPEND-ONLY on directories for what
        you want.
    
    Append-only (uappnd/sappnd)
    
        If set on a directory no file within the directory may be deleted or
        renamed.  However, new files may be created in the directory and
        the files in the directory can be modified or hardlinked without
        restriction.
    
        If set on a file the file cannot be truncated, random-written, or
        deleted.  It CAN be chmoded, chowned, renamed, and appended to
        with O_APPEND etc.
    
        If you do not wish the file to be renameable then you must also
        set the Undeletable flag.  Setting the append-only flag will ensure
        that the file doesn't disappear from the filesystem, but does not
        prevent it from being moved about the filesystem.
    
    Security fix - futimes()
    
        futimes() could be called on any open descriptor.  Restrict
        it to just those files you own or have write permission on.
    
    Security fix - Hardlinks
    
        Users can no longer hardlink foreign-owned files which they do not
        have write access to.  The user must now have write permission on
        the file being hardlinked or the user must own the file, or be root.
    
    Security fix - fcntl()
    
        fcntl() can no longer be used to turn of O_APPEND mode if the file
        was flagged append-only.
    
    NOTE - DIFFERENCES WITH FREEBSD
    
        * Append-only on directories
    
        * Immutable on directories to control set-in-stone & hardlinking
    
        * Immutable files can be hardlinked on DragonFly, not on FreeBSD.
    
        * User must be the owner of the file or have write access to the
          file being hardlinked.
    Matthew Dillon committed May 6, 2009
Commits on May 5, 2009
  1. document kvm_open*() support for live vkernels

    Aggelos Economopoulos committed May 5, 2009
Commits on May 4, 2009
  1. teach libkvm about vkernels

    Add support for accessing a running vkernel's memory by
    reading its /proc/$pid/mem file.
    Aggelos Economopoulos committed May 4, 2009
  2. Make dev.cpu.X.cx_usage sysctl also report current average of sleep t…

    …ime.
    Hasso Tepper committed May 4, 2009
  3. Rework a CPU C-state selection logic a bit.

    Avoid comparing negative signed to positive unsignad values. It was
    leading to a bug, when C-state does not decrease on sleep shorter then
    declared transition latency. Fixing this deprecates workaround for broken
    C-states on some hardware.
    
    By the way, change state selecting logic a bit. Instead of last sleep
    time use short-time average of it. Global interrupts rate in system is a
    quite random value, to corellate subsequent sleeps so directly.
    
    Obtained-from: FreeBSD
    Hasso Tepper committed May 4, 2009
  4. Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe().

    Put it into acpi_cpu_startup() which is where all the other code to update
    this global variable lives.  This fixes a bug where cpu_cx_count was not
    updated correctly if acpi_cpu_generic_cx_probe() returned early.
    
    Obtained-from: FreeBSD
    Hasso Tepper committed May 4, 2009
  5. acpi_cpu: fixup for PIIX4E PCI config related to C2.

    If you have seen
    cpu0: too many short sleeps, backing off to C1
    with this chipset before you may want to try cx_lowest of C2 again.
    
    Obtained-from: FreeBSD
    Hasso Tepper committed May 4, 2009
  6. Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git…

    …/dragonfly
    Matthew Dillon committed May 4, 2009
  7. The kernel permissions check code was not checking deletability for

    the rename source or the directory sticky bit for rename targets which
    existed.
    
    This only effected HAMMER which assumes the kernel is responsible for
    permissions checks.
    
    Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
    Matthew Dillon committed May 4, 2009
Commits on May 3, 2009
  1. nanosleep: don't overwrite error with copyout success status

    When nanosleep gets interrupted, it returns EINTR.  In the case of a
    non-zero error status, sys_nanosleep will copyout() the remaining sleep
    time.  However it would overwrite the nanosleep error status with the
    error status of copyout() -- which is 0 (success) most of the time.  This
    means the important error status of nanosleep (EINTR) would be overwritten
    by 0.  Follow FreeBSD and NetBSD and only return the copyout status if it
    failed.
    
    Reported-by: walt
    corecode committed May 3, 2009
  2. installer: Sync ASCII Fred with loader menu pic.

    Sascha Wildner committed May 3, 2009
  3. installer: Move the installer from contrib/ to usr.sbin/.

    Fix trailing whitespace while I'm doing it.
    Sascha Wildner committed May 3, 2009
  4. acpi: Select proper one shot timer based on CPUs' C3 state.

    Sepherosa Ziehau committed May 3, 2009
  5. Allow one shot timer to be switched on a running system between i8254…

    … and
    
    lapic timer:
    
    - Always register "clk" interrupt.
    - Add cputimer_intr_switch(), which could switch one shot timer between
      i8254 and lapic timer on a running system.  It could be used to select
      a proper one shot timer duing ACPI C3 transition:
      e.g. ->C3 use i8254, C3-> use lapic timer
    - Add sysctl node hw.cputimer_intr_type to test cputimer_intr_switch().
    Sepherosa Ziehau committed May 3, 2009
  6. hpet: Veto Sx state transition, if hpet is the sys_cputimer, since

    hpet is not required to function under S1-S5.  Add comment about
    the reference to the related hpet standard items.
    Sepherosa Ziehau committed May 3, 2009
  7. lapic timer: Improve lapic timer vector code

    - Check for a non-zero td->td_nest_count before allowing the processing
      to occur.  Mainly to allow interrupt thread preemption to work for
      slow interrupts
    - Increment V_INTR statistic, so vm.stats.sys.v_intr shows correct value,
      i.e. 'Int' field in systat -vm
    
    Submitted-by: dillon@
    Sepherosa Ziehau committed May 3, 2009
  8. installer: Deactivate "Install extra software packages" option.

    Our installation unconditionally cpdups the CD/DVD's /usr/pkg to the
    disk so this option doesn't make sense and only confused people in the
    past.
    
    Leave "Remove software packages" in, though, since it actually seems to
    work.
    Sascha Wildner committed May 3, 2009
  9. installer: Fix various issues related to MFS backed partitions.

    * The size of the MFS should be what the user specified, and not be
      based on slice size.
    
    * On the fstab line, specify block and fragment size too. Softupdates
      is ignored as it doesn't seem to play nice with MFS.
    
    * MFS backed partitions don't need to be mounted at installation time
      but the mount points have to be created anyway.
    
    * While here, perform some minor cleanup.
    Sascha Wildner committed May 3, 2009
  10. installer: Fix typo that prevented the creation of MFS backed partiti…

    …ons.
    
    A bit late, but it was hard to spot. :)
    
    Reported-by:   Alec Berryman <alec@thened.net>
    Dragonfly-bug: <http://bugs.dragonflybsd.org/issue34>
    Sascha Wildner committed May 2, 2009
  11. installer: Remove some OpenBSD specific code.

    Sascha Wildner committed May 2, 2009