]> err.no Git - linux-2.6/blobdiff - fs/aio.c
ext4: modify block allocation algorithm for the last group
[linux-2.6] / fs / aio.c
index 26c1930889fafb0b191c202d2c5b7df4d8032ba8..b74c567383bc3689412a6195cb5fd4e2520cb724 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1329,6 +1329,10 @@ static ssize_t aio_rw_vect_retry(struct kiocb *iocb)
                opcode = IOCB_CMD_PWRITEV;
        }
 
+       /* This matches the pread()/pwrite() logic */
+       if (iocb->ki_pos < 0)
+               return -EINVAL;
+
        do {
                ret = rw_op(iocb, &iocb->ki_iovec[iocb->ki_cur_seg],
                            iocb->ki_nr_segs - iocb->ki_cur_seg,