-int obd_alloc_fail(const void *ptr, const char *name, const char *type,
- size_t size, const char *file, int line)
-{
- if (ptr == NULL ||
- (cfs_rand() & OBD_ALLOC_FAIL_MASK) < obd_alloc_fail_rate) {
- CERROR("%s%salloc of %s ("LPU64" bytes) failed at %s:%d\n",
- ptr ? "force " :"", type, name, (__u64)size, file,
- line);
- CERROR(LPU64" total bytes and "LPU64" total pages "
- "("LPU64" bytes) allocated by Lustre, "
- "%d total bytes by LNET\n",
- obd_memory_sum(),
- obd_pages_sum() << PAGE_CACHE_SHIFT,
- obd_pages_sum(),
- atomic_read(&libcfs_kmemory));
- return 1;
- }
- return 0;
+out:
+ if (rc != 0)
+ RETURN(rc);
+
+ /* Only replace the job ID if it changed. */
+ if (strcmp(jobid, tmp_jobid) != 0)
+ memcpy(jobid, tmp_jobid, jobid_len);
+
+ RETURN(0);