GNU bug report logs - #48833
reflink copying does not check/set No_COW attribute and fail

Previous Next

Package: coreutils;

Reported by: Tom Yan <tom.ty89 <at> gmail.com>

Date: Fri, 4 Jun 2021 14:38:02 UTC

Severity: normal

Full log


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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Zygo Blaxell <ce3g8jdj <at> umail.furryterror.org>, Tom Yan <tom.ty89 <at> gmail.com>
Cc: 48833 <at> debbugs.gnu.org, linux-btrfs <at> vger.kernel.org
Subject: Re: bug#48833: reflink copying does not check/set No_COW attribute
 and fail
Date: Sun, 6 Jun 2021 22:47:05 -0700
On 6/5/21 10:42 PM, Zygo Blaxell wrote:
> If cp -a implements the inode attribute propagation (or inheritance), then
> only users of cp -a are impacted.  They are more likely to be aware that
> they may be creating new files with reduced-integrity storage attributes.

True, although I think this aspect of attribute-copying will typically 
come as a surprise even to "cp -a" users.

> If the file is empty, you can chattr +C or -C.  If the file is not
> empty, chattr fails with an error.

Although coreutils 'cp -a' currently truncates any already-existing 
output file (by opening it with O_TRUNC), it then calls copy_file_range 
before calling fsetxattr on the destination. Presumably cp should do the 
equivalent of chattr +C before doing the copy_file_range stuff. (Perhaps 
you've already mentioned this point; if so, my apologies for the 
duplication.)





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

Previous Next


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