[LU-9197] Incorrect return value for llog_cancel_rec() Created: 08/Mar/17  Updated: 26/Mar/17  Resolved: 26/Mar/17

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.8.0, Lustre 2.9.0, Lustre 2.10.0
Fix Version/s: Lustre 2.10.0

Type: Bug Priority: Minor
Reporter: Di Wang Assignee: Di Wang
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-6846 dt_record_write()) ASSERTION( dt->do_... Resolved
Severity: 3
Rank (Obsolete): 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.



 Comments   
Comment by Gerrit Updater [ 17/Mar/17 ]

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

Comment by Gerrit Updater [ 26/Mar/17 ]

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

Comment by Peter Jones [ 26/Mar/17 ]

Landed for 2.10

Generated at Sat Feb 10 02:24:04 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.