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

bad error handling in mgs_object_init

    XMLWordPrintable

Details

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

    Description

      The function mgs_object_init() lost an error code return and always return zero as success.
      Need to return proper error code.

      lustre-wc-rel/lustre/mgs/mgs_handler.c:
      static int mgs_object_init(const struct lu_env *env, struct lu_object *o,
      const struct lu_object_conf *unused)
      {
      struct mgs_device *d = lu2mgs_dev(o->lo_dev);
      struct lu_device *under;
      struct lu_object *below;
      int rc = 0;
      ENTRY;

      /* do no set .do_ops as mgs calls to bottom osd directly */

      CDEBUG(D_INFO, "object init, fid = "DFID"\n",
      PFID(lu_object_fid(o)));

      under = &d->mgs_bottom->dd_lu_dev;
      below = under->ld_ops->ldo_object_alloc(env, o->lo_header, under);
      if (below != NULL)
      lu_object_add(o, below);
      else
      rc = ENOMEM;<-- Variable 'rc' is assigned a value that is never used.

      return 0;
      }

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              maximus Ashish Purkar (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: