<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/btrfs, branch v3.2-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs</title>
<updated>2011-11-12T01:47:06+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-11-12T01:47:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c1f4246716392ec8693c23cffb969bd73c1b0910'/>
<id>c1f4246716392ec8693c23cffb969bd73c1b0910</id>
<content type='text'>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  btrfs: rename the option to nospace_cache
  Btrfs: handle bio_add_page failure gracefully in scrub
  Btrfs: fix deadlock caused by the race between relocation
  Btrfs: only map pages if we know we need them when reading the space cache
  Btrfs: fix orphan backref nodes
  Btrfs: Abstract similar code for btrfs_block_rsv_add{, _noflush}
  Btrfs: fix unreleased path in btrfs_orphan_cleanup()
  Btrfs: fix no reserved space for writing out inode cache
  Btrfs: fix nocow when deleting the item
  Btrfs: tweak the delayed inode reservations again
  Btrfs: rework error handling in btrfs_mount()
  Btrfs: close devices on all error paths in open_ctree()
  Btrfs: avoid null dereference and leaks when bailing from open_ctree()
  Btrfs: fix subvol_name leak on error in btrfs_mount()
  Btrfs: fix memory leak in btrfs_parse_early_options()
  Btrfs: fix our reservations for updating an inode when completing io
  Btrfs: fix oops on NULL trans handle in btrfs_truncate
  btrfs: fix double-free 'tree_root' in 'btrfs_mount()'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  btrfs: rename the option to nospace_cache
  Btrfs: handle bio_add_page failure gracefully in scrub
  Btrfs: fix deadlock caused by the race between relocation
  Btrfs: only map pages if we know we need them when reading the space cache
  Btrfs: fix orphan backref nodes
  Btrfs: Abstract similar code for btrfs_block_rsv_add{, _noflush}
  Btrfs: fix unreleased path in btrfs_orphan_cleanup()
  Btrfs: fix no reserved space for writing out inode cache
  Btrfs: fix nocow when deleting the item
  Btrfs: tweak the delayed inode reservations again
  Btrfs: rework error handling in btrfs_mount()
  Btrfs: close devices on all error paths in open_ctree()
  Btrfs: avoid null dereference and leaks when bailing from open_ctree()
  Btrfs: fix subvol_name leak on error in btrfs_mount()
  Btrfs: fix memory leak in btrfs_parse_early_options()
  Btrfs: fix our reservations for updating an inode when completing io
  Btrfs: fix oops on NULL trans handle in btrfs_truncate
  btrfs: fix double-free 'tree_root' in 'btrfs_mount()'
</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: rename the option to nospace_cache</title>
<updated>2011-11-11T15:14:57+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.cz</email>
</author>
<published>2011-11-11T15:14:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8965593e41dd2d0e2a2f1e6f245336005ea94a2c'/>
<id>8965593e41dd2d0e2a2f1e6f245336005ea94a2c</id>
<content type='text'>
Rename no_space_cache option to nospace_cache to be more consistent with
the rest, where the simple prefix 'no' is used to negate an option.

The option has been introduced during the -rc1 cycle and there are has not been
widely used, so it's safe.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename no_space_cache option to nospace_cache to be more consistent with
the rest, where the simple prefix 'no' is used to negate an option.

The option has been introduced during the -rc1 cycle and there are has not been
widely used, so it's safe.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: handle bio_add_page failure gracefully in scrub</title>
<updated>2011-11-11T13:17:10+00:00</updated>
<author>
<name>Arne Jansen</name>
<email>sensille@gmx.net</email>
</author>
<published>2011-11-11T13:17:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=69f4cb526bd02ae5af35846f9a710c099eec3347'/>
<id>69f4cb526bd02ae5af35846f9a710c099eec3347</id>
<content type='text'>
Currently scrub fails with ENOMEM when bio_add_page fails. Unfortunately
dm based targets accept only one page per bio, thus making scrub always
fails. This patch just submits the current bio when an error is encountered
and starts a new one.

Signed-off-by: Arne Jansen &lt;sensille@gmx.net&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently scrub fails with ENOMEM when bio_add_page fails. Unfortunately
dm based targets accept only one page per bio, thus making scrub always
fails. This patch just submits the current bio when an error is encountered
and starts a new one.

Signed-off-by: Arne Jansen &lt;sensille@gmx.net&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix deadlock caused by the race between relocation</title>
<updated>2011-11-11T01:45:05+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2011-11-11T01:45:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=62f30c5462374b991e7e3f42d49ce2265c1b82f1'/>
<id>62f30c5462374b991e7e3f42d49ce2265c1b82f1</id>
<content type='text'>
We can not do flushable reservation for the relocation when we create snapshot,
because it may make the transaction commit task and the flush task wait for
each other and the deadlock happens.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We can not do flushable reservation for the relocation when we create snapshot,
because it may make the transaction commit task and the flush task wait for
each other and the deadlock happens.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: only map pages if we know we need them when reading the space cache</title>
<updated>2011-11-11T01:45:05+00:00</updated>
<author>
<name>Josef Bacik</name>
<email>josef@redhat.com</email>
</author>
<published>2011-11-11T01:45:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2f120c05e67ae34c93786b1050c6828904314429'/>
<id>2f120c05e67ae34c93786b1050c6828904314429</id>
<content type='text'>
People have been running into a warning when loading space cache because the
page is already mapped when trying to read in a bitmap.  The way we read in
entries and pages is kind of convoluted, so fix it so that io_ctl_read_entry
maps the entries if it needs to, and if it hits the end of the page it simply
unmaps the page.  That way we can unconditionally unmap the io_ctl before
reading in the bitmap and we should stop hitting these warnings.  Thanks,

Signed-off-by: Josef Bacik &lt;josef@redhat.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
People have been running into a warning when loading space cache because the
page is already mapped when trying to read in a bitmap.  The way we read in
entries and pages is kind of convoluted, so fix it so that io_ctl_read_entry
maps the entries if it needs to, and if it hits the end of the page it simply
unmaps the page.  That way we can unconditionally unmap the io_ctl before
reading in the bitmap and we should stop hitting these warnings.  Thanks,

Signed-off-by: Josef Bacik &lt;josef@redhat.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix orphan backref nodes</title>
<updated>2011-11-11T01:45:05+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2011-11-11T01:45:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=76b9e23d25d5c99f994bee3172de39492e452e93'/>
<id>76b9e23d25d5c99f994bee3172de39492e452e93</id>
<content type='text'>
If the root node of a fs/file tree is in the block group that is
being relocated, but the others are not in the other block groups.
when we create a snapshot for this tree between the relocation tree
creation ends and -&gt;create_reloc_tree is set to 0, Btrfs will create
some backref nodes that are the lowest nodes of the backrefs cache.
But we forget to add them into -&gt;leaves list of the backref cache
and deal with them, and at last, they will triggered BUG_ON().

  kernel BUG at fs/btrfs/relocation.c:239!

This patch fixes it by adding them into -&gt;leaves list of backref cache.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the root node of a fs/file tree is in the block group that is
being relocated, but the others are not in the other block groups.
when we create a snapshot for this tree between the relocation tree
creation ends and -&gt;create_reloc_tree is set to 0, Btrfs will create
some backref nodes that are the lowest nodes of the backrefs cache.
But we forget to add them into -&gt;leaves list of the backref cache
and deal with them, and at last, they will triggered BUG_ON().

  kernel BUG at fs/btrfs/relocation.c:239!

This patch fixes it by adding them into -&gt;leaves list of backref cache.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: Abstract similar code for btrfs_block_rsv_add{, _noflush}</title>
<updated>2011-11-11T01:45:05+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2011-11-11T01:45:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=61b520a9d0083b9b361638e456af45fd75150c87'/>
<id>61b520a9d0083b9b361638e456af45fd75150c87</id>
<content type='text'>
btrfs_block_rsv_add{, _noflush}() have similar code, so abstract that code.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
btrfs_block_rsv_add{, _noflush}() have similar code, so abstract that code.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix unreleased path in btrfs_orphan_cleanup()</title>
<updated>2011-11-11T01:45:05+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2011-11-11T01:45:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3254c87618354e58fa2a7b375c6664f567480c33'/>
<id>3254c87618354e58fa2a7b375c6664f567480c33</id>
<content type='text'>
When we did stress test for the space relocation, the deadlock happened.
By debugging, We found it was caused by the carelessness that we forgot
to unlock the read lock of the extent buffers in btrfs_orphan_cleanup()
before we end the transaction handle, so the transaction commit task waited
the task, which called btrfs_orphan_cleanup(), to unlock the extent buffer,
but that task waited the commit task to end the transaction commit, and
the deadlock happened. Fix it.

Signed-ff-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we did stress test for the space relocation, the deadlock happened.
By debugging, We found it was caused by the carelessness that we forgot
to unlock the read lock of the extent buffers in btrfs_orphan_cleanup()
before we end the transaction handle, so the transaction commit task waited
the task, which called btrfs_orphan_cleanup(), to unlock the extent buffer,
but that task waited the commit task to end the transaction commit, and
the deadlock happened. Fix it.

Signed-ff-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix no reserved space for writing out inode cache</title>
<updated>2011-11-11T01:45:04+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2011-11-11T01:45:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ba38eb4de354d228f2792f93cde2c748a3a3f3b2'/>
<id>ba38eb4de354d228f2792f93cde2c748a3a3f3b2</id>
<content type='text'>
I-node cache forgets to reserve the space when writing out it. And when
we do some stress test, such as synctest, it will trigger WARN_ON() in
use_block_rsv().

WARNING: at fs/btrfs/extent-tree.c:5718 btrfs_alloc_free_block+0xbf/0x281 [btrfs]()
...
Call Trace:
 [&lt;ffffffff8104df86&gt;] warn_slowpath_common+0x80/0x98
 [&lt;ffffffff8104dfb3&gt;] warn_slowpath_null+0x15/0x17
 [&lt;ffffffffa0369c60&gt;] btrfs_alloc_free_block+0xbf/0x281 [btrfs]
 [&lt;ffffffff810cbcb8&gt;] ? __set_page_dirty_nobuffers+0xfe/0x108
 [&lt;ffffffffa035c040&gt;] __btrfs_cow_block+0x118/0x3b5 [btrfs]
 [&lt;ffffffffa035c7ba&gt;] btrfs_cow_block+0x103/0x14e [btrfs]
 [&lt;ffffffffa035e4c4&gt;] btrfs_search_slot+0x249/0x6a4 [btrfs]
 [&lt;ffffffffa036d086&gt;] btrfs_lookup_inode+0x2a/0x8a [btrfs]
 [&lt;ffffffffa03788b7&gt;] btrfs_update_inode+0xaa/0x141 [btrfs]
 [&lt;ffffffffa036d7ec&gt;] btrfs_save_ino_cache+0xea/0x202 [btrfs]
 [&lt;ffffffffa03a761e&gt;] ? btrfs_update_reloc_root+0x17e/0x197 [btrfs]
 [&lt;ffffffffa0373867&gt;] commit_fs_roots+0xaa/0x158 [btrfs]
 [&lt;ffffffffa03746a6&gt;] btrfs_commit_transaction+0x405/0x731 [btrfs]
 [&lt;ffffffff810690df&gt;] ? wake_up_bit+0x25/0x25
 [&lt;ffffffffa039d652&gt;] ? btrfs_log_dentry_safe+0x43/0x51 [btrfs]
 [&lt;ffffffffa0381c5f&gt;] btrfs_sync_file+0x16a/0x198 [btrfs]
 [&lt;ffffffff81122806&gt;] ? mntput+0x21/0x23
 [&lt;ffffffff8112d150&gt;] vfs_fsync_range+0x18/0x21
 [&lt;ffffffff8112d170&gt;] vfs_fsync+0x17/0x19
 [&lt;ffffffff8112d316&gt;] do_fsync+0x29/0x3e
 [&lt;ffffffff8112d348&gt;] sys_fsync+0xb/0xf
 [&lt;ffffffff81468352&gt;] system_call_fastpath+0x16/0x1b

Sometimes it causes BUG_ON() in the reservation code of the delayed inode
is triggered.

So we must reserve enough space for inode cache.

Note: If we can not reserve the enough space for inode cache, we will
give up writing out it.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I-node cache forgets to reserve the space when writing out it. And when
we do some stress test, such as synctest, it will trigger WARN_ON() in
use_block_rsv().

WARNING: at fs/btrfs/extent-tree.c:5718 btrfs_alloc_free_block+0xbf/0x281 [btrfs]()
...
Call Trace:
 [&lt;ffffffff8104df86&gt;] warn_slowpath_common+0x80/0x98
 [&lt;ffffffff8104dfb3&gt;] warn_slowpath_null+0x15/0x17
 [&lt;ffffffffa0369c60&gt;] btrfs_alloc_free_block+0xbf/0x281 [btrfs]
 [&lt;ffffffff810cbcb8&gt;] ? __set_page_dirty_nobuffers+0xfe/0x108
 [&lt;ffffffffa035c040&gt;] __btrfs_cow_block+0x118/0x3b5 [btrfs]
 [&lt;ffffffffa035c7ba&gt;] btrfs_cow_block+0x103/0x14e [btrfs]
 [&lt;ffffffffa035e4c4&gt;] btrfs_search_slot+0x249/0x6a4 [btrfs]
 [&lt;ffffffffa036d086&gt;] btrfs_lookup_inode+0x2a/0x8a [btrfs]
 [&lt;ffffffffa03788b7&gt;] btrfs_update_inode+0xaa/0x141 [btrfs]
 [&lt;ffffffffa036d7ec&gt;] btrfs_save_ino_cache+0xea/0x202 [btrfs]
 [&lt;ffffffffa03a761e&gt;] ? btrfs_update_reloc_root+0x17e/0x197 [btrfs]
 [&lt;ffffffffa0373867&gt;] commit_fs_roots+0xaa/0x158 [btrfs]
 [&lt;ffffffffa03746a6&gt;] btrfs_commit_transaction+0x405/0x731 [btrfs]
 [&lt;ffffffff810690df&gt;] ? wake_up_bit+0x25/0x25
 [&lt;ffffffffa039d652&gt;] ? btrfs_log_dentry_safe+0x43/0x51 [btrfs]
 [&lt;ffffffffa0381c5f&gt;] btrfs_sync_file+0x16a/0x198 [btrfs]
 [&lt;ffffffff81122806&gt;] ? mntput+0x21/0x23
 [&lt;ffffffff8112d150&gt;] vfs_fsync_range+0x18/0x21
 [&lt;ffffffff8112d170&gt;] vfs_fsync+0x17/0x19
 [&lt;ffffffff8112d316&gt;] do_fsync+0x29/0x3e
 [&lt;ffffffff8112d348&gt;] sys_fsync+0xb/0xf
 [&lt;ffffffff81468352&gt;] system_call_fastpath+0x16/0x1b

Sometimes it causes BUG_ON() in the reservation code of the delayed inode
is triggered.

So we must reserve enough space for inode cache.

Note: If we can not reserve the enough space for inode cache, we will
give up writing out it.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix nocow when deleting the item</title>
<updated>2011-11-11T01:45:04+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2011-11-11T01:45:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=924cd8fbe41851eda2b68bf2ed501b2777fd77b4'/>
<id>924cd8fbe41851eda2b68bf2ed501b2777fd77b4</id>
<content type='text'>
btrfs_previous_item() just search the b+ tree, do not COW the nodes or leaves,
if we modify the result of it, the meta-data will be broken. fix it.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
btrfs_previous_item() just search the b+ tree, do not COW the nodes or leaves,
if we modify the result of it, the meta-data will be broken. fix it.

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
