Details
-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
Lustre 2.10.5
-
None
-
3
-
9223372036854775807
Description
When lfs mkdir fails, llog_cat_cancel_records() is executed for error handling. But, in a condition of !llog_exist(loghandle), llog_handle_put() is not executed (that is, lgh_refcount is not decremented), so llog_free_handle() will not be executed in umount. This cause memory leak.
682 int llog_cat_cancel_records(const struct lu_env *env, 683 struct llog_handle *cathandle, int count, 684 struct llog_cookie *cookies) 685 { 686 int i, index, rc = 0, failed = 0; 687 688 ENTRY; 689 690 for (i = 0; i < count; i++, cookies++) { 691 struct llog_handle *loghandle; 692 struct llog_logid *lgl = &cookies->lgc_lgl; 693 int lrc; 694 695 rc = llog_cat_id2handle(env, cathandle, &loghandle, lgl); // llog_cat_id2handle(llog_handle_get) increments lgh_refcount <snip> 705 if ((cathandle->lgh_ctxt->loc_flags & 706 LLOG_CTXT_FLAG_NORMAL_FID) && !llog_exist(loghandle)) { 707 /* For update log, some of loghandles of cathandle 708 * might not exist because remote llog creation might 709 * be failed, so let's skip the record cancellation 710 * for these non-exist llogs. 711 */ 712 lrc = -ENOENT; 713 CDEBUG(D_HA, "%s: llog "DFID":%x does not exist" 714 ": rc = %d\n", 715 cathandle->lgh_ctxt->loc_obd->obd_name, 716 PFID(&lgl->lgl_oi.oi_fid), lgl->lgl_ogen, lrc); 717 failed++; 718 if (rc == 0) 719 rc = lrc; // llog_handle_put() should be called to decrement lgh_refcount 720 continue; 721 }
Attachments
Issue Links
- is related to
-
LU-11924 Combine cancellation of llog records at osp_sync_process_committed
-
- Resolved
-
Fixed via patch https://review.whamcloud.com/34179 "
LU-11924osp: combine llog cancel operations" which is included in 2.13.