git.iko.soy/typeable/nixpkgs
on master help sign in
fix builds for rest of kernel modules on 3.18
commit27281f660c5f8ea589f13e5d40494228d174e79a authorDomen Kožar <domen@dev.si> dateThu 11 Dec 2014, 02:03 (12 years ago) parent1075112
4 files changed+88−1
pkgs/os-specific/linux/ktap/default.nix+2 pkgs/os-specific/linux/zfs/bc151f7b312dea09c6ec5b9a320e65140789643a.patch+84 pkgs/os-specific/linux/zfs/git.nix+1−1 pkgs/servers/openafs-client/default.nix+1
pkgs/os-specific/linux/ktap/default.nix+2
@@ -1,5 +1,7 @@
11{ stdenv, fetchgit, kernel, useFFI ? false }:
22
3+assert builtins.substring 0 4 kernel.version != "3.18";
4+
35let
46 ffiArgs = stdenv.lib.optionalString useFFI "FFI=1";
57in
pkgs/os-specific/linux/zfs/bc151f7b312dea09c6ec5b9a320e65140789643a.patchnew file+84
@@ -0,0 +1,84 @@
1+From bc151f7b312dea09c6ec5b9a320e65140789643a Mon Sep 17 00:00:00 2001
2+From: Ned Bass <bass6@llnl.gov>
3+Date: Thu, 16 Oct 2014 13:52:56 -0700
4+Subject: [PATCH] Remove checks for mandatory locks
5+
6+The Linux VFS handles mandatory locks generically so we shouldn't
7+need to check for conflicting locks in zfs_read(), zfs_write(), or
8+zfs_freesp(). Linux 3.18 removed the lock_may_read() and
9+lock_may_write() interfaces which we were relying on for this
10+purpose. Rather than emulating those interfaces we remove the
11+redundant checks.
12+
13+Signed-off-by: Ned Bass <bass6@llnl.gov>
14+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
15+Closes #2804
16+---
17+ module/zfs/zfs_vnops.c | 18 ------------------
18+ module/zfs/zfs_znode.c | 10 ----------
19+ 2 files changed, 28 deletions(-)
20+
21+diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
22+index 33f9e0e..2f55e56 100644
23+--- a/module/zfs/zfs_vnops.c
24++++ b/module/zfs/zfs_vnops.c
25+@@ -474,15 +474,6 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
26+ }
27+
28+ /*
29+- * Check for mandatory locks
30+- */
31+- if (mandatory_lock(ip) &&
32+- !lock_may_read(ip, uio->uio_loffset, uio->uio_resid)) {
33+- ZFS_EXIT(zsb);
34+- return (SET_ERROR(EAGAIN));
35+- }
36+-
37+- /*
38+ * If we're in FRSYNC mode, sync out this znode before reading it.
39+ */
40+ if (ioflag & FRSYNC || zsb->z_os->os_sync == ZFS_SYNC_ALWAYS)
41+@@ -651,15 +642,6 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
42+ }
43+
44+ /*
45+- * Check for mandatory locks before calling zfs_range_lock()
46+- * in order to prevent a deadlock with locks set via fcntl().
47+- */
48+- if (mandatory_lock(ip) && !lock_may_write(ip, woff, n)) {
49+- ZFS_EXIT(zsb);
50+- return (SET_ERROR(EAGAIN));
51+- }
52+-
53+- /*
54+ * Pre-fault the pages to ensure slow (eg NFS) pages
55+ * don't hold up txg.
56+ * Skip this if uio contains loaned arc_buf.
57+diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
58+index 90dbfd3..f02c021 100644
59+--- a/module/zfs/zfs_znode.c
60++++ b/module/zfs/zfs_znode.c
61+@@ -1546,7 +1546,6 @@ zfs_trunc(znode_t *zp, uint64_t end)
62+ int
63+ zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
64+ {
65+- struct inode *ip = ZTOI(zp);
66+ dmu_tx_t *tx;
67+ zfs_sb_t *zsb = ZTOZSB(zp);
68+ zilog_t *zilog = zsb->z_log;
69+@@ -1567,15 +1566,6 @@ zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
70+ goto out;
71+ }
72+
73+- /*
74+- * Check for any locks in the region to be freed.
75+- */
76+- if (ip->i_flock && mandatory_lock(ip)) {
77+- uint64_t length = (len ? len : zp->z_size - off);
78+- if (!lock_may_write(ip, off, length))
79+- return (SET_ERROR(EAGAIN));
80+- }
81+-
82+ if (len == 0) {
83+ error = zfs_trunc(zp, off);
84+ } else {
pkgs/os-specific/linux/zfs/git.nix+1−1
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
99 sha256 = "1yqsfdhyzh33aisfvwqd692n5kfgnlz7yjixd2gqn8vx9bv0dz0b";
1010 };
1111
12− patches = [ ./mount_zfs_prefix.patch ./nix-build.patch ];
12+ patches = [ ./mount_zfs_prefix.patch ./nix-build.patch ./bc151f7b312dea09c6ec5b9a320e65140789643a.patch ];
1313
1414 buildInputs = [ spl_git perl autoconf automake libtool zlib libuuid coreutils ];
1515
pkgs/servers/openafs-client/default.nix+1
@@ -2,6 +2,7 @@
22 kernel, glibc, ncurses, perl, krb5 }:
33
44assert stdenv.isLinux;
5+assert builtins.substring 0 4 kernel.version != "3.18";
56
67stdenv.mkDerivation {
78 name = "openafs-1.6.9-${kernel.version}";