<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/mtd/ubi/vmt.c, branch linux-4.16.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-01-17T20:47:33+00:00</updated>
<entry>
<title>ubi: Fix race condition between ubi volume creation and udev</title>
<updated>2018-01-17T20:47:33+00:00</updated>
<author>
<name>Clay McClure</name>
<email>clay@daemons.net</email>
</author>
<published>2017-09-22T02:01:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a51a0c8d213594bc094cb8e54aad0cb6d7f7b9a6'/>
<id>urn:sha1:a51a0c8d213594bc094cb8e54aad0cb6d7f7b9a6</id>
<content type='text'>
Similar to commit 714fb87e8bc0 ("ubi: Fix race condition between ubi
device creation and udev"), we should make the volume active before
registering it.

Signed-off-by: Clay McClure &lt;clay@daemons.net&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>mtd: utilize new cdev_device_add helper function</title>
<updated>2017-03-21T05:44:33+00:00</updated>
<author>
<name>Logan Gunthorpe</name>
<email>logang@deltatee.com</email>
</author>
<published>2017-03-17T18:48:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=493cfaeaa0c9bc0c79ce5751193d49fdac9aaaec'/>
<id>urn:sha1:493cfaeaa0c9bc0c79ce5751193d49fdac9aaaec</id>
<content type='text'>
This is not as straightforward a conversion as the others
in this series. These drivers did not originally make use of
kobj.parent so they likely suffered from a use after free bug if
someone unregistered the devices while they are being used.

In order to make the conversions, switch from device_register
to device_initialize / cdev_device_add.

In build.c, this patch unwinds a complicated mess of extra
get_device/put_devices and reference tracking by moving device_initialize
early in the attach process. Then it always uses put_device and instead of
using device_unregister and extra get_devices everywhere we just use
cdev_device_del and one put_device once everything is completely done.
This simplifies things dramatically and makes it easier to reason about.

In vmt.c, the patch pushes device initialization up to the beginning of the
device creation and then that function only needs to use put_device
in the error path which simplifies things a good deal.

Signed-off-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>UBI: hide EBA internals</title>
<updated>2016-10-02T20:48:14+00:00</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2016-09-16T14:59:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=799dca34ac543485f581bd8464ec9b1c4f0f852a'/>
<id>urn:sha1:799dca34ac543485f581bd8464ec9b1c4f0f852a</id>
<content type='text'>
Create a private ubi_eba_table struct to hide EBA internals and provide
helpers to allocate, destroy, copy and assing an EBA table to a volume.

Now that external EBA users are using helpers to query/modify the EBA
state we can safely change the internal representation, which will be
needed to support the LEB consolidation concept.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>ubi: Make volume resize power cut aware</title>
<updated>2016-07-29T21:32:01+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2016-06-23T17:30:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4946784bd3924b1374f05eebff2fd68660bae866'/>
<id>urn:sha1:4946784bd3924b1374f05eebff2fd68660bae866</id>
<content type='text'>
When the volume resize operation shrinks a volume,
LEBs will be unmapped. Since unmapping will not erase these
LEBs immediately we have to wait for that operation to finish.
Otherwise in case of a power cut right after writing the new
volume table the UBI attach process can find more LEBs than the
volume table knows. This will render the UBI image unattachable.

Fix this issue by waiting for erase to complete and write the new
volume table afterward.

Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Clean up return in ubi_remove_volume()</title>
<updated>2016-05-24T13:24:26+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-04-13T06:41:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fadb3665bad96be8f696e4899ee0f618536d54c7'/>
<id>urn:sha1:fadb3665bad96be8f696e4899ee0f618536d54c7</id>
<content type='text'>
My static checker says that "err" can be uninitialized if
"vol-&gt;reserved_pebs" is &lt;= 0.  I don't think that can happen but
returning a literal is cleaner anyway.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Use static class and attribute groups</title>
<updated>2015-06-02T11:16:25+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2015-05-15T08:20:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=53cd255ce7539eff28d86eafb3416a6d964be4df'/>
<id>urn:sha1:53cd255ce7539eff28d86eafb3416a6d964be4df</id>
<content type='text'>
This patch cleans up the manual device_create_file() or
class_create_file() calls by replacing with static attribute groups.
It simplifies the code and also avoids the possible races between the
device/class registration and sysfs creations.

For the simplification, also make ubi_class a static instance with
initializers, too.

Amend a bit by Hujianyang.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Tested-by: Sheng Yong &lt;shengyong1@huawei.com&gt;
Signed-off-by: hujianyang &lt;hujianyang@huawei.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Init vol-&gt;reserved_pebs by assignment</title>
<updated>2015-06-02T09:44:43+00:00</updated>
<author>
<name>shengyong</name>
<email>shengyong1@huawei.com</email>
</author>
<published>2015-05-26T10:07:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e8d266cf8d24e52eac65bdab24afd6f4cfc0ad07'/>
<id>urn:sha1:e8d266cf8d24e52eac65bdab24afd6f4cfc0ad07</id>
<content type='text'>
`vol' is a newly allocated value by kzalloc. Initialize it by assignment
instead of `+='.

Signed-off-by: Sheng Yong &lt;shengyong1@huawei.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: Extend UBI layer debug/messaging capabilities</title>
<updated>2014-11-07T10:08:51+00:00</updated>
<author>
<name>Tanya Brokhman</name>
<email>tlinder@codeaurora.org</email>
</author>
<published>2014-10-20T16:57:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=326087033108e7806e24974f2c8271f95cddaf3a'/>
<id>urn:sha1:326087033108e7806e24974f2c8271f95cddaf3a</id>
<content type='text'>
If there is more then one UBI device mounted, there is no way to
distinguish between messages from different UBI devices.
Add device number to all ubi layer message types.

The R/O block driver messages were replaced by pr_* since
ubi_device structure is not used by it.

Amended a bit by Artem.

Signed-off-by: Tanya Brokhman &lt;tlinder@codeaurora.org&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>UBI: introduce helpers dbg_chk_{io, gen}</title>
<updated>2012-12-10T11:38:59+00:00</updated>
<author>
<name>Ezequiel Garcia</name>
<email>elezegarcia@gmail.com</email>
</author>
<published>2012-11-28T12:18:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=64575574f26d7969713ede9bde750c979da4037e'/>
<id>urn:sha1:64575574f26d7969713ede9bde750c979da4037e</id>
<content type='text'>
With this patch code is a bit more readable and there's no
generated code or functionality impact.
Furthermore, this abstracts implementation details and
will allow to change ubi_debug_info in a less invasive way.

Signed-off-by: Ezequiel Garcia &lt;elezegarcia@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>UBI: replace memcpy with struct assignment</title>
<updated>2012-12-03T11:54:14+00:00</updated>
<author>
<name>Ezequiel Garcia</name>
<email>elezegarcia@gmail.com</email>
</author>
<published>2012-11-23T11:58:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d856c13c11d81dfa545f927db8d31663d45bbc94'/>
<id>urn:sha1:d856c13c11d81dfa545f927db8d31663d45bbc94</id>
<content type='text'>
This kind of memcpy() is error-prone. Its replacement with a struct
assignment is prefered because it's type-safe and much easier to read.

Found by coccinelle. Hand patched and reviewed.
Tested by compilation only.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@@
identifier struct_name;
struct struct_name to;
struct struct_name from;
expression E;
@@
-memcpy(&amp;(to), &amp;(from), E);
+to = from;
// &lt;/smpl&gt;

Signed-off-by: Peter Senna Tschudin &lt;peter.senna@gmail.com&gt;
Signed-off-by: Ezequiel Garcia &lt;elezegarcia@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
</feed>
