Project

General

Profile

Actions

Bug #3867

closed

stmfCreateLu failed: GUID_IN_USE

Added by Christopher Siden almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Category:
comstar - iSCSI/FC/SAS target
Start date:
2013-07-03
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

From Jeff Biseda's bug report at Delphix:

Looking at the code we should be going down the following code path:

stmfCreateLu
-> createDiskLu
--> IOCTL

createDiskLu is mapping SBD_RET_GUID_ALREADY_REGISTERED to
STMF_ERROR_GUID_IN_USE

in the kernel we should be following this path:

sbd_create_register_lu
-> sbd_populate_and_register_lu
--> stmf_register_lu

which checks for a duplicate GUID

sbd_populate_and_register_lu is mapping this error in sbd.c:

1448    if ((ret = stmf_register_lu(lu)) != STMF_SUCCESS) {
1449        stmf_trace(0, "Failed to register with framework, ret=%llx",
1450            ret);
1451        if (ret == STMF_ALREADY) {
1452            *err_ret = SBD_RET_GUID_ALREADY_REGISTERED;
1453        }
1454        return (EIO);
1455    }

because we don't specify a GUID explicitly, sbd_create_register_lu should be
generating one for us with:

1970        if (stmf_scsilib_uniq_lu_id2(slu->slu_company_id, hid,
1971            (scsi_devid_desc_t *)&sl->sl_device_id[0]) !=
1972            STMF_SUCCESS) {

stmf_scsilib_uniq_lu_id2 has a race with an atomic variable
stmf_lu_id_gen_number, where it should be using atomic_add_16_nv and saving the
value rather than using atomic_add_16.

Jeff wrote the attached script to reproduce the problem (run 4 or more times in parallel for a while until the bug is hit).


Files

stmfspin.c (1.63 KB) stmfspin.c Christopher Siden, 2013-07-03 07:04 PM
Actions #1

Updated by Christopher Siden almost 9 years ago

  • Status changed from In Progress to Closed
commit 57ff5e7
Author: Jeff Biseda <jeff.biseda@delphix.com>
Date:   Mon Jul 8 09:57:02 2013

    3866 panic in idm module
    3867 stmfCreateLu failed: GUID_IN_USE
    3868 iscsi target not accepting any new connections
    Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
    Reviewed by: Jeremy Jones <jeremy@delphix.com>
    Reviewed by: Eric Diven <eric.diven@delphix.com>
    Reviewed by: Richard Lowe <richlowe@richlowe.net>
    Reviewed by: T Nguyen <truongqnguien@gmail.com>
    Approved by: Gordon Ross <gwr@nexenta.com>
Actions

Also available in: Atom PDF