switch DM tables to readonly automatically
Quoted 12 lines
Hi all,
this patch switches the device-mapper table to read-only status automatically if one underlying device returns
-EROFS.Rationale:
Whenever a SCSI device is switched to read-only a table reload from multipath-tools fails, without any indication about the reason. And it's actually quite tricky to detect the read-only status from userland. And quite pointless, too, as the kernel already knows about it.And we now can create tables for CD-ROMs, too, without having to use the '-r' flag to dmsetup ...
Christophe, this might also fix your problem.
It seems it will solve the map creation error on read-only LU, but what about these LU becoming writable ? ... as is the case with the Symmetrix R2 upon spliting the synchronisation link.
Will the devmap become writable too automagically or is the multipathd daemon expected to take action the promote the map RW ?
Thanks for caring anyway.
Quoted 11 lines
As usual, comments etc are welcome.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare suse de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
Hi Christophe,
Quoted 7 lines · Christophe Varoqui
Quoted 7 lines
Hi all,
this patch switches the device-mapper table to read-only status automatically if one underlying device returns
-EROFS.Rationale:
Whenever a SCSI device is switched to read-only a table reload from multipath-tools fails, without any indication about the reason. And it's actually quite tricky to detect the read-only status from userland. And quite pointless, too, as the kernel already knows about it.
Quoted 8 lines
Quoted 4 lines
And we now can create tables for CD-ROMs, too, without having to use the '-r' flag to dmsetup ...
Christophe, this might also fix your problem.
It seems it will solve the map creation error on read-only LU, but what about these LU becoming writable ? ... as is the case with the Symmetrix R2 upon spliting the synchronisation link.
Will the devmap become writable too automagically or is the multipathd daemon expected to take action the promote the map RW ?
Tricky business. We'll first have to be notified that the LU is becoming writeable. The current SCSI stack is not very good at providing that sort of information.
I would think the best way here would be to modify the 'tur' checker to check for the READ-ONLY state, too. That would mean we'll have to implement a new path state 'READONLY', but that should be okay methinks. But this would have to be done at the SCSI level as the current 'sd' driver is not capable of switching between read-only and read-write on the fly, either.
Maybe I'll give it a go if I find some time.
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg)
Quoted 21 lines · Hannes Reinecke
Hi Christophe,
Quoted 7 lines · Christophe Varoqui
Quoted 7 lines
Hi all,
this patch switches the device-mapper table to read-only status automatically if one underlying device returns
-EROFS.Rationale:
Whenever a SCSI device is switched to read-only a table reload from multipath-tools fails, without any indication about the reason. And it's actually quite tricky to detect the read-only status from userland. And quite pointless, too, as the kernel already knows about it.Quoted 8 lines
Quoted 4 lines
And we now can create tables for CD-ROMs, too, without having to use the '-r' flag to dmsetup ...
Christophe, this might also fix your problem.
It seems it will solve the map creation error on read-only LU, but what about these LU becoming writable ? ... as is the case with the Symmetrix R2 upon spliting the synchronisation link.
Will the devmap become writable too automagically or is the multipathd daemon expected to take action the promote the map RW ?Tricky business. We'll first have to be notified that the LU is becoming writeable. The current SCSI stack is not very good at providing that sort of information.
Quoted 7 lines
I would think the best way here would be to modify the 'tur' checker to check for the READ-ONLY state, too. That would mean we'll have to implement a new path state 'READONLY', but that should be okay methinks. But this would have to be done at the SCSI level as the current 'sd' driver is not capable of switching between read-only and read-write on the fly, either.
Maybe I'll give it a go if I find some time.
For your information, I checked the rhel4 behaviour.
That stuff worked out-of-the-box with rhel4 kernel : paths to R2 were not flagged RO, so maps over R2 LU paths were RW; the Symmetrix failed ios when paths were actually not writable and, upon spliting, multipaths were usable without any userspace action.
Is all this precaution about not submitting ios to the R2 LU really worth the pain ? Can't we just let the device mapper moun RW maps over RO paths ?
Regards,
cvaroqui