On Mon, Oct 16, 2017 at 12:53:53PM -0500, Eric W. Biederman wrote: > I would prefer that we start with what we can do easily. There is a > danger in working on revoke like actions that a high cost will be paid > to get nice semantics for a rare case. Users wanting to remove a USB thumb drives do *not* seem like a rare case to me.... and disconnecting from the backing store without corrupting the file system is not necessarily trivial. > We can easily before that request that the filesystem be remounted > read-only. We may not succeed (as someone may have something open for > write) but that code path exists and it is easy to use. > > Tracking down all instances of struct file and all instances of struct > path that reference a filesystem is expensive today, and expensive to > add a list to do. So I don't know that we want to do that. It's not that expensive. After all, system administsrators are running lsof all the time to work around this sort of problem. And doing this kind forced unmount is not a high-performance critical path. And just like what a human system administrator will be doing, if there are no struct files holding the file system open, we won't need to scan all of the struct files. If there is something holding the file system busy, either the kernel is going to have to scan all of struct files, or we are going to be forcing the system adminsitrator to paw through all of /proc/*/fd/* and /proc/*/mounts looking for the needle in the haystack. I claim it's ***always*** going to be faster to do it in the kernel than forcing the system administrator to suck the information through the thin straw which is /proc/*/mounts and /proc/*/fd/*. - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html