]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Linux 4.1 compat: loop device on ZFS
authorChunwei Chen <tuxoko@gmail.com>
Thu, 30 Jul 2015 14:24:36 +0000 (22:24 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 24 Aug 2015 17:17:06 +0000 (10:17 -0700)
commit5475aada9474464f973788c1b2fc6216486fb303
treef4b02aff6e841b47cad4894b40c7a1092ad0be3b
parent17888ae30d6111f1fe25087a256724ee9b1a0a84
Linux 4.1 compat: loop device on ZFS

Starting from Linux 4.1 allows iov_iter with bio_vec to be passed into
iter_read/iter_write. Notably, the loop device will pass bio_vec to backend
filesystem. However, current ZFS code assumes iovec without any check, so it
will always crash when using loop device.

With the restructured uio_t, we can safely pass bio_vec in uio_t with UIO_BVEC
set. The uio* functions are modified to handle bio_vec case separately.

The const uio_iov causes some warning in xuio related stuff, so explicit
convert them to non const.

Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3511
Closes #3640
module/zcommon/zfs_uio.c
module/zfs/dmu.c
module/zfs/zfs_vnops.c
module/zfs/zpl_file.c
module/zfs/zpl_inode.c