<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/fs/btrfs, branch v3.0.15</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.0.15</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.0.15'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2011-10-03T18:41:03+00:00</updated>
<entry>
<title>btrfs: fix d_off in the first dirent</title>
<updated>2011-10-03T18:41:03+00:00</updated>
<author>
<name>Hidetoshi Seto</name>
<email>seto.hidetoshi@jp.fujitsu.com</email>
</author>
<published>2011-09-18T14:20:46+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=890ecd3d30e0ba8b1b676eaf6c925f65483f5f0d'/>
<id>urn:sha1:890ecd3d30e0ba8b1b676eaf6c925f65483f5f0d</id>
<content type='text'>
commit 3765fefaee2da83f10829fa64a74e6b7360350cb upstream.

Since the d_off in the first dirent for "." (that originates from
the 4th argument "offset" of filldir() for the 2nd dirent for "..")
is wrongly assigned in btrfs_real_readdir(), telldir returns same
offset for different locations.

 | # mkfs.btrfs /dev/sdb1
 | # mount /dev/sdb1 fs0
 | # cd fs0
 | # touch file0 file1
 | # ../test
 | telldir: 0
 | readdir: d_off = 2, d_name = "."
 | telldir: 2
 | readdir: d_off = 2, d_name = ".."
 | telldir: 2
 | readdir: d_off = 3, d_name = "file0"
 | telldir: 3
 | readdir: d_off = 2147483647, d_name = "file1"
 | telldir: 2147483647

To fix this problem, pass filp-&gt;f_pos (which is loff_t) instead.

 | # ../test
 | telldir: 0
 | readdir: d_off = 1, d_name = "."
 | telldir: 1
 | readdir: d_off = 2, d_name = ".."
 | telldir: 2
 | readdir: d_off = 3, d_name = "file0"
 :

At the moment the "offset" for "." is unused because there is no
preceding dirent, however it is better to pass filp-&gt;f_pos to follow
grammatical usage.

Signed-off-by: Hidetoshi Seto &lt;seto.hidetoshi@jp.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Cc: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Btrfs: fix an oops of log replay</title>
<updated>2011-08-29T20:29:09+00:00</updated>
<author>
<name>liubo</name>
<email>liubo2009@cn.fujitsu.com</email>
</author>
<published>2011-08-06T08:35:23+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=966ef7daecee021ffded11d584e57160ee0395c2'/>
<id>urn:sha1:966ef7daecee021ffded11d584e57160ee0395c2</id>
<content type='text'>
commit 34f3e4f23ca3d259fe078f62a128d97ca83508ef upstream.

When btrfs recovers from a crash, it may hit the oops below:

------------[ cut here ]------------
kernel BUG at fs/btrfs/inode.c:4580!
[...]
RIP: 0010:[&lt;ffffffffa03df251&gt;]  [&lt;ffffffffa03df251&gt;] btrfs_add_link+0x161/0x1c0 [btrfs]
[...]
Call Trace:
 [&lt;ffffffffa03e7b31&gt;] ? btrfs_inode_ref_index+0x31/0x80 [btrfs]
 [&lt;ffffffffa04054e9&gt;] add_inode_ref+0x319/0x3f0 [btrfs]
 [&lt;ffffffffa0407087&gt;] replay_one_buffer+0x2c7/0x390 [btrfs]
 [&lt;ffffffffa040444a&gt;] walk_down_log_tree+0x32a/0x480 [btrfs]
 [&lt;ffffffffa0404695&gt;] walk_log_tree+0xf5/0x240 [btrfs]
 [&lt;ffffffffa0406cc0&gt;] btrfs_recover_log_trees+0x250/0x350 [btrfs]
 [&lt;ffffffffa0406dc0&gt;] ? btrfs_recover_log_trees+0x350/0x350 [btrfs]
 [&lt;ffffffffa03d18b2&gt;] open_ctree+0x1442/0x17d0 [btrfs]
[...]

This comes from that while replaying an inode ref item, we forget to
check those old conflicting DIR_ITEM and DIR_INDEX items in fs/file tree,
then we will come to conflict corners which lead to BUG_ON().

Signed-off-by: Liu Bo &lt;liubo2009@cn.fujitsu.com&gt;
Tested-by: Andy Lutomirski &lt;luto@mit.edu&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Btrfs: detect wether a device supports discard</title>
<updated>2011-08-29T20:29:08+00:00</updated>
<author>
<name>Josef Bacik</name>
<email>josef@redhat.com</email>
</author>
<published>2011-08-04T14:52:27+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a2ea18615b6929ccc884e651cd1c0e04941548bf'/>
<id>urn:sha1:a2ea18615b6929ccc884e651cd1c0e04941548bf</id>
<content type='text'>
commit d5e2003c2bcda93a8f2e668eb4642d70c9c38301 upstream.

We have a problem where if a user specifies discard but doesn't actually support
it we will return EOPNOTSUPP from btrfs_discard_extent.  This is a problem
because this gets called (in a fashion) from the tree log recovery code, which
has a nice little BUG_ON(ret) after it, which causes us to fail the tree log
replay.  So instead detect wether our devices support discard when we're adding
them and then don't issue discards if we know that the device doesn't support
it.  And just for good measure set ret = 0 in btrfs_issue_discard just in case
we still get EOPNOTSUPP so we don't screw anybody up like this again.  Thanks,

Signed-off-by: Josef Bacik &lt;josef@redhat.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable</title>
<updated>2011-07-09T06:25:45+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-07-09T06:25:45+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=1acc9309eb2674533944f48dbaaa53e7750e3947'/>
<id>urn:sha1:1acc9309eb2674533944f48dbaaa53e7750e3947</id>
<content type='text'>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  btrfs: fix oops when doing space balance
  Btrfs: don't panic if we get an error while balancing V2
  btrfs: add missing options displayed in mount output
</content>
</entry>
<entry>
<title>btrfs: fix oops when doing space balance</title>
<updated>2011-07-06T22:51:53+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2011-07-06T22:51:53+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=149e2d76b4886c4c7ff5e077646a8ba3563c8026'/>
<id>urn:sha1:149e2d76b4886c4c7ff5e077646a8ba3563c8026</id>
<content type='text'>
We need to make sure the data relocation inode doesn't go through
the delayed metadata updates, otherwise we get an oops during balance:

kernel BUG at fs/btrfs/relocation.c:4303!
[SNIP]
Call Trace:
 [&lt;ffffffffa03143fd&gt;] ? update_ref_for_cow+0x22d/0x330 [btrfs]
 [&lt;ffffffffa0314951&gt;] __btrfs_cow_block+0x451/0x5e0 [btrfs]
 [&lt;ffffffffa031355d&gt;] ? read_block_for_search+0x14d/0x4d0 [btrfs]
 [&lt;ffffffffa0314beb&gt;] btrfs_cow_block+0x10b/0x240 [btrfs]
 [&lt;ffffffffa031acae&gt;] btrfs_search_slot+0x49e/0x7a0 [btrfs]
 [&lt;ffffffffa032d8af&gt;] btrfs_lookup_inode+0x2f/0xa0 [btrfs]
 [&lt;ffffffff8147bf0e&gt;] ? mutex_lock+0x1e/0x50
 [&lt;ffffffffa0380cf1&gt;] btrfs_update_delayed_inode+0x71/0x160 [btrfs]
 [&lt;ffffffffa037ff27&gt;] ? __btrfs_release_delayed_node+0x67/0x190 [btrfs]
 [&lt;ffffffffa0381cf8&gt;] btrfs_run_delayed_items+0xe8/0x120 [btrfs]
 [&lt;ffffffffa03365e0&gt;] btrfs_commit_transaction+0x250/0x850 [btrfs]
 [&lt;ffffffff810f91d9&gt;] ? find_get_pages+0x39/0x130
 [&lt;ffffffffa0336cd5&gt;] ? join_transaction+0x25/0x250 [btrfs]
 [&lt;ffffffff81081de0&gt;] ? wake_up_bit+0x40/0x40
 [&lt;ffffffffa03785fa&gt;] prepare_to_relocate+0xda/0xf0 [btrfs]
 [&lt;ffffffffa037f2bb&gt;] relocate_block_group+0x4b/0x620 [btrfs]
 [&lt;ffffffffa0334cf5&gt;] ? btrfs_clean_old_snapshots+0x35/0x150 [btrfs]
 [&lt;ffffffffa037fa43&gt;] btrfs_relocate_block_group+0x1b3/0x2e0 [btrfs]
 [&lt;ffffffffa0368ec0&gt;] ? btrfs_tree_unlock+0x50/0x50 [btrfs]
 [&lt;ffffffffa035e39b&gt;] btrfs_relocate_chunk+0x8b/0x670 [btrfs]
 [&lt;ffffffffa031303d&gt;] ? btrfs_set_path_blocking+0x3d/0x50 [btrfs]
 [&lt;ffffffffa03577d8&gt;] ? read_extent_buffer+0xd8/0x1d0 [btrfs]
 [&lt;ffffffffa031bea1&gt;] ? btrfs_previous_item+0xb1/0x150 [btrfs]
 [&lt;ffffffffa03577d8&gt;] ? read_extent_buffer+0xd8/0x1d0 [btrfs]
 [&lt;ffffffffa035f5aa&gt;] btrfs_balance+0x21a/0x2b0 [btrfs]
 [&lt;ffffffffa0368898&gt;] btrfs_ioctl+0x798/0xd20 [btrfs]
 [&lt;ffffffff8111e358&gt;] ? handle_mm_fault+0x148/0x270
 [&lt;ffffffff814809e8&gt;] ? do_page_fault+0x1d8/0x4b0
 [&lt;ffffffff81160d6a&gt;] do_vfs_ioctl+0x9a/0x540
 [&lt;ffffffff811612b1&gt;] sys_ioctl+0xa1/0xb0
 [&lt;ffffffff81484ec2&gt;] system_call_fastpath+0x16/0x1b
[SNIP]
RIP  [&lt;ffffffffa037c1cc&gt;] btrfs_reloc_cow_block+0x22c/0x270 [btrfs]

Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: don't panic if we get an error while balancing V2</title>
<updated>2011-07-06T22:46:43+00:00</updated>
<author>
<name>Josef Bacik</name>
<email>josef@redhat.com</email>
</author>
<published>2011-07-02T21:24:41+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=508794eb5ec2a2b832742e78c6766844b10c0c94'/>
<id>urn:sha1:508794eb5ec2a2b832742e78c6766844b10c0c94</id>
<content type='text'>
A user reported an error where if we try to balance an fs after a device has
been removed it will blow up.  This is because we get an EIO back and this is
where BUG_ON(ret) bites us in the ass.  To fix we just exit.  Thanks,

Reported-by: Anand Jain &lt;Anand.Jain@oracle.com&gt;
Signed-off-by: Josef Bacik &lt;josef@redhat.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>btrfs: add missing options displayed in mount output</title>
<updated>2011-07-06T22:46:43+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.cz</email>
</author>
<published>2011-06-28T15:10:37+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0942caa373c676dca614ea8352ac77e0270aba73'/>
<id>urn:sha1:0942caa373c676dca614ea8352ac77e0270aba73</id>
<content type='text'>
There are three missed mount options settable by user which are not
currently displayed in mount output.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable</title>
<updated>2011-06-27T20:32:14+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-06-27T20:32:14+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=af4087e0e682df12bdffec5cfafc2fec9208716e'/>
<id>urn:sha1:af4087e0e682df12bdffec5cfafc2fec9208716e</id>
<content type='text'>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  btrfs: fix inconsonant inode information
  Btrfs: make sure to update total_bitmaps when freeing cache V3
  Btrfs: fix type mismatch in find_free_extent()
  Btrfs: make sure to record the transid in new inodes
</content>
</entry>
<entry>
<title>btrfs: fix inconsonant inode information</title>
<updated>2011-06-27T15:34:27+00:00</updated>
<author>
<name>Miao Xie</name>
<email>miaox@cn.fujitsu.com</email>
</author>
<published>2011-06-23T07:27:13+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2f7e33d432d097a2a7f467b031bf18be91cb3d49'/>
<id>urn:sha1:2f7e33d432d097a2a7f467b031bf18be91cb3d49</id>
<content type='text'>
When iputting the inode, We may leave the delayed nodes if they have some
delayed items that have not been dealt with. So when the inode is read again,
we must look up the relative delayed node, and use the information in it to
initialize the inode. Or we will get inconsonant inode information, it may
cause that the same directory index number is allocated again, and hit the
following oops:

[ 5447.554187] err add delayed dir index item(name: pglog_0.965_0) into the
insertion tree of the delayed node(root id: 262, inode id: 258, errno: -17)
[ 5447.569766] ------------[ cut here ]------------
[ 5447.575361] kernel BUG at fs/btrfs/delayed-inode.c:1301!
[SNIP]
[ 5447.790721] Call Trace:
[ 5447.793191]  [&lt;ffffffffa0641c4e&gt;] btrfs_insert_dir_item+0x189/0x1bb [btrfs]
[ 5447.800156]  [&lt;ffffffffa0651a45&gt;] btrfs_add_link+0x12b/0x191 [btrfs]
[ 5447.806517]  [&lt;ffffffffa0651adc&gt;] btrfs_add_nondir+0x31/0x58 [btrfs]
[ 5447.812876]  [&lt;ffffffffa0651d6a&gt;] btrfs_create+0xf9/0x197 [btrfs]
[ 5447.818961]  [&lt;ffffffff8111f840&gt;] vfs_create+0x72/0x92
[ 5447.824090]  [&lt;ffffffff8111fa8c&gt;] do_last+0x22c/0x40b
[ 5447.829133]  [&lt;ffffffff8112076a&gt;] path_openat+0xc0/0x2ef
[ 5447.834438]  [&lt;ffffffff810c58e2&gt;] ? __perf_event_task_sched_out+0x24/0x44
[ 5447.841216]  [&lt;ffffffff8103ecdd&gt;] ? perf_event_task_sched_out+0x59/0x67
[ 5447.847846]  [&lt;ffffffff81121a79&gt;] do_filp_open+0x3d/0x87
[ 5447.853156]  [&lt;ffffffff811e126c&gt;] ? strncpy_from_user+0x43/0x4d
[ 5447.859072]  [&lt;ffffffff8111f1f5&gt;] ? getname_flags+0x2e/0x80
[ 5447.864636]  [&lt;ffffffff8111f179&gt;] ? do_getname+0x14b/0x173
[ 5447.870112]  [&lt;ffffffff8111f1b7&gt;] ? audit_getname+0x16/0x26
[ 5447.875682]  [&lt;ffffffff8112b1ab&gt;] ? spin_lock+0xe/0x10
[ 5447.880882]  [&lt;ffffffff81112d39&gt;] do_sys_open+0x69/0xae
[ 5447.886153]  [&lt;ffffffff81112db1&gt;] sys_open+0x20/0x22
[ 5447.891114]  [&lt;ffffffff813b9aab&gt;] system_call_fastpath+0x16/0x1b

Fix it by reusing the old delayed node.

Reported-by: Jim Schutt &lt;jaschut@sandia.gov&gt;
Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Tested-by: Jim Schutt &lt;jaschut@sandia.gov&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: make sure to update total_bitmaps when freeing cache V3</title>
<updated>2011-06-25T13:31:06+00:00</updated>
<author>
<name>Josef Bacik</name>
<email>josef@redhat.com</email>
</author>
<published>2011-06-24T16:02:51+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9b90f5135320bc74dc6c9a8c74d69fd4821d9282'/>
<id>urn:sha1:9b90f5135320bc74dc6c9a8c74d69fd4821d9282</id>
<content type='text'>
A user reported this bug again where we have more bitmaps than we are supposed
to.  This is because we failed to load the free space cache, but don't update
the ctl-&gt;total_bitmaps counter when we remove entries from the tree.  This patch
fixes this problem and we should be good to go again.  Thanks,

Signed-off-by: Josef Bacik &lt;josef@redhat.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
</feed>
