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

Incorrect return value for llog_cancel_rec()

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.10.0
    • Lustre 2.8.0, Lustre 2.9.0, Lustre 2.10.0
    • None
    • 3
    • 9223372036854775807

    Description

      This problem is brought by http://review.whamcloud.com/16333

                      rc = llog_trans_destroy(env, loghandle, th);
                      if (rc < 0) {
                              /* Sigh, can not destroy the final plain llog, but
                               * the bitmap has been cleared, so the record cannot
                               * be accessed anymore. Let's return 0 for now, and
                               * the orphan will be handled by LFSCK.
                               */
                              CERROR("%s: can't kill empty llog "DFID":%x: rc = %d\n",
                                     loghandle->lgh_ctxt->loc_obd->obd_name,
                                     PFID(&loghandle->lgh_id.lgl_oi.oi_fid),
                                     loghandle->lgh_id.lgl_ogen, rc);
                              GOTO(out_unlock, rc);
                      }
      

      If llog cancel is failed, it should still return 0 as commented by the above comments. Initially this returning rc is for restoring the lgh_count if destroy failed, so if this is reverted back to "GOTO(out_unlock, rc = 0);", then the following

              if (rc < 0 && subtract_count) {
                      mutex_lock(&loghandle->lgh_hdr_mutex);
                      loghandle->lgh_hdr->llh_count++;
                      ext2_set_bit(index, LLOG_HDR_BITMAP(llh));
                      mutex_unlock(&loghandle->lgh_hdr_mutex);
              }
      

      needs to be resolved without rc < 0.

      Attachments

        Issue Links

          Activity

            [LU-9197] Incorrect return value for llog_cancel_rec()
            pjones Peter Jones added a comment -

            Landed for 2.10

            pjones Peter Jones added a comment - Landed for 2.10

            Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/26069/
            Subject: LU-9197 llog: return 0 if llog destroy fails
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 80adfae553a61dc51df5344e98988cda0c281ad4

            gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/26069/ Subject: LU-9197 llog: return 0 if llog destroy fails Project: fs/lustre-release Branch: master Current Patch Set: Commit: 80adfae553a61dc51df5344e98988cda0c281ad4

            wangdi (di.wang@intel.com) uploaded a new patch: https://review.whamcloud.com/26069
            Subject: LU-9197 llog: return 0 if llog destroy fails
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: c1b3b09a302a8fd1859d9e538549478f4ea1edef

            gerrit Gerrit Updater added a comment - wangdi (di.wang@intel.com) uploaded a new patch: https://review.whamcloud.com/26069 Subject: LU-9197 llog: return 0 if llog destroy fails Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: c1b3b09a302a8fd1859d9e538549478f4ea1edef

            People

              di.wang Di Wang
              di.wang Di Wang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: