Bug#1082886: cp --sparse defeated by ficlone

2024-09-29 Thread Pádraig Brady
On 27/09/2024 18:18, Matthew Wilcox wrote: Package: coreutils Version: 9.4-3.1 strace cp --sparse=always dd dd-sparse [extraneous stuff skipped] openat(AT_FDCWD, "dd", O_RDONLY)= 3 fstat(3, {st_mode=S_IFREG|0755, st_size=134248, ...}) = 0 openat(AT_FDCWD, "dd-sparse", O_WRONLY|O_CREAT|O_

Bug#1082886: cp --sparse defeated by ficlone

2024-09-27 Thread Matthew Wilcox
On Fri, Sep 27, 2024 at 09:25:11PM -0400, Michael Stone wrote: > On Sat, Sep 28, 2024 at 01:20:17AM +0100, Matthew Wilcox wrote: > > On Fri, Sep 27, 2024 at 06:23:05PM -0400, Michael Stone wrote: > > > It would be just as confusing for cp to ignore reflink, right? > > > > I didn't ask cp to use re

Bug#1082886: cp --sparse defeated by ficlone

2024-09-27 Thread Michael Stone
On Sat, Sep 28, 2024 at 01:20:17AM +0100, Matthew Wilcox wrote: On Fri, Sep 27, 2024 at 06:23:05PM -0400, Michael Stone wrote: On Fri, Sep 27, 2024 at 09:31:37PM +0100, Matthew Wilcox wrote: > On Fri, Sep 27, 2024 at 02:41:39PM -0400, Michael Stone wrote: > > On Fri, Sep 27, 2024 at 06:18:20PM +

Bug#1082886: cp --sparse defeated by ficlone

2024-09-27 Thread Matthew Wilcox
On Fri, Sep 27, 2024 at 06:23:05PM -0400, Michael Stone wrote: > On Fri, Sep 27, 2024 at 09:31:37PM +0100, Matthew Wilcox wrote: > > On Fri, Sep 27, 2024 at 02:41:39PM -0400, Michael Stone wrote: > > > On Fri, Sep 27, 2024 at 06:18:20PM +0100, Matthew Wilcox wrote: > > > > Without looking at the so

Bug#1082886: cp --sparse defeated by ficlone

2024-09-27 Thread Michael Stone
On Fri, Sep 27, 2024 at 09:31:37PM +0100, Matthew Wilcox wrote: On Fri, Sep 27, 2024 at 02:41:39PM -0400, Michael Stone wrote: On Fri, Sep 27, 2024 at 06:18:20PM +0100, Matthew Wilcox wrote: > Without looking at the source code, it seems likely that cp blindly > tries FICLONE without checking to

Bug#1082886: cp --sparse defeated by ficlone

2024-09-27 Thread Matthew Wilcox
On Fri, Sep 27, 2024 at 02:41:39PM -0400, Michael Stone wrote: > On Fri, Sep 27, 2024 at 06:18:20PM +0100, Matthew Wilcox wrote: > > Without looking at the source code, it seems likely that cp blindly > > tries FICLONE without checking to see whether the sparse flag is set. > > I suggest that setti

Bug#1082886: cp --sparse defeated by ficlone

2024-09-27 Thread Matthew Wilcox
Package: coreutils Version: 9.4-3.1 strace cp --sparse=always dd dd-sparse [extraneous stuff skipped] openat(AT_FDCWD, "dd", O_RDONLY)= 3 fstat(3, {st_mode=S_IFREG|0755, st_size=134248, ...}) = 0 openat(AT_FDCWD, "dd-sparse", O_WRONLY|O_CREAT|O_EXCL, 0755) = 4 ioctl(4, BTRFS_IOC_CLONE or F

Bug#1082886: cp --sparse defeated by ficlone

2024-09-27 Thread Michael Stone
On Fri, Sep 27, 2024 at 06:18:20PM +0100, Matthew Wilcox wrote: Without looking at the source code, it seems likely that cp blindly tries FICLONE without checking to see whether the sparse flag is set. I suggest that setting --sparse=always should disable the FICLONE optimisation. I tend to dis