Summary: | ioctl FICLONE mishandled | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Kenton Varda <kenton> |
Component: | general | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | balint, laurent.bonnans, mark |
Priority: | NOR | ||
Version: | 3.13.0 | ||
Target Milestone: | --- | ||
Platform: | Debian unstable | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Patch to handle FICLONE ioctl on Linux |
Description
Kenton Varda
2018-08-19 07:02:56 UTC
Created attachment 116351 [details]
Patch to handle FICLONE ioctl on Linux
I've sent a patch to handle FICLONE correctly. It seems to me that the ioctl definition in Linux's uapi is misleading because it is set with a write direction but do not use the argument as a pointer (it is a file descriptor). Hence the error in the generic ioctl handler. It can be tested by running this command on a btrfs filesystem (might do it with another fs, haven't tested): valgrind cp --reflink=always example.txt example_copy.txt I can confirm that the patch works and in would be nice to have in in the next Valgrind release. I've set up a PPA with the patch applied: https://launchpad.net/~rbalint/+archive/ubuntu/valgrind Apologies this patch lingered so long. It does look correct, I replicated the issue and your analysis of how the _IOW uapi definition is misleading also seems correct. Pushed as: commit 1c49351424f04ee29a5efc054cb08ab3ad22b978 Author: Laurent Bonnans <laurent.bonnans@here.com> Date: Fri Nov 16 15:22:18 2018 +0100 Fix 397605 - Add support for Linux FICLONE ioctl |