bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62404: --reflink=auto not falling back appropriately on older kernel


From: Paul Eggert
Subject: bug#62404: --reflink=auto not falling back appropriately on older kernels
Date: Sat, 25 Mar 2023 13:34:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

Thanks for installing that. I found the comments still a bit confusing so I pushed the attached; hope it's OK.

It is annoying that in the common case where A is a regular file and B does not exist but will be created on the same file system, the syscalls start out:

  openat(AT_FDCWD, "B", O_RDONLY|O_PATH|O_DIRECTORY) = -1 ENOENT
  newfstatat(AT_FDCWD, "A", ...}, 0) = 0
  openat(AT_FDCWD, "A", O_RDONLY)        = 3
  newfstatat(3, "", ..., AT_EMPTY_PATH) = 0
  openat(AT_FDCWD, "B", O_WRONLY|O_CREAT|O_EXCL, 0775) = 4
  ioctl(4, BTRFS_IOC_CLONE or FICLONE, 3) = -1 EOPNOTSUPP
  newfstatat(4, "", ..., AT_EMPTY_PATH) = 0

They should be just:

  openat(AT_FDCWD, "A", O_RDONLY)        = 3
  newfstatat(3, "", ..., AT_EMPTY_PATH) = 0
  openat(AT_FDCWD, "B", O_WRONLY|O_CREAT|O_EXCL, 0775) = 4
  ioctl(4, BTRFS_IOC_CLONE or FICLONE, 3) = -1 EOPNOTSUPP
  newfstatat(4, "", ..., AT_EMPTY_PATH) = 0

as there should be no need to stat the source twice, or to try to open the destination twice. But this is a performance improvement for another day.

Attachment: 0001-cp-clarify-commentary.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]