Whamcloud - gitweb
LU-3581 osc: Lustre returns EINTR from writes when SA_RESTART is set
[fs/lustre-release.git] / lustre / mdt / mdt_coordinator.c
index 66df716..5c07bf0 100644 (file)
@@ -425,7 +425,7 @@ static int mdt_coordinator(void *data)
        cfs_waitq_signal(&cdt->cdt_thread.t_ctl_waitq);
 
        CDEBUG(D_HSM, "%s: coordinator thread starting, pid=%d\n",
-              mdt_obd_name(mdt), cfs_curproc_pid());
+              mdt_obd_name(mdt), current_pid());
 
        /*
         * create /proc entries for coordinator
@@ -657,11 +657,11 @@ out:
 
        if (rc != 0)
                CERROR("%s: coordinator thread exiting, process=%d, rc=%d\n",
-                      mdt_obd_name(mdt), cfs_curproc_pid(), rc);
+                      mdt_obd_name(mdt), current_pid(), rc);
        else
                CDEBUG(D_HSM, "%s: coordinator thread exiting, process=%d,"
                              " no error\n",
-                      mdt_obd_name(mdt), cfs_curproc_pid());
+                      mdt_obd_name(mdt), current_pid());
 
        return rc;
 }
@@ -1368,8 +1368,9 @@ unlock:
                /* just give back layout lock, we keep
                 * the reference which is given back
                 * later with the lock for HSM flags */
-               if (!IS_ERR(obj))
+               if (!IS_ERR(obj) && crh != NULL)
                        mdt_object_unlock(mti, obj, &crh->crh_lh, 1);
+
                if (crh != NULL)
                        OBD_SLAB_FREE_PTR(crh, mdt_hsm_cdt_kmem);
        }