|
From: | Paul Eggert |
Subject: | bug#48833: reflink copying does not check/set No_COW attribute and fail |
Date: | Sun, 6 Jun 2021 22:47:05 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
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.)
[Prev in Thread] | Current Thread | [Next in Thread] |