[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: |
|
||||||||
| 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 |
| Comment by Gerrit Updater [ 26/Mar/17 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/26069/ |
| Comment by Peter Jones [ 26/Mar/17 ] |
|
Landed for 2.10 |