mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Merge pull request #9546 from dfoxfranke/openafs-client
openafs-client: 1.6.9 -> 1.6.14, fix build
This commit is contained in:
commit
556eb9b30b
5 changed files with 6 additions and 300 deletions
|
@ -1,48 +0,0 @@
|
|||
From: Marc Dionne <marc.dionne@your-file-system.com>
|
||||
Date: Thu, 25 Sep 2014 10:52:12 +0000 (-0300)
|
||||
Subject: Linux 3.17: Deal with d_splice_alias errors
|
||||
X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=af7f1d59135526ea584a4403b6400106dc92a992;hp=880401913d6190054bb0511093606a206b16326c
|
||||
|
||||
Linux 3.17: Deal with d_splice_alias errors
|
||||
|
||||
In 3.17 the logic in d_splice_alias has changed. Of interest to
|
||||
us is the fact that it will now return an EIO error if it finds
|
||||
an existing connected directory for the dentry, where it would
|
||||
previously have added a new alias for it. As a result the end
|
||||
user can get EIO errors when accessing any file in a volume
|
||||
if the volume was first accessed through a different path (ex:
|
||||
RO path vs RW path).
|
||||
|
||||
This commit just restores the old behaviour, adding the directory
|
||||
alias manually in the error case, which is what older versions
|
||||
of d_splice_alias used to do.
|
||||
|
||||
Change-Id: I5558c64760e4cad2bd3dc648067d81020afc69b6
|
||||
---
|
||||
|
||||
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
|
||||
index e03187f..0cdd9e0 100644
|
||||
--- a/src/afs/LINUX/osi_vnodeops.c
|
||||
+++ b/src/afs/LINUX/osi_vnodeops.c
|
||||
@@ -1593,9 +1593,18 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
|
||||
/* It's ok for the file to not be found. That's noted by the caller by
|
||||
* seeing that the dp->d_inode field is NULL.
|
||||
*/
|
||||
- if (!code || code == ENOENT)
|
||||
- return newdp;
|
||||
- else
|
||||
+ if (!code || code == ENOENT) {
|
||||
+ /*
|
||||
+ * d_splice_alias can return an error (EIO) if there is an existing
|
||||
+ * connected directory alias for this dentry.
|
||||
+ */
|
||||
+ if (!IS_ERR(newdp))
|
||||
+ return newdp;
|
||||
+ else {
|
||||
+ d_add(dp, ip);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ } else
|
||||
return ERR_PTR(afs_convert_code(code));
|
||||
}
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
From 880401913d6190054bb0511093606a206b16326c Mon Sep 17 00:00:00 2001
|
||||
From: Marc Dionne <marc.dionne@your-file-system.com>
|
||||
Date: Tue, 9 Sep 2014 10:39:55 -0300
|
||||
Subject: [PATCH] Linux 3.17: No more typedef for ctl_table
|
||||
|
||||
The typedef has been removed so we need to use the structure
|
||||
directly.
|
||||
|
||||
Note that the API for register_sysctl_table has also changed
|
||||
with 3.17, but it reverted back to a form that existed
|
||||
before and the configure tests handle it correctly.
|
||||
|
||||
Change-Id: If1fd9d27f795dee4b5aa2152dd09e0540d643a69
|
||||
---
|
||||
src/afs/LINUX/osi_sysctl.c | 4 ++--
|
||||
src/cf/linux-test4.m4 | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c
|
||||
index a8f7fac..834e8ad 100644
|
||||
--- a/src/afs/LINUX/osi_sysctl.c
|
||||
+++ b/src/afs/LINUX/osi_sysctl.c
|
||||
@@ -34,7 +34,7 @@ extern afs_int32 afs_pct2;
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static struct ctl_table_header *afs_sysctl = NULL;
|
||||
|
||||
-static ctl_table afs_sysctl_table[] = {
|
||||
+static struct ctl_table afs_sysctl_table[] = {
|
||||
{
|
||||
#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME)
|
||||
#if defined(CTL_UNNUMBERED)
|
||||
@@ -234,7 +234,7 @@ static ctl_table afs_sysctl_table[] = {
|
||||
{0}
|
||||
};
|
||||
|
||||
-static ctl_table fs_sysctl_table[] = {
|
||||
+static struct ctl_table fs_sysctl_table[] = {
|
||||
{
|
||||
#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME)
|
||||
#if defined(CTL_UNNUMBERED)
|
||||
diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
|
||||
index dad91d9..228b491 100644
|
||||
--- a/src/cf/linux-test4.m4
|
||||
+++ b/src/cf/linux-test4.m4
|
||||
@@ -395,7 +395,7 @@ AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
|
||||
AC_CHECK_LINUX_BUILD([whether register_sysctl_table has an insert_at_head argument],
|
||||
[ac_cv_linux_register_sysctl_table_noflag],
|
||||
[#include <linux/sysctl.h>],
|
||||
- [ctl_table *t; register_sysctl_table (t);],
|
||||
+ [struct ctl_table *t; register_sysctl_table (t);],
|
||||
[REGISTER_SYSCTL_TABLE_NOFLAG],
|
||||
[define if register_sysctl_table has no insert_at head flag],
|
||||
[])
|
||||
--
|
||||
1.7.1
|
|
@ -1,51 +0,0 @@
|
|||
From e284db57f94c8f97ed1c95dcd0bd9518d86c050c Mon Sep 17 00:00:00 2001
|
||||
From: Marc Dionne <marc.dionne@your-file-system.com>
|
||||
Date: Wed, 18 Jun 2014 08:53:48 -0400
|
||||
Subject: [PATCH] Linux 3.16: Switch to iter_file_splice_write
|
||||
|
||||
Users of generic_file_splice_write need to switch to
|
||||
using iter_file_splice_write.
|
||||
|
||||
Change-Id: If4801d27e030e1cb986f483cf437a2cfa7398eb3
|
||||
Reviewed-on: http://gerrit.openafs.org/11302
|
||||
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
|
||||
Tested-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
|
||||
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
|
||||
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
|
||||
---
|
||||
acinclude.m4 | 3 +++
|
||||
src/afs/LINUX/osi_vnodeops.c | 4 ++++
|
||||
2 files changed, 7 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/acinclude.m4 b/acinclude.m4
|
||||
index ae8f1ed..9e39d90 100644
|
||||
--- a/acinclude.m4
|
||||
+++ b/acinclude.m4
|
||||
@@ -958,6 +958,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
|
||||
AC_CHECK_LINUX_FUNC([inode_setattr],
|
||||
[#include <linux/fs.h>],
|
||||
[inode_setattr(NULL, NULL);])
|
||||
+ AC_CHECK_LINUX_FUNC([iter_file_splice_write],
|
||||
+ [#include <linux/fs.h>],
|
||||
+ [iter_file_splice_write(NULL,NULL,NULL,0,0);])
|
||||
AC_CHECK_LINUX_FUNC([kernel_setsockopt],
|
||||
[#include <linux/net.h>],
|
||||
[kernel_setsockopt(NULL, 0, 0, NULL, 0);])
|
||||
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
|
||||
index 6f4000b..2685915 100644
|
||||
--- a/src/afs/LINUX/osi_vnodeops.c
|
||||
+++ b/src/afs/LINUX/osi_vnodeops.c
|
||||
@@ -827,7 +827,11 @@ struct file_operations afs_file_fops = {
|
||||
.sendfile = generic_file_sendfile,
|
||||
#endif
|
||||
#if defined(STRUCT_FILE_OPERATIONS_HAS_SPLICE)
|
||||
+# if defined(HAVE_LINUX_ITER_FILE_SPLICE_WRITE)
|
||||
+ .splice_write = iter_file_splice_write,
|
||||
+# else
|
||||
.splice_write = generic_file_splice_write,
|
||||
+# endif
|
||||
.splice_read = generic_file_splice_read,
|
||||
#endif
|
||||
.release = afs_linux_release,
|
||||
--
|
||||
1.7.1
|
|
@ -1,24 +1,14 @@
|
|||
{ stdenv, fetchurl, which, autoconf, automake, flex, yacc,
|
||||
kernel, glibc, ncurses, perl, kerberos }:
|
||||
|
||||
assert stdenv.isLinux;
|
||||
assert builtins.substring 0 4 kernel.version != "3.18";
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "openafs-1.6.9-${kernel.version}";
|
||||
name = "openafs-1.6.14-${kernel.version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = http://www.openafs.org/dl/openafs/1.6.9/openafs-1.6.9-src.tar.bz2;
|
||||
sha256 = "1isgw7znp10w0mr3sicnjzbc12bd1gdwfqqr667w6p3syyhs6bkv";
|
||||
url = http://www.openafs.org/dl/openafs/1.6.14/openafs-1.6.14-src.tar.bz2;
|
||||
sha256 = "3e62c798a7f982c4f88d85d32e46bee6a47848d207b1e318fe661ce44ae4e01f";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./f3c0f74186f4a323ffc5f125d961fe384d396cac.patch
|
||||
./ae86b07f827d6f3e2032a412f5f6cb3951a27d2d.patch
|
||||
./I5558c64760e4cad2bd3dc648067d81020afc69b6.patch
|
||||
./If1fd9d27f795dee4b5aa2152dd09e0540d643a69.patch
|
||||
];
|
||||
|
||||
buildInputs = [ autoconf automake flex yacc ncurses perl which ];
|
||||
|
||||
preConfigure = ''
|
||||
|
@ -34,14 +24,14 @@ stdenv.mkDerivation {
|
|||
|
||||
./regen.sh
|
||||
|
||||
${stdenv.lib.optionalString (kerberos != null) ''
|
||||
export KRB5_CONFIG=${kerberos}/bin/krb5-config"
|
||||
''}
|
||||
${stdenv.lib.optionalString (kerberos != null)
|
||||
"export KRB5_CONFIG=${kerberos}/bin/krb5-config"}
|
||||
|
||||
configureFlagsArray=(
|
||||
"--with-linux-kernel-build=$TMP/linux"
|
||||
${stdenv.lib.optionalString (kerberos != null) "--with-krb5"}
|
||||
"--sysconfdir=/etc/static"
|
||||
"--disable-linux-d_splice-alias-extra-iput"
|
||||
)
|
||||
'';
|
||||
|
||||
|
|
|
@ -1,130 +0,0 @@
|
|||
From: Marc Dionne <marc.dionne@your-file-system.com>
|
||||
Date: Wed, 18 Jun 2014 13:06:39 +0000 (-0400)
|
||||
Subject: Linux 3.16: Convert to new write_iter/read_iter ops
|
||||
X-Git-Tag: openafs-stable-1_6_10pre1~76
|
||||
X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=f3c0f74186f4a323ffc5f125d961fe384d396cac
|
||||
|
||||
Linux 3.16: Convert to new write_iter/read_iter ops
|
||||
|
||||
Change read/write operations to the new write_iter/read_iter
|
||||
operations.
|
||||
|
||||
Reviewed-on: http://gerrit.openafs.org/11303
|
||||
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
|
||||
Tested-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
|
||||
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
|
||||
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
|
||||
(cherry picked from commit a303bb257ed9e790d8c14644779e9508167887b6)
|
||||
|
||||
Change-Id: I3f66104be067698a4724ed78537765cf26d4aa10
|
||||
Reviewed-on: http://gerrit.openafs.org/11309
|
||||
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
|
||||
Tested-by: BuildBot <buildbot@rampaginggeek.com>
|
||||
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
|
||||
---
|
||||
|
||||
diff --git a/acinclude.m4 b/acinclude.m4
|
||||
index 83a1a8c..13d70db 100644
|
||||
--- a/acinclude.m4
|
||||
+++ b/acinclude.m4
|
||||
@@ -836,6 +836,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
|
||||
AC_CHECK_LINUX_STRUCT([inode], [i_security], [fs.h])
|
||||
AC_CHECK_LINUX_STRUCT([file_operations], [flock], [fs.h])
|
||||
AC_CHECK_LINUX_STRUCT([file_operations], [iterate], [fs.h])
|
||||
+ AC_CHECK_LINUX_STRUCT([file_operations], [read_iter], [fs.h])
|
||||
AC_CHECK_LINUX_STRUCT([file_operations], [sendfile], [fs.h])
|
||||
AC_CHECK_LINUX_STRUCT([file_system_type], [mount], [fs.h])
|
||||
AC_CHECK_LINUX_STRUCT([inode_operations], [truncate], [fs.h])
|
||||
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
|
||||
index 441cce7..818debe 100644
|
||||
--- a/src/afs/LINUX/osi_vnodeops.c
|
||||
+++ b/src/afs/LINUX/osi_vnodeops.c
|
||||
@@ -99,8 +99,11 @@ afs_linux_VerifyVCache(struct vcache *avc, cred_t **retcred) {
|
||||
return afs_convert_code(code);
|
||||
}
|
||||
|
||||
-#ifdef HAVE_LINUX_GENERIC_FILE_AIO_READ
|
||||
-# ifdef LINUX_HAS_NONVECTOR_AIO
|
||||
+#if defined(STRUCT_FILE_OPERATIONS_HAS_READ_ITER) || defined(HAVE_LINUX_GENERIC_FILE_AIO_READ)
|
||||
+# if defined(STRUCT_FILE_OPERATIONS_HAS_READ_ITER)
|
||||
+static ssize_t
|
||||
+afs_linux_read_iter(struct kiocb *iocb, struct iov_iter *iter)
|
||||
+# elif defined(LINUX_HAS_NONVECTOR_AIO)
|
||||
static ssize_t
|
||||
afs_linux_aio_read(struct kiocb *iocb, char __user *buf, size_t bufsize,
|
||||
loff_t pos)
|
||||
@@ -113,6 +116,11 @@ afs_linux_aio_read(struct kiocb *iocb, const struct iovec *buf,
|
||||
struct file *fp = iocb->ki_filp;
|
||||
ssize_t code = 0;
|
||||
struct vcache *vcp = VTOAFS(fp->f_dentry->d_inode);
|
||||
+# if defined(STRUCT_FILE_OPERATIONS_HAS_READ_ITER)
|
||||
+ loff_t pos = iocb->ki_pos;
|
||||
+ unsigned long bufsize = iter->nr_segs;
|
||||
+# endif
|
||||
+
|
||||
|
||||
AFS_GLOCK();
|
||||
afs_Trace4(afs_iclSetp, CM_TRACE_AIOREADOP, ICL_TYPE_POINTER, vcp,
|
||||
@@ -125,7 +133,11 @@ afs_linux_aio_read(struct kiocb *iocb, const struct iovec *buf,
|
||||
* so we optimise by not using it */
|
||||
osi_FlushPages(vcp, NULL); /* ensure stale pages are gone */
|
||||
AFS_GUNLOCK();
|
||||
+# if defined(STRUCT_FILE_OPERATIONS_HAS_READ_ITER)
|
||||
+ code = generic_file_read_iter(iocb, iter);
|
||||
+# else
|
||||
code = generic_file_aio_read(iocb, buf, bufsize, pos);
|
||||
+# endif
|
||||
AFS_GLOCK();
|
||||
}
|
||||
|
||||
@@ -170,8 +182,11 @@ afs_linux_read(struct file *fp, char *buf, size_t count, loff_t * offp)
|
||||
* also take care of re-positioning the pointer if file is open in append
|
||||
* mode. Call fake open/close to ensure we do writes of core dumps.
|
||||
*/
|
||||
-#ifdef HAVE_LINUX_GENERIC_FILE_AIO_READ
|
||||
-# ifdef LINUX_HAS_NONVECTOR_AIO
|
||||
+#if defined(STRUCT_FILE_OPERATIONS_HAS_READ_ITER) || defined(HAVE_LINUX_GENERIC_FILE_AIO_READ)
|
||||
+# if defined(STRUCT_FILE_OPERATIONS_HAS_READ_ITER)
|
||||
+static ssize_t
|
||||
+afs_linux_write_iter(struct kiocb *iocb, struct iov_iter *iter)
|
||||
+# elif defined(LINUX_HAS_NONVECTOR_AIO)
|
||||
static ssize_t
|
||||
afs_linux_aio_write(struct kiocb *iocb, const char __user *buf, size_t bufsize,
|
||||
loff_t pos)
|
||||
@@ -184,6 +199,10 @@ afs_linux_aio_write(struct kiocb *iocb, const struct iovec *buf,
|
||||
ssize_t code = 0;
|
||||
struct vcache *vcp = VTOAFS(iocb->ki_filp->f_dentry->d_inode);
|
||||
cred_t *credp;
|
||||
+# if defined(STRUCT_FILE_OPERATIONS_HAS_READ_ITER)
|
||||
+ loff_t pos = iocb->ki_pos;
|
||||
+ unsigned long bufsize = iter->nr_segs;
|
||||
+# endif
|
||||
|
||||
AFS_GLOCK();
|
||||
|
||||
@@ -199,7 +218,11 @@ afs_linux_aio_write(struct kiocb *iocb, const struct iovec *buf,
|
||||
ReleaseWriteLock(&vcp->lock);
|
||||
if (code == 0) {
|
||||
AFS_GUNLOCK();
|
||||
+# if defined(STRUCT_FILE_OPERATIONS_HAS_READ_ITER)
|
||||
+ code = generic_file_write_iter(iocb, iter);
|
||||
+# else
|
||||
code = generic_file_aio_write(iocb, buf, bufsize, pos);
|
||||
+# endif
|
||||
AFS_GLOCK();
|
||||
}
|
||||
|
||||
@@ -788,7 +811,12 @@ struct file_operations afs_dir_fops = {
|
||||
};
|
||||
|
||||
struct file_operations afs_file_fops = {
|
||||
-#ifdef HAVE_LINUX_GENERIC_FILE_AIO_READ
|
||||
+#ifdef STRUCT_FILE_OPERATIONS_HAS_READ_ITER
|
||||
+ .read_iter = afs_linux_read_iter,
|
||||
+ .write_iter = afs_linux_write_iter,
|
||||
+ .read = new_sync_read,
|
||||
+ .write = new_sync_write,
|
||||
+#elif defined(HAVE_LINUX_GENERIC_FILE_AIO_READ)
|
||||
.aio_read = afs_linux_aio_read,
|
||||
.aio_write = afs_linux_aio_write,
|
||||
.read = do_sync_read,
|
Loading…
Reference in a new issue