From 488f93f92541e07d269c7e3d94905f96e9cd0609 Mon Sep 17 00:00:00 2001 From: zam Date: Tue, 7 Apr 2009 06:39:30 +0000 Subject: [PATCH] Branch HEAD b=18988 i=alexey.lyashkov i=jinshan.xiong i=adilger If append write, vvp_io_write_start sets pos to the end of the file and doesn't touch kiocb->ki_pos, it triggers BUG_ON(iocb->ki_pos != pos) in Linux kernel code. This patch adds missing ki_pos adjustment. --- lustre/llite/vvp_io.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index a7653db..dc0d234 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -522,12 +522,16 @@ static int vvp_io_write_start(const struct lu_env *env, ENTRY; - if (cl_io_is_append(io)) + if (cl_io_is_append(io)) { /* * PARALLEL IO This has to be changed for parallel IO doing * out-of-order writes. */ pos = io->u.ci_wr.wr.crw_pos = i_size_read(inode); +#ifndef HAVE_FILE_WRITEV + cio->cui_iocb->ki_pos = pos; +#endif + } CDEBUG(D_VFSTRACE, "write: [%lli, %lli)\n", pos, pos + (long long)cnt); -- 1.8.3.1