<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/disk-io.c, branch linux-4.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-03-21T17:53:37Z</updated>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs</title>
<updated>2015-03-21T17:53:37Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2015-03-21T17:53:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=521d474631310e8aafef7953a8a7f7d1efd42da6'/>
<id>urn:sha1:521d474631310e8aafef7953a8a7f7d1efd42da6</id>
<content type='text'>
Pull btrfs fixes from Chris Mason:
 "Most of these are fixing extent reservation accounting, or corners
  with tree writeback during commit.

  Josef's set does add a test, which isn't strictly a fix, but it'll
  keep us from making this same mistake again"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: fix outstanding_extents accounting in DIO
  Btrfs: add sanity test for outstanding_extents accounting
  Btrfs: just free dummy extent buffers
  Btrfs: account merges/splits properly
  Btrfs: prepare block group cache before writing
  Btrfs: fix ASSERT(list_empty(&amp;cur_trans-&gt;dirty_bgs_list)
  Btrfs: account for the correct number of extents for delalloc reservations
  Btrfs: fix merge delalloc logic
  Btrfs: fix comp_oper to get right order
  Btrfs: catch transaction abortion after waiting for it
  btrfs: fix sizeof format specifier in btrfs_check_super_valid()
</content>
</entry>
<entry>
<title>btrfs: fix sizeof format specifier in btrfs_check_super_valid()</title>
<updated>2015-03-13T20:38:22Z</updated>
<author>
<name>Fabian Frederick</name>
</author>
<published>2015-02-14T12:10:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d22071293f17eedc96df25093d8e99d09cd76463'/>
<id>urn:sha1:d22071293f17eedc96df25093d8e99d09cd76463</id>
<content type='text'>
This patch fixes mips compilation warning:

fs/btrfs/disk-io.c: In function 'btrfs_check_super_valid':
fs/btrfs/disk-io.c:3927:21: warning: format '%lu' expects argument
of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat]

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs</title>
<updated>2015-02-19T22:36:00Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2015-02-19T22:36:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b9fb532d4168e8974fe49709e2c4c8d5352a64c'/>
<id>urn:sha1:2b9fb532d4168e8974fe49709e2c4c8d5352a64c</id>
<content type='text'>
Pull btrfs updates from Chris Mason:
 "This pull is mostly cleanups and fixes:

   - The raid5/6 cleanups from Zhao Lei fixup some long standing warts
     in the code and add improvements on top of the scrubbing support
     from 3.19.

   - Josef has round one of our ENOSPC fixes coming from large btrfs
     clusters here at FB.

   - Dave Sterba continues a long series of cleanups (thanks Dave), and
     Filipe continues hammering on corner cases in fsync and others

  This all was held up a little trying to track down a use-after-free in
  btrfs raid5/6.  It's not clear yet if this is just made easier to
  trigger with this pull or if its a new bug from the raid5/6 cleanups.
  Dave Sterba is the only one to trigger it so far, but he has a
  consistent way to reproduce, so we'll get it nailed shortly"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (68 commits)
  Btrfs: don't remove extents and xattrs when logging new names
  Btrfs: fix fsync data loss after adding hard link to inode
  Btrfs: fix BUG_ON in btrfs_orphan_add() when delete unused block group
  Btrfs: account for large extents with enospc
  Btrfs: don't set and clear delalloc for O_DIRECT writes
  Btrfs: only adjust outstanding_extents when we do a short write
  btrfs: Fix out-of-space bug
  Btrfs: scrub, fix sleep in atomic context
  Btrfs: fix scheduler warning when syncing log
  Btrfs: Remove unnecessary placeholder in btrfs_err_code
  btrfs: cleanup init for list in free-space-cache
  btrfs: delete chunk allocation attemp when setting block group ro
  btrfs: clear bio reference after submit_one_bio()
  Btrfs: fix scrub race leading to use-after-free
  Btrfs: add missing cleanup on sysfs init failure
  Btrfs: fix race between transaction commit and empty block group removal
  btrfs: add more checks to btrfs_read_sys_array
  btrfs: cleanup, rename a few variables in btrfs_read_sys_array
  btrfs: add checks for sys_chunk_array sizes
  btrfs: more superblock checks, lower bounds on devices and sectorsize/nodesize
  ...
</content>
</entry>
<entry>
<title>Btrfs: fix race between transaction commit and empty block group removal</title>
<updated>2015-02-03T03:24:48Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2015-01-29T19:18:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d4b450cd4b33ce7c572e7fdccf33b59c4cdf361c'/>
<id>urn:sha1:d4b450cd4b33ce7c572e7fdccf33b59c4cdf361c</id>
<content type='text'>
Committing a transaction can race with automatic removal of empty block
groups (cleaner kthread), leading to a BUG_ON() in the transaction
commit code while running btrfs_finish_extent_commit(). The following
sequence diagram shows how it can happen:

           CPU 1                                       CPU 2

btrfs_commit_transaction()
  fs_info-&gt;running_transaction = NULL
  btrfs_finish_extent_commit()
    find_first_extent_bit()
      -&gt; found range for block group X
         in fs_info-&gt;freed_extents[]

                                               btrfs_delete_unused_bgs()
                                                 -&gt; found block group X

                                                 Removed block group X's range
                                                 from fs_info-&gt;freed_extents[]

                                                 btrfs_remove_chunk()
                                                    btrfs_remove_block_group(bg X)

    unpin_extent_range(bg X range)
       btrfs_lookup_block_group(bg X)
          -&gt; returns NULL
            -&gt; BUG_ON()

The trace that results from the BUG_ON() is:

[48665.187808] ------------[ cut here ]------------
[48665.188032] kernel BUG at fs/btrfs/extent-tree.c:5675!
[48665.188032] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
[48665.188032] Modules linked in: dm_flakey dm_mod crc32c_generic btrfs xor raid6_pq nfsd auth_rpcgss oid_registry nfs_acl nfs lockd grace fscache sunrpc loop parport_pc evdev microcode
[48665.197388] CPU: 2 PID: 31211 Comm: kworker/u32:16 Tainted: G        W      3.19.0-rc5-btrfs-next-4+ #1
[48665.197388] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
[48665.197388] Workqueue: events_unbound btrfs_async_reclaim_metadata_space [btrfs]
[48665.197388] task: ffff880222011810 ti: ffff8801b56a4000 task.ti: ffff8801b56a4000
[48665.197388] RIP: 0010:[&lt;ffffffffa0350d05&gt;]  [&lt;ffffffffa0350d05&gt;] unpin_extent_range+0x6a/0x1ba [btrfs]
[48665.197388] RSP: 0018:ffff8801b56a7b88  EFLAGS: 00010246
[48665.197388] RAX: 0000000000000000 RBX: ffff8802143a6000 RCX: ffff8802220120c8
[48665.197388] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff8800a3c140b0
[48665.197388] RBP: ffff8801b56a7bd8 R08: 0000000000000003 R09: 0000000000000000
[48665.197388] R10: 0000000000000000 R11: 000000000000bbac R12: 0000000012e8e000
[48665.197388] R13: ffff8800a3c14000 R14: 0000000000000000 R15: 0000000000000000
[48665.197388] FS:  0000000000000000(0000) GS:ffff88023ec40000(0000) knlGS:0000000000000000
[48665.197388] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[48665.197388] CR2: 00007f065e42f270 CR3: 0000000206f70000 CR4: 00000000000006e0
[48665.197388] Stack:
[48665.197388]  ffff8801b56a7bd8 0000000012ea0000 01ff8800a3c14138 0000000012e9ffff
[48665.197388]  ffff880141df3dd8 ffff8802143a6000 ffff8800a3c14138 ffff880141df3df0
[48665.197388]  ffff880141df3dd8 0000000000000000 ffff8801b56a7c08 ffffffffa0354227
[48665.197388] Call Trace:
[48665.197388]  [&lt;ffffffffa0354227&gt;] btrfs_finish_extent_commit+0xb0/0xd9 [btrfs]
[48665.197388]  [&lt;ffffffffa0366b4b&gt;] btrfs_commit_transaction+0x791/0x92c [btrfs]
[48665.197388]  [&lt;ffffffffa0352432&gt;] flush_space+0x43d/0x452 [btrfs]
[48665.197388]  [&lt;ffffffff814295c3&gt;] ? _raw_spin_unlock+0x28/0x33
[48665.197388]  [&lt;ffffffffa035255f&gt;] btrfs_async_reclaim_metadata_space+0x118/0x164 [btrfs]
[48665.197388]  [&lt;ffffffff81059917&gt;] ? process_one_work+0x14b/0x3ab
[48665.197388]  [&lt;ffffffff810599ac&gt;] process_one_work+0x1e0/0x3ab
[48665.197388]  [&lt;ffffffff81079fa9&gt;] ? trace_hardirqs_off+0xd/0xf
[48665.197388]  [&lt;ffffffff8105a55b&gt;] worker_thread+0x210/0x2d0
[48665.197388]  [&lt;ffffffff8105a34b&gt;] ? rescuer_thread+0x2c3/0x2c3
[48665.197388]  [&lt;ffffffff8105e5c0&gt;] kthread+0xef/0xf7
[48665.197388]  [&lt;ffffffff81429682&gt;] ? _raw_spin_unlock_irq+0x2d/0x39
[48665.197388]  [&lt;ffffffff8105e4d1&gt;] ? __kthread_parkme+0xad/0xad
[48665.197388]  [&lt;ffffffff81429dec&gt;] ret_from_fork+0x7c/0xb0
[48665.197388]  [&lt;ffffffff8105e4d1&gt;] ? __kthread_parkme+0xad/0xad
[48665.197388] Code: 85 f6 74 14 49 8b 06 49 03 46 09 49 39 c4 72 1d 4c 89 f7 e8 83 ec ff ff 4c 89 e6 4c 89 ef e8 1e f1 ff ff 48 85 c0 49 89 c6 75 02 &lt;0f&gt; 0b 49 8b 1e 49 03 5e 09 48 8b
[48665.197388] RIP  [&lt;ffffffffa0350d05&gt;] unpin_extent_range+0x6a/0x1ba [btrfs]
[48665.197388]  RSP &lt;ffff8801b56a7b88&gt;
[48665.272246] ---[ end trace b9c6ab9957521376 ]---

Fix this by ensuring that unpining the block group's range in
btrfs_finish_extent_commit() is done in a synchronized fashion
with removing the block group's range from freed_extents[]
in btrfs_delete_unused_bgs()

This race got introduced with the change:

    Btrfs: remove empty block groups automatically
    commit 47ab2a6c689913db23ccae38349714edf8365e0a

Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: add checks for sys_chunk_array sizes</title>
<updated>2015-02-03T03:23:43Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-10-31T17:42:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce7fca5f57ed0fcd7e7b3d7b1a3e1791f8e56fa3'/>
<id>urn:sha1:ce7fca5f57ed0fcd7e7b3d7b1a3e1791f8e56fa3</id>
<content type='text'>
Verify that possible minimum and maximum size is set, validity of
contents is checked in btrfs_read_sys_array.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: more superblock checks, lower bounds on devices and sectorsize/nodesize</title>
<updated>2015-02-03T03:20:39Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-10-31T16:18:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=75d6ad382bb91f363452119d34238e156589ca2d'/>
<id>urn:sha1:75d6ad382bb91f363452119d34238e156589ca2d</id>
<content type='text'>
I received a few crafted images from Jiri, all got through the recently
added superblock checks. The lower bounds checks for num_devices and
sector/node -sizes were missing and caused a crash during mount.

Tools for symbolic code execution were used to prepare the images
contents.

Reported-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: fix unused members in struct btrfs_root</title>
<updated>2015-01-22T02:22:37Z</updated>
<author>
<name>Anand Jain</name>
</author>
<published>2015-01-12T16:55:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=78f55e5e1fa9f684705325667d455a957f43ad66'/>
<id>urn:sha1:78f55e5e1fa9f684705325667d455a957f43ad66</id>
<content type='text'>
There isn't any real use of following members of struct btrfs_root
so delete them.

struct kobject root_kobj;
struct completion kobj_unregister;

Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: set proper message level for skinny metadata</title>
<updated>2015-01-22T02:02:03Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-12-19T17:38:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5efa0490cc94aee06cd8d282683e22a8ce0a0026'/>
<id>urn:sha1:5efa0490cc94aee06cd8d282683e22a8ce0a0026</id>
<content type='text'>
This has been confusing people for too long, the message is really just
informative.

CC: &lt;stable@vger.kernel.org&gt; # 3.10+
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: update message levels after checksum errors</title>
<updated>2015-01-22T02:02:03Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-12-19T17:38:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f0954c66377b1610a512fd05f4d33afa54441c3b'/>
<id>urn:sha1:f0954c66377b1610a512fd05f4d33afa54441c3b</id>
<content type='text'>
The errors are worth noting and might get missed with INFO level.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: update message levels during failed mount</title>
<updated>2015-01-22T02:02:03Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-12-19T17:38:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aa8ee31209d644a3f4716cb0c43aba7889fbef31'/>
<id>urn:sha1:aa8ee31209d644a3f4716cb0c43aba7889fbef31</id>
<content type='text'>
All error conditions from open_ctree shall be ERR. Warning would
suggest that something's wrong and we can continue.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
</feed>
