From 08737fadab9b72068a5564111b3e8a8b0bfd5a05 Mon Sep 17 00:00:00 2001 From: Mike Hibler Date: Wed, 22 Jan 2014 14:17:05 -0700 Subject: [PATCH] Handle RO export of an extent. --- clientside/tmcc/freenas8/libvnode_blockstore.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clientside/tmcc/freenas8/libvnode_blockstore.pm b/clientside/tmcc/freenas8/libvnode_blockstore.pm index 106ea6a45..bb7e32f47 100644 --- a/clientside/tmcc/freenas8/libvnode_blockstore.pm +++ b/clientside/tmcc/freenas8/libvnode_blockstore.pm @@ -741,11 +741,16 @@ sub exportSlice($$$$) { return -1; } + my $perm = "rw"; + if (exists($sconf->{'PERMS'}) && $sconf->{'PERMS'} eq "RO") { + $perm = "ro"; + } + # Create iSCSI target my $serial = genSerial(); eval { freenasRunCmd($FREENAS_CLI_VERB_IST_TARGET, "add $iqn $serial $ISCSI_GLOBAL_PORTAL ". - "$tag Auto -1") }; + "$tag Auto -1 flags=$perm") }; if ($@) { warn("*** ERROR: blockstore_exportSlice: $volname: ". "Failed to create iSCSI target: $@"); -- GitLab