Commit 08737fad authored by Mike Hibler's avatar Mike Hibler

Handle RO export of an extent.

parent cd5edf1e
...@@ -741,11 +741,16 @@ sub exportSlice($$$$) { ...@@ -741,11 +741,16 @@ sub exportSlice($$$$) {
return -1; return -1;
} }
my $perm = "rw";
if (exists($sconf->{'PERMS'}) && $sconf->{'PERMS'} eq "RO") {
$perm = "ro";
}
# Create iSCSI target # Create iSCSI target
my $serial = genSerial(); my $serial = genSerial();
eval { freenasRunCmd($FREENAS_CLI_VERB_IST_TARGET, eval { freenasRunCmd($FREENAS_CLI_VERB_IST_TARGET,
"add $iqn $serial $ISCSI_GLOBAL_PORTAL ". "add $iqn $serial $ISCSI_GLOBAL_PORTAL ".
"$tag Auto -1") }; "$tag Auto -1 flags=$perm") };
if ($@) { if ($@) {
warn("*** ERROR: blockstore_exportSlice: $volname: ". warn("*** ERROR: blockstore_exportSlice: $volname: ".
"Failed to create iSCSI target: $@"); "Failed to create iSCSI target: $@");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment