<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/fs/btrfs, branch linux-4.8.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>btrfs: make file clone aware of fatal signals</title>
<updated>2017-01-06T10:16:21+00:00</updated>
<author>
<name>Wang Xiaoguang</name>
<email>wangxg.fnst@cn.fujitsu.com</email>
</author>
<published>2016-10-13T01:23:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=fc1d3e5f3cd0a9f3bf173c19d321102e406f8d2f'/>
<id>fc1d3e5f3cd0a9f3bf173c19d321102e406f8d2f</id>
<content type='text'>
commit 69ae5e4459e43e56f03d0987e865fbac2b05af2a upstream.

Indeed this just make the behavior similar to xfs when process has
fatal signals pending, and it'll make fstests/generic/298 happy.

Signed-off-by: Wang Xiaoguang &lt;wangxg.fnst@cn.fujitsu.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 69ae5e4459e43e56f03d0987e865fbac2b05af2a upstream.

Indeed this just make the behavior similar to xfs when process has
fatal signals pending, and it'll make fstests/generic/298 happy.

Signed-off-by: Wang Xiaoguang &lt;wangxg.fnst@cn.fujitsu.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix incremental send failure caused by balance</title>
<updated>2017-01-06T10:16:21+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2016-09-19T09:57:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8c59356c12322d26e597156558b6361536c8ca86'/>
<id>8c59356c12322d26e597156558b6361536c8ca86</id>
<content type='text'>
commit d5e84fd8d0634d056248b67463b42f6c85896a19 upstream.

Commit 951555856b88 ("Btrfs: send, don't bug on inconsistent snapshots")
removed some BUG_ON() statements (replacing them with returning errors
to user space and logging error messages) when a snapshot is in an
inconsistent state due to failures to update a delayed inode item (ENOMEM
or ENOSPC) after adding/updating/deleting references, xattrs or file
extent items.

However there is a case, when no errors happen, where a file extent item
can be modified without having the corresponding inode item updated. This
case happens during balance under very specific timings, when relocation
is in the stage where it updates data pointers and a leaf that contains
file extent items is COWed. When that happens file extent items get their
disk_bytenr field updated to a new value that reflects the post relocation
logical address of the extent, without updating their respective inode
items (as there is nothing that needs to be updated on them). This is
performed at relocation.c:replace_file_extents() through
relocation.c:btrfs_reloc_cow_block().

So make an incremental send deal with this case and don't do any processing
for a file extent item that got its disk_bytenr field updated by relocation,
since the extent's data is the same as the one pointed by the file extent
item in the parent snapshot.

After the recent commit mentioned above this case resulted in EIO errors
returned to user space (and an error message logged to dmesg/syslog) when
doing an incremental send, while before it, it resulted in hitting a
BUG_ON leading to the following trace:

[  952.206705] ------------[ cut here ]------------
[  952.206714] kernel BUG at ../fs/btrfs/send.c:5653!
[  952.206719] Internal error: Oops - BUG: 0 [#1] SMP
[  952.209854] Modules linked in: st dm_mod nls_utf8 isofs fuse nf_log_ipv6 xt_pkttype xt_physdev br_netfilter nf_log_ipv4 nf_log_common xt_LOG xt_limit ebtable_filter ebtables af_packet bridge stp llc ip6t_REJECT xt_tcpudp nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw ipt_REJECT iptable_raw xt_CT iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4 nf_defrag_ipv4 ip_tables xt_conntrack nf_conntrack ip6table_filter ip6_tables x_tables xfs libcrc32c nls_iso8859_1 nls_cp437 vfat fat joydev aes_ce_blk ablk_helper cryptd snd_intel8x0 aes_ce_cipher snd_ac97_codec ac97_bus snd_pcm ghash_ce sha2_ce sha1_ce snd_timer snd virtio_net soundcore btrfs xor sr_mod cdrom hid_generic usbhid raid6_pq virtio_blk virtio_scsi bochs_drm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm virtio_mmio xhci_pci xhci_hcd usbcore usb_common virtio_pci virtio_ring virtio drm sg efivarfs
[  952.228333] Supported: Yes
[  952.228908] CPU: 0 PID: 12779 Comm: snapperd Not tainted 4.4.14-50-default #1
[  952.230329] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
[  952.231683] task: ffff800058e94100 ti: ffff8000d866c000 task.ti: ffff8000d866c000
[  952.233279] PC is at changed_cb+0x9f4/0xa48 [btrfs]
[  952.234375] LR is at changed_cb+0x58/0xa48 [btrfs]
[  952.236552] pc : [&lt;ffff7ffffc39de7c&gt;] lr : [&lt;ffff7ffffc39d4e0&gt;] pstate: 80000145
[  952.238049] sp : ffff8000d866fa20
[  952.238732] x29: ffff8000d866fa20 x28: 0000000000000019
[  952.239840] x27: 00000000000028d5 x26: 00000000000024a2
[  952.241008] x25: 0000000000000002 x24: ffff8000e66e92f0
[  952.242131] x23: ffff8000b8c76800 x22: ffff800092879140
[  952.243238] x21: 0000000000000002 x20: ffff8000d866fb78
[  952.244348] x19: ffff8000b8f8c200 x18: 0000000000002710
[  952.245607] x17: 0000ffff90d42480 x16: ffff800000237dc0
[  952.246719] x15: 0000ffff90de7510 x14: ab000c000a2faf08
[  952.247835] x13: 0000000000577c2b x12: ab000c000b696665
[  952.248981] x11: 2e65726f632f6966 x10: 652d34366d72612f
[  952.250101] x9 : 32627572672f746f x8 : ab000c00092f1671
[  952.251352] x7 : 8000000000577c2b x6 : ffff800053eadf45
[  952.252468] x5 : 0000000000000000 x4 : ffff80005e169494
[  952.253582] x3 : 0000000000000004 x2 : ffff8000d866fb78
[  952.254695] x1 : 000000000003e2a3 x0 : 000000000003e2a4
[  952.255803]
[  952.256150] Process snapperd (pid: 12779, stack limit = 0xffff8000d866c020)
[  952.257516] Stack: (0xffff8000d866fa20 to 0xffff8000d8670000)
[  952.258654] fa20: ffff8000d866fae0 ffff7ffffc308fc0 ffff800092879140 ffff8000e66e92f0
[  952.260219] fa40: 0000000000000035 ffff800055de6000 ffff8000b8c76800 ffff8000d866fb78
[  952.261745] fa60: 0000000000000002 00000000000024a2 00000000000028d5 0000000000000019
[  952.263269] fa80: ffff8000d866fae0 ffff7ffffc3090f0 ffff8000d866fae0 ffff7ffffc309128
[  952.264797] faa0: ffff800092879140 ffff8000e66e92f0 0000000000000035 ffff800055de6000
[  952.268261] fac0: ffff8000b8c76800 ffff8000d866fb78 0000000000000002 0000000000001000
[  952.269822] fae0: ffff8000d866fbc0 ffff7ffffc39ecfc ffff8000b8f8c200 ffff8000b8f8c368
[  952.271368] fb00: ffff8000b8f8c378 ffff800055de6000 0000000000000001 ffff8000ecb17500
[  952.272893] fb20: ffff8000b8c76800 ffff800092879140 ffff800062b6d000 ffff80007a9e2470
[  952.274420] fb40: ffff8000b8f8c208 0000000005784000 ffff8000580a8000 ffff8000b8f8c200
[  952.276088] fb60: ffff7ffffc39d488 00000002b8f8c368 0000000000000000 000000000003e2a4
[  952.280275] fb80: 000000000000006c ffff7ffffc39ec00 000000000003e2a4 000000000000006c
[  952.283219] fba0: ffff8000b8f8c300 0000000000000100 0000000000000001 ffff8000ecb17500
[  952.286166] fbc0: ffff8000d866fcd0 ffff7ffffc3643c0 ffff8000f8842700 0000ffff8ffe9278
[  952.289136] fbe0: 0000000040489426 ffff800055de6000 0000ffff8ffe9278 0000000040489426
[  952.292083] fc00: 000000000000011d 000000000000001d ffff80007a9e4598 ffff80007a9e43e8
[  952.294959] fc20: ffff8000b8c7693f 0000000000003b24 0000000000000019 ffff8000b8f8c218
[  952.301161] fc40: 00000001d866fc70 ffff8000b8c76800 0000000000000128 ffffffffffffff84
[  952.305749] fc60: ffff800058e941ff 0000000000003a58 ffff8000d866fcb0 ffff8000000f7390
[  952.308875] fc80: 000000000000012a 0000000000010290 ffff8000d866fc00 000000000000007b
[  952.311915] fca0: 0000000000010290 ffff800046c1b100 74732d7366727462 000001006d616572
[  952.314937] fcc0: ffff8000fffc4100 cb88537fdc8ba60e ffff8000d866fe10 ffff8000002499e8
[  952.318008] fce0: 0000000040489426 ffff8000f8842700 0000ffff8ffe9278 ffff80007a9e4598
[  952.321321] fd00: 0000ffff8ffe9278 0000000040489426 000000000000011d 000000000000001d
[  952.324280] fd20: ffff80000072c000 ffff8000d866c000 ffff8000d866fda0 ffff8000000e997c
[  952.327156] fd40: ffff8000fffc4180 00000000000031ed ffff8000fffc4180 ffff800046c1b7d4
[  952.329895] fd60: 0000000000000140 0000ffff907ea170 000000000000011d 00000000000000dc
[  952.334641] fd80: ffff80000072c000 ffff8000d866c000 0000000000000000 0000000000000002
[  952.338002] fda0: ffff8000d866fdd0 ffff8000000ebacc ffff800046c1b080 ffff800046c1b7d4
[  952.340724] fdc0: ffff8000d866fdf0 ffff8000000db67c 0000000000000040 ffff800000e69198
[  952.343415] fde0: 0000ffff8ffea790 00000000000031ed ffff8000d866fe20 ffff800000254000
[  952.346101] fe00: 000000000000001d 0000000000000004 ffff8000d866fe90 ffff800000249d3c
[  952.348980] fe20: ffff8000f8842700 0000000000000000 ffff8000f8842701 0000000000000008
[  952.351696] fe40: ffff8000d866fe70 0000000000000008 ffff8000d866fe90 ffff800000249cf8
[  952.354387] fe60: ffff8000f8842700 0000ffff8ffe9170 ffff8000f8842701 0000000000000008
[  952.357083] fe80: 0000ffff8ffe9278 ffff80008ff85500 0000ffff8ffe90c0 ffff800000085c84
[  952.359800] fea0: 0000000000000000 0000ffff8ffe9170 ffffffffffffffff 0000ffff90d473bc
[  952.365351] fec0: 0000000000000000 0000000000000015 0000000000000008 0000000040489426
[  952.369550] fee0: 0000ffff8ffe9278 0000ffff907ea790 0000ffff907ea170 0000ffff907ea790
[  952.372416] ff00: 0000ffff907ea170 0000000000000000 000000000000001d 0000000000000004
[  952.375223] ff20: 0000ffff90a32220 00000000003d0f00 0000ffff907ea0a0 0000ffff8ffe8f30
[  952.378099] ff40: 0000ffff9100f554 0000ffff91147000 0000ffff91117bc0 0000ffff90d473b0
[  952.381115] ff60: 0000ffff9100f620 0000ffff880069b0 0000ffff8ffe9170 0000ffff8ffe91a0
[  952.384003] ff80: 0000ffff8ffe9160 0000ffff8ffe9140 0000ffff88006990 0000ffff8ffe9278
[  952.386860] ffa0: 0000ffff88008a60 0000ffff8ffe9480 0000ffff88014ca0 0000ffff8ffe90c0
[  952.389654] ffc0: 0000ffff910be8e8 0000ffff8ffe90c0 0000ffff90d473bc 0000000000000000
[  952.410986] ffe0: 0000000000000008 000000000000001d 6e2079747265706f 72616d223d656d61
[  952.415497] Call trace:
[  952.417403] [&lt;ffff7ffffc39de7c&gt;] changed_cb+0x9f4/0xa48 [btrfs]
[  952.420023] [&lt;ffff7ffffc308fc0&gt;] btrfs_compare_trees+0x500/0x6b0 [btrfs]
[  952.422759] [&lt;ffff7ffffc39ecfc&gt;] btrfs_ioctl_send+0xb4c/0xe10 [btrfs]
[  952.425601] [&lt;ffff7ffffc3643c0&gt;] btrfs_ioctl+0x374/0x29a4 [btrfs]
[  952.428031] [&lt;ffff8000002499e8&gt;] do_vfs_ioctl+0x33c/0x600
[  952.430360] [&lt;ffff800000249d3c&gt;] SyS_ioctl+0x90/0xa4
[  952.432552] [&lt;ffff800000085c84&gt;] el0_svc_naked+0x38/0x3c
[  952.434803] Code: 2a1503e0 17fffdac b9404282 17ffff28 (d4210000)
[  952.437457] ---[ end trace 9afd7090c466cf15 ]---

Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d5e84fd8d0634d056248b67463b42f6c85896a19 upstream.

Commit 951555856b88 ("Btrfs: send, don't bug on inconsistent snapshots")
removed some BUG_ON() statements (replacing them with returning errors
to user space and logging error messages) when a snapshot is in an
inconsistent state due to failures to update a delayed inode item (ENOMEM
or ENOSPC) after adding/updating/deleting references, xattrs or file
extent items.

However there is a case, when no errors happen, where a file extent item
can be modified without having the corresponding inode item updated. This
case happens during balance under very specific timings, when relocation
is in the stage where it updates data pointers and a leaf that contains
file extent items is COWed. When that happens file extent items get their
disk_bytenr field updated to a new value that reflects the post relocation
logical address of the extent, without updating their respective inode
items (as there is nothing that needs to be updated on them). This is
performed at relocation.c:replace_file_extents() through
relocation.c:btrfs_reloc_cow_block().

So make an incremental send deal with this case and don't do any processing
for a file extent item that got its disk_bytenr field updated by relocation,
since the extent's data is the same as the one pointed by the file extent
item in the parent snapshot.

After the recent commit mentioned above this case resulted in EIO errors
returned to user space (and an error message logged to dmesg/syslog) when
doing an incremental send, while before it, it resulted in hitting a
BUG_ON leading to the following trace:

[  952.206705] ------------[ cut here ]------------
[  952.206714] kernel BUG at ../fs/btrfs/send.c:5653!
[  952.206719] Internal error: Oops - BUG: 0 [#1] SMP
[  952.209854] Modules linked in: st dm_mod nls_utf8 isofs fuse nf_log_ipv6 xt_pkttype xt_physdev br_netfilter nf_log_ipv4 nf_log_common xt_LOG xt_limit ebtable_filter ebtables af_packet bridge stp llc ip6t_REJECT xt_tcpudp nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw ipt_REJECT iptable_raw xt_CT iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4 nf_defrag_ipv4 ip_tables xt_conntrack nf_conntrack ip6table_filter ip6_tables x_tables xfs libcrc32c nls_iso8859_1 nls_cp437 vfat fat joydev aes_ce_blk ablk_helper cryptd snd_intel8x0 aes_ce_cipher snd_ac97_codec ac97_bus snd_pcm ghash_ce sha2_ce sha1_ce snd_timer snd virtio_net soundcore btrfs xor sr_mod cdrom hid_generic usbhid raid6_pq virtio_blk virtio_scsi bochs_drm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm virtio_mmio xhci_pci xhci_hcd usbcore usb_common virtio_pci virtio_ring virtio drm sg efivarfs
[  952.228333] Supported: Yes
[  952.228908] CPU: 0 PID: 12779 Comm: snapperd Not tainted 4.4.14-50-default #1
[  952.230329] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
[  952.231683] task: ffff800058e94100 ti: ffff8000d866c000 task.ti: ffff8000d866c000
[  952.233279] PC is at changed_cb+0x9f4/0xa48 [btrfs]
[  952.234375] LR is at changed_cb+0x58/0xa48 [btrfs]
[  952.236552] pc : [&lt;ffff7ffffc39de7c&gt;] lr : [&lt;ffff7ffffc39d4e0&gt;] pstate: 80000145
[  952.238049] sp : ffff8000d866fa20
[  952.238732] x29: ffff8000d866fa20 x28: 0000000000000019
[  952.239840] x27: 00000000000028d5 x26: 00000000000024a2
[  952.241008] x25: 0000000000000002 x24: ffff8000e66e92f0
[  952.242131] x23: ffff8000b8c76800 x22: ffff800092879140
[  952.243238] x21: 0000000000000002 x20: ffff8000d866fb78
[  952.244348] x19: ffff8000b8f8c200 x18: 0000000000002710
[  952.245607] x17: 0000ffff90d42480 x16: ffff800000237dc0
[  952.246719] x15: 0000ffff90de7510 x14: ab000c000a2faf08
[  952.247835] x13: 0000000000577c2b x12: ab000c000b696665
[  952.248981] x11: 2e65726f632f6966 x10: 652d34366d72612f
[  952.250101] x9 : 32627572672f746f x8 : ab000c00092f1671
[  952.251352] x7 : 8000000000577c2b x6 : ffff800053eadf45
[  952.252468] x5 : 0000000000000000 x4 : ffff80005e169494
[  952.253582] x3 : 0000000000000004 x2 : ffff8000d866fb78
[  952.254695] x1 : 000000000003e2a3 x0 : 000000000003e2a4
[  952.255803]
[  952.256150] Process snapperd (pid: 12779, stack limit = 0xffff8000d866c020)
[  952.257516] Stack: (0xffff8000d866fa20 to 0xffff8000d8670000)
[  952.258654] fa20: ffff8000d866fae0 ffff7ffffc308fc0 ffff800092879140 ffff8000e66e92f0
[  952.260219] fa40: 0000000000000035 ffff800055de6000 ffff8000b8c76800 ffff8000d866fb78
[  952.261745] fa60: 0000000000000002 00000000000024a2 00000000000028d5 0000000000000019
[  952.263269] fa80: ffff8000d866fae0 ffff7ffffc3090f0 ffff8000d866fae0 ffff7ffffc309128
[  952.264797] faa0: ffff800092879140 ffff8000e66e92f0 0000000000000035 ffff800055de6000
[  952.268261] fac0: ffff8000b8c76800 ffff8000d866fb78 0000000000000002 0000000000001000
[  952.269822] fae0: ffff8000d866fbc0 ffff7ffffc39ecfc ffff8000b8f8c200 ffff8000b8f8c368
[  952.271368] fb00: ffff8000b8f8c378 ffff800055de6000 0000000000000001 ffff8000ecb17500
[  952.272893] fb20: ffff8000b8c76800 ffff800092879140 ffff800062b6d000 ffff80007a9e2470
[  952.274420] fb40: ffff8000b8f8c208 0000000005784000 ffff8000580a8000 ffff8000b8f8c200
[  952.276088] fb60: ffff7ffffc39d488 00000002b8f8c368 0000000000000000 000000000003e2a4
[  952.280275] fb80: 000000000000006c ffff7ffffc39ec00 000000000003e2a4 000000000000006c
[  952.283219] fba0: ffff8000b8f8c300 0000000000000100 0000000000000001 ffff8000ecb17500
[  952.286166] fbc0: ffff8000d866fcd0 ffff7ffffc3643c0 ffff8000f8842700 0000ffff8ffe9278
[  952.289136] fbe0: 0000000040489426 ffff800055de6000 0000ffff8ffe9278 0000000040489426
[  952.292083] fc00: 000000000000011d 000000000000001d ffff80007a9e4598 ffff80007a9e43e8
[  952.294959] fc20: ffff8000b8c7693f 0000000000003b24 0000000000000019 ffff8000b8f8c218
[  952.301161] fc40: 00000001d866fc70 ffff8000b8c76800 0000000000000128 ffffffffffffff84
[  952.305749] fc60: ffff800058e941ff 0000000000003a58 ffff8000d866fcb0 ffff8000000f7390
[  952.308875] fc80: 000000000000012a 0000000000010290 ffff8000d866fc00 000000000000007b
[  952.311915] fca0: 0000000000010290 ffff800046c1b100 74732d7366727462 000001006d616572
[  952.314937] fcc0: ffff8000fffc4100 cb88537fdc8ba60e ffff8000d866fe10 ffff8000002499e8
[  952.318008] fce0: 0000000040489426 ffff8000f8842700 0000ffff8ffe9278 ffff80007a9e4598
[  952.321321] fd00: 0000ffff8ffe9278 0000000040489426 000000000000011d 000000000000001d
[  952.324280] fd20: ffff80000072c000 ffff8000d866c000 ffff8000d866fda0 ffff8000000e997c
[  952.327156] fd40: ffff8000fffc4180 00000000000031ed ffff8000fffc4180 ffff800046c1b7d4
[  952.329895] fd60: 0000000000000140 0000ffff907ea170 000000000000011d 00000000000000dc
[  952.334641] fd80: ffff80000072c000 ffff8000d866c000 0000000000000000 0000000000000002
[  952.338002] fda0: ffff8000d866fdd0 ffff8000000ebacc ffff800046c1b080 ffff800046c1b7d4
[  952.340724] fdc0: ffff8000d866fdf0 ffff8000000db67c 0000000000000040 ffff800000e69198
[  952.343415] fde0: 0000ffff8ffea790 00000000000031ed ffff8000d866fe20 ffff800000254000
[  952.346101] fe00: 000000000000001d 0000000000000004 ffff8000d866fe90 ffff800000249d3c
[  952.348980] fe20: ffff8000f8842700 0000000000000000 ffff8000f8842701 0000000000000008
[  952.351696] fe40: ffff8000d866fe70 0000000000000008 ffff8000d866fe90 ffff800000249cf8
[  952.354387] fe60: ffff8000f8842700 0000ffff8ffe9170 ffff8000f8842701 0000000000000008
[  952.357083] fe80: 0000ffff8ffe9278 ffff80008ff85500 0000ffff8ffe90c0 ffff800000085c84
[  952.359800] fea0: 0000000000000000 0000ffff8ffe9170 ffffffffffffffff 0000ffff90d473bc
[  952.365351] fec0: 0000000000000000 0000000000000015 0000000000000008 0000000040489426
[  952.369550] fee0: 0000ffff8ffe9278 0000ffff907ea790 0000ffff907ea170 0000ffff907ea790
[  952.372416] ff00: 0000ffff907ea170 0000000000000000 000000000000001d 0000000000000004
[  952.375223] ff20: 0000ffff90a32220 00000000003d0f00 0000ffff907ea0a0 0000ffff8ffe8f30
[  952.378099] ff40: 0000ffff9100f554 0000ffff91147000 0000ffff91117bc0 0000ffff90d473b0
[  952.381115] ff60: 0000ffff9100f620 0000ffff880069b0 0000ffff8ffe9170 0000ffff8ffe91a0
[  952.384003] ff80: 0000ffff8ffe9160 0000ffff8ffe9140 0000ffff88006990 0000ffff8ffe9278
[  952.386860] ffa0: 0000ffff88008a60 0000ffff8ffe9480 0000ffff88014ca0 0000ffff8ffe90c0
[  952.389654] ffc0: 0000ffff910be8e8 0000ffff8ffe90c0 0000ffff90d473bc 0000000000000000
[  952.410986] ffe0: 0000000000000008 000000000000001d 6e2079747265706f 72616d223d656d61
[  952.415497] Call trace:
[  952.417403] [&lt;ffff7ffffc39de7c&gt;] changed_cb+0x9f4/0xa48 [btrfs]
[  952.420023] [&lt;ffff7ffffc308fc0&gt;] btrfs_compare_trees+0x500/0x6b0 [btrfs]
[  952.422759] [&lt;ffff7ffffc39ecfc&gt;] btrfs_ioctl_send+0xb4c/0xe10 [btrfs]
[  952.425601] [&lt;ffff7ffffc3643c0&gt;] btrfs_ioctl+0x374/0x29a4 [btrfs]
[  952.428031] [&lt;ffff8000002499e8&gt;] do_vfs_ioctl+0x33c/0x600
[  952.430360] [&lt;ffff800000249d3c&gt;] SyS_ioctl+0x90/0xa4
[  952.432552] [&lt;ffff800000085c84&gt;] el0_svc_naked+0x38/0x3c
[  952.434803] Code: 2a1503e0 17fffdac b9404282 17ffff28 (d4210000)
[  952.437457] ---[ end trace 9afd7090c466cf15 ]---

Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: don't BUG() during drop snapshot</title>
<updated>2017-01-06T10:16:20+00:00</updated>
<author>
<name>Josef Bacik</name>
<email>jbacik@fb.com</email>
</author>
<published>2016-09-23T11:23:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=02fffa116bda3353e41954e48ca5253f970b6c4d'/>
<id>02fffa116bda3353e41954e48ca5253f970b6c4d</id>
<content type='text'>
commit 4867268c57ff709a7b6b86ae6f6537d846d1443a upstream.

Really there's lots of things that can go wrong here, kill all the
BUG_ON()'s and replace the logic ones with ASSERT()'s and return EIO
instead.

Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
[ switched to btrfs_err, errors go to common label ]
Reviewed-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4867268c57ff709a7b6b86ae6f6537d846d1443a upstream.

Really there's lots of things that can go wrong here, kill all the
BUG_ON()'s and replace the logic ones with ASSERT()'s and return EIO
instead.

Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
[ switched to btrfs_err, errors go to common label ]
Reviewed-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: fix a possible umount deadlock</title>
<updated>2017-01-06T10:16:20+00:00</updated>
<author>
<name>Anand Jain</name>
<email>anand.jain@oracle.com</email>
</author>
<published>2016-09-22T04:56:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0f2e022db23739f537ca2abc66aae1e5ba9205e8'/>
<id>0f2e022db23739f537ca2abc66aae1e5ba9205e8</id>
<content type='text'>
commit 0ccd05285e7f5a8e297e1d6dfc41e7c65757d6fa upstream.

btrfs_show_devname() is using the device_list_mutex, sometimes
a call to blkdev_put() leads vfs calling into this func. So
call blkdev_put() outside of device_list_mutex, as of now.

[  983.284212] ======================================================
[  983.290401] [ INFO: possible circular locking dependency detected ]
[  983.296677] 4.8.0-rc5-ceph-00023-g1b39cec2 #1 Not tainted
[  983.302081] -------------------------------------------------------
[  983.308357] umount/21720 is trying to acquire lock:
[  983.313243]  (&amp;bdev-&gt;bd_mutex){+.+.+.}, at: [&lt;ffffffff9128ec51&gt;] blkdev_put+0x31/0x150
[  983.321264]
[  983.321264] but task is already holding lock:
[  983.327101]  (&amp;fs_devs-&gt;device_list_mutex){+.+...}, at: [&lt;ffffffffc033d6f6&gt;] __btrfs_close_devices+0x46/0x200 [btrfs]
[  983.337839]
[  983.337839] which lock already depends on the new lock.
[  983.337839]
[  983.346024]
[  983.346024] the existing dependency chain (in reverse order) is:
[  983.353512]
-&gt; #4 (&amp;fs_devs-&gt;device_list_mutex){+.+...}:
[  983.359096]        [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.365143]        [&lt;ffffffff91823125&gt;] mutex_lock_nested+0x65/0x350
[  983.371521]        [&lt;ffffffffc02d8116&gt;] btrfs_show_devname+0x36/0x1f0 [btrfs]
[  983.378710]        [&lt;ffffffff9129523e&gt;] show_vfsmnt+0x4e/0x150
[  983.384593]        [&lt;ffffffff9126ffc7&gt;] m_show+0x17/0x20
[  983.389957]        [&lt;ffffffff91276405&gt;] seq_read+0x2b5/0x3b0
[  983.395669]        [&lt;ffffffff9124c808&gt;] __vfs_read+0x28/0x100
[  983.401464]        [&lt;ffffffff9124eb3b&gt;] vfs_read+0xab/0x150
[  983.407080]        [&lt;ffffffff9124ec32&gt;] SyS_read+0x52/0xb0
[  983.412609]        [&lt;ffffffff91825fc0&gt;] entry_SYSCALL_64_fastpath+0x23/0xc1
[  983.419617]
-&gt; #3 (namespace_sem){++++++}:
[  983.424024]        [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.430074]        [&lt;ffffffff918239e9&gt;] down_write+0x49/0x80
[  983.435785]        [&lt;ffffffff91272457&gt;] lock_mount+0x67/0x1c0
[  983.441582]        [&lt;ffffffff91272ab2&gt;] do_add_mount+0x32/0xf0
[  983.447458]        [&lt;ffffffff9127363a&gt;] finish_automount+0x5a/0xc0
[  983.453682]        [&lt;ffffffff91259513&gt;] follow_managed+0x1b3/0x2a0
[  983.459912]        [&lt;ffffffff9125b750&gt;] lookup_fast+0x300/0x350
[  983.465875]        [&lt;ffffffff9125d6e7&gt;] path_openat+0x3a7/0xaa0
[  983.471846]        [&lt;ffffffff9125ef75&gt;] do_filp_open+0x85/0xe0
[  983.477731]        [&lt;ffffffff9124c41c&gt;] do_sys_open+0x14c/0x1f0
[  983.483702]        [&lt;ffffffff9124c4de&gt;] SyS_open+0x1e/0x20
[  983.489240]        [&lt;ffffffff91825fc0&gt;] entry_SYSCALL_64_fastpath+0x23/0xc1
[  983.496254]
-&gt; #2 (&amp;sb-&gt;s_type-&gt;i_mutex_key#3){+.+.+.}:
[  983.501798]        [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.507855]        [&lt;ffffffff918239e9&gt;] down_write+0x49/0x80
[  983.513558]        [&lt;ffffffff91366237&gt;] start_creating+0x87/0x100
[  983.519703]        [&lt;ffffffff91366647&gt;] debugfs_create_dir+0x17/0x100
[  983.526195]        [&lt;ffffffff911df153&gt;] bdi_register+0x93/0x210
[  983.532165]        [&lt;ffffffff911df313&gt;] bdi_register_owner+0x43/0x70
[  983.538570]        [&lt;ffffffff914080fb&gt;] device_add_disk+0x1fb/0x450
[  983.544888]        [&lt;ffffffff91580226&gt;] loop_add+0x1e6/0x290
[  983.550596]        [&lt;ffffffff91fec358&gt;] loop_init+0x10b/0x14f
[  983.556394]        [&lt;ffffffff91002207&gt;] do_one_initcall+0xa7/0x180
[  983.562618]        [&lt;ffffffff91f932e0&gt;] kernel_init_freeable+0x1cc/0x266
[  983.569370]        [&lt;ffffffff918174be&gt;] kernel_init+0xe/0x100
[  983.575166]        [&lt;ffffffff9182620f&gt;] ret_from_fork+0x1f/0x40
[  983.581131]
-&gt; #1 (loop_index_mutex){+.+.+.}:
[  983.585801]        [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.591858]        [&lt;ffffffff91823125&gt;] mutex_lock_nested+0x65/0x350
[  983.598256]        [&lt;ffffffff9157ed3f&gt;] lo_open+0x1f/0x60
[  983.603704]        [&lt;ffffffff9128eec3&gt;] __blkdev_get+0x123/0x400
[  983.609757]        [&lt;ffffffff9128f4ea&gt;] blkdev_get+0x34a/0x350
[  983.615639]        [&lt;ffffffff9128f554&gt;] blkdev_open+0x64/0x80
[  983.621428]        [&lt;ffffffff9124aff6&gt;] do_dentry_open+0x1c6/0x2d0
[  983.627651]        [&lt;ffffffff9124c029&gt;] vfs_open+0x69/0x80
[  983.633181]        [&lt;ffffffff9125db74&gt;] path_openat+0x834/0xaa0
[  983.639152]        [&lt;ffffffff9125ef75&gt;] do_filp_open+0x85/0xe0
[  983.645035]        [&lt;ffffffff9124c41c&gt;] do_sys_open+0x14c/0x1f0
[  983.650999]        [&lt;ffffffff9124c4de&gt;] SyS_open+0x1e/0x20
[  983.656535]        [&lt;ffffffff91825fc0&gt;] entry_SYSCALL_64_fastpath+0x23/0xc1
[  983.663541]
-&gt; #0 (&amp;bdev-&gt;bd_mutex){+.+.+.}:
[  983.668107]        [&lt;ffffffff910def43&gt;] __lock_acquire+0x1003/0x17b0
[  983.674510]        [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.680561]        [&lt;ffffffff91823125&gt;] mutex_lock_nested+0x65/0x350
[  983.686967]        [&lt;ffffffff9128ec51&gt;] blkdev_put+0x31/0x150
[  983.692761]        [&lt;ffffffffc033481f&gt;] btrfs_close_bdev+0x4f/0x60 [btrfs]
[  983.699699]        [&lt;ffffffffc033d77b&gt;] __btrfs_close_devices+0xcb/0x200 [btrfs]
[  983.707178]        [&lt;ffffffffc033d8db&gt;] btrfs_close_devices+0x2b/0xa0 [btrfs]
[  983.714380]        [&lt;ffffffffc03081c5&gt;] close_ctree+0x265/0x340 [btrfs]
[  983.721061]        [&lt;ffffffffc02d7959&gt;] btrfs_put_super+0x19/0x20 [btrfs]
[  983.727908]        [&lt;ffffffff91250e2f&gt;] generic_shutdown_super+0x6f/0x100
[  983.734744]        [&lt;ffffffff91250f56&gt;] kill_anon_super+0x16/0x30
[  983.740888]        [&lt;ffffffffc02da97e&gt;] btrfs_kill_super+0x1e/0x130 [btrfs]
[  983.747909]        [&lt;ffffffff91250fe9&gt;] deactivate_locked_super+0x49/0x80
[  983.754745]        [&lt;ffffffff912515fd&gt;] deactivate_super+0x5d/0x70
[  983.760977]        [&lt;ffffffff91270a1c&gt;] cleanup_mnt+0x5c/0x80
[  983.766773]        [&lt;ffffffff91270a92&gt;] __cleanup_mnt+0x12/0x20
[  983.772738]        [&lt;ffffffff910aa2fe&gt;] task_work_run+0x7e/0xc0
[  983.778708]        [&lt;ffffffff91081b5a&gt;] exit_to_usermode_loop+0x7e/0xb4
[  983.785373]        [&lt;ffffffff910039eb&gt;] syscall_return_slowpath+0xbb/0xd0
[  983.792212]        [&lt;ffffffff9182605c&gt;] entry_SYSCALL_64_fastpath+0xbf/0xc1
[  983.799225]
[  983.799225] other info that might help us debug this:
[  983.799225]
[  983.807291] Chain exists of:
  &amp;bdev-&gt;bd_mutex --&gt; namespace_sem --&gt; &amp;fs_devs-&gt;device_list_mutex

[  983.816521]  Possible unsafe locking scenario:
[  983.816521]
[  983.822489]        CPU0                    CPU1
[  983.827043]        ----                    ----
[  983.831599]   lock(&amp;fs_devs-&gt;device_list_mutex);
[  983.836289]                                lock(namespace_sem);
[  983.842268]                                lock(&amp;fs_devs-&gt;device_list_mutex);
[  983.849478]   lock(&amp;bdev-&gt;bd_mutex);
[  983.853127]
[  983.853127]  *** DEADLOCK ***
[  983.853127]
[  983.859113] 3 locks held by umount/21720:
[  983.863145]  #0:  (&amp;type-&gt;s_umount_key#35){++++..}, at: [&lt;ffffffff912515f5&gt;] deactivate_super+0x55/0x70
[  983.872713]  #1:  (uuid_mutex){+.+.+.}, at: [&lt;ffffffffc033d8d3&gt;] btrfs_close_devices+0x23/0xa0 [btrfs]
[  983.882206]  #2:  (&amp;fs_devs-&gt;device_list_mutex){+.+...}, at: [&lt;ffffffffc033d6f6&gt;] __btrfs_close_devices+0x46/0x200 [btrfs]
[  983.893422]
[  983.893422] stack backtrace:
[  983.897824] CPU: 6 PID: 21720 Comm: umount Not tainted 4.8.0-rc5-ceph-00023-g1b39cec2 #1
[  983.905958] Hardware name: Supermicro SYS-5018R-WR/X10SRW-F, BIOS 1.0c 09/07/2015
[  983.913492]  0000000000000000 ffff8c8a53c17a38 ffffffff91429521 ffffffff9260f4f0
[  983.921018]  ffffffff92642760 ffff8c8a53c17a88 ffffffff911b2b04 0000000000000050
[  983.928542]  ffffffff9237d620 ffff8c8a5294aee0 ffff8c8a5294aeb8 ffff8c8a5294aee0
[  983.936072] Call Trace:
[  983.938545]  [&lt;ffffffff91429521&gt;] dump_stack+0x85/0xc4
[  983.943715]  [&lt;ffffffff911b2b04&gt;] print_circular_bug+0x1fb/0x20c
[  983.949748]  [&lt;ffffffff910def43&gt;] __lock_acquire+0x1003/0x17b0
[  983.955613]  [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.961123]  [&lt;ffffffff9128ec51&gt;] ? blkdev_put+0x31/0x150
[  983.966550]  [&lt;ffffffff91823125&gt;] mutex_lock_nested+0x65/0x350
[  983.972407]  [&lt;ffffffff9128ec51&gt;] ? blkdev_put+0x31/0x150
[  983.977832]  [&lt;ffffffff9128ec51&gt;] blkdev_put+0x31/0x150
[  983.983101]  [&lt;ffffffffc033481f&gt;] btrfs_close_bdev+0x4f/0x60 [btrfs]
[  983.989500]  [&lt;ffffffffc033d77b&gt;] __btrfs_close_devices+0xcb/0x200 [btrfs]
[  983.996415]  [&lt;ffffffffc033d8db&gt;] btrfs_close_devices+0x2b/0xa0 [btrfs]
[  984.003068]  [&lt;ffffffffc03081c5&gt;] close_ctree+0x265/0x340 [btrfs]
[  984.009189]  [&lt;ffffffff9126cc5e&gt;] ? evict_inodes+0x15e/0x170
[  984.014881]  [&lt;ffffffffc02d7959&gt;] btrfs_put_super+0x19/0x20 [btrfs]
[  984.021176]  [&lt;ffffffff91250e2f&gt;] generic_shutdown_super+0x6f/0x100
[  984.027476]  [&lt;ffffffff91250f56&gt;] kill_anon_super+0x16/0x30
[  984.033082]  [&lt;ffffffffc02da97e&gt;] btrfs_kill_super+0x1e/0x130 [btrfs]
[  984.039548]  [&lt;ffffffff91250fe9&gt;] deactivate_locked_super+0x49/0x80
[  984.045839]  [&lt;ffffffff912515fd&gt;] deactivate_super+0x5d/0x70
[  984.051525]  [&lt;ffffffff91270a1c&gt;] cleanup_mnt+0x5c/0x80
[  984.056774]  [&lt;ffffffff91270a92&gt;] __cleanup_mnt+0x12/0x20
[  984.062201]  [&lt;ffffffff910aa2fe&gt;] task_work_run+0x7e/0xc0
[  984.067625]  [&lt;ffffffff91081b5a&gt;] exit_to_usermode_loop+0x7e/0xb4
[  984.073747]  [&lt;ffffffff910039eb&gt;] syscall_return_slowpath+0xbb/0xd0
[  984.080038]  [&lt;ffffffff9182605c&gt;] entry_SYSCALL_64_fastpath+0xbf/0xc1

Reported-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0ccd05285e7f5a8e297e1d6dfc41e7c65757d6fa upstream.

btrfs_show_devname() is using the device_list_mutex, sometimes
a call to blkdev_put() leads vfs calling into this func. So
call blkdev_put() outside of device_list_mutex, as of now.

[  983.284212] ======================================================
[  983.290401] [ INFO: possible circular locking dependency detected ]
[  983.296677] 4.8.0-rc5-ceph-00023-g1b39cec2 #1 Not tainted
[  983.302081] -------------------------------------------------------
[  983.308357] umount/21720 is trying to acquire lock:
[  983.313243]  (&amp;bdev-&gt;bd_mutex){+.+.+.}, at: [&lt;ffffffff9128ec51&gt;] blkdev_put+0x31/0x150
[  983.321264]
[  983.321264] but task is already holding lock:
[  983.327101]  (&amp;fs_devs-&gt;device_list_mutex){+.+...}, at: [&lt;ffffffffc033d6f6&gt;] __btrfs_close_devices+0x46/0x200 [btrfs]
[  983.337839]
[  983.337839] which lock already depends on the new lock.
[  983.337839]
[  983.346024]
[  983.346024] the existing dependency chain (in reverse order) is:
[  983.353512]
-&gt; #4 (&amp;fs_devs-&gt;device_list_mutex){+.+...}:
[  983.359096]        [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.365143]        [&lt;ffffffff91823125&gt;] mutex_lock_nested+0x65/0x350
[  983.371521]        [&lt;ffffffffc02d8116&gt;] btrfs_show_devname+0x36/0x1f0 [btrfs]
[  983.378710]        [&lt;ffffffff9129523e&gt;] show_vfsmnt+0x4e/0x150
[  983.384593]        [&lt;ffffffff9126ffc7&gt;] m_show+0x17/0x20
[  983.389957]        [&lt;ffffffff91276405&gt;] seq_read+0x2b5/0x3b0
[  983.395669]        [&lt;ffffffff9124c808&gt;] __vfs_read+0x28/0x100
[  983.401464]        [&lt;ffffffff9124eb3b&gt;] vfs_read+0xab/0x150
[  983.407080]        [&lt;ffffffff9124ec32&gt;] SyS_read+0x52/0xb0
[  983.412609]        [&lt;ffffffff91825fc0&gt;] entry_SYSCALL_64_fastpath+0x23/0xc1
[  983.419617]
-&gt; #3 (namespace_sem){++++++}:
[  983.424024]        [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.430074]        [&lt;ffffffff918239e9&gt;] down_write+0x49/0x80
[  983.435785]        [&lt;ffffffff91272457&gt;] lock_mount+0x67/0x1c0
[  983.441582]        [&lt;ffffffff91272ab2&gt;] do_add_mount+0x32/0xf0
[  983.447458]        [&lt;ffffffff9127363a&gt;] finish_automount+0x5a/0xc0
[  983.453682]        [&lt;ffffffff91259513&gt;] follow_managed+0x1b3/0x2a0
[  983.459912]        [&lt;ffffffff9125b750&gt;] lookup_fast+0x300/0x350
[  983.465875]        [&lt;ffffffff9125d6e7&gt;] path_openat+0x3a7/0xaa0
[  983.471846]        [&lt;ffffffff9125ef75&gt;] do_filp_open+0x85/0xe0
[  983.477731]        [&lt;ffffffff9124c41c&gt;] do_sys_open+0x14c/0x1f0
[  983.483702]        [&lt;ffffffff9124c4de&gt;] SyS_open+0x1e/0x20
[  983.489240]        [&lt;ffffffff91825fc0&gt;] entry_SYSCALL_64_fastpath+0x23/0xc1
[  983.496254]
-&gt; #2 (&amp;sb-&gt;s_type-&gt;i_mutex_key#3){+.+.+.}:
[  983.501798]        [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.507855]        [&lt;ffffffff918239e9&gt;] down_write+0x49/0x80
[  983.513558]        [&lt;ffffffff91366237&gt;] start_creating+0x87/0x100
[  983.519703]        [&lt;ffffffff91366647&gt;] debugfs_create_dir+0x17/0x100
[  983.526195]        [&lt;ffffffff911df153&gt;] bdi_register+0x93/0x210
[  983.532165]        [&lt;ffffffff911df313&gt;] bdi_register_owner+0x43/0x70
[  983.538570]        [&lt;ffffffff914080fb&gt;] device_add_disk+0x1fb/0x450
[  983.544888]        [&lt;ffffffff91580226&gt;] loop_add+0x1e6/0x290
[  983.550596]        [&lt;ffffffff91fec358&gt;] loop_init+0x10b/0x14f
[  983.556394]        [&lt;ffffffff91002207&gt;] do_one_initcall+0xa7/0x180
[  983.562618]        [&lt;ffffffff91f932e0&gt;] kernel_init_freeable+0x1cc/0x266
[  983.569370]        [&lt;ffffffff918174be&gt;] kernel_init+0xe/0x100
[  983.575166]        [&lt;ffffffff9182620f&gt;] ret_from_fork+0x1f/0x40
[  983.581131]
-&gt; #1 (loop_index_mutex){+.+.+.}:
[  983.585801]        [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.591858]        [&lt;ffffffff91823125&gt;] mutex_lock_nested+0x65/0x350
[  983.598256]        [&lt;ffffffff9157ed3f&gt;] lo_open+0x1f/0x60
[  983.603704]        [&lt;ffffffff9128eec3&gt;] __blkdev_get+0x123/0x400
[  983.609757]        [&lt;ffffffff9128f4ea&gt;] blkdev_get+0x34a/0x350
[  983.615639]        [&lt;ffffffff9128f554&gt;] blkdev_open+0x64/0x80
[  983.621428]        [&lt;ffffffff9124aff6&gt;] do_dentry_open+0x1c6/0x2d0
[  983.627651]        [&lt;ffffffff9124c029&gt;] vfs_open+0x69/0x80
[  983.633181]        [&lt;ffffffff9125db74&gt;] path_openat+0x834/0xaa0
[  983.639152]        [&lt;ffffffff9125ef75&gt;] do_filp_open+0x85/0xe0
[  983.645035]        [&lt;ffffffff9124c41c&gt;] do_sys_open+0x14c/0x1f0
[  983.650999]        [&lt;ffffffff9124c4de&gt;] SyS_open+0x1e/0x20
[  983.656535]        [&lt;ffffffff91825fc0&gt;] entry_SYSCALL_64_fastpath+0x23/0xc1
[  983.663541]
-&gt; #0 (&amp;bdev-&gt;bd_mutex){+.+.+.}:
[  983.668107]        [&lt;ffffffff910def43&gt;] __lock_acquire+0x1003/0x17b0
[  983.674510]        [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.680561]        [&lt;ffffffff91823125&gt;] mutex_lock_nested+0x65/0x350
[  983.686967]        [&lt;ffffffff9128ec51&gt;] blkdev_put+0x31/0x150
[  983.692761]        [&lt;ffffffffc033481f&gt;] btrfs_close_bdev+0x4f/0x60 [btrfs]
[  983.699699]        [&lt;ffffffffc033d77b&gt;] __btrfs_close_devices+0xcb/0x200 [btrfs]
[  983.707178]        [&lt;ffffffffc033d8db&gt;] btrfs_close_devices+0x2b/0xa0 [btrfs]
[  983.714380]        [&lt;ffffffffc03081c5&gt;] close_ctree+0x265/0x340 [btrfs]
[  983.721061]        [&lt;ffffffffc02d7959&gt;] btrfs_put_super+0x19/0x20 [btrfs]
[  983.727908]        [&lt;ffffffff91250e2f&gt;] generic_shutdown_super+0x6f/0x100
[  983.734744]        [&lt;ffffffff91250f56&gt;] kill_anon_super+0x16/0x30
[  983.740888]        [&lt;ffffffffc02da97e&gt;] btrfs_kill_super+0x1e/0x130 [btrfs]
[  983.747909]        [&lt;ffffffff91250fe9&gt;] deactivate_locked_super+0x49/0x80
[  983.754745]        [&lt;ffffffff912515fd&gt;] deactivate_super+0x5d/0x70
[  983.760977]        [&lt;ffffffff91270a1c&gt;] cleanup_mnt+0x5c/0x80
[  983.766773]        [&lt;ffffffff91270a92&gt;] __cleanup_mnt+0x12/0x20
[  983.772738]        [&lt;ffffffff910aa2fe&gt;] task_work_run+0x7e/0xc0
[  983.778708]        [&lt;ffffffff91081b5a&gt;] exit_to_usermode_loop+0x7e/0xb4
[  983.785373]        [&lt;ffffffff910039eb&gt;] syscall_return_slowpath+0xbb/0xd0
[  983.792212]        [&lt;ffffffff9182605c&gt;] entry_SYSCALL_64_fastpath+0xbf/0xc1
[  983.799225]
[  983.799225] other info that might help us debug this:
[  983.799225]
[  983.807291] Chain exists of:
  &amp;bdev-&gt;bd_mutex --&gt; namespace_sem --&gt; &amp;fs_devs-&gt;device_list_mutex

[  983.816521]  Possible unsafe locking scenario:
[  983.816521]
[  983.822489]        CPU0                    CPU1
[  983.827043]        ----                    ----
[  983.831599]   lock(&amp;fs_devs-&gt;device_list_mutex);
[  983.836289]                                lock(namespace_sem);
[  983.842268]                                lock(&amp;fs_devs-&gt;device_list_mutex);
[  983.849478]   lock(&amp;bdev-&gt;bd_mutex);
[  983.853127]
[  983.853127]  *** DEADLOCK ***
[  983.853127]
[  983.859113] 3 locks held by umount/21720:
[  983.863145]  #0:  (&amp;type-&gt;s_umount_key#35){++++..}, at: [&lt;ffffffff912515f5&gt;] deactivate_super+0x55/0x70
[  983.872713]  #1:  (uuid_mutex){+.+.+.}, at: [&lt;ffffffffc033d8d3&gt;] btrfs_close_devices+0x23/0xa0 [btrfs]
[  983.882206]  #2:  (&amp;fs_devs-&gt;device_list_mutex){+.+...}, at: [&lt;ffffffffc033d6f6&gt;] __btrfs_close_devices+0x46/0x200 [btrfs]
[  983.893422]
[  983.893422] stack backtrace:
[  983.897824] CPU: 6 PID: 21720 Comm: umount Not tainted 4.8.0-rc5-ceph-00023-g1b39cec2 #1
[  983.905958] Hardware name: Supermicro SYS-5018R-WR/X10SRW-F, BIOS 1.0c 09/07/2015
[  983.913492]  0000000000000000 ffff8c8a53c17a38 ffffffff91429521 ffffffff9260f4f0
[  983.921018]  ffffffff92642760 ffff8c8a53c17a88 ffffffff911b2b04 0000000000000050
[  983.928542]  ffffffff9237d620 ffff8c8a5294aee0 ffff8c8a5294aeb8 ffff8c8a5294aee0
[  983.936072] Call Trace:
[  983.938545]  [&lt;ffffffff91429521&gt;] dump_stack+0x85/0xc4
[  983.943715]  [&lt;ffffffff911b2b04&gt;] print_circular_bug+0x1fb/0x20c
[  983.949748]  [&lt;ffffffff910def43&gt;] __lock_acquire+0x1003/0x17b0
[  983.955613]  [&lt;ffffffff910dfd0c&gt;] lock_acquire+0x1bc/0x1f0
[  983.961123]  [&lt;ffffffff9128ec51&gt;] ? blkdev_put+0x31/0x150
[  983.966550]  [&lt;ffffffff91823125&gt;] mutex_lock_nested+0x65/0x350
[  983.972407]  [&lt;ffffffff9128ec51&gt;] ? blkdev_put+0x31/0x150
[  983.977832]  [&lt;ffffffff9128ec51&gt;] blkdev_put+0x31/0x150
[  983.983101]  [&lt;ffffffffc033481f&gt;] btrfs_close_bdev+0x4f/0x60 [btrfs]
[  983.989500]  [&lt;ffffffffc033d77b&gt;] __btrfs_close_devices+0xcb/0x200 [btrfs]
[  983.996415]  [&lt;ffffffffc033d8db&gt;] btrfs_close_devices+0x2b/0xa0 [btrfs]
[  984.003068]  [&lt;ffffffffc03081c5&gt;] close_ctree+0x265/0x340 [btrfs]
[  984.009189]  [&lt;ffffffff9126cc5e&gt;] ? evict_inodes+0x15e/0x170
[  984.014881]  [&lt;ffffffffc02d7959&gt;] btrfs_put_super+0x19/0x20 [btrfs]
[  984.021176]  [&lt;ffffffff91250e2f&gt;] generic_shutdown_super+0x6f/0x100
[  984.027476]  [&lt;ffffffff91250f56&gt;] kill_anon_super+0x16/0x30
[  984.033082]  [&lt;ffffffffc02da97e&gt;] btrfs_kill_super+0x1e/0x130 [btrfs]
[  984.039548]  [&lt;ffffffff91250fe9&gt;] deactivate_locked_super+0x49/0x80
[  984.045839]  [&lt;ffffffff912515fd&gt;] deactivate_super+0x5d/0x70
[  984.051525]  [&lt;ffffffff91270a1c&gt;] cleanup_mnt+0x5c/0x80
[  984.056774]  [&lt;ffffffff91270a92&gt;] __cleanup_mnt+0x12/0x20
[  984.062201]  [&lt;ffffffff910aa2fe&gt;] task_work_run+0x7e/0xc0
[  984.067625]  [&lt;ffffffff91081b5a&gt;] exit_to_usermode_loop+0x7e/0xb4
[  984.073747]  [&lt;ffffffff910039eb&gt;] syscall_return_slowpath+0xbb/0xd0
[  984.080038]  [&lt;ffffffff9182605c&gt;] entry_SYSCALL_64_fastpath+0xbf/0xc1

Reported-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix memory leak in do_walk_down</title>
<updated>2017-01-06T10:16:20+00:00</updated>
<author>
<name>Liu Bo</name>
<email>bo.li.liu@oracle.com</email>
</author>
<published>2016-09-14T02:02:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=65563ab7271bf12683fcd4d668d1b37878fb795a'/>
<id>65563ab7271bf12683fcd4d668d1b37878fb795a</id>
<content type='text'>
commit a958eab0ed7fdc1b977bc25d3af6efedaa945488 upstream.

The extent buffer 'next' needs to be free'd conditionally.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a958eab0ed7fdc1b977bc25d3af6efedaa945488 upstream.

The extent buffer 'next' needs to be free'd conditionally.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: clean the old superblocks before freeing the device</title>
<updated>2017-01-06T10:16:20+00:00</updated>
<author>
<name>Jeff Mahoney</name>
<email>jeffm@suse.com</email>
</author>
<published>2016-09-20T12:50:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=364b85c57d253c95498f57c9c02a430063883798'/>
<id>364b85c57d253c95498f57c9c02a430063883798</id>
<content type='text'>
commit cea67ab92d3d4da9f2b4141d87cb8664757daca0 upstream.

btrfs_rm_device frees the block device but then re-opens it using
the saved device name.  A race exists between the close and the
re-open that allows the block size to be changed.  The result
is getting stuck forever in the reclaim loop in __getblk_slow.

This patch moves the superblock cleanup before closing the block
device, which is also consistent with other callers.  We also don't
need a private copy of dev_name as the whole routine operates under
the uuid_mutex.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit cea67ab92d3d4da9f2b4141d87cb8664757daca0 upstream.

btrfs_rm_device frees the block device but then re-opens it using
the saved device name.  A race exists between the close and the
re-open that allows the block size to be changed.  The result
is getting stuck forever in the reclaim loop in __getblk_slow.

This patch moves the superblock cleanup before closing the block
device, which is also consistent with other callers.  We also don't
need a private copy of dev_name as the whole routine operates under
the uuid_mutex.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: don't leak reloc root nodes on error</title>
<updated>2017-01-06T10:16:20+00:00</updated>
<author>
<name>Josef Bacik</name>
<email>jbacik@fb.com</email>
</author>
<published>2016-09-02T19:25:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6a6e9276f3f5e6670309470a712a10220bc9480a'/>
<id>6a6e9276f3f5e6670309470a712a10220bc9480a</id>
<content type='text'>
commit 6bdf131fac2336adb1a628f992ba32384f653a55 upstream.

We don't track the reloc roots in any sort of normal way, so the only way the
root/commit_root nodes get free'd is if the relocation finishes successfully and
the reloc root is deleted.  Fix this by free'ing them in free_reloc_roots.
Thanks,

Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6bdf131fac2336adb1a628f992ba32384f653a55 upstream.

We don't track the reloc roots in any sort of normal way, so the only way the
root/commit_root nodes get free'd is if the relocation finishes successfully and
the reloc root is deleted.  Fix this by free'ing them in free_reloc_roots.
Thanks,

Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: return gracefully from balance if fs tree is corrupted</title>
<updated>2017-01-06T10:16:20+00:00</updated>
<author>
<name>Liu Bo</name>
<email>bo.li.liu@oracle.com</email>
</author>
<published>2016-09-14T15:51:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4d3d9b59d963d35f71e5e04cf3b312c9d6547f60'/>
<id>4d3d9b59d963d35f71e5e04cf3b312c9d6547f60</id>
<content type='text'>
commit 3561b9db70928f207be4570b48fc19898eeaef54 upstream.

When relocating tree blocks, we firstly get block information from
back references in the extent tree, we then search fs tree to try to
find all parents of a block.

However, if fs tree is corrupted, eg. if there're some missing
items, we could come across these WARN_ONs and BUG_ONs.

This makes us print some error messages and return gracefully
from balance.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Reviewed-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3561b9db70928f207be4570b48fc19898eeaef54 upstream.

When relocating tree blocks, we firstly get block information from
back references in the extent tree, we then search fs tree to try to
find all parents of a block.

However, if fs tree is corrupted, eg. if there're some missing
items, we could come across these WARN_ONs and BUG_ONs.

This makes us print some error messages and return gracefully
from balance.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Reviewed-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: bail out if block group has different mixed flag</title>
<updated>2017-01-06T10:16:20+00:00</updated>
<author>
<name>Liu Bo</name>
<email>bo.li.liu@oracle.com</email>
</author>
<published>2016-08-26T01:08:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a6522e487b2c3c4834470ae6eea9a24bedcb7127'/>
<id>a6522e487b2c3c4834470ae6eea9a24bedcb7127</id>
<content type='text'>
commit 49303381f19ab16a371a061b67e783d3f570d56e upstream.

Currently we allow inconsistence about mixed flag
 (BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA).

We'd get ENOSPC if block group has mixed flag and btrfs doesn't.
If that happens, we have one space_info with mixed flag and another
space_info only with BTRFS_BLOCK_GROUP_METADATA, and
global_block_rsv.space_info points to the latter one, but all bytes
from block_group contributes to the mixed space_info, thus all the
allocation will fail with ENOSPC.

This adds a check for the above case.

Reported-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
[ updated message ]
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 49303381f19ab16a371a061b67e783d3f570d56e upstream.

Currently we allow inconsistence about mixed flag
 (BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA).

We'd get ENOSPC if block group has mixed flag and btrfs doesn't.
If that happens, we have one space_info with mixed flag and another
space_info only with BTRFS_BLOCK_GROUP_METADATA, and
global_block_rsv.space_info points to the latter one, but all bytes
from block_group contributes to the mixed space_info, thus all the
allocation will fail with ENOSPC.

This adds a check for the above case.

Reported-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
[ updated message ]
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix memory leak in reading btree blocks</title>
<updated>2017-01-06T10:16:20+00:00</updated>
<author>
<name>Liu Bo</name>
<email>bo.li.liu@oracle.com</email>
</author>
<published>2016-08-03T19:33:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d7839adcb0e310aef3a81a3992dcc3e1c8768e5f'/>
<id>d7839adcb0e310aef3a81a3992dcc3e1c8768e5f</id>
<content type='text'>
commit 2571e739677f1e4c0c63f5ed49adcc0857923625 upstream.

So we can read a btree block via readahead or intentional read,
and we can end up with a memory leak when something happens as
follows,
1) readahead starts to read block A but does not wait for read
   completion,
2) btree_readpage_end_io_hook finds that block A is corrupted,
   and it needs to clear all block A's pages' uptodate bit.
3) meanwhile an intentional read kicks in and checks block A's
   pages' uptodate to decide which page needs to be read.
4) when some pages have the uptodate bit during 3)'s check so
   3) doesn't count them for eb-&gt;io_pages, but they are later
   cleared by 2) so we has to readpage on the page, we get
   the wrong eb-&gt;io_pages which results in a memory leak of
   this block.

This fixes the problem by firstly getting all pages's locking and
then checking pages' uptodate bit.

   t1(readahead)                              t2(readahead endio)                                       t3(the following read)
read_extent_buffer_pages                    end_bio_extent_readpage
  for pg in eb:                                for page 0,1,2 in eb:
      if pg is uptodate:                           btree_readpage_end_io_hook(pg)
          num_reads++                              if uptodate:
  eb-&gt;io_pages = num_reads                             SetPageUptodate(pg)              _______________
  for pg in eb:                                for page 3 in eb:                                     read_extent_buffer_pages
       if pg is NOT uptodate:                      btree_readpage_end_io_hook(pg)                       for pg in eb:
           __extent_read_full_page(pg)                 sanity check reports something wrong                 if pg is uptodate:
                                                       clear_extent_buffer_uptodate(eb)                         num_reads++
                                                           for pg in eb:                                eb-&gt;io_pages = num_reads
                                                               ClearPageUptodate(page)  _______________
                                                                                                        for pg in eb:
                                                                                                            if pg is NOT uptodate:
                                                                                                                __extent_read_full_page(pg)

So t3's eb-&gt;io_pages is not consistent with the number of pages it's reading,
and during endio(), atomic_dec_and_test(&amp;eb-&gt;io_pages) will get a negative
number so that we're not able to free the eb.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2571e739677f1e4c0c63f5ed49adcc0857923625 upstream.

So we can read a btree block via readahead or intentional read,
and we can end up with a memory leak when something happens as
follows,
1) readahead starts to read block A but does not wait for read
   completion,
2) btree_readpage_end_io_hook finds that block A is corrupted,
   and it needs to clear all block A's pages' uptodate bit.
3) meanwhile an intentional read kicks in and checks block A's
   pages' uptodate to decide which page needs to be read.
4) when some pages have the uptodate bit during 3)'s check so
   3) doesn't count them for eb-&gt;io_pages, but they are later
   cleared by 2) so we has to readpage on the page, we get
   the wrong eb-&gt;io_pages which results in a memory leak of
   this block.

This fixes the problem by firstly getting all pages's locking and
then checking pages' uptodate bit.

   t1(readahead)                              t2(readahead endio)                                       t3(the following read)
read_extent_buffer_pages                    end_bio_extent_readpage
  for pg in eb:                                for page 0,1,2 in eb:
      if pg is uptodate:                           btree_readpage_end_io_hook(pg)
          num_reads++                              if uptodate:
  eb-&gt;io_pages = num_reads                             SetPageUptodate(pg)              _______________
  for pg in eb:                                for page 3 in eb:                                     read_extent_buffer_pages
       if pg is NOT uptodate:                      btree_readpage_end_io_hook(pg)                       for pg in eb:
           __extent_read_full_page(pg)                 sanity check reports something wrong                 if pg is uptodate:
                                                       clear_extent_buffer_uptodate(eb)                         num_reads++
                                                           for pg in eb:                                eb-&gt;io_pages = num_reads
                                                               ClearPageUptodate(page)  _______________
                                                                                                        for pg in eb:
                                                                                                            if pg is NOT uptodate:
                                                                                                                __extent_read_full_page(pg)

So t3's eb-&gt;io_pages is not consistent with the number of pages it's reading,
and during endio(), atomic_dec_and_test(&amp;eb-&gt;io_pages) will get a negative
number so that we're not able to free the eb.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
