Package: partman-md
Version: 26
Severity: important
Tags: patch, pending

Probably since the the implementation of 2.6 with udev, partman tries to 
open /dev/md/x devices twice. This leads to a warning dialog "The device 
is already opened".

The attached log shows what happens in detail. Basically there are two 
scripts that now both try open the device:
- /lib/partman/init.d/30parted     (from partman-base)
- /lib/partman/init.d/31md-devices (from partman-md)

The change is probably that parted_devices in the 30parted script now 
lists RAID devices while in the past it did not and thus the separate 
script 31md-devices had to open the device.

Probable reason that parted_devices now lists RAID is that there is now a 
symlink /dev/md0 -> /dev/md/0. Removal of that symlink causes 
parted_devices to no longer list them.
In that respect this bug is related to #377242.

The patch below seems to solve the problem and should keep backwards 
compatibility.

--- partman-md/init.d/md-devices        (revision 38739)
+++ partman-md/init.d/md-devices        (working copy)
@@ -35,11 +35,17 @@
        fi
        size=$(($size * $sector_size))
        echo "$size" > ${DEVICE}/size
-       open_dialog OPEN "/dev/md/${NUMBER}"
+
+       open_dialog OPENED "/dev/md/${NUMBER}"
        read_line response
        close_dialog
-       if [ "$response" = "failed" ]; then
-               rm -rf ${DEVICE}
+       if [ "$response" = "no" ]; then
+               open_dialog OPEN "/dev/md/${NUMBER}"
+               read_line response
+               close_dialog
+               if [ "$response" = "failed" ]; then
+                       rm -rf ${DEVICE}
+               fi
        fi

        open_dialog NEW_LABEL loop

parted_server: ======= Starting the server
parted_server: main_loop: iteration 1
parted_server: Opening infifo
/lib/partman/init.d/30parted: IN: OPEN =dev=scsi=host0=bus0=target0=lun0=disc /dev/scsi/host
0/bus0/target0/lun0/disc
parted_server: Read command: OPEN
parted_server: command_open()
parted_server: Request to open =dev=scsi=host0=bus0=target0=lun0=disc
parted_server: Opening outfifo
parted_server: OUT: OK


parted_server: OUT: OK


parted_server: Note =dev=scsi=host0=bus0=target0=lun0=disc as unchanged
parted_server: Closing infifo and outfifo
parted_server: main_loop: iteration 2
parted_server: Opening infifo
/lib/partman/init.d/30parted: IN: OPEN =dev=scsi=host0=bus0=target1=lun0=disc /dev/scsi/host
0/bus0/target1/lun0/disc
parted_server: Read command: OPEN
parted_server: command_open()
parted_server: Request to open =dev=scsi=host0=bus0=target1=lun0=disc
parted_server: Opening outfifo
parted_server: OUT: OK


parted_server: OUT: OK


parted_server: Note =dev=scsi=host0=bus0=target1=lun0=disc as unchanged
parted_server: Closing infifo and outfifo
parted_server: main_loop: iteration 3
parted_server: Opening infifo
/lib/partman/init.d/30parted: IN: OPEN =dev=md=0 /dev/md/0
parted_server: Read command: OPEN
parted_server: command_open()
parted_server: Request to open =dev=md=0
parted_server: Opening outfifo
parted_server: OUT: OK


parted_server: OUT: OK


parted_server: Note =dev=md=0 as unchanged
parted_server: Closing infifo and outfifo
/lib/partman/init.d/31md-devices: *******************************************************
parted_server: main_loop: iteration 4
parted_server: Opening infifo
/lib/partman/init.d/31md-devices: IN: OPEN =dev=md=0 /dev/md/0
parted_server: Read command: OPEN
parted_server: command_open()
parted_server: Request to open =dev=md=0
parted_server: Opening outfifo
parted_server: Warning: the device is already opened
parted_server: OUT: Warning


parted_server: OUT: The device is already opened.


parted_server: OUT:


parted_server: OUT: OK


parted_server: OUT:


/lib/partman/init.d/31md-devices: error_handler: exception with type Warning
/lib/partman/init.d/31md-devices: error_handler: reading message
/lib/partman/init.d/31md-devices: paragraph: The device is already opened.
/lib/partman/init.d/31md-devices: error_handler: reading options
/lib/partman/init.d/31md-devices: option: OK
/lib/partman/init.d/31md-devices: IN: unhandled
parted_server: User canceled exception handler
parted_server: OUT: OK


parted_server: OUT: OK


parted_server: Note =dev=md=0 as unchanged
parted_server: Closing infifo and outfifo
parted_server: main_loop: iteration 5
parted_server: Opening infifo
/lib/partman/init.d/31md-devices: IN: NEW_LABEL =dev=md=0 loop
parted_server: Read command: NEW_LABEL
parted_server: command_new_label()
parted_server: Note =dev=md=0 as changed
parted_server: Opening outfifo
parted_server: command_new_label: requested label with type loop
parted_server: command_new_label: creating
parted_server: OUT: OK


parted_server: Closing infifo and outfifo
parted_server: main_loop: iteration 6
parted_server: Opening infifo
/lib/partman/init.d/31md-devices: IN: PARTITIONS =dev=md=0
parted_server: Read command: PARTITIONS
parted_server: command_partitions()
parted_server: Opening outfifo
parted_server: OUT: OK


parted_server: OUT: -1  0-4194697215    4194697216      primary free    /dev/md/0


parted_server: Partitions printed
parted_server: OUT:


Attachment: pgpbJhSjeZ5Oo.pgp
Description: PGP signature

Reply via email to