Whamcloud - gitweb
LU-9781 llog: Improve catalog full warning 93/28093/4
authorGiuseppe Di Natale <dinatale2@llnl.gov>
Tue, 18 Jul 2017 21:57:18 +0000 (14:57 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 28 Aug 2017 06:26:36 +0000 (06:26 +0000)
When warning that a catalog file is full, provide the name
of the catalog file. If the name of catalog file isn't
defined, print its FID.

Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Change-Id: I559e43d08febfd8a1512ceb58fd3030b06372e9f
Reviewed-on: https://review.whamcloud.com/28093
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/llog_cat.c

index 950445a..0d57ce3 100644 (file)
@@ -85,8 +85,18 @@ static int llog_cat_new_log(const struct lu_env *env,
         * last_idx and cat_idx */
        if ((index == llh->llh_cat_idx + 1 && llh->llh_count > 1) ||
            (index == 0 && llh->llh_cat_idx == 0)) {
-               CWARN("%s: there are no more free slots in catalog\n",
-                     loghandle->lgh_ctxt->loc_obd->obd_name);
+               if (cathandle->lgh_name == NULL) {
+                       CWARN("%s: there are no more free slots in catalog "
+                             DFID":%x\n",
+                             loghandle->lgh_ctxt->loc_obd->obd_name,
+                             PFID(&cathandle->lgh_id.lgl_oi.oi_fid),
+                             cathandle->lgh_id.lgl_ogen);
+               } else {
+                       CWARN("%s: there are no more free slots in "
+                             "catalog %s\n",
+                             loghandle->lgh_ctxt->loc_obd->obd_name,
+                             cathandle->lgh_name);
+               }
                RETURN(-ENOSPC);
        }