How useful should copy_file_range() be?
How useful should copy_file_range() be?
Posted Feb 20, 2021 14:45 UTC (Sat) by smurf (subscriber, #17840)In reply to: How useful should copy_file_range() be? by jengelh
Parent article: How useful should copy_file_range() be?
So the bug is on the user. If you treat these things like ordinary files and expect all the posicky corner cases to work "correctly", you're SOL. These files will never have POSIX semantics. No, you can't use libc to emulate it. Deal.
Yes there should be a way to ask the kernel whether a file conforms to 100% posix. Well, we don't have that. Deal.
One possible workaround is to check the file size. If it's smaller than pagesize*4 or so then it's probably cheaper to copy its data the old-fashioned way anyway.