Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-7669

lmv_connect() leaks export if lmv_connect_mdc() fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • None
    • 3
    • 9223372036854775807

    Description

      This is easy to see when using the shared key patches but applies to master as well. If a client does not have the proper keys installed but tries to mount a shared key-ized FS then we leak a reference on the LMV device.

      t:lustre-release# mount q@tcp:/lustre /mnt/lustre -t lustre; lctl dk
      mount.lustre: mount q@tcp:/lustre at /mnt/lustre failed: Connection refused
      t:lustre-release# lctl dl
        2 ST lmv lustre-clilmv-ffff88007a00f5f8 d2cfcdb0-2a13-93ae-0876-8990528536e6 2
      
      00010000:00000001:3.0:1452801434.533046:0:27296:0:(ldlm_lib.c:577:client_connect_import()) Process leaving via out_ldlm (rc=18446744073709551505 : -111 : 0xffffffffffffff91)
      00000020:00000001:3.0:1452801434.533049:0:27296:0:(genops.c:1223:class_disconnect()) Process entered
      00000020:00000080:3.0:1452801434.533050:0:27296:0:(genops.c:1244:class_disconnect()) disconnect: cookie 0x2be62eb0a682b6f9
      00000020:00000001:3.0:1452801434.533057:0:27296:0:(genops.c:1780:obd_stale_export_put()) Process entered
      00000020:00000001:3.0:1452801434.533059:0:27296:0:(genops.c:1804:obd_stale_export_put()) Process leaving
      00000020:00000080:3.0:1452801434.533060:0:27296:0:(genops.c:823:class_export_put()) final put ffff88007a6e7538/LMV_MDC_UUID
      00000020:00000001:3.0:1452801434.533062:0:27296:0:(lprocfs_status_server.c:443:lprocfs_exp_cleanup()) Process leaving (rc=0 : 0 : 0)
      00000020:00000001:3.0:1452801434.533087:0:27296:0:(genops.c:1255:class_disconnect()) Process leaving (rc=0 : 0 : 0)
      00800000:00000001:3.0:1452801434.533100:0:27296:0:(obd_class.h:816:obd_connect()) Process leaving (rc=18446744073709551505 : -111 : ffffffffffffff91)
      00800000:00020000:3.0:1452801434.533102:0:27296:0:(lmv_obd.c:346:lmv_connect_mdc()) target lustre-MDT0000_UUID connect error -111
      00800000:00000001:3.0:1452801434.535203:0:27296:0:(lmv_obd.c:347:lmv_connect_mdc()) Process leaving (rc=18446744073709551505 : -111 : ffffffffffffff91)
      00800000:00000001:3.0:1452801434.535207:0:27296:0:(lmv_obd.c:566:lmv_check_connect()) Process leaving via out_disc (rc=18446744073709551505 : -111 : 0xffffffffffffff91)
      00000020:00000001:3.0:1452801434.535210:0:27296:0:(genops.c:1223:class_disconnect()) Process entered
      00000020:00000080:3.0:1452801434.535211:0:27296:0:(genops.c:1244:class_disconnect()) disconnect: cookie 0x2be62eb0a682b6f2
      00000020:00000001:3.0:1452801434.535213:0:27296:0:(genops.c:1780:obd_stale_export_put()) Process entered
      00000020:00000001:3.0:1452801434.535214:0:27296:0:(genops.c:1804:obd_stale_export_put()) Process leaving
      00000020:00000001:3.0:1452801434.535215:0:27296:0:(genops.c:1255:class_disconnect()) Process leaving (rc=0 : 0 : 0)
      00800000:00000001:3.0:1452801434.535217:0:27296:0:(lmv_obd.c:595:lmv_check_connect()) Process leaving (rc=18446744073709551505 : -111 : ffffffffffffff91)
      00800000:00000001:3.0:1452801434.535240:0:27296:0:(lmv_obd.c:267:lmv_connect()) Process leaving (rc=18446744073709551505 : -111 : ffffffffffffff91)
      00000080:00000001:3.0:1452801434.535247:0:27296:0:(obd_class.h:816:obd_connect()) Process leaving (rc=18446744073709551505 : -111 : ffffffffffffff91)
      00000080:00020000:3.0:1452801434.535249:0:27296:0:(llite_lib.c:265:client_common_fill_super()) cannot connect to lustre-clilmv-ffff88007a00f5f8: rc = -111
      00000080:00000001:3.0:1452801434.537807:0:27296:0:(llite_lib.c:266:client_common_fill_super()) Process leaving via out (rc=18446744073709551505 : -111 : 0xffffffffffffff91)
      00000080:00000001:3.0:1452801434.537815:0:27296:0:(llite_lib.c:1064:ll_fill_super()) Process leaving via out_free (rc=18446744073709551505 : -111 : 0xffffffffffffff91)
      

      This can be fixed by adding a call to

      {class_disconnect()}

      in the error path of

      {lmv_connect()}

      . There is some complexity here around the use of

      {lmv->exp}. But there seems to be a lot of unnecessary code around the uses of {OBD_CONNECT_REAL} and {lmv_check_connect()} that could be removed to make things clearer and probably remove the need for {lmv->exp}

      and calling

      {lmv_check_connect()}

      on entry to every LMV function.

      Attachments

        Activity

          People

            jhammond John Hammond
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: