Comment 2 for bug 1294267

Revision history for this message
Rarylson Freitas (rarylson) wrote :

I think the problem can be related to this fact: the TGT daemon don't add a block storage to a LUN if some process was accessing it.

The following command show another operation in which a similar problem occours:

# All block storage added to the targets
$ tgt-admin --dump | grep -o "backing-store \(.*\)" | sed -e "s/^backing-store \(.*\)$/\1/"
/dev/vg_vmware/vmware_4
/dev/vg_vmware/vmware_3
/dev/vg_vmware/vmware_2
/dev/vg_vmware/vmware_1
/dev/vg_vmware/vmware_5
# Now, we'll run a stop/start operation. Some device block (previously LUNs) still opened by some process
# between the `stop` and `start` operations. In our case, the device blocks was opened by the command `blkid`,
# running with the 'root' user.
$ stop tgt; lsof /dev/mapper/vg_vmware-vmware_1 /dev/mapper/vg_vmware-vmware_2 \
$ /dev/mapper/vg_vmware-vmware_3 /dev/mapper/vg_vmware-vmware_4 \
$ /dev/mapper/vg_vmware-vmware_5; start tgt; tgt-admin --dump | grep -o "backing-store \(.*\)" | \
$ sed -e "s/^backing-store \(.*\)$/\1/"
tgt stop/waiting
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
blkid 29870 root 3r BLK 252,2 0t212992 1585695 /dev/mapper/../dm-2
blkid 29871 root 3r BLK 252,0 0t143360 1605724 /dev/mapper/../dm-0
blkid 29872 root 3r BLK 252,3 0t180224 1585696 /dev/mapper/../dm-3
blkid 29875 root 3r BLK 252,4 0x1fd70bce200 1585697 /dev/mapper/../dm-4
tgt start/running, process 29878
/dev/vg_vmware/vmware_5
$ ls -lh /dev/mapper/vg_vmware-vmware_1 /dev/mapper/vg_vmware-vmware_2 /dev/mapper/vg_vmware-vmware_3 /dev/mapper/vg_vmware-vmware_4 /dev/mapper/vg_vmware-vmware_5
lrwxrwxrwx 1 root root 7 Mar 18 15:27 /dev/mapper/vg_vmware-vmware_1 -> ../dm-0
lrwxrwxrwx 1 root root 7 Mar 18 15:27 /dev/mapper/vg_vmware-vmware_2 -> ../dm-2
lrwxrwxrwx 1 root root 7 Mar 18 15:27 /dev/mapper/vg_vmware-vmware_3 -> ../dm-3
lrwxrwxrwx 1 root root 7 Mar 18 15:27 /dev/mapper/vg_vmware-vmware_4 -> ../dm-4
lrwxrwxrwx 1 root root 7 Mar 18 15:27 /dev/mapper/vg_vmware-vmware_5 -> ../dm-5

In our test, four device blocks (vg_vmware-vmware_1, vg_vmware-vmware_2, vg_vmware-vmware_3 and vg_vmware-vmware_4) were opened by the blkid command, and the `start tgt` command (that runs `/usr/sbin/tgt-admin -e`) only adds the other lun (vg_vmware-vmware_5).

I hope this test helps.