[stgt] [PATCH 1/1] tgtd: allow 'immutable' files and have them become read-only LUNs.
ronnie sahlberg
ronniesahlberg at gmail.com
Sun Oct 10 07:28:29 CEST 2010
List, Tomo
(right list this time:-) )
Please find attached a small patch to the three bs_*.c files used for
SBC and MMC devices.
The patch changes the *_open() function in such way that if the normal
open for O_RDWR fails with EACCES,
we try to open the file with O_RDONLY instead, and set the LUN to read-only.
This allows to set the backing file to "chattr +i" for those
filesystems that support these attributes and automatically
flags them to read-only.
In particular for ISO images I find it very nice to have them set to
immutable to prevent any process from accidentally writing/modifying
them.
regards
ronnie sahlberg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Update-bs_-_open-to-try-to-open-the-backend-file-in-.patch
Type: text/x-diff
Size: 2513 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/stgt/attachments/20101010/0d4b5597/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Update-bs_-_open-to-try-to-open-the-backend-file-in-.patch.gz
Type: application/x-gzip
Size: 886 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/stgt/attachments/20101010/0d4b5597/attachment-0001.bin>
More information about the stgt
mailing list