Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / llite / vvp_io.c
index 890997e..9635fa5 100644 (file)
@@ -377,7 +377,7 @@ static int vvp_io_trunc_start(const struct lu_env *env,
                          * Wait for the transfer completion for a partially
                          * truncated page to avoid dead-locking an OST with
                          * the concurrent page-wise overlapping WRITE and
-                         * PUNCH requests.
+                         * PUNCH requests. BUG:17397.
                          *
                          * Partial page is disowned in vvp_io_trunc_end().
                          */
@@ -456,15 +456,18 @@ static int vvp_io_read_start(const struct lu_env *env,
         loff_t  pos = io->u.ci_rd.rd.crw_pos;
         size_t  cnt = io->u.ci_rd.rd.crw_count;
         size_t  tot = cio->cui_tot_count;
+        int     exceed = 0;
 
         CLOBINVRNT(env, obj, ccc_object_invariant(obj));
         LASSERT(vio->cui_oneshot == 0);
 
         CDEBUG(D_VFSTRACE, "read: -> [%lli, %lli)\n", pos, pos + cnt);
 
-        result = ccc_prep_size(env, obj, io, pos + tot - 1, 1);
+        result = ccc_prep_size(env, obj, io, pos, tot, 1, &exceed);
         if (result != 0)
                 return result;
+        else if (exceed != 0)
+                goto out;
 
         LU_OBJECT_HEADER(D_INODE, env, &obj->co_lu,
                         "Read ino %lu, "LPSZ" bytes, offset %lld, size %llu\n",
@@ -493,6 +496,7 @@ static int vvp_io_read_start(const struct lu_env *env,
                 result = lustre_generic_file_read(file, cio, &pos);
         }
 
+out:
         if (result >= 0) {
                 if (result < cnt)
                         io->ci_continue = 0;
@@ -567,7 +571,7 @@ static int vvp_io_fault_start(const struct lu_env *env,
         /* offset of the last byte on the page */
         offset = cl_offset(obj, fio->ft_index + 1) - 1;
         LASSERT(cl_index(obj, offset) == fio->ft_index);
-        result = ccc_prep_size(env, obj, io, offset, 0);
+        result = ccc_prep_size(env, obj, io, 0, offset + 1, 0, NULL);
         if (result != 0)
                 return result;
 
@@ -733,7 +737,7 @@ static int vvp_page_sync_io(const struct lu_env *env, struct cl_io *io,
         cl_sync_io_init(anchor, 1);
         cp->cpg_sync_io = anchor;
         cl_page_clip(env, page, 0, to);
-        result = cl_io_submit_rw(env, io, crt, queue);
+        result = cl_io_submit_rw(env, io, crt, queue, CRP_NORMAL);
         if (result == 0)
                 result = cl_sync_io_wait(env, io, &queue->c2_qout, anchor);
         else