open-source-firmware / go-tcg-storage

Go library for interfacing TCG Storage functions on storage devices
BSD 3-Clause "New" or "Revised" License
21 stars 10 forks source link

Use O_EXCL to avoid interference? #33

Open bluecmd opened 3 years ago

bluecmd commented 3 years ago

See http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/SCSI-Generic-HOWTO.html and specifically 7.1 open().

Reading that, we might also be fine with opening with RDONLY

No idea how this works with nvme though.

ChriMarMe commented 2 years ago

What is the status of this? This relevant? Can you give me a little more information what might be the benefit of this?

bluecmd commented 2 years ago

The benefit/problem statement is to handle multiple concurrent runs of the library/tools. I'd imagine a way to test this is to run hundreds of instances of the tools against one drive and ensure that no protocol errors happen. Either by synchronizing around something like O_EXCL or something else