GNU bug report logs - #62404
--reflink=auto not falling back appropriately to standard copy in all cases

Previous Next

Package: coreutils;

Reported by: Pádraig Brady <P <at> draigBrady.com>

Date: Thu, 23 Mar 2023 13:04:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #27 received at 62404 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 62404 <at> debbugs.gnu.org
Subject: Re: bug#62404: --reflink=auto not falling back appropriately on older
 kernels
Date: Sat, 25 Mar 2023 13:34:40 -0700
[Message part 1 (text/plain, inline)]
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.
[0001-cp-clarify-commentary.patch (text/x-patch, attachment)]

This bug report was last modified 2 years and 59 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.