[Bug 53475] cp(1) copies files in reverse order to destination

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue May 5 13:23:07 UTC 2015


--- Comment #3 from commit-hook at freebsd.org ---
A commit references this bug:

Author: jilles
Date: Tue May  5 13:23:04 UTC 2015
New revision: 282482
URL: https://svnweb.freebsd.org/changeset/base/282482

  cp: Remove fts sorting.

  In an attempt to improve performance, cp reordered directories first
  (although the comment says directories last). This is not effective with new
  UFS layout policies.

  The sorting reorders multiple arguments passed to cp, which may be

  Additionally, the comparison function does not induce a total order. Per
  POSIX, this causes undefined behaviour in qsort().

  NetBSD removed the sorting in 2009.

  On filesystems that return directory entries in hash/btree order, sorting by
  d_fileno before statting improves performance on large directories. However,
  this can only be implemented in fts(3).

  PR:        53475
  Reviewed by:    bde (in 2004)
  MFC after:    1 week


You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list