<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/btrfs/sysfs.c, branch linux-4.4.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-06-11T10:23:52+00:00</updated>
<entry>
<title>btrfs: sysfs: don't leak memory when failing add fsid</title>
<updated>2019-06-11T10:23:52+00:00</updated>
<author>
<name>Tobin C. Harding</name>
<email>tobin@kernel.org</email>
</author>
<published>2019-05-13T03:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5c9a20390c010548901d3f2469a9699c7e39b11c'/>
<id>urn:sha1:5c9a20390c010548901d3f2469a9699c7e39b11c</id>
<content type='text'>
commit e32773357d5cc271b1d23550b3ed026eb5c2a468 upstream.

A failed call to kobject_init_and_add() must be followed by a call to
kobject_put().  Currently in the error path when adding fs_devices we
are missing this call.  This could be fixed by calling
btrfs_sysfs_remove_fsid() if btrfs_sysfs_add_fsid() returns an error or
by adding a call to kobject_put() directly in btrfs_sysfs_add_fsid().
Here we choose the second option because it prevents the slightly
unusual error path handling requirements of kobject from leaking out
into btrfs functions.

Add a call to kobject_put() in the error path of kobject_add_and_init().
This causes the release method to be called if kobject_init_and_add()
fails.  open_tree() is the function that calls btrfs_sysfs_add_fsid()
and the error code in this function is already written with the
assumption that the release method is called during the error path of
open_tree() (as seen by the call to btrfs_sysfs_remove_fsid() under the
fail_fsdev_sysfs label).

Cc: stable@vger.kernel.org # v4.4+
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Tobin C. Harding &lt;tobin@kernel.org&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>
</entry>
<entry>
<title>Btrfs: rename super_kobj to fsid_kobj</title>
<updated>2015-09-29T14:29:59+00:00</updated>
<author>
<name>Anand Jain</name>
<email>anand.jain@oracle.com</email>
</author>
<published>2015-08-14T10:32:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c1b7e474595b1b3a4463450cc22aa18b926093a3'/>
<id>urn:sha1:c1b7e474595b1b3a4463450cc22aa18b926093a3</id>
<content type='text'>
Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: rename btrfs_kobj_rm_device to btrfs_sysfs_rm_device_link</title>
<updated>2015-09-29T14:29:59+00:00</updated>
<author>
<name>Anand Jain</name>
<email>anand.jain@oracle.com</email>
</author>
<published>2015-08-14T10:32:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=325760404820e070bb20be0ce57e8d684d69a2ac'/>
<id>urn:sha1:325760404820e070bb20be0ce57e8d684d69a2ac</id>
<content type='text'>
Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: rename btrfs_kobj_add_device to btrfs_sysfs_add_device_link</title>
<updated>2015-09-29T14:29:59+00:00</updated>
<author>
<name>Anand Jain</name>
<email>anand.jain@oracle.com</email>
</author>
<published>2015-08-14T10:32:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e3bd6973bcf134a56786a8bd248d1740249352ec'/>
<id>urn:sha1:e3bd6973bcf134a56786a8bd248d1740249352ec</id>
<content type='text'>
Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: rename btrfs_sysfs_remove_one to btrfs_sysfs_remove_mounted</title>
<updated>2015-09-29T14:29:58+00:00</updated>
<author>
<name>Anand Jain</name>
<email>anand.jain@oracle.com</email>
</author>
<published>2015-08-14T10:32:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6618a59bfc0a0490f2a51df37c67878e23285670'/>
<id>urn:sha1:6618a59bfc0a0490f2a51df37c67878e23285670</id>
<content type='text'>
Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: rename btrfs_sysfs_add_one to btrfs_sysfs_add_mounted</title>
<updated>2015-09-29T14:29:57+00:00</updated>
<author>
<name>Anand Jain</name>
<email>anand.jain@oracle.com</email>
</author>
<published>2015-08-14T10:32:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96f3136e51580ed68a2952341c8b9e2d7f853472'/>
<id>urn:sha1:96f3136e51580ed68a2952341c8b9e2d7f853472</id>
<content type='text'>
Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: Check if kobject is initialized before put</title>
<updated>2015-06-22T12:43:31+00:00</updated>
<author>
<name>Anand Jain</name>
<email>Anand.Jain@oracle.com</email>
</author>
<published>2015-06-22T10:18:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f90fc5472882ee7e76e0f345b9642b92c8677582'/>
<id>urn:sha1:f90fc5472882ee7e76e0f345b9642b92c8677582</id>
<content type='text'>
Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Tested-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
<entry>
<title>Btrfs: sysfs: add support to add parent for fsid</title>
<updated>2015-05-27T10:27:22+00:00</updated>
<author>
<name>Anand Jain</name>
<email>anand.jain@oracle.com</email>
</author>
<published>2015-03-09T22:38:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=24bd69cb0fb2d90f4ced5f6acfee3688b33bcbdd'/>
<id>urn:sha1:24bd69cb0fb2d90f4ced5f6acfee3688b33bcbdd</id>
<content type='text'>
To support seed sysfs layout and represent seed fsid under
the sprout we need the facility to create fsid under the
specified parent.

Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
<entry>
<title>Btrfs: sysfs: separate kobject and attribute creation</title>
<updated>2015-05-27T10:27:22+00:00</updated>
<author>
<name>Anand Jain</name>
<email>anand.jain@oracle.com</email>
</author>
<published>2015-03-09T22:38:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b7c35e81adcd593daca2160b5ba0ec62f71a9303'/>
<id>urn:sha1:b7c35e81adcd593daca2160b5ba0ec62f71a9303</id>
<content type='text'>
Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
<entry>
<title>Btrfs: sysfs: btrfs_sysfs_remove_fsid() make it non static</title>
<updated>2015-05-27T10:27:22+00:00</updated>
<author>
<name>Anand Jain</name>
<email>anand.jain@oracle.com</email>
</author>
<published>2015-03-09T22:38:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1d1c1be3720c1f4b621c5f90a4f61bdd856a0aa8'/>
<id>urn:sha1:1d1c1be3720c1f4b621c5f90a4f61bdd856a0aa8</id>
<content type='text'>
Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
</feed>
