[dm-devel] [PATCH] [RFC] switch DM tables to readonly automatically

Alasdair G Kergon agk at redhat.com
Thu May 1 11:24:51 UTC 2008


On Fri, Apr 25, 2008 at 04:32:37PM +0200, Hannes Reinecke wrote:
> this patch switches the device-mapper table to read-only
> status automatically if one underlying device returns -EROFS.
 
I'm going to need some persuading here...

An analogy.  If I call open() with O_RDWR and but that can't be done
because the device is read-only - what happens?  Does the open()
silently give me a read-only file descriptor instead?  Or does it
give me -EROFS?

If I request DM_TABLE_LOAD without the DM_READONLY_FLAG, I am asking
for a device I can write to and if that's not possible I expect an
error.  If I'd wanted a read-only device I'd have set the
DM_READONLY_FLAG on my request.

Is the real problem that -EROFS/-ENXIO errors are not propagating back
up through target _ctr functions as perhaps they should?

Alasdair
-- 
agk at redhat.com




More information about the dm-devel mailing list