[Pkg-iscsi-maintainers] Bug#745708: open-iscsi: umountiscsi.sh prematurely exits when encountering targets without block devices

Ritesh Raj Sarraf rrs at debian.org
Thu Apr 24 18:39:29 UTC 2014


On 04/24/2014 02:20 PM, Sammy Atmadja wrote:
> Package: open-iscsi
> Version: 2.0.873-3
> Severity: normal
> Tags: patch
>
> Dear Maintainer,
>
> While rebooting a server with iscsi partitions I encountered bug
> #691732 . Seeing that #691732 was fixed in version
> 2.0.873+git0.3b4b4500-1 of open-iscsi I looked over the changes and
> noticed that if umountiscsi.sh finds an iscsi target without block
> devices it does an exit 0 while in the middle of the for loop and
> skips the rest of the targets.
>
> This could be a problem if the target without block devices is not the
> last target. See my patch below which continues instead of an exit.
>
> Sammy
>
> -- System Information:
> Debian Release: 7.4
>   APT prefers stable
>   APT policy: (990, 'stable'), (500, 'stable-updates')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 3.13-0.bpo.1-amd64 (SMP w/4 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
>
> Versions of packages open-iscsi depends on:
> ii  libc6  2.13-38+deb7u1
> ii  udev   204-8~bpo70+1
>
> open-iscsi recommends no packages.
>
> open-iscsi suggests no packages.
>
> -- Configuration Files:
> /etc/iscsi/initiatorname.iscsi [Errno 13] Permission denied: u'/etc/iscsi/initiatorname.iscsi'
>
> -- no debconf information
>
> --- patch for umountiscsi.sh ---
> diff --git a/debian/umountiscsi.sh.init b/debian/umountiscsi.sh.init
> index 8f7161b..d5b0591 100644
> --- a/debian/umountiscsi.sh.init
> +++ b/debian/umountiscsi.sh.init
> @@ -56,9 +56,8 @@ do_stop () {
>                 for BLOCK_FILE in $SESSION_DIR/target*/*\:*/block/*; do
>                         BLOCK_DEV=`echo "$BLOCK_FILE" | sed 's/.*block\///'`
>                         if [ "${BLOCK_DEV}" = "*" ];then
> -                               log_warning_msg "No iSCSI block devices found"
> -                               log_end_msg 0
> -                               exit 0
> +                               log_warning_msg "iSCSI target without block devices found"
> +                               continue
>                         fi
>                         DOS_PARTITIONS="`awk "/^\/dev\/$BLOCK_DEV/ { print \\$2; }" < /proc/mounts`"
>                         for DEVICE in $DOS_PARTITIONS; do
> --- end patch ---
>

Patch looks good. But just a quick question.  If the specific target
session does not have any block device, wouldn't BLOCK_FILE be empty and
thus not fall under the if condition ?

-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-iscsi-maintainers/attachments/20140425/0da52d98/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-iscsi-maintainers/attachments/20140425/0da52d98/attachment.sig>


More information about the Pkg-iscsi-maintainers mailing list