Whamcloud - gitweb
LU-2895 osp: return proper error in osp_precreate_reserve
authorNiu Yawei <niu@whamcloud.com>
Tue, 12 Mar 2013 09:41:18 +0000 (05:41 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 25 Mar 2013 19:25:43 +0000 (15:25 -0400)
Make sure the osp_precreate_reserve() always return proper error
when reserving object failed.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I9d16135091ebe5ef1243416a15722c4859026e46
Reviewed-on: http://review.whamcloud.com/5683
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osp/osp_precreate.c

index 1836f18..9b3febc 100644 (file)
@@ -1139,8 +1139,10 @@ int osp_precreate_reserve(const struct lu_env *env, struct osp_device *d)
 
                lwi = LWI_TIMEOUT(expire - cfs_time_current(),
                                osp_precreate_timeout_condition, d);
 
                lwi = LWI_TIMEOUT(expire - cfs_time_current(),
                                osp_precreate_timeout_condition, d);
-               if (cfs_time_aftereq(cfs_time_current(), expire))
+               if (cfs_time_aftereq(cfs_time_current(), expire)) {
+                       rc = -ETIMEDOUT;
                        break;
                        break;
+               }
 
                l_wait_event(d->opd_pre_user_waitq,
                             osp_precreate_ready_condition(env, d), &lwi);
 
                l_wait_event(d->opd_pre_user_waitq,
                             osp_precreate_ready_condition(env, d), &lwi);