Whamcloud - gitweb
- don't call dt_write_prep() under spinlock
authoralex <alex>
Fri, 27 Feb 2009 08:16:40 +0000 (08:16 +0000)
committeralex <alex>
Fri, 27 Feb 2009 08:16:40 +0000 (08:16 +0000)
lustre/ofd/ofd_io.c

index 99f6883..bc385b5 100644 (file)
@@ -128,8 +128,6 @@ static int filter_preprw_write(const struct lu_env *env, struct obd_export *exp,
         rc = filter_grant_check(env, exp, oa, objcount, obj, nb,
                                 res, &left, &used, &ungranted);
 
-        rc = dt_write_prep(env, filter_object_child(fo), res, *nr_local, &used);
-
         rc = filter_grant_client_calc(exp, &left, &used, &ungranted);
 
         /* do not zero out oa->o_valid as it is used in
@@ -139,6 +137,9 @@ static int filter_preprw_write(const struct lu_env *env, struct obd_export *exp,
                 oa->o_grant = filter_grant(env, exp, oa->o_grant,
                                            oa->o_undirty, left);
         spin_unlock(&exp->exp_obd->obd_osfs_lock);
+
+        rc = dt_write_prep(env, filter_object_child(fo), res, *nr_local, &used);
+
         filter_object_put(env, fo);
         RETURN(rc);
 }