<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/sysfs.c, branch linux-3.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-07-01T03:12:02Z</updated>
<entry>
<title>btrfs: allocate raid type kobjects dynamically</title>
<updated>2014-07-01T03:12:02Z</updated>
<author>
<name>Jeff Mahoney</name>
</author>
<published>2014-05-27T16:59:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9e22eb8c724a00c0d51f4c0d144c48bd0d108bd2'/>
<id>urn:sha1:9e22eb8c724a00c0d51f4c0d144c48bd0d108bd2</id>
<content type='text'>
commit c1895442be01c58449e3bf9272f22062a670e08f upstream.

We are currently allocating space_info objects in an array when we
allocate space_info. When a user does something like:

# btrfs balance start -mconvert=raid1 -dconvert=raid1 /mnt
# btrfs balance start -mconvert=single -dconvert=single /mnt -f
# btrfs balance start -mconvert=raid1 -dconvert=raid1 /

We can end up with memory corruption since the kobject hasn't
been reinitialized properly and the name pointer was left set.

The rationale behind allocating them statically was to avoid
creating a separate kobject container that just contained the
raid type. It used the index in the array to determine the index.

Ultimately, though, this wastes more memory than it saves in all
but the most complex scenarios and introduces kobject lifetime
questions.

This patch allocates the kobjects dynamically instead. Note that
we also remove the kobject_get/put of the parent kobject since
kobject_add and kobject_del do that internally.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Reported-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>btrfs: fix null pointer deference at btrfs_sysfs_add_one+0x105</title>
<updated>2014-02-15T16:03:09Z</updated>
<author>
<name>Anand Jain</name>
</author>
<published>2014-01-15T09:22:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f085381e6d08f4c8d6882825f31accd455c54d70'/>
<id>urn:sha1:f085381e6d08f4c8d6882825f31accd455c54d70</id>
<content type='text'>
bdev is null when disk has disappeared and mounted with
the degrade option

stack trace
---------
btrfs_sysfs_add_one+0x105/0x1c0 [btrfs]
open_ctree+0x15f3/0x1fe0 [btrfs]
btrfs_mount+0x5db/0x790 [btrfs]
? alloc_pages_current+0xa4/0x160
mount_fs+0x34/0x1b0
vfs_kern_mount+0x62/0xf0
do_mount+0x22e/0xa80
? __get_free_pages+0x9/0x40
? copy_mount_options+0x31/0x170
SyS_mount+0x7e/0xc0
system_call_fastpath+0x16/0x1b
---------

reproducer:
-------
mkfs.btrfs -draid1 -mraid1 /dev/sdc /dev/sdd
(detach a disk)
devmgt detach /dev/sdc [1]
mount -o degrade /dev/sdd /btrfs
-------

[1] github.com/anajain/devmgt.git

Signed-off-by: Anand Jain &lt;Anand.Jain@oracle.com&gt;
Tested-by: Hidetoshi Seto &lt;seto.hidetoshi@jp.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: sysfs: list the NO_HOLES feature</title>
<updated>2014-01-28T21:20:42Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-01-21T17:56:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c736c095de53c1a0a23909239d69bb56693df8ef'/>
<id>urn:sha1:c736c095de53c1a0a23909239d69bb56693df8ef</id>
<content type='text'>
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: sysfs: don't show reserved incompat feature</title>
<updated>2014-01-28T21:20:41Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-01-21T17:56:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=66b4bbd4f5895e4b9da03885c00e42ba64f7038e'/>
<id>urn:sha1:66b4bbd4f5895e4b9da03885c00e42ba64f7038e</id>
<content type='text'>
The COMPRESS_LZOv2 incompat featue is currently not implemented, the bit
is only reserved, no point to list it in sysfs.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: convert printk to btrfs_ and fix BTRFS prefix</title>
<updated>2014-01-28T21:20:05Z</updated>
<author>
<name>Frank Holton</name>
</author>
<published>2013-12-20T16:37:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=efe120a067c8674a8ae21b194f0e68f098b61ee2'/>
<id>urn:sha1:efe120a067c8674a8ae21b194f0e68f098b61ee2</id>
<content type='text'>
Convert all applicable cases of printk and pr_* to the btrfs_* macros.

Fix all uses of the BTRFS prefix.

Signed-off-by: Frank Holton &lt;fholton@gmail.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: fix leaks during sysfs teardown</title>
<updated>2014-01-28T21:19:45Z</updated>
<author>
<name>Jeff Mahoney</name>
</author>
<published>2013-11-21T15:37:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e453d989e0bb33defaaa5be4e9f577cea946e2a6'/>
<id>urn:sha1:e453d989e0bb33defaaa5be4e9f577cea946e2a6</id>
<content type='text'>
Filipe noticed that we were leaking the features attribute group
after umount. His fix of just calling sysfs_remove_group() wasn't enough
since that removes just the supported features and not the unsupported
features.

This patch changes the unknown feature handling to add them individually
so we can skip the kmalloc and uses the same iteration to tear them down
later.

We also fix the error handling during mount so that we catch the
failing creation of the per-super kobject, and handle proper teardown
of a half-setup sysfs context.

Tested properly with kmemleak enabled this time.

Reported-by: Filipe David Borba Manana &lt;fdmanana@gmail.com&gt;
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Tested-by: Filipe David Borba Manana &lt;fdmanana@gmail.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: replace BUG in can_modify_feature</title>
<updated>2014-01-28T21:19:41Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2013-11-19T12:36:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc37bb04201217b7acb11213e16cb5530c30da8f'/>
<id>urn:sha1:cc37bb04201217b7acb11213e16cb5530c30da8f</id>
<content type='text'>
We don't need to crash hard here, it's just reading a sysfs file. The
values considered in switch are from a fixed set, the default case
should not happen at all.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: reserve no transaction units in btrfs_feature_attr_store</title>
<updated>2014-01-28T21:19:40Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2013-11-18T13:24:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=43d87fa23154d135a2a1006bc6656ae73ae84190'/>
<id>urn:sha1:43d87fa23154d135a2a1006bc6656ae73ae84190</id>
<content type='text'>
Added in patch "btrfs: add ability to change features via sysfs",
modifications to superblock don't need to reserve metadata blocks when
starting a transaction.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: publish fs label in sysfs</title>
<updated>2014-01-28T21:19:30Z</updated>
<author>
<name>Jeff Mahoney</name>
</author>
<published>2013-11-01T17:07:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8ba9c11f8320be0d553d4b18000e35f7ad672ac'/>
<id>urn:sha1:f8ba9c11f8320be0d553d4b18000e35f7ad672ac</id>
<content type='text'>
This adds a writeable attribute which describes the label.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: publish device membership in sysfs</title>
<updated>2014-01-28T21:19:29Z</updated>
<author>
<name>Jeff Mahoney</name>
</author>
<published>2013-11-01T17:07:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=29e5be240a3caf175364fdeecb0441dff500d5d9'/>
<id>urn:sha1:29e5be240a3caf175364fdeecb0441dff500d5d9</id>
<content type='text'>
Now that we have the infrastructure for per-super attributes, we can
publish device membership in /sys/fs/btrfs/&lt;fsid&gt;/devices. The information
is published as symlinks to the block devices.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
</feed>
