Whamcloud - gitweb
b=20645
authorjxiong <jxiong>
Tue, 10 Nov 2009 02:33:10 +0000 (02:33 +0000)
committerjxiong <jxiong>
Tue, 10 Nov 2009 02:33:10 +0000 (02:33 +0000)
r=jay

A temporal fix for osc_trunc_check.

lustre/osc/osc_io.c

index ef514da..8680a7b 100644 (file)
@@ -384,7 +384,10 @@ static int osc_punch_upcall(void *a, int rc)
         return 0;
 }
 
-#ifdef __KERNEL__
+/* Disable osc_trunc_check() because it is naturally race between read and
+ * truncate. See bug 20645 for details.
+ */
+#if 0 && defined(__KERNEL__)
 /**
  * Checks that there are no pages being written in the extent being truncated.
  */
@@ -454,9 +457,6 @@ static int osc_io_trunc_start(const struct lu_env *env,
         loff_t                   size   = io->u.ci_truncate.tr_size;
         int                      result = 0;
 
-
-        memset(oa, 0, sizeof(*oa));
-
         osc_trunc_check(env, io, oio, size);
 
         if (oio->oi_lockless == 0) {
@@ -470,6 +470,7 @@ static int osc_io_trunc_start(const struct lu_env *env,
                 cl_object_attr_unlock(obj);
         }
 
+        memset(oa, 0, sizeof(*oa));
         if (result == 0) {
                 oa->o_id = loi->loi_id;
                 oa->o_gr = loi->loi_gr;