This looks correct and safe to me, but I wonder if anyone relies on multi-threaded /dev/sg write usage, which would be completely serialized with this.
This looks correct and safe to me, but I wonder if anyone relies on multi-threaded /dev/sg write usage, which would be completely serialized with this.