Hi Chris, > I have a filesystem for which fstrim won't do anything. > The filesystem has a history of abuse; dev add, dev remove, dding, ... > > There's nothing wrong with the kernel or the disc; other btrfs volumes > on the same disc trim fine, and the volume used to trim fine. > > By "won't trim", I mean that it always, instantly returns 0 bytes > trimmed: you probably suffer from the same problem I had a few years ago. It is a bug in how btrfs implements fstrim. Adding and removing devices is the way I got my btrfs filesystem into the same situation then. See for the background: http://comments.gmane.org/gmane.comp.file-systems.btrfs/15597 I wrote a patch, see here: http://www.mail-archive.com/linux-btrfs@xxxxxxxxxxxxxxx/msg40618.html I understand that in kernel 4.3 there will be an extension so that fstrim trims free space outside of allocated chunks. This is orthogonal; my patch allows to trim free space inside allocated chunks (which, somewhat accidentally, works for most btrfs filesystems since a long time) even with filesystems like yours. Kind regards, Lutz Euler -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
