From 4502a37ce21a25da5b1f0cf717ee94352b9def1b Mon Sep 17 00:00:00 2001 From: Jay Xiong Date: Wed, 23 Dec 2009 06:18:42 +0300 Subject: [PATCH] b=21454 Disable cl_page_in_io check for append write. This is because for append write, it's difficult to pass the uptodate file size to subio. i=wangdi i=eric.mei --- lustre/llite/file.c | 2 +- lustre/lov/lov_io.c | 8 ++++++-- lustre/obdclass/cl_io.c | 13 ++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 4af77c3b..cb32570 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -805,7 +805,7 @@ void ll_io_init(struct cl_io *io, const struct file *file, int write) memset(io, 0, sizeof *io); io->u.ci_rw.crw_nonblock = file->f_flags & O_NONBLOCK; if (write) - io->u.ci_wr.wr_append = file->f_flags & O_APPEND; + io->u.ci_wr.wr_append = !!(file->f_flags & O_APPEND); io->ci_obj = ll_i2info(inode)->lli_clob; io->ci_lockreq = CILR_MAYBE; if (ll_file_nolock(file)) { diff --git a/lustre/lov/lov_io.c b/lustre/lov/lov_io.c index 3634b4b..80bfb20 100644 --- a/lustre/lov/lov_io.c +++ b/lustre/lov/lov_io.c @@ -118,8 +118,12 @@ static void lov_io_sub_inherit(struct cl_io *io, struct lov_io *lio, } case CIT_READ: case CIT_WRITE: { - io->u.ci_rw.crw_pos = start; - io->u.ci_rw.crw_count = end - start; + if (cl_io_is_append(parent)) { + io->u.ci_wr.wr_append = 1; + } else { + io->u.ci_rw.crw_pos = start; + io->u.ci_rw.crw_count = end - start; + } break; } default: diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index d9c6d51..5a6b8b0 100644 --- a/lustre/obdclass/cl_io.c +++ b/lustre/obdclass/cl_io.c @@ -657,7 +657,7 @@ cl_io_slice_page(const struct cl_io_slice *ios, struct cl_page *page) */ static int cl_page_in_io(const struct cl_page *page, const struct cl_io *io) { - int result; + int result = 1; loff_t start; loff_t end; pgoff_t idx; @@ -670,10 +670,13 @@ static int cl_page_in_io(const struct cl_page *page, const struct cl_io *io) * check that [start, end) and [pos, pos + count) extents * overlap. */ - start = cl_offset(page->cp_obj, idx); - end = cl_offset(page->cp_obj, idx + 1); - result = io->u.ci_rw.crw_pos < end && - start < io->u.ci_rw.crw_pos + io->u.ci_rw.crw_count; + if (!cl_io_is_append(io)) { + const struct cl_io_rw_common *crw = &(io->u.ci_rw); + start = cl_offset(page->cp_obj, idx); + end = cl_offset(page->cp_obj, idx + 1); + result = crw->crw_pos < end && + start < crw->crw_pos + crw->crw_count; + } break; case CIT_FAULT: result = io->u.ci_fault.ft_index == idx; -- 1.8.3.1