]> git.proxmox.com Git - zfsonlinux.git/blame - spl-patches/0002-deadlock-between-mm_sem-and-tx-assign-in-zfs_write-a.patch
zfs/debian: add packaging files
[zfsonlinux.git] / spl-patches / 0002-deadlock-between-mm_sem-and-tx-assign-in-zfs_write-a.patch
CommitLineData
1bb9f57d
SI
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: ilbsmart <wgqimut@gmail.com>
3Date: Wed, 17 Oct 2018 02:11:24 +0800
4Subject: [PATCH] deadlock between mm_sem and tx assign in zfs_write() and page
5 fault
6
7The bug time sequence:
81. thread #1, `zfs_write` assign a txg "n".
92. In a same process, thread #2, mmap page fault (which means the
10 `mm_sem` is hold) occurred, `zfs_dirty_inode` open a txg failed,
11 and wait previous txg "n" completed.
123. thread #1 call `uiomove` to write, however page fault is occurred
13 in `uiomove`, which means it need `mm_sem`, but `mm_sem` is hold by
14 thread #2, so it stuck and can't complete, then txg "n" will
15 not complete.
16
17So thread #1 and thread #2 are deadlocked.
18
19Reviewed-by: Chunwei Chen <tuxoko@gmail.com>
20Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
21Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
22Signed-off-by: Grady Wong <grady.w@xtaotech.com>
23Closes #7939
24
25(backported from: zfs-upstream 779a6c0bf6df76e0dd92c1ccf81f48512b835bb0)
26Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
27---
28 include/sys/uio.h | 1 +
29 1 file changed, 1 insertion(+)
30
31diff --git a/include/sys/uio.h b/include/sys/uio.h
32index 764beb9..2895690 100644
33--- a/include/sys/uio.h
34+++ b/include/sys/uio.h
35@@ -53,6 +53,7 @@ typedef struct uio {
36 int uio_iovcnt;
37 offset_t uio_loffset;
38 uio_seg_t uio_segflg;
39+ boolean_t uio_fault_disable;
40 uint16_t uio_fmode;
41 uint16_t uio_extflg;
42 offset_t uio_limit;