Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jun 2017 12:17:04 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r320356 - stable/11/sys/kern
Message-ID:  <201706261217.v5QCH4nM090152@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Jun 26 12:17:04 2017
New Revision: 320356
URL: https://svnweb.freebsd.org/changeset/base/320356

Log:
  MFC r320108:
  Allow negative aio_offset only for the read and write LIO ops on
  device nodes.
  
  Approved by:	re (marius)

Modified:
  stable/11/sys/kern/vfs_aio.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_aio.c
==============================================================================
--- stable/11/sys/kern/vfs_aio.c	Mon Jun 26 09:34:41 2017	(r320355)
+++ stable/11/sys/kern/vfs_aio.c	Mon Jun 26 12:17:04 2017	(r320356)
@@ -1550,7 +1550,9 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, stru
 		goto aqueue_fail;
 	}
 
-	if (opcode != LIO_SYNC && job->uaiocb.aio_offset == -1LL) {
+	if ((opcode == LIO_READ || opcode == LIO_WRITE) &&
+	    job->uaiocb.aio_offset < 0 &&
+	    (fp->f_vnode == NULL || fp->f_vnode->v_type != VCHR)) {
 		error = EINVAL;
 		goto aqueue_fail;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706261217.v5QCH4nM090152>