On 9/23/2015 8:31 PM, Brian C. Lane wrote: > This doesn't try to make any commands use RO, it is making sure that > there is only 1 RW open/close instead of 2 of them. When linux_new is > called it calls the init_ functions which don't need to be RW so now we > have a RO open/close and then a RW open/close and udev only watches for > RW so it doesn't trigger the udev rules close together.
Ahh... why don't we try to get rid of the R/W open for commands that don't need it too? ;) I'm thinking something like, open initially opens it ro, and then linux_write checks and if it is still ro, reopen it rw? This does mean that EPERM when you lack write access would be delayed to the write instead of open, but from a user perspective, that is probably a good thing since you could print the partition table just fine without write access.

