]> git.pld-linux.org Git - packages/kernel.git/blob - kernel-small_fixes.patch
- up to 5.1.15; improved xfs writeback support (from xfs ml)
[packages/kernel.git] / kernel-small_fixes.patch
1 --- linux-5.1/net/sunrpc/Kconfig~       2019-05-06 02:42:58.000000000 +0200
2 +++ linux-5.1/net/sunrpc/Kconfig        2019-05-10 12:54:36.566903892 +0200
3 @@ -34,7 +34,7 @@ config RPCSEC_GSS_KRB5
4  
5           If unsure, say Y.
6  
7 -config CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES
8 +config SUNRPC_DISABLE_INSECURE_ENCTYPES
9         bool "Secure RPC: Disable insecure Kerberos encryption types"
10         depends on RPCSEC_GSS_KRB5
11         default n
12 Move setting up operation and write hint to xfs_alloc_ioend, and\r
13 then just copy over all needed information from the previous bio\r
14 in xfs_chain_bio and stop passing various parameters to it.\r
15 \r
16 Signed-off-by: Christoph Hellwig <hch@lst.de>\r
17 ---\r
18  fs/xfs/xfs_aops.c | 35 +++++++++++++++++------------------\r
19  1 file changed, 17 insertions(+), 18 deletions(-)\r
20 \r
21 diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c\r
22 index a6f0f4761a37..9cceb90e77c5 100644\r
23 --- a/fs/xfs/xfs_aops.c\r
24 +++ b/fs/xfs/xfs_aops.c\r
25 @@ -665,7 +665,6 @@ xfs_submit_ioend(\r
26  \r
27         ioend->io_bio->bi_private = ioend;\r
28         ioend->io_bio->bi_end_io = xfs_end_bio;\r
29 -       ioend->io_bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc);\r
30  \r
31         /*\r
32          * If we are failing the IO now, just mark the ioend with an\r
33 @@ -679,7 +678,6 @@ xfs_submit_ioend(\r
34                 return status;\r
35         }\r
36  \r
37 -       ioend->io_bio->bi_write_hint = ioend->io_inode->i_write_hint;\r
38         submit_bio(ioend->io_bio);\r
39         return 0;\r
40  }\r
41 @@ -691,7 +689,8 @@ xfs_alloc_ioend(\r
42         xfs_exntst_t            state,\r
43         xfs_off_t               offset,\r
44         struct block_device     *bdev,\r
45 -       sector_t                sector)\r
46 +       sector_t                sector,\r
47 +       struct writeback_control *wbc)\r
48  {\r
49         struct xfs_ioend        *ioend;\r
50         struct bio              *bio;\r
51 @@ -699,6 +698,8 @@ xfs_alloc_ioend(\r
52         bio = bio_alloc_bioset(GFP_NOFS, BIO_MAX_PAGES, &xfs_ioend_bioset);\r
53         bio_set_dev(bio, bdev);\r
54         bio->bi_iter.bi_sector = sector;\r
55 +       bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc);\r
56 +       bio->bi_write_hint = inode->i_write_hint;\r
57  \r
58         ioend = container_of(bio, struct xfs_ioend, io_inline_bio);\r
59         INIT_LIST_HEAD(&ioend->io_list);\r
60 @@ -719,24 +720,22 @@ xfs_alloc_ioend(\r
61   * so that the bi_private linkage is set up in the right direction for the\r
62   * traversal in xfs_destroy_ioend().\r
63   */\r
64 -static void\r
65 +static struct bio *\r
66  xfs_chain_bio(\r
67 -       struct xfs_ioend        *ioend,\r
68 -       struct writeback_control *wbc,\r
69 -       struct block_device     *bdev,\r
70 -       sector_t                sector)\r
71 +       struct bio              *prev)\r
72  {\r
73         struct bio *new;\r
74  \r
75         new = bio_alloc(GFP_NOFS, BIO_MAX_PAGES);\r
76 -       bio_set_dev(new, bdev);\r
77 -       new->bi_iter.bi_sector = sector;\r
78 -       bio_chain(ioend->io_bio, new);\r
79 -       bio_get(ioend->io_bio);         /* for xfs_destroy_ioend */\r
80 -       ioend->io_bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc);\r
81 -       ioend->io_bio->bi_write_hint = ioend->io_inode->i_write_hint;\r
82 -       submit_bio(ioend->io_bio);\r
83 -       ioend->io_bio = new;\r
84 +       bio_copy_dev(new, prev);\r
85 +       new->bi_iter.bi_sector = bio_end_sector(prev);\r
86 +       new->bi_opf = prev->bi_opf;\r
87 +       new->bi_write_hint = prev->bi_write_hint;\r
88 +\r
89 +       bio_chain(prev, new);\r
90 +       bio_get(prev);          /* for xfs_destroy_ioend */\r
91 +       submit_bio(prev);\r
92 +       return new;\r
93  }\r
94  \r
95  /*\r
96 @@ -771,14 +770,14 @@ xfs_add_to_ioend(\r
97                 if (wpc->ioend)\r
98                         list_add(&wpc->ioend->io_list, iolist);\r
99                 wpc->ioend = xfs_alloc_ioend(inode, wpc->fork,\r
100 -                               wpc->imap.br_state, offset, bdev, sector);\r
101 +                               wpc->imap.br_state, offset, bdev, sector, wbc);\r
102         }\r
103  \r
104         if (!__bio_try_merge_page(wpc->ioend->io_bio, page, len, poff, true)) {\r
105                 if (iop)\r
106                         atomic_inc(&iop->write_count);\r
107                 if (bio_full(wpc->ioend->io_bio))\r
108 -                       xfs_chain_bio(wpc->ioend, wbc, bdev, sector);\r
109 +                       wpc->ioend->io_bio = xfs_chain_bio(wpc->ioend->io_bio);\r
110                 bio_add_page(wpc->ioend->io_bio, page, len, poff);\r
111         }\r
112  \r
113 -- \r
114 2.20.1\r
115 \r
116 \r
117 Link every newly allocated writeback bio to cgroup pointed to by the\r
118 writeback control structure, and charge every byte written back to it.\r
119 \r
120 Tested-by: Stefan Priebe - Profihost AG <s.priebe@profihost.ag>\r
121 Signed-off-by: Christoph Hellwig <hch@lst.de>\r
122 ---\r
123  fs/xfs/xfs_aops.c  | 4 +++-\r
124  fs/xfs/xfs_super.c | 2 ++\r
125  2 files changed, 5 insertions(+), 1 deletion(-)\r
126 \r
127 diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c\r
128 index 9cceb90e77c5..73c291aeae17 100644\r
129 --- a/fs/xfs/xfs_aops.c\r
130 +++ b/fs/xfs/xfs_aops.c\r
131 @@ -700,6 +700,7 @@ xfs_alloc_ioend(\r
132         bio->bi_iter.bi_sector = sector;\r
133         bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc);\r
134         bio->bi_write_hint = inode->i_write_hint;\r
135 +       wbc_init_bio(wbc, bio);\r
136  \r
137         ioend = container_of(bio, struct xfs_ioend, io_inline_bio);\r
138         INIT_LIST_HEAD(&ioend->io_list);\r
139 @@ -727,7 +728,7 @@ xfs_chain_bio(\r
140         struct bio *new;\r
141  \r
142         new = bio_alloc(GFP_NOFS, BIO_MAX_PAGES);\r
143 -       bio_copy_dev(new, prev);\r
144 +       bio_copy_dev(new, prev);/* also copies over blkcg information */\r
145         new->bi_iter.bi_sector = bio_end_sector(prev);\r
146         new->bi_opf = prev->bi_opf;\r
147         new->bi_write_hint = prev->bi_write_hint;\r
148 @@ -782,6 +783,7 @@ xfs_add_to_ioend(\r
149         }\r
150  \r
151         wpc->ioend->io_size += len;\r
152 +       wbc_account_io(wbc, page, len);\r
153  }\r
154  \r
155  STATIC void\r
156 diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c\r
157 index 594c119824cc..ee0df8f611ff 100644\r
158 --- a/fs/xfs/xfs_super.c\r
159 +++ b/fs/xfs/xfs_super.c\r
160 @@ -1685,6 +1685,8 @@ xfs_fs_fill_super(\r
161         sb->s_maxbytes = xfs_max_file_offset(sb->s_blocksize_bits);\r
162         sb->s_max_links = XFS_MAXLINK;\r
163         sb->s_time_gran = 1;\r
164 +       sb->s_iflags |= SB_I_CGROUPWB;\r
165 +\r
166         set_posix_acl_flag(sb);\r
167  \r
168         /* version 5 superblocks support inode version counters. */\r
169 -- \r
170 2.20.1\r
171 \r
This page took 0.045516 seconds and 3 git commands to generate.