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