Whamcloud - gitweb
- move the peter branch changes to the head
[fs/lustre-release.git] / lustre / llite / rw.c
index 32b45de..5ce6087 100644 (file)
@@ -200,11 +200,14 @@ void ll_truncate(struct inode *inode)
 
         CDEBUG(D_INFO, "calling punch for %ld (all bytes after %Ld)\n",
                (long)oa.o_id, (unsigned long long)oa.o_size);
+
         oa.o_size = inode->i_size;
         oa.o_id = md->lmd_object_id;
-        oa.o_valid = OBD_MD_FLSIZE | OBD_MD_FLID;
-        /* truncate == punch from i_size onwards */
-        err = obd_punch(ll_i2obdconn(inode), &oa, md, -1 - oa.o_size, oa.o_size);
+        oa.o_valid = OBD_MD_FLID;
+        /* truncate == punch to/from start from/to end:
+           set end to -1 for that. */
+        err = obd_punch(ll_i2obdconn(inode), &oa, md, oa.o_size, 
+                        0xffffffffffffffff);
         if (err)
                 CERROR("obd_truncate fails (%d)\n", err);
         else