On Sat, Jul 22, 2017 at 12:06:17PM -0600, Chris Murphy wrote: > I just did an additional test that's pretty icky behavior. > > 2x HDD device Btrfs volume. Add both devices and `btrfs devices ready` > exits with 0 as expected. Physically remove both USB devices. > Reconnect one device. `btrfs device ready` still exits 0. That's > definitely not good. (If I leave that one device connected and reboot, > `btrfs device ready` exits 1).
In a slightly less-specific way, this has been a problem pretty much since the inception of the FS. It's not possible to do the reverse of the "scan" operation on a device -- that is, invalidate/ remove the device's record in the kernel. So, as you've discovered here, if you have a device which is removed (overwritten, unplugged), the kernel still thinks it's a part of the FS. It's something I recall being talked about a bit, some years ago. I don't recall now why it was going to be useful, though. I think you have a good use-case for such a new ioctl (or extension to the SCAN_DEV ioctl) now, though. Hugo. -- Hugo Mills | UNIX: Italian pen maker hugo@... carfax.org.uk | http://carfax.org.uk/ | PGP: E2AB1DE4 |
signature.asc
Description: Digital signature