Hi Justin, On Wed, 1 Apr 2015 14:35:51 +0200 Justin Ossevoort <jus...@quarantainenet.nl> wrote:
> The FITRIM ioctl updates the fstrim_range structure it receives. This > way the caller can determine how many bytes were trimmed. The > guest-fstrim logic reuses the same fstrim_range for each filesystem, > effectively limiting each filesystem to trim at most as much as the > previous was able to trim. > > If a previous filesystem would have trimmed 0 bytes, than the next > filesystem would report an error 'Invalid argument' because a FITRIM > request with length 0 is not valid. > > This change resets the fstrim_range structure for each filesystem. It > returns a list of all trimmed filesystems with their status. If the > trime operation succeeded it returns the amount of bytes trimmed and > the effective minimum chunk size. On error it returns the value of > the errno for that filesystem operation (instead of aborting the > request). I think I've ran into the same problem today - guest-fstrim failed with "invalid argument" when being used with multiple file systems. Could you maybe split your patch in two parts, so that the first patch just fixes the issue with struct fstrim_range and the second patch does all the extensions to the guest agent call? That makes the patch easier to review and the bug fix itself could be cherry-picked easier to the stable branches later (i.e. for the first patch, you should/could CC: to the qemu-stable mailing list, too). Thanks! Thomas