@@ -2,7 +2,7 @@ Meta: 1
Name: zfs
Branch: 1.0
Version: 0.7.5
-Release: 1ubuntu11
+Release: 1ubuntu8
Release-Tags: relext
License: CDDL
Author: OpenZFS on Linux
@@ -195,7 +195,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
$(top_srcdir)/config/toolchain-simd.m4 \
$(top_srcdir)/config/user-dracut.m4 \
$(top_srcdir)/config/user-frame-larger-than.m4 \
- $(top_srcdir)/config/user-libaio.m4 \
$(top_srcdir)/config/user-libattr.m4 \
$(top_srcdir)/config/user-libblkid.m4 \
$(top_srcdir)/config/user-libtirpc.m4 \
@@ -427,7 +426,6 @@ KERNELCPPFLAGS = @KERNELCPPFLAGS@
KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
LD = @LD@
LDFLAGS = @LDFLAGS@
-LIBAIO = @LIBAIO@
LIBATTR = @LIBATTR@
LIBBLKID = @LIBBLKID@
LIBOBJS = @LIBOBJS@
@@ -1303,7 +1303,6 @@ m4_include([config/mount-helper.m4])
m4_include([config/toolchain-simd.m4])
m4_include([config/user-dracut.m4])
m4_include([config/user-frame-larger-than.m4])
-m4_include([config/user-libaio.m4])
m4_include([config/user-libattr.m4])
m4_include([config/user-libblkid.m4])
m4_include([config/user-libtirpc.m4])
deleted file mode 100644
@@ -1,14 +0,0 @@
-dnl #
-dnl # Check for libaio - only used for libaiot test cases.
-dnl #
-AC_DEFUN([ZFS_AC_CONFIG_USER_LIBAIO], [
- LIBAIO=
-
- AC_CHECK_HEADER([libaio.h], [
- user_libaio=yes
- AC_SUBST([LIBAIO], ["-laio"])
- AC_DEFINE([HAVE_LIBAIO], 1, [Define if you have libaio])
- ], [
- user_libaio=no
- ])
-])
@@ -13,7 +13,6 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
ZFS_AC_CONFIG_USER_LIBTIRPC
ZFS_AC_CONFIG_USER_LIBBLKID
ZFS_AC_CONFIG_USER_LIBATTR
- ZFS_AC_CONFIG_USER_LIBAIO
ZFS_AC_CONFIG_USER_LIBUDEV
ZFS_AC_CONFIG_USER_FRAME_LARGER_THAN
ZFS_AC_CONFIG_USER_RUNSTATEDIR
@@ -79,11 +79,11 @@ AC_DEFUN([ZFS_AC_CONFIG], [
AM_CONDITIONAL([CONFIG_KERNEL],
[test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
[test "x$enable_linux_builtin" != xyes ])
+ AM_CONDITIONAL([WANT_DEVNAME2DEVID],
+ [test "x$user_libudev" = xyes ])
AM_CONDITIONAL([CONFIG_QAT],
[test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
[test "x$qatsrc" != x ])
- AM_CONDITIONAL([WANT_DEVNAME2DEVID], [test "x$user_libudev" = xyes ])
- AM_CONDITIONAL([WANT_MMAP_LIBAIO], [test "x$user_libaio" = xyes ])
])
dnl #
@@ -635,12 +635,10 @@ LIBOBJS
DEBUG_ZFS
DEBUG_STACKFLAGS
DEBUG_CFLAGS
-WANT_MMAP_LIBAIO_FALSE
-WANT_MMAP_LIBAIO_TRUE
-WANT_DEVNAME2DEVID_FALSE
-WANT_DEVNAME2DEVID_TRUE
CONFIG_QAT_FALSE
CONFIG_QAT_TRUE
+WANT_DEVNAME2DEVID_FALSE
+WANT_DEVNAME2DEVID_TRUE
CONFIG_KERNEL_FALSE
CONFIG_KERNEL_TRUE
CONFIG_USER_FALSE
@@ -650,7 +648,6 @@ ZONENAME
NO_FORMAT_TRUNCATION
FRAME_LARGER_THAN
LIBUDEV
-LIBAIO
LIBATTR
LIBBLKID
LIBTIRPC_CFLAGS
@@ -26911,27 +26908,6 @@ $as_echo "#define HAVE_LIBATTR 1" >>confdefs.h
- LIBAIO=
-
- ac_fn_c_check_header_mongrel "$LINENO" "libaio.h" "ac_cv_header_libaio_h" "$ac_includes_default"
-if test "x$ac_cv_header_libaio_h" = xyes; then :
-
- user_libaio=yes
- LIBAIO="-laio"
-
-
-$as_echo "#define HAVE_LIBAIO 1" >>confdefs.h
-
-
-else
-
- user_libaio=no
-
-fi
-
-
-
-
LIBUDEV=
ac_fn_c_check_header_mongrel "$LINENO" "libudev.h" "ac_cv_header_libudev_h" "$ac_includes_default"
@@ -27960,27 +27936,6 @@ $as_echo "#define HAVE_LIBATTR 1" >>confdefs.h
- LIBAIO=
-
- ac_fn_c_check_header_mongrel "$LINENO" "libaio.h" "ac_cv_header_libaio_h" "$ac_includes_default"
-if test "x$ac_cv_header_libaio_h" = xyes; then :
-
- user_libaio=yes
- LIBAIO="-laio"
-
-
-$as_echo "#define HAVE_LIBAIO 1" >>confdefs.h
-
-
-else
-
- user_libaio=no
-
-fi
-
-
-
-
LIBUDEV=
ac_fn_c_check_header_mongrel "$LINENO" "libudev.h" "ac_cv_header_libudev_h" "$ac_includes_default"
@@ -40959,15 +40914,6 @@ else
CONFIG_KERNEL_FALSE=
fi
- if test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all &&
- test "x$qatsrc" != x ; then
- CONFIG_QAT_TRUE=
- CONFIG_QAT_FALSE='#'
-else
- CONFIG_QAT_TRUE='#'
- CONFIG_QAT_FALSE=
-fi
-
if test "x$user_libudev" = xyes ; then
WANT_DEVNAME2DEVID_TRUE=
WANT_DEVNAME2DEVID_FALSE='#'
@@ -40976,12 +40922,13 @@ else
WANT_DEVNAME2DEVID_FALSE=
fi
- if test "x$user_libaio" = xyes ; then
- WANT_MMAP_LIBAIO_TRUE=
- WANT_MMAP_LIBAIO_FALSE='#'
+ if test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all &&
+ test "x$qatsrc" != x ; then
+ CONFIG_QAT_TRUE=
+ CONFIG_QAT_FALSE='#'
else
- WANT_MMAP_LIBAIO_TRUE='#'
- WANT_MMAP_LIBAIO_FALSE=
+ CONFIG_QAT_TRUE='#'
+ CONFIG_QAT_FALSE=
fi
@@ -41189,16 +41136,12 @@ if test -z "${CONFIG_KERNEL_TRUE}" && test -z "${CONFIG_KERNEL_FALSE}"; then
as_fn_error $? "conditional \"CONFIG_KERNEL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${CONFIG_QAT_TRUE}" && test -z "${CONFIG_QAT_FALSE}"; then
- as_fn_error $? "conditional \"CONFIG_QAT\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${WANT_DEVNAME2DEVID_TRUE}" && test -z "${WANT_DEVNAME2DEVID_FALSE}"; then
as_fn_error $? "conditional \"WANT_DEVNAME2DEVID\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${WANT_MMAP_LIBAIO_TRUE}" && test -z "${WANT_MMAP_LIBAIO_FALSE}"; then
- as_fn_error $? "conditional \"WANT_MMAP_LIBAIO\" was never defined.
+if test -z "${CONFIG_QAT_TRUE}" && test -z "${CONFIG_QAT_FALSE}"; then
+ as_fn_error $? "conditional \"CONFIG_QAT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
@@ -187,7 +187,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
$(top_srcdir)/config/toolchain-simd.m4 \
$(top_srcdir)/config/user-dracut.m4 \
$(top_srcdir)/config/user-frame-larger-than.m4 \
- $(top_srcdir)/config/user-libaio.m4 \
$(top_srcdir)/config/user-libattr.m4 \
$(top_srcdir)/config/user-libblkid.m4 \
$(top_srcdir)/config/user-libtirpc.m4 \
@@ -401,7 +400,6 @@ KERNELCPPFLAGS = @KERNELCPPFLAGS@
KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
LD = @LD@
LDFLAGS = @LDFLAGS@
-LIBAIO = @LIBAIO@
LIBATTR = @LIBATTR@
LIBBLKID = @LIBBLKID@
LIBOBJS = @LIBOBJS@
@@ -187,7 +187,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
$(top_srcdir)/config/toolchain-simd.m4 \
$(top_srcdir)/config/user-dracut.m4 \
$(top_srcdir)/config/user-frame-larger-than.m4 \
- $(top_srcdir)/config/user-libaio.m4 \
$(top_srcdir)/config/user-libattr.m4 \
$(top_srcdir)/config/user-libblkid.m4 \
$(top_srcdir)/config/user-libtirpc.m4 \
@@ -346,7 +345,6 @@ KERNELCPPFLAGS = @KERNELCPPFLAGS@
KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
LD = @LD@
LDFLAGS = @LDFLAGS@
-LIBAIO = @LIBAIO@
LIBATTR = @LIBATTR@
LIBBLKID = @LIBBLKID@
LIBOBJS = @LIBOBJS@
@@ -187,7 +187,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
$(top_srcdir)/config/toolchain-simd.m4 \
$(top_srcdir)/config/user-dracut.m4 \
$(top_srcdir)/config/user-frame-larger-than.m4 \
- $(top_srcdir)/config/user-libaio.m4 \
$(top_srcdir)/config/user-libattr.m4 \
$(top_srcdir)/config/user-libblkid.m4 \
$(top_srcdir)/config/user-libtirpc.m4 \
@@ -607,7 +606,6 @@ KERNELCPPFLAGS = @KERNELCPPFLAGS@
KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
LD = @LD@
LDFLAGS = @LDFLAGS@
-LIBAIO = @LIBAIO@
LIBATTR = @LIBATTR@
LIBBLKID = @LIBBLKID@
LIBOBJS = @LIBOBJS@
@@ -187,7 +187,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
$(top_srcdir)/config/toolchain-simd.m4 \
$(top_srcdir)/config/user-dracut.m4 \
$(top_srcdir)/config/user-frame-larger-than.m4 \
- $(top_srcdir)/config/user-libaio.m4 \
$(top_srcdir)/config/user-libattr.m4 \
$(top_srcdir)/config/user-libblkid.m4 \
$(top_srcdir)/config/user-libtirpc.m4 \
@@ -343,7 +342,6 @@ KERNELCPPFLAGS = @KERNELCPPFLAGS@
KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
LD = @LD@
LDFLAGS = @LDFLAGS@
-LIBAIO = @LIBAIO@
LIBATTR = @LIBATTR@
LIBBLKID = @LIBBLKID@
LIBOBJS = @LIBOBJS@
@@ -187,7 +187,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
$(top_srcdir)/config/toolchain-simd.m4 \
$(top_srcdir)/config/user-dracut.m4 \
$(top_srcdir)/config/user-frame-larger-than.m4 \
- $(top_srcdir)/config/user-libaio.m4 \
$(top_srcdir)/config/user-libattr.m4 \
$(top_srcdir)/config/user-libblkid.m4 \
$(top_srcdir)/config/user-libtirpc.m4 \
@@ -383,7 +382,6 @@ KERNELCPPFLAGS = @KERNELCPPFLAGS@
KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
LD = @LD@
LDFLAGS = @LDFLAGS@
-LIBAIO = @LIBAIO@
LIBATTR = @LIBATTR@
LIBBLKID = @LIBBLKID@
LIBOBJS = @LIBOBJS@
@@ -187,7 +187,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
$(top_srcdir)/config/toolchain-simd.m4 \
$(top_srcdir)/config/user-dracut.m4 \
$(top_srcdir)/config/user-frame-larger-than.m4 \
- $(top_srcdir)/config/user-libaio.m4 \
$(top_srcdir)/config/user-libattr.m4 \
$(top_srcdir)/config/user-libblkid.m4 \
$(top_srcdir)/config/user-libtirpc.m4 \
@@ -339,7 +338,6 @@ KERNELCPPFLAGS = @KERNELCPPFLAGS@
KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
LD = @LD@
LDFLAGS = @LDFLAGS@
-LIBAIO = @LIBAIO@
LIBATTR = @LIBATTR@
LIBBLKID = @LIBBLKID@
LIBOBJS = @LIBOBJS@
@@ -187,7 +187,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
$(top_srcdir)/config/toolchain-simd.m4 \
$(top_srcdir)/config/user-dracut.m4 \
$(top_srcdir)/config/user-frame-larger-than.m4 \
- $(top_srcdir)/config/user-libaio.m4 \
$(top_srcdir)/config/user-libattr.m4 \
$(top_srcdir)/config/user-libblkid.m4 \
$(top_srcdir)/config/user-libtirpc.m4 \
@@ -339,7 +338,6 @@ KERNELCPPFLAGS = @KERNELCPPFLAGS@
KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
LD = @LD@
LDFLAGS = @LDFLAGS@
-LIBAIO = @LIBAIO@
LIBATTR = @LIBATTR@
LIBBLKID = @LIBBLKID@
LIBOBJS = @LIBOBJS@
@@ -187,7 +187,6 @@ am__aclocal_m4_deps = $(top_srcdir)/config/always-arch.m4 \
$(top_srcdir)/config/toolchain-simd.m4 \
$(top_srcdir)/config/user-dracut.m4 \
$(top_srcdir)/config/user-frame-larger-than.m4 \
- $(top_srcdir)/config/user-libaio.m4 \
$(top_srcdir)/config/user-libattr.m4 \
$(top_srcdir)/config/user-libblkid.m4 \
$(top_srcdir)/config/user-libtirpc.m4 \
@@ -343,7 +342,6 @@ KERNELCPPFLAGS = @KERNELCPPFLAGS@
KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
LD = @LD@
LDFLAGS = @LDFLAGS@
-LIBAIO = @LIBAIO@
LIBATTR = @LIBATTR@
LIBBLKID = @LIBBLKID@
LIBOBJS = @LIBOBJS@
@@ -42,7 +42,7 @@
#include <sys/uio.h>
extern int uiomove(void *, size_t, enum uio_rw, uio_t *);
-extern int uio_prefaultpages(ssize_t, enum uio_rw, uio_t *);
+extern void uio_prefaultpages(ssize_t, uio_t *);
extern int uiocopy(void *, size_t, enum uio_rw, uio_t *, size_t *);
extern void uioskip(uio_t *, size_t);
@@ -148,51 +148,64 @@ uiomove(void *p, size_t n, enum uio_rw rw, struct uio *uio)
}
EXPORT_SYMBOL(uiomove);
+#define fuword8(uptr, vptr) get_user((*vptr), (uptr))
+
/*
- * Fault in the user space pages specified by the uio structure. Note that
- * when faulting in pages with UIO_READ they may have zeros written to them
- * which is OK because we know they'll be overwritten.
+ * Fault in the pages of the first n bytes specified by the uio structure.
+ * 1 byte in each page is touched and the uio struct is unmodified. Any
+ * error will terminate the process as this is only a best attempt to get
+ * the pages resident.
*/
-int
-uio_prefaultpages(ssize_t n, enum uio_rw rw, struct uio *uio)
+void
+uio_prefaultpages(ssize_t n, struct uio *uio)
{
- const struct iovec *iov = uio->uio_iov;
- size_t skip = uio->uio_skip;
- int iovcnt = uio->uio_iovcnt;
- uio_seg_t seg = uio->uio_segflg;
- char __user *p;
- ulong_t cnt;
- int error;
+ const struct iovec *iov;
+ ulong_t cnt, incr;
+ caddr_t p;
+ uint8_t tmp;
+ int iovcnt;
+ size_t skip;
- /* No need to fault in kernel pages */
- if (seg == UIO_SYSSPACE || seg == UIO_BVEC)
- return (0);
+ /* no need to fault in kernel pages */
+ switch (uio->uio_segflg) {
+ case UIO_SYSSPACE:
+ case UIO_BVEC:
+ return;
+ case UIO_USERSPACE:
+ case UIO_USERISPACE:
+ break;
+ default:
+ ASSERT(0);
+ }
- ASSERT(seg == UIO_USERSPACE || seg == UIO_USERISPACE);
+ iov = uio->uio_iov;
+ iovcnt = uio->uio_iovcnt;
+ skip = uio->uio_skip;
- while ((n > 0) && (iovcnt > 0)) {
+ for (; n > 0 && iovcnt > 0; iov++, iovcnt--, skip = 0) {
cnt = MIN(iov->iov_len - skip, n);
+ /* empty iov */
+ if (cnt == 0)
+ continue;
+ n -= cnt;
+ /*
+ * touch each page in this segment.
+ */
p = iov->iov_base + skip;
-
- if (rw == UIO_READ)
- error = -fault_in_pages_writeable(p, cnt);
- else
- error = -fault_in_pages_readable(p, cnt);
-
- if (error)
- return (error);
-
- skip += cnt;
- if (skip == iov->iov_len) {
- skip = 0;
- iov++;
- iovcnt--;
+ while (cnt) {
+ if (fuword8((uint8_t *)p, &tmp))
+ return;
+ incr = MIN(cnt, PAGESIZE);
+ p += incr;
+ cnt -= incr;
}
-
- n -= cnt;
+ /*
+ * touch the last byte in case it straddles a page.
+ */
+ p--;
+ if (fuword8((uint8_t *)p, &tmp))
+ return;
}
-
- return (0);
}
EXPORT_SYMBOL(uio_prefaultpages);
@@ -390,10 +390,6 @@ mappedread(struct inode *ip, int nbytes, uio_t *uio)
int error = 0;
void *pb;
- error = uio_prefaultpages(nbytes, UIO_READ, uio);
- if (error)
- return (error);
-
start = uio->uio_loffset;
off = start & (PAGE_SIZE-1);
for (start &= PAGE_MASK; len > 0; start += PAGE_SIZE) {
@@ -679,7 +675,7 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
xuio = (xuio_t *)uio;
else
#endif
- uio_prefaultpages(MIN(n, max_blksz), UIO_WRITE, uio);
+ uio_prefaultpages(MIN(n, max_blksz), uio);
/*
* If in append mode, set the io offset pointer to eof.
@@ -925,7 +921,7 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
n -= nbytes;
if (!xuio && n > 0)
- uio_prefaultpages(MIN(n, max_blksz), UIO_WRITE, uio);
+ uio_prefaultpages(MIN(n, max_blksz), uio);
}
zfs_inode_update(zp);
@@ -312,9 +312,6 @@
/* kernel has large stacks */
#undef HAVE_LARGE_STACKS
-/* Define if you have libaio */
-#undef HAVE_LIBAIO
-
/* Define if you have libattr */
#undef HAVE_LIBATTR
From: Colin Ian King <colin.king@canonical.com> BugLink: https://bugs.launchpad.net/bugs/1754584 Remove original hotfix to replace it with an improved fix This reverts commit bc0adba16e0600a898435fa22c803f15e3caa866. --- zfs/META | 2 +- zfs/Makefile.in | 2 - zfs/aclocal.m4 | 1 - zfs/config/user-libaio.m4 | 14 ------ zfs/config/user.m4 | 1 - zfs/config/zfs-build.m4 | 4 +- zfs/configure | 77 +++++---------------------------- zfs/include/Makefile.in | 2 - zfs/include/linux/Makefile.in | 2 - zfs/include/sys/Makefile.in | 2 - zfs/include/sys/crypto/Makefile.in | 2 - zfs/include/sys/fm/Makefile.in | 2 - zfs/include/sys/fm/fs/Makefile.in | 2 - zfs/include/sys/fs/Makefile.in | 2 - zfs/include/sys/sysevent/Makefile.in | 2 - zfs/include/sys/uio_impl.h | 2 +- zfs/module/zcommon/zfs_uio.c | 83 +++++++++++++++++++++--------------- zfs/module/zfs/zfs_vnops.c | 8 +--- zfs/zfs_config.h.in | 3 -- 19 files changed, 64 insertions(+), 149 deletions(-) delete mode 100644 zfs/config/user-libaio.m4