]> git.proxmox.com Git - zfsonlinux.git/blob - zfs-patches/0045-Increment-zil_itx_needcopy_bytes-properly.patch
revert potentially buggy zap_add change
[zfsonlinux.git] / zfs-patches / 0045-Increment-zil_itx_needcopy_bytes-properly.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: chrisrd <chris@onthe.net.au>
3 Date: Sat, 3 Mar 2018 05:01:53 +1100
4 Subject: [PATCH] Increment zil_itx_needcopy_bytes properly
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 In zil_lwb_commit() with TX_WRITE, we copy the log write record (lrw)
10 into the log write block (lwb) and send it off using zil_lwb_add_txg().
11 If we also have WR_NEED_COPY, we additionally copy the lwr's data into
12 the lwb to be sent off. If the lwr + data doesn't fit into the lwb, we
13 send the lrw and as much data as will fit (dnow bytes), then go back
14 and do the same with the remaining data.
15
16 Each time through this loop we're sending dnow data bytes. I.e.
17 zil_itx_needcopy_bytes should be incremented by dnow.
18
19 Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
20 Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
21 Signed-off-by: Chris Dunlop <chris@onthe.net.au>
22 Closes #6988
23 Closes #7176
24 (cherry picked from commit 792f88131c647a70440c709c78d43210db6c6534)
25 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
26 ---
27 module/zfs/zil.c | 3 +--
28 1 file changed, 1 insertion(+), 2 deletions(-)
29
30 diff --git a/module/zfs/zil.c b/module/zfs/zil.c
31 index 4d714cefc..645b1d4d8 100644
32 --- a/module/zfs/zil.c
33 +++ b/module/zfs/zil.c
34 @@ -1167,8 +1167,7 @@ cont:
35 lrw->lr_offset += dnow;
36 lrw->lr_length -= dnow;
37 ZIL_STAT_BUMP(zil_itx_needcopy_count);
38 - ZIL_STAT_INCR(zil_itx_needcopy_bytes,
39 - lrw->lr_length);
40 + ZIL_STAT_INCR(zil_itx_needcopy_bytes, dnow);
41 } else {
42 ASSERT(itx->itx_wr_state == WR_INDIRECT);
43 dbuf = NULL;
44 --
45 2.14.2
46