lol

kernel: fix 9p issues

[tuomas: rename the patch from 9p-hacks to something slighly more
meaningful]
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

authored by

Volth and committed by
Tuomas Tynkkynen
ed41d50e d19384ca

+96
+85
pkgs/os-specific/linux/kernel/p9-fixes.patch
··· 1 + diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c 2 + --- a/fs/9p/vfs_inode.c 3 + +++ b/fs/9p/vfs_inode.c 4 + @@ -483,6 +483,9 @@ static int v9fs_test_inode(struct inode *inode, void *data) 5 + 6 + if (v9inode->qid.type != st->qid.type) 7 + return 0; 8 + + 9 + + if (v9inode->qid.path != st->qid.path) 10 + + return 0; 11 + return 1; 12 + } 13 + 14 + diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c 15 + --- a/fs/9p/vfs_inode_dotl.c 16 + +++ b/fs/9p/vfs_inode_dotl.c 17 + @@ -87,6 +87,9 @@ static int v9fs_test_inode_dotl(struct inode *inode, void *data) 18 + 19 + if (v9inode->qid.type != st->qid.type) 20 + return 0; 21 + + 22 + + if (v9inode->qid.path != st->qid.path) 23 + + return 0; 24 + return 1; 25 + } 26 + 27 + diff --git a/net/9p/client.c b/net/9p/client.c 28 + index 3ce672af1596..f1c8ad373f90 100644 29 + --- a/net/9p/client.c 30 + +++ b/net/9p/client.c 31 + @@ -749,8 +749,7 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...) 32 + } 33 + again: 34 + /* Wait for the response */ 35 + - err = wait_event_interruptible(*req->wq, 36 + - req->status >= REQ_STATUS_RCVD); 37 + + err = wait_event_killable(*req->wq, req->status >= REQ_STATUS_RCVD); 38 + 39 + /* 40 + * Make sure our req is coherent with regard to updates in other 41 + diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c 42 + index f24b25c25106..f3a4efcf1456 100644 43 + --- a/net/9p/trans_virtio.c 44 + +++ b/net/9p/trans_virtio.c 45 + @@ -286,8 +286,8 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req) 46 + if (err == -ENOSPC) { 47 + chan->ring_bufs_avail = 0; 48 + spin_unlock_irqrestore(&chan->lock, flags); 49 + - err = wait_event_interruptible(*chan->vc_wq, 50 + - chan->ring_bufs_avail); 51 + + err = wait_event_killable(*chan->vc_wq, 52 + + chan->ring_bufs_avail); 53 + if (err == -ERESTARTSYS) 54 + return err; 55 + 56 + @@ -327,7 +327,7 @@ static int p9_get_mapped_pages(struct virtio_chan *chan, 57 + * Other zc request to finish here 58 + */ 59 + if (atomic_read(&vp_pinned) >= chan->p9_max_pages) { 60 + - err = wait_event_interruptible(vp_wq, 61 + + err = wait_event_killable(vp_wq, 62 + (atomic_read(&vp_pinned) < chan->p9_max_pages)); 63 + if (err == -ERESTARTSYS) 64 + return err; 65 + @@ -471,8 +471,8 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req, 66 + if (err == -ENOSPC) { 67 + chan->ring_bufs_avail = 0; 68 + spin_unlock_irqrestore(&chan->lock, flags); 69 + - err = wait_event_interruptible(*chan->vc_wq, 70 + - chan->ring_bufs_avail); 71 + + err = wait_event_killable(*chan->vc_wq, 72 + + chan->ring_bufs_avail); 73 + if (err == -ERESTARTSYS) 74 + goto err_out; 75 + 76 + @@ -489,8 +489,7 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req, 77 + virtqueue_kick(chan->vq); 78 + spin_unlock_irqrestore(&chan->lock, flags); 79 + p9_debug(P9_DEBUG_TRANS, "virtio request kicked\n"); 80 + - err = wait_event_interruptible(*req->wq, 81 + - req->status >= REQ_STATUS_RCVD); 82 + + err = wait_event_killable(*req->wq, req->status >= REQ_STATUS_RCVD); 83 + /* 84 + * Non kernel buffers are pinned, unpin them 85 + */
+5
pkgs/os-specific/linux/kernel/patches.nix
··· 52 52 patch = ./bridge-stp-helper.patch; 53 53 }; 54 54 55 + p9_fixes = 56 + { name = "p9-fixes"; 57 + patch = ./p9-fixes.patch; 58 + }; 59 + 55 60 no_xsave = 56 61 { name = "no-xsave"; 57 62 patch = ./no-xsave.patch;
+6
pkgs/top-level/all-packages.nix
··· 11501 11501 linux_mptcp = callPackage ../os-specific/linux/kernel/linux-mptcp.nix { 11502 11502 kernelPatches = 11503 11503 [ kernelPatches.bridge_stp_helper 11504 + kernelPatches.p9_fixes 11504 11505 kernelPatches.packet_fix_race_condition_CVE_2016_8655 11505 11506 kernelPatches.DCCP_double_free_vulnerability_CVE-2017-6074 11506 11507 ] ··· 11521 11522 linux_3_10 = callPackage ../os-specific/linux/kernel/linux-3.10.nix { 11522 11523 kernelPatches = with kernelPatches; 11523 11524 [ bridge_stp_helper 11525 + p9_fixes 11524 11526 lguest_entry-linkage 11525 11527 packet_fix_race_condition_CVE_2016_8655 11526 11528 DCCP_double_free_vulnerability_CVE-2017-6074 ··· 11535 11537 linux_4_4 = callPackage ../os-specific/linux/kernel/linux-4.4.nix { 11536 11538 kernelPatches = 11537 11539 [ kernelPatches.bridge_stp_helper 11540 + kernelPatches.p9_fixes 11538 11541 kernelPatches.cpu-cgroup-v2."4.4" 11539 11542 ] 11540 11543 ++ lib.optionals ((platform.kernelArch or null) == "mips") ··· 11547 11550 linux_4_9 = callPackage ../os-specific/linux/kernel/linux-4.9.nix { 11548 11551 kernelPatches = 11549 11552 [ kernelPatches.bridge_stp_helper 11553 + kernelPatches.p9_fixes 11550 11554 # See pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/README.md 11551 11555 # when adding a new linux version 11552 11556 # !!! 4.7 patch doesn't apply, 4.9 patch not up yet, will keep checking ··· 11563 11567 linux_4_10 = callPackage ../os-specific/linux/kernel/linux-4.10.nix { 11564 11568 kernelPatches = 11565 11569 [ kernelPatches.bridge_stp_helper 11570 + kernelPatches.p9_fixes 11566 11571 # See pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/README.md 11567 11572 # when adding a new linux version 11568 11573 # !!! 4.7 patch doesn't apply, 4.9 patch not up yet, will keep checking ··· 11579 11584 linux_testing = callPackage ../os-specific/linux/kernel/linux-testing.nix { 11580 11585 kernelPatches = [ 11581 11586 kernelPatches.bridge_stp_helper 11587 + kernelPatches.p9_fixes 11582 11588 kernelPatches.modinst_arg_list_too_long 11583 11589 ] ++ lib.optionals ((platform.kernelArch or null) == "mips") [ 11584 11590 kernelPatches.mips_fpureg_emu