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
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
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.
16 Signed-off-by: Christoph Hellwig <hch@lst.de>
18 fs/xfs/xfs_aops.c | 35 +++++++++++++++++------------------
19 1 file changed, 17 insertions(+), 18 deletions(-)
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(
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);
32 * If we are failing the IO now, just mark the ioend with an
33 @@ -679,7 +678,6 @@ xfs_submit_ioend(
37 - ioend->io_bio->bi_write_hint = ioend->io_inode->i_write_hint;
38 submit_bio(ioend->io_bio);
41 @@ -691,7 +689,8 @@ xfs_alloc_ioend(
44 struct block_device *bdev,
47 + struct writeback_control *wbc)
49 struct xfs_ioend *ioend;
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;
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().
67 - struct xfs_ioend *ioend,
68 - struct writeback_control *wbc,
69 - struct block_device *bdev,
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;
89 + bio_chain(prev, new);
90 + bio_get(prev); /* for xfs_destroy_ioend */
96 @@ -772,7 +772,7 @@ xfs_add_to_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);
104 merged = __bio_try_merge_page(wpc->ioend->io_bio, page, len, poff,
105 @@ -783,7 +783,7 @@ xfs_add_to_ioend(
108 if (bio_full(wpc->ioend->io_bio))
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);
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.
121 Tested-by: Stefan Priebe - Profihost AG <s.priebe@profihost.ag>
122 Signed-off-by: Christoph Hellwig <hch@lst.de>
124 fs/xfs/xfs_aops.c | 4 +++-
125 fs/xfs/xfs_super.c | 2 ++
126 2 files changed, 5 insertions(+), 1 deletion(-)
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);
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(
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(
152 wpc->ioend->io_size += len;
153 + wbc_account_io(wbc, page, len);
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;
165 + sb->s_iflags |= SB_I_CGROUPWB;
167 set_posix_acl_flag(sb);
169 /* version 5 superblocks support inode version counters. */