Whamcloud - gitweb
Branch HEAD
authorzam <zam>
Tue, 7 Apr 2009 06:39:30 +0000 (06:39 +0000)
committerzam <zam>
Tue, 7 Apr 2009 06:39:30 +0000 (06:39 +0000)
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

index a7653db..dc0d234 100644 (file)
@@ -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);