* 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().
*/
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",
result = lustre_generic_file_read(file, cio, &pos);
}
+out:
if (result >= 0) {
if (result < cnt)
io->ci_continue = 0;
/* 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;
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