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

protect cli->cl_import with with_imp_locked()

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      Protect cli->cl_import with with_imp_locked():

      /* You must use these macros when you want to refer to
       * the import in a client obd_device for a lprocfs entry
       */
      #define with_imp_locked(__obd, __imp, __rc)                             \
              for (down_read(&(__obd)->u.cli.cl_sem),                         \
                   __imp = (__obd)->u.cli.cl_import,                          \
                   __rc = __imp ? 0 : -ENODEV;                                \
                   __imp ? 1 : (up_read(&(__obd)->u.cli.cl_sem), 0);          \
                   __imp = NULL)
      

      Attachments

        Issue Links

          Activity

            [LU-14145] protect cli->cl_import with with_imp_locked()
            simmonsja James A Simmons added a comment - - edited

            His patch does improve things including handling nested locking, but I did mention in the patch's review other things that need to be covered such as  imp_connect_data and imp_generation access as well. Also lov_iocontrol() does no locking for cl_import access. So another patch is needed.

            simmonsja James A Simmons added a comment - - edited His patch does improve things including handling nested locking, but I did mention in the patch's review other things that need to be covered such as  imp_connect_data and imp_generation access as well. Also lov_iocontrol() does no locking for cl_import access. So another patch is needed.
            yujian Jian Yu added a comment -

            Thank you James.
            The following code in obd_set_max_mod_rpcs_in_flight() is not covered in the above patch:

                    ocd = &cli->cl_import->imp_connect_data;
            
            yujian Jian Yu added a comment - Thank you James. The following code in obd_set_max_mod_rpcs_in_flight() is not covered in the above patch: ocd = &cli->cl_import->imp_connect_data;

            Note Neil has a patch for this at https://review.whamcloud.com/#/c/39595/

            simmonsja James A Simmons added a comment - Note Neil has a patch for this at  https://review.whamcloud.com/#/c/39595/

            People

              neilb Neil Brown
              yujian Jian Yu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: