From: zam Date: Tue, 7 Apr 2009 06:39:30 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_167~26 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=488f93f92541e07d269c7e3d94905f96e9cd0609;p=fs%2Flustre-release.git 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. --- 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);