- 28 3月, 2016 1 次提交
-
-
由 Al Viro 提交于
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 21 3月, 2016 1 次提交
-
-
由 Joe Perches 提交于
Using logging functions instead of macros can reduce overall object size. $ size drivers/mtd/ubi/built-in.o* text data bss dec hex filename 271620 163364 73696 508680 7c308 drivers/mtd/ubi/built-in.o.allyesconfig.new 287638 165380 73504 526522 808ba drivers/mtd/ubi/built-in.o.allyesconfig.old 87728 3780 504 92012 1676c drivers/mtd/ubi/built-in.o.defconfig.new 97084 3780 504 101368 18bf8 drivers/mtd/ubi/built-in.o.defconfig.old Signed-off-by: NJoe Perches <joe@perches.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 06 3月, 2016 1 次提交
-
-
由 Richard Weinberger 提交于
ubi_start_leb_change() allocates too few bytes. ubi_more_leb_change_data() will write up to req->upd_bytes + ubi->min_io_size bytes. Cc: stable@vger.kernel.org Signed-off-by: NRichard Weinberger <richard@nod.at> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 23 1月, 2016 1 次提交
-
-
由 Al Viro 提交于
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested}, inode_foo(inode) being mutex_foo(&inode->i_mutex). Please, use those for access to ->i_mutex; over the coming cycle ->i_mutex will become rwsem, with ->lookup() done with it held only shared. Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 10 1月, 2016 1 次提交
-
-
由 Sebastian Siewior 提交于
wear_leveling_worker() currently unconditionally puts a PEB on erase in the error case even it just been taken from the free_list and never used. In case the PEB was never used it can be put back on the free list saving a precious erase cycle. v1…v2: - to_leb_clean -> dst_leb_clean - use the nested option for ensure_wear_leveling() - do_sync_erase() can't go -ENOMEM so we can just go into RO-mode now. Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 17 12月, 2015 4 次提交
-
-
由 Sebastian Siewior 提交于
If __erase_worker() fails to erase the EB and schedule_erase() fails as well to do anything about it then we go RO. But that is not a reason to leak the e argument here. Therefore clean up e. Cc: <stable@vger.kernel.org> Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Sebastian Siewior 提交于
Since fastmap we gained do_sync_erase(). This function can return an error and its error handling isn't obvious. First the memory allocation for struct ubi_work can fail and as such struct ubi_wl_entry is leaked. However if the memory allocation succeeds then the tail function takes care of the struct ubi_wl_entry. A free here could result in a double free. To make the error handling simpler, I split the tail function into one piece which does the work and another which frees the struct ubi_work which is passed as argument. As result do_sync_erase() can keep the struct on stack and we get rid of one error source. Cc: <stable@vger.kernel.org> Fixes: 8199b901 ("UBI: Add fastmap support to the WL sub-system") Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Brian Norris 提交于
Looks like a typo, using UBI_EC_HDR_SIZE_CRC (note the "EC") to compute the CRC for the VID header. This shouldn't cause any functional change, as both structures are 64 bytes. Verified with: BUILD_BUG_ON(UBI_VID_HDR_SIZE_CRC != UBI_EC_HDR_SIZE_CRC); Reported here: http://lists.infradead.org/pipermail/linux-mtd/2013-September/048570.html Reported by: Bill Pringlemeir <bpringlemeir@gmail.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Sudip Mukherjee 提交于
We are checking dfs_rootdir for error value or NULL. But in the conditional ternary operator we returned -ENODEV if dfs_rootdir contains an error value and returned PTR_ERR(dfs_rootdir) if dfs_rootdir is NULL. So in the case of dfs_rootdir being NULL we actually assigned 0 to err and returned it to the caller implying a success. Lets return -ENODEV when dfs_rootdir is NULL else return PTR_ERR(dfs_rootdir). Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 07 11月, 2015 2 次提交
-
-
由 Richard Weinberger 提交于
...found while browsing. Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Ezequiel García 提交于
The PEB array is an array of __be32, so let's fix the scan_pool() prototype accordingly. Signed-off-by: NEzequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 04 10月, 2015 6 次提交
-
-
由 Richard Weinberger 提交于
If fastmap requests a free PEB for a pool and UBI is busy with erasing PEBs we need to offer a function to wait for one. We can reuse produce_free_peb() from the non-fastmap WL code but with different locking semantics. Cc: stable@vger.kernel.org # 4.1.x- Reported-and-tested-by: NJörg Krause <joerg.krause@embedded.rocks> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Julia Lawall 提交于
Remove unneeded NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // </smpl> Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Andrew Murray 提交于
This patch trivially updates code comments to reflect the addition of the UBI_METAONLY flag - as discussed https://lkml.org/lkml/2014/10/29/764 Cc: Richard Weinberger <richard@nod.at> Cc: trivial@kernel.org Signed-off-by: NAndrew Murray <amurray@embedded-bits.co.uk> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Richard Weinberger 提交于
We have to use j instead of i. i is the volume id and not the block. Reported-by: Alexander.Block@continental-corporation.com Signed-off-by: NRichard Weinberger <richard@nod.at> Acked-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Richard Weinberger 提交于
While we are here fix a s/beween/between typo. Signed-off-by: NRichard Weinberger <richard@nod.at> Acked-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Richard Weinberger 提交于
There is no need to compute pnum again. Signed-off-by: NRichard Weinberger <richard@nod.at> Acked-by: NBrian Norris <computersforpeace@gmail.com>
-
- 29 9月, 2015 3 次提交
-
-
由 Andrew Murray 提交于
This patch trivially updates code comments to reflect the addition of the UBI_METAONLY flag - as discussed https://lkml.org/lkml/2014/10/29/764 Cc: Richard Weinberger <richard@nod.at> Cc: trivial@kernel.org Signed-off-by: NAndrew Murray <amurray@embedded-bits.co.uk> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 shengyong 提交于
UBI: attaching mtd1 to ubi0 UBI: scanning is finished UBI error: init_volumes: not enough PEBs, required 706, available 686 UBI error: ubi_wl_init: no enough physical eraseblocks (-20, need 1) UBI error: ubi_attach_mtd_dev: failed to attach mtd1, error -12 <= NOT ENOMEM UBI error: ubi_init: cannot attach mtd1 If available PEBs are not enough when initializing volumes, return -ENOSPC directly. If available PEBs are not enough when initializing WL, return -ENOSPC instead of -ENOMEM. Cc: stable@vger.kernel.org Signed-off-by: NSheng Yong <shengyong1@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at> Reviewed-by: NDavid Gstir <david@sigma-star.at>
-
由 Richard Weinberger 提交于
Make sure that data_size is less than LEB size. Otherwise a handcrafted UBI image is able to trigger an out of bounds memory access in ubi_compare_lebs(). Cc: stable@vger.kernel.org Signed-off-by: NRichard Weinberger <richard@nod.at> Reviewed-by: NDavid Gstir <david@sigma-star.at>
-
- 03 6月, 2015 1 次提交
-
-
由 shengyong 提交于
Signed-off-by: NSheng Yong <shengyong1@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 02 6月, 2015 8 次提交
-
-
由 Takashi Iwai 提交于
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: NTakashi Iwai <tiwai@suse.de> Tested-by: NSheng Yong <shengyong1@huawei.com> Signed-off-by: Nhujianyang <hujianyang@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 shengyong 提交于
Signed-off-by: NSheng Yong <shengyong1@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 shengyong 提交于
During fastmap attaching, check if a volume already exists when adding the volume to volume tree. NOTE that the issue cannot happen, only if the on-flash fastmap data is modified. Signed-off-by: NSheng Yong <shengyong1@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 shengyong 提交于
`vol' is a newly allocated value by kzalloc. Initialize it by assignment instead of `+='. Signed-off-by: NSheng Yong <shengyong1@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 shengyong 提交于
s/fmpl1/fmpl s/fmpl2/fmpl_wl Add "WL" to the error message when wrong WL pool magic number is detected. Signed-off-by: NSheng Yong <shengyong1@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 shengyong 提交于
Signed-off-by: NSheng Yong <shengyong1@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 shengyong 提交于
Signed-off-by: NSheng Yong <shengyong1@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Dan Ehrenberg 提交于
This patch makes ubiblock devices have minor numbers beginning from 0, allocated dynamically independently of the ubi device/volume number. This property becomes useful because, on 32-bit architectures with LFS turned off in a userspace program, device minor numbers over 8 bits cause stat to return -EOVERFLOW. If the device number is high (>1) due to multiple MTD partitions, such an overflow will occur. While enabling LFS is clearly a nicer solution, it's often difficult to turn on in practice globally as many widely distributed packages don't work with LFS on. Other storage systems have their own workarounds, with SCSI making multiple device majors and MMC having a config option for the number of partitions per device. A completely dynamic minor numbering is simpler than these. It is unlikely that anyone is depending on a static minor number since the major is dynamic anyway. In addition, ubiblock is still relatively new, so now is the time to make such changes. Signed-off-by: NDan Ehrenberg <dehrenberg@chromium.org> Acked-by: NEzequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 28 5月, 2015 1 次提交
-
-
由 Luis R. Rodriguez 提交于
Most code already uses consts for the struct kernel_param_ops, sweep the kernel for the last offending stragglers. Other than include/linux/moduleparam.h and kernel/params.c all other changes were generated with the following Coccinelle SmPL patch. Merge conflicts between trees can be handled with Coccinelle. In the future git could get Coccinelle merge support to deal with patch --> fail --> grammar --> Coccinelle --> new patch conflicts automatically for us on patches where the grammar is available and the patch is of high confidence. Consider this a feature request. Test compiled on x86_64 against: * allnoconfig * allmodconfig * allyesconfig @ const_found @ identifier ops; @@ const struct kernel_param_ops ops = { }; @ const_not_found depends on !const_found @ identifier ops; @@ -struct kernel_param_ops ops = { +const struct kernel_param_ops ops = { }; Generated-by: Coccinelle SmPL Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Junio C Hamano <gitster@pobox.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: cocci@systeme.lip6.fr Cc: linux-kernel@vger.kernel.org Signed-off-by: NLuis R. Rodriguez <mcgrof@suse.com> Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
-
- 07 5月, 2015 1 次提交
-
-
由 Kevin Cernekee 提交于
Block drivers are responsible for calling flush_dcache_page() on each BIO request. This operation keeps the I$ coherent with the D$ on architectures that don't have hardware coherency support. Without this flush, random crashes are seen when executing user programs from an ext4 filesystem backed by a ubiblock device. This patch is based on the change implemented in commit 2d4dc890 ("block: add helpers to run flush_dcache_page() against a bio and a request's pages"). Fixes: 9d54c8a3 ("UBI: R/O block driver on top of UBI volumes") Signed-off-by: NKevin Cernekee <cernekee@chromium.org> Signed-off-by: NEzequiel Garcia <ezequiel.garcia@imgtec.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 16 4月, 2015 1 次提交
-
-
由 David Howells 提交于
Signed-off-by: NDavid Howells <dhowells@redhat.com> Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 14 4月, 2015 1 次提交
-
-
Emulate random power cuts by switching device to ro after a number of writes to allow simple power cut testing with nand-sim. Maximum and minimum number of successful writes before power cut and what kind of writes (EC header, VID header or none) to interrupt configurable via debugfs. Signed-off-by: NDavid Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 27 3月, 2015 7 次提交
-
-
由 Richard Weinberger 提交于
If we encounter an uncorrectable ECC error while scanning for the fastmap UBI must not fail hard. Instead fall back to scanning mode. Reported-by: NAlexander Block <Alexander.Block@continental-corporation.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Richard Weinberger 提交于
This function was added to fastmap in a very early stage to have paranoid assertions. With the current fastmap implementation this assert will never trigger as fastmap PEBs are not seen by the WL sub-system. Remove it to save us some CPU cycles. Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Richard Weinberger 提交于
Another checkpatch complaint: WARNING: Missing a blank line after declarations Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Richard Weinberger 提交于
checkpatch.pl complains: WARNING: else is not generally useful after a break or return Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Richard Weinberger 提交于
...and kill another #ifdef. Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Richard Weinberger 提交于
...and kill another #ifdef in wl.c. :-) Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Richard Weinberger 提交于
Use the new WL accessor functions in fastmap. Signed-off-by: NRichard Weinberger <richard@nod.at>
-