b) don't keep track of dma_buf, keep track of gem objects, when we get a lookup, check inside the gem object, since currently we NULL out the export_dma_buf when we hit the release path, apart from the fact I'm sure the locking is foobar,
Okay I've sent and implementation of this option, however it does mean that prime relies on GEM, which at this point is a tradeoff I'm quite happy to start making.
Dave.