aboutsummaryrefslogtreecommitdiffstats
path: root/net/iet
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2013-01-26 05:30:24 +0800
committerdelphij <delphij@FreeBSD.org>2013-01-26 05:30:24 +0800
commit85cc648f0e8e8b2320deb01d5b0c0b5aadbe143e (patch)
tree78a6cfc11c51b5c9a72e2c3909f3842915cf1d34 /net/iet
parent517dcf7187c3e47b3126b19ef725209057ae3481 (diff)
downloadfreebsd-ports-gnome-85cc648f0e8e8b2320deb01d5b0c0b5aadbe143e.tar.gz
freebsd-ports-gnome-85cc648f0e8e8b2320deb01d5b0c0b5aadbe143e.tar.zst
freebsd-ports-gnome-85cc648f0e8e8b2320deb01d5b0c0b5aadbe143e.zip
Add a workaround for r231949 which fixes the problem of uio_resid being
truncated into int but introduced an KPI/KBI change. While I'm there, also add code to support the now MPSAFE VFS.
Diffstat (limited to 'net/iet')
-rw-r--r--net/iet/Makefile2
-rw-r--r--net/iet/files/patch-freebsd10222
2 files changed, 223 insertions, 1 deletions
diff --git a/net/iet/Makefile b/net/iet/Makefile
index 9e3efd0ed759..964909e628be 100644
--- a/net/iet/Makefile
+++ b/net/iet/Makefile
@@ -7,7 +7,7 @@
PORTNAME= iet
PORTVERSION= 1.4.20.2
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= net
MASTER_SITES= SF/iscsitarget/iscsitarget/${PORTVERSION}/
DISTNAME= iscsitarget-${PORTVERSION}
diff --git a/net/iet/files/patch-freebsd10 b/net/iet/files/patch-freebsd10
new file mode 100644
index 000000000000..f3615bfaf733
--- /dev/null
+++ b/net/iet/files/patch-freebsd10
@@ -0,0 +1,222 @@
+--- kernel/iscsi.c.orig 2013-01-25 12:58:06.191784106 -0800
++++ kernel/iscsi.c 2013-01-25 12:58:45.785782759 -0800
+@@ -1963,7 +1963,7 @@
+ return ctr_major;
+ }
+ #else
+- ietdev = make_dev(&iet_csw, 0, UID_ROOT, GID_WHEEL, 0550, ctr_name);
++ ietdev = make_dev(&iet_csw, 0, UID_ROOT, GID_WHEEL, 0550, "%s", ctr_name);
+ #endif
+
+ #ifdef LINUX
+--- kernel/block-io.c.orig 2013-01-25 12:58:06.194781035 -0800
++++ kernel/block-io.c 2013-01-25 12:58:45.786780433 -0800
+@@ -260,7 +260,9 @@
+ int flags = FMODE_READ | (LUReadonly(volume) ? 0 : FMODE_WRITE);
+ int vaccess;
+ int error;
++#if defined(NDHASGIANT)
+ int vfslocked;
++#endif
+ struct vnode *devvp = NULL;
+ struct g_provider *pp;
+ struct g_geom *gp;
+@@ -270,13 +272,19 @@
+ if (!bio_data->path)
+ return -(ENOMEM);
+
++#if defined(MPSAFE)
+ NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, path, curthread);
++#else
++ NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, path, curthread);
++#endif
+ error = vn_open(&nd, &flags, 0, NULL);
+ if (error) {
+ eprintk("failed to open disk %s error %d\n", path, error);
+ return -(error);
+ }
++#if defined(NDHASGIANT)
+ vfslocked = NDHASGIANT(&nd);
++#endif
+ NDFREE(&nd, NDF_ONLY_PNBUF);
+
+ devvp = nd.ni_vp;
+@@ -321,7 +329,9 @@
+ g_topology_unlock();
+ bio_data->bdev = devvp;
+ VOP_UNLOCK(devvp, 0);
++#if defined(NDHASGIANT)
+ VFS_UNLOCK_GIANT(vfslocked);
++#endif
+ return 0;
+
+ gcleanup: /* On geom errors */
+@@ -331,7 +341,9 @@
+ failed:
+ VOP_UNLOCK(devvp, 0);
+ (void)vn_close(devvp, flags, curthread->td_ucred, curthread);
++#if defined(NDHASGIANT)
+ VFS_UNLOCK_GIANT(vfslocked);
++#endif
+ return -(error);
+ }
+ #endif
+@@ -439,11 +451,15 @@
+ }
+
+ if (bio_data->bdev) {
++#if defined(NDHASGIANT)
+ int vfslocked;
+
+ vfslocked = VFS_LOCK_GIANT(bio_data->bdev->v_mount);
++#endif
+ (void)vn_close(bio_data->bdev, flags, curthread->td_ucred, curthread);
++#if defined(NDHASGIANT)
+ VFS_UNLOCK_GIANT(vfslocked);
++#endif
+ }
+
+ if (bio_data->path)
+--- kernel/file-io.c.orig 2013-01-25 12:58:06.197782092 -0800
++++ kernel/file-io.c 2013-01-25 13:01:32.708794758 -0800
+@@ -24,8 +24,15 @@
+ struct file *filp;
+ #else
+ struct vnode *vp;
++#if defined(NDHASGIANT)
+ int vfslocked;
+- int error, aresid;
++#endif
++ int error;
++#if ((__FreeBSD_version < 1000000 && __FreeBSD_version >= 900506) || (__FreeBSD_version >= 1000009))
++ ssize_t aresid;
++#else
++ int aresid;
++#endif
+ #endif
+ struct fileio_data *p = lu->private;
+ page_t *page;
+@@ -40,8 +47,10 @@
+ filp = p->filp;
+ #else
+ vp = p->filevp;
++#if defined(NDHASGIANT)
+ vfslocked = VFS_LOCK_GIANT(vp->v_mount);
+ #endif
++#endif
+
+ size = tio->size;
+ offset= tio->offset;
+@@ -87,8 +96,10 @@
+ }
+ assert(!size);
+ #ifdef FREEBSD
++#if defined(NDHASGIANT)
+ VFS_UNLOCK_GIANT(vfslocked);
+ #endif
++#endif
+ return err;
+ }
+
+@@ -149,12 +160,17 @@
+ static int fileio_sync(struct iet_volume *lu, struct tio *tio)
+ {
+ struct fileio_data *p = lu->private;
+- int vfslocked, error;
++#if defined(NDHASGIANT)
++ int vfslocked;
++#endif
++ int error;
+ struct vnode *vp;
+ struct mount *mp;
+
+ vp = p->filevp;
++#if defined(NDHASGIANT)
+ vfslocked = VFS_LOCK_GIANT(vp->v_mount);
++#endif
+ if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
+ goto drop;
+
+@@ -163,7 +179,9 @@
+ VOP_UNLOCK(vp, 0);
+ vn_finished_write(mp);
+ drop:
++#if defined(NDHASGIANT)
+ VFS_UNLOCK_GIANT(vfslocked);
++#endif
+ return error;
+ }
+
+@@ -174,16 +192,25 @@
+ struct nameidata nd;
+ struct vnode *filevp;
+ struct vattr vattr;
++#if defined(NDHASGIANT)
+ int vfslocked;
++#endif
+ int flags = FMODE_READ | (LUReadonly(volume) ? 0 : FMODE_WRITE);
+
+ info->path = kstrdup(path, GFP_KERNEL);
+ if (!info->path)
+ return -ENOMEM;
+
++#if defined(NDHASGIANT)
+ NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, path, curthread);
++#else
++ NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, path, curthread);
++#endif
+ error = namei(&nd);
++#if defined(NDHASGIANT)
+ vfslocked = NDHASGIANT(&nd);
++#else
++#endif
+ if (error) {
+ eprintk("lookup failed for %s err %d\n", path, error);
+ return -(error);
+@@ -193,7 +220,9 @@
+ if (filevp->v_type != VREG) {
+ eprintk("path %s not a regular file\n", path);
+ NDFREE(&nd, 0);
++#if defined(NDHASGIANT)
+ VFS_UNLOCK_GIANT(vfslocked);
++#endif
+ return -(EINVAL);
+ }
+
+@@ -201,7 +230,9 @@
+ if (error != 0) {
+ eprintk("failed to open path %s err %d\n", path, error);
+ NDFREE(&nd, 0);
++#if defined(NDHASGIANT)
+ VFS_UNLOCK_GIANT(vfslocked);
++#endif
+ return -(error);
+ }
+ NDFREE(&nd, NDF_ONLY_PNBUF);
+@@ -212,7 +243,9 @@
+ VOP_UNLOCK(filevp, 0);
+ (void)vn_close(filevp, flags, curthread->td_ucred, curthread);
+ vrele(filevp);
++#if defined(NDHASGIANT)
+ VFS_UNLOCK_GIANT(vfslocked);
++#endif
+ return -(error);
+ }
+
+@@ -300,12 +333,16 @@
+ #else
+ if (p->filevp) {
+ int flags = FMODE_READ | (LUReadonly(lu) ? 0 : FMODE_WRITE);
++#if defined(NDHASGIANT)
+ int vfslocked;
+
+ vfslocked = VFS_LOCK_GIANT(p->filevp->v_mount);
++#endif
+ vn_close(p->filevp, flags, curthread->td_ucred, curthread);
+ vrele(p->filevp);
++#if defined(NDHASGIANT)
+ VFS_UNLOCK_GIANT(vfslocked);
++#endif
+ }
+ #endif
+ kfree(p);