[parted-devel] [PATCH] libparted: Use read only when probing devices on linux (#1245144)
Brian C. Lane
bcl at redhat.com
Thu Sep 24 15:58:26 UTC 2015
On Thu, Sep 24, 2015 at 09:19:10AM -0400, Phil Susi wrote:
> 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.
>
Sure, we could do that. But I'd prefer that to happen in a separate
patchset.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
More information about the parted-devel
mailing list