bug#59382: cp(1) tries to allocate too much memory if filesystem blocksizes are unusual

2022-11-20 Thread Korn Andras
On Sat, Nov 19, 2022 at 07:50:06PM -0800, Paul Eggert wrote: > > > The block size for filesystems can also be quite large (currently, > > > up to 16M). > > It seems ZFS tries to "help" apps by reporting misinformation (namely a > smaller block size than actually preferred) when the file is

bug#59382: cp(1) tries to allocate too much memory if filesystem blocksizes are unusual

2022-11-19 Thread Korn Andras
Hi, on zfs, newfstatat() can return an st_blksize that is approximately equal to the file size in bytes (if the file fit into a single zfs record). The block size for filesystems can also be quite large (currently, up to 16M). The code at