<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/mtd/ubi, branch v4.17.1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.17.1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.17.1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-04-11T23:39:34+00:00</updated>
<entry>
<title>Merge tag 'tags/upstream-4.17-rc1' of git://git.infradead.org/linux-ubifs</title>
<updated>2018-04-11T23:39:34+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2018-04-11T23:39:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=77cb51e65df0010cb22169bcbb6ea1b4f21da7e0'/>
<id>urn:sha1:77cb51e65df0010cb22169bcbb6ea1b4f21da7e0</id>
<content type='text'>
Pull UBI and UBIFS updates from Richard Weinberger:
 "Minor bug fixes and improvements"

* tag 'tags/upstream-4.17-rc1' of git://git.infradead.org/linux-ubifs:
  ubi: Reject MLC NAND
  ubifs: Remove useless parameter of lpt_heap_replace
  ubifs: Constify struct ubifs_lprops in scan_for_leb_for_idx
  ubifs: remove unnecessary assignment
  ubi: Fix error for write access
  ubi: fastmap: Don't flush fastmap work on detach
  ubifs: Check ubifs_wbuf_sync() return code
</content>
</entry>
<entry>
<title>ubi: Reject MLC NAND</title>
<updated>2018-04-04T21:48:11+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2018-03-03T10:45:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b5094b7f135be34630e3ea8a98fa215715d0f29d'/>
<id>urn:sha1:b5094b7f135be34630e3ea8a98fa215715d0f29d</id>
<content type='text'>
While UBI and UBIFS seem to work at first sight with MLC NAND, you will
most likely lose all your data upon a power-cut or due to read/write
disturb.
In order to protect users from bad surprises, refuse to attach to MLC
NAND.

Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Acked-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Acked-by: Artem Bityutskiy &lt;dedekind1@gmail.com&gt;
</content>
</entry>
<entry>
<title>ubi: Fix error for write access</title>
<updated>2018-04-04T21:48:05+00:00</updated>
<author>
<name>Romain Izard</name>
<email>romain.izard.pro@gmail.com</email>
</author>
<published>2018-01-29T10:18:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=78a8dfbabbece22bee58ac4cb26cab10e7a19c5d'/>
<id>urn:sha1:78a8dfbabbece22bee58ac4cb26cab10e7a19c5d</id>
<content type='text'>
When opening a device with write access, ubiblock_open returns an error
code. Currently, this error code is -EPERM, but this is not the right
value.

The open function for other block devices returns -EROFS when opening
read-only devices with FMODE_WRITE set. When used with dm-verity, the
veritysetup userspace tool is expecting EROFS, and refuses to use the
ubiblock device.

Use -EROFS for ubiblock as well. As a result, veritysetup accepts the
ubiblock device as valid.

Cc: stable@vger.kernel.org
Fixes: 9d54c8a33eec (UBI: R/O block driver on top of UBI volumes)
Signed-off-by: Romain Izard &lt;romain.izard.pro@gmail.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>ubi: fastmap: Don't flush fastmap work on detach</title>
<updated>2018-04-04T21:41:44+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2018-01-17T22:15:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=29b7a6fa1ec07e8480b0d9caf635a4498a438bf4'/>
<id>urn:sha1:29b7a6fa1ec07e8480b0d9caf635a4498a438bf4</id>
<content type='text'>
At this point UBI volumes have already been free()'ed and fastmap can no
longer access these data structures.

Reported-by: Martin Townsend &lt;mtownsend1973@gmail.com&gt;
Fixes: 74cdaf24004a ("UBI: Fastmap: Fix memory leaks while closing the WL sub-system")
Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>mtd: Stop updating erase_info-&gt;state and calling mtd_erase_callback()</title>
<updated>2018-03-21T08:50:56+00:00</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-02-12T21:03:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e7bfb3fdbde3bfeeeb64e2d73ac6babe59519c9e'/>
<id>urn:sha1:e7bfb3fdbde3bfeeeb64e2d73ac6babe59519c9e</id>
<content type='text'>
MTD users are no longer checking erase_info-&gt;state to determine if the
erase operation failed or succeeded. Moreover, mtd_erase_callback() is
now a NOP.

We can safely get rid of all mtd_erase_callback() calls and all
erase_info-&gt;state assignments. While at it, get rid of the
erase_info-&gt;state field, all MTD_ERASE_XXX definitions and the
mtd_erase_callback() function.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Reviewed-by: Richard Weinberger &lt;richard@nod.at&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Acked-by: Bert Kenward &lt;bkenward@solarflare.com&gt;
---
Changes in v2:
- Address a few coding style issues (reported by Miquel)
- Remove comments that are no longer valid (reported by Miquel)
</content>
</entry>
<entry>
<title>mtd: Unconditionally update -&gt;fail_addr and -&gt;addr in part_erase()</title>
<updated>2018-03-15T17:22:26+00:00</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-02-12T21:03:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8f347c4232d5fc097599b711a3385722a6834005'/>
<id>urn:sha1:8f347c4232d5fc097599b711a3385722a6834005</id>
<content type='text'>
-&gt;fail_addr and -&gt;addr can be updated no matter the result of
parent-&gt;_erase(), we just need to remove the code doing the same thing
in mtd_erase_callback() to avoid adjusting those fields twice.

Note that this can be done because all MTD users have been converted to
not pass an erase_info-&gt;callback() and are thus only taking the
-&gt;addr_fail and -&gt;addr fields into account after part_erase() has
returned.

While we're at it, get rid of the erase_info-&gt;mtd field which was only
needed to let mtd_erase_callback() get the partition device back.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Reviewed-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>mtd: Stop assuming mtd_erase() is asynchronous</title>
<updated>2018-03-15T17:21:07+00:00</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@bootlin.com</email>
</author>
<published>2018-02-12T21:03:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=884cfd9023ce6afe8bcf181ec988d8516eb32bf0'/>
<id>urn:sha1:884cfd9023ce6afe8bcf181ec988d8516eb32bf0</id>
<content type='text'>
None of the mtd-&gt;_erase() implementations work in an asynchronous manner,
so let's simplify MTD users that call mtd_erase(). All they need to do
is check the value returned by mtd_erase() and assume that != 0 means
failure.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Reviewed-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>ubi: block: Fix locking for idr_alloc/idr_remove</title>
<updated>2018-01-18T15:48:31+00:00</updated>
<author>
<name>Bradley Bolen</name>
<email>bradleybolen@gmail.com</email>
</author>
<published>2018-01-18T13:55:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7f29ae9f977bcdc3654e68bc36d170223c52fd48'/>
<id>urn:sha1:7f29ae9f977bcdc3654e68bc36d170223c52fd48</id>
<content type='text'>
This fixes a race with idr_alloc where gd-&gt;first_minor can be set to the
same value for two simultaneous calls to ubiblock_create.  Each instance
calls device_add_disk with the same first_minor.  device_add_disk calls
bdi_register_owner which generates several warnings.

WARNING: CPU: 1 PID: 179 at kernel-source/fs/sysfs/dir.c:31
sysfs_warn_dup+0x68/0x88
sysfs: cannot create duplicate filename '/devices/virtual/bdi/252:2'

WARNING: CPU: 1 PID: 179 at kernel-source/lib/kobject.c:240
kobject_add_internal+0x1ec/0x2f8
kobject_add_internal failed for 252:2 with -EEXIST, don't try to
register things with the same name in the same directory

WARNING: CPU: 1 PID: 179 at kernel-source/fs/sysfs/dir.c:31
sysfs_warn_dup+0x68/0x88
sysfs: cannot create duplicate filename '/dev/block/252:2'

However, device_add_disk does not error out when bdi_register_owner
returns an error.  Control continues until reaching blk_register_queue.
It then BUGs.

kernel BUG at kernel-source/fs/sysfs/group.c:113!
[&lt;c01e26cc&gt;] (internal_create_group) from [&lt;c01e2950&gt;]
(sysfs_create_group+0x20/0x24)
[&lt;c01e2950&gt;] (sysfs_create_group) from [&lt;c00e3d38&gt;]
(blk_trace_init_sysfs+0x18/0x20)
[&lt;c00e3d38&gt;] (blk_trace_init_sysfs) from [&lt;c02bdfbc&gt;]
(blk_register_queue+0xd8/0x154)
[&lt;c02bdfbc&gt;] (blk_register_queue) from [&lt;c02cec84&gt;]
(device_add_disk+0x194/0x44c)
[&lt;c02cec84&gt;] (device_add_disk) from [&lt;c0436ec8&gt;]
(ubiblock_create+0x284/0x2e0)
[&lt;c0436ec8&gt;] (ubiblock_create) from [&lt;c0427bb8&gt;]
(vol_cdev_ioctl+0x450/0x554)
[&lt;c0427bb8&gt;] (vol_cdev_ioctl) from [&lt;c0189110&gt;] (vfs_ioctl+0x30/0x44)
[&lt;c0189110&gt;] (vfs_ioctl) from [&lt;c01892e0&gt;] (do_vfs_ioctl+0xa0/0x790)
[&lt;c01892e0&gt;] (do_vfs_ioctl) from [&lt;c0189a14&gt;] (SyS_ioctl+0x44/0x68)
[&lt;c0189a14&gt;] (SyS_ioctl) from [&lt;c0010640&gt;] (ret_fast_syscall+0x0/0x34)

Locking idr_alloc/idr_remove removes the race and keeps gd-&gt;first_minor
unique.

Fixes: 2bf50d42f3a4 ("UBI: block: Dynamically allocate minor numbers")
Cc: stable@vger.kernel.org
Signed-off-by: Bradley Bolen &lt;bradleybolen@gmail.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>mtd: ubi: wl: Fix error return code in ubi_wl_init()</title>
<updated>2018-01-18T15:45:19+00:00</updated>
<author>
<name>Wei Yongjun</name>
<email>weiyongjun1@huawei.com</email>
</author>
<published>2018-01-18T14:05:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7233982ade15eeac05c6f351e8d347406e6bcd2f'/>
<id>urn:sha1:7233982ade15eeac05c6f351e8d347406e6bcd2f</id>
<content type='text'>
Fix to return error code -ENOMEM from the kmem_cache_alloc() error
handling case instead of 0, as done elsewhere in this function.

Fixes: f78e5623f45b ("ubi: fastmap: Erase outdated anchor PEBs during
attach")
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.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: Fix copy/paste error in function documentation</title>
<updated>2018-01-17T23:18:51+00:00</updated>
<author>
<name>Sascha Hauer</name>
<email>s.hauer@pengutronix.de</email>
</author>
<published>2017-11-24T11:17:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=01f196945a21b3eec37317e3bc5cf35f95f95063'/>
<id>urn:sha1:01f196945a21b3eec37317e3bc5cf35f95f95063</id>
<content type='text'>
The function documentation of leb_write_trylock is copied from
leb_write_lock. Replace the function name with the correct one.

Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
</feed>
