- 27 3月, 2015 2 次提交
-
-
由 Richard Weinberger 提交于
ubi_wl_get_peb() has two problems, it reads the pool size and usage counters without any protection. While reading one value would be perfectly fine it reads multiple values and compares them. This is racy and can lead to incorrect pool handling. Furthermore ubi_update_fastmap() is called without wl_lock held, before incrementing the used counter it needs to be checked again. It could happen that another thread consumed all PEBs from the pool and the counter goes beyond ->size. Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Richard Weinberger 提交于
If the WL pool runs out of PEBs we schedule a fastmap write to refill it as soon as possible. Ensure that only one at a time is scheduled otherwise we might end in a fastmap write storm because writing the fastmap can schedule another write if bitflips are detected. Signed-off-by: NRichard Weinberger <richard@nod.at> Reviewed-by: NTanya Brokhman <tlinder@codeaurora.org> Reviewed-by: NGuido Martínez <guido@vanguardiasur.com.ar>
-
- 26 3月, 2015 1 次提交
-
-
由 Brian Norris 提交于
The kerneldoc for @vid_hdr_aloffset continues onto a second line, but this is not obvious, because the second line isn't indented, and it begins with '@'. Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 28 1月, 2015 3 次提交
-
-
由 Artem Bityutskiy 提交于
Let's prefix UBI messages with 'ubiX' instead of 'UBI-X' - this is more consistent with the way we name UBI devices. Also, commit "32608703 UBI: Extend UBI layer debug/messaging capabilities" added the function name print to 'ubi_msg()' - lets revert this change, since these messages are supposed to be just informative messages, and not debugging messages. Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Richard Weinberger 提交于
Adds a new set of functions to deal with scatter gather. ubi_eba_read_leb_sg() will read from a LEB into a scatter gather list. The new data structure struct ubi_sgl will be used within UBI to hold the scatter gather list itself and metadata to have a cursor within the list. Signed-off-by: NRichard Weinberger <richard@nod.at> Tested-by: NEzequiel Garcia <ezequiel@vanguardiasur.com.ar> Reviewed-by: NEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
-
由 Richard Weinberger 提交于
UBI_METAONLY is a new open mode for UBI volumes, it indicates that only meta data is being changed. Meta data in terms of UBI volumes means data which is stored in the UBI volume table but not on the volume itself. While it does not interfere with UBI_READONLY and UBI_READWRITE it is not allowed to use UBI_METAONLY together with UBI_EXCLUSIVE. Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Cc: Andrew Murray <amurray@embedded-bits.co.uk> Signed-off-by: NRichard Weinberger <richard@nod.at> Tested-by: NGuido Martínez <guido@vanguardiasur.com.ar> Reviewed-by: NGuido Martínez <guido@vanguardiasur.com.ar> Tested-by: NChristoph Fritz <chf.fritz@googlemail.com> Tested-by: NAndrew Murray <amurray@embedded-bits.co.uk>
-
- 07 11月, 2014 1 次提交
-
-
由 Tanya Brokhman 提交于
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: NTanya Brokhman <tlinder@codeaurora.org> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
- 26 9月, 2014 1 次提交
-
-
由 Richard Weinberger 提交于
It confused me more than once that the cancel flag of the work function does not indicate the cancellation of a single work. In fact it indicates the WL sub-system shutdown and therefore worker functions have to free their wl_entries too. That's why you cannot cancel a single work, you can only shutdown all works. Signed-off-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
- 19 9月, 2014 1 次提交
-
-
由 Richard Weinberger 提交于
Make clear what work_sem really does. Suggested-by: NArtem Bityutskiy <dedekind1@gmail.com> Signed-off-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
- 11 3月, 2014 1 次提交
-
-
由 Paul Gortmaker 提交于
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Cc: David Woodhouse <dwmw2@infradead.org> Cc: Brian Norris <computersforpeace@gmail.com> Cc: linux-mtd@lists.infradead.org Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com> [Brian: dropped one incorrect hunk] Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 05 3月, 2014 1 次提交
-
-
由 Ezequiel Garcia 提交于
In order to have a way of distinguishing an invalid ioctl from a not supported (but otherwise valid) ioctl, this commit changes the return value of the ioctl stubs from ENOTTY to ENOSYS. This will be useful to report more accurate error messages from userspace tools. Signed-off-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
- 04 3月, 2014 1 次提交
-
-
由 Artem Bityutskiy 提交于
We already use term attach/detach for UBI->MTD relations, let's not use this for UBI->ubiblock relations to avoid confusion. Just use 'create' and 'remove' instead. E.g., "create a R/O block device on top of a UBI volume". Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
- 28 2月, 2014 1 次提交
-
-
由 Ezequiel Garcia 提交于
This commit introduces read-only block device emulation on top of UBI volumes. Given UBI takes care of wear leveling and bad block management it's possible to add a thin layer to enable block device access to UBI volumes. This allows to use a block-oriented filesystem on a flash device. The UBI block devices are meant to be used in conjunction with any regular, block-oriented file system (e.g. ext4), although it's primarily targeted at read-only file systems, such as squashfs. Block devices are created upon user request through new ioctls: UBI_IOCVOLATTBLK to attach and UBI_IOCVOLDETBLK to detach. Also, a new UBI module parameter is added 'ubi.block'. This parameter is needed in order to attach a block device on boot-up time, allowing to mount the rootfs on a ubiblock device. For instance, you could have these kernel parameters: ubi.mtd=5 ubi.block=0,0 root=/dev/ubiblock0_0 Or, if you compile ubi as a module: $ modprobe ubi mtd=/dev/mtd5 block=/dev/ubi0_0 Artem: amend commentaries and massage the patch a little bit. Signed-off-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
- 10 12月, 2012 1 次提交
-
-
由 Ezequiel Garcia 提交于
ubi_debug_info struct was dynamically allocated which is always suboptimal, for it tends to fragment memory and make the code error-prone. Fix this by embedding it in ubi_device struct. Signed-off-by: NEzequiel Garcia <elezegarcia@gmail.com> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
- 03 10月, 2012 2 次提交
-
-
由 Richard Weinberger 提交于
- Export compare_lebs() as fastmap needs this function. - Implement fastmap scan logic. Signed-off-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Richard Weinberger 提交于
This patch adds fastmap specific data structures to ubi.h. It moves also struct ubi_work to ubi.h as it is now needed for more than one c file. Signed-off-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
- 04 9月, 2012 4 次提交
-
-
由 Artem Bityutskiy 提交于
Use 'pr_err()' instead of 'printk(KERN_ERR', etc. Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Richard Genoud 提交于
This patch prepare the way for the addition of max_beb_per1024 module parameter. There's no functional change. Signed-off-by: NRichard Genoud <richard.genoud@gmail.com> Reviewed-by: NShmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Shmulik Ladkani 提交于
CONFIG_MTD_UBI_BEB_RESERVE and MIN_RESEVED_PEBS are no longer used, since the amount of reserved eraseblocks for bad PEB handling is now derived from 'ubi->bad_peb_limit' (ubi's maximum expected bad eraseblocks). Signed-off-by: NShmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
-
由 Shmulik Ladkani 提交于
Introduce 'ubi->bad_peb_limit', which specifies an upper limit of PEBs UBI expects to go bad. Currently, it is initialized to a fixed percentage of total PEBs in the UBI device (configurable via CONFIG_MTD_UBI_BEB_LIMIT). The 'bad_peb_limit' is intended to be used for calculating the amount of PEBs UBI needs to reserve for bad eraseblock handling. Artem: minor amendments. Signed-off-by: NShmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
-
- 18 7月, 2012 1 次提交
-
-
由 Shmulik Ladkani 提交于
Currently, there are several locations where an attempt to reserve more PEBs for bad PEB handling is made, with the same code being duplicated. Harmonize it by introducing 'ubi_update_reserved()'. Also, improve the debug message issued, making it more descriptive. Artem: amended the patch a little. Signed-off-by: NShmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
-
- 21 5月, 2012 11 次提交
-
-
由 Joel Reardon 提交于
This patch modifies ubi_wl_flush to force the erasure of particular volume id / logical eraseblock number pairs. Previous functionality is preserved when passing UBI_ALL for both values. The locations where ubi_wl_flush were called are appropriately changed: ubi_leb_erase only flushes for the erased LEB, and ubi_create_volume forces only flushing for its volume id. External code can call this new feature via the new function ubi_flush() added to kapi.c, which simply passes through to ubi_wl_flush(). This was tested by disabling the call to do_work in ubi thread, which results in the work queue remaining unless explicitly called to remove. UBIFS was changed to call ubifs_leb_change 50 times for four different LEBs. Then the new function was called to clear the queue: passing wrong volume ids / lnum, correct ones, and finally UBI_ALL for both to ensure it was finally all cleard. The work queue was dumped each time and the selective removal of the particular LEB numbers was observed. Extra checks were enabled and ubifs's integck was also run. Finally, the drive was repeatedly filled and emptied to ensure that the queue was cleared normally. Artem: amended the patch. Signed-off-by: NJoel Reardon <reardonj@inf.ethz.ch> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Artem Bityutskiy 提交于
Joel will use it in his 'ubi_flush()' extention to specify all eraseblocks. Also amend the comment for UBI_UNKNOWN - it is used beyond attaching info structure now. Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Joel Reardon 提交于
This is part of a multipart patch to allow UBI to force the erasure of particular logical eraseblock numbers. In this patch, the volume id and LEB number are added to ubi_work data structure, and both are also passed as a parameter to schedule erase to set it appropriately. Whenever ubi_wl_put_peb is called, the lnum is also passed to be forwarded to schedule erase. Later, a new ubi_sync_lnum will be added to execute immediately all work related to that lnum. This was tested by outputting the vol_id and lnum during the schedule of erasure. The ubi thread was disabled and two ubifs drives on separate partitions repeated changed a small number of LEBs. The ubi module was readded, and all the erased LEBs, corresponding to the volumes, were added to the schedule erase queue. Artem: minor tweaks Signed-off-by: NJoel Reardon <reardonj@inf.ethz.ch> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Joel Reardon 提交于
This patch adds the volume id to struct ubi_ainf_peb when scanning the LEBs at startup. PEBs now added to the erase queue will know their original LEB number and volume id, if available, and will be -1 otherwise (for instance, if the VID header is unreadable). This was tested by creating an ubi device with 3 volumes and disabiling the ubi_thread's do_work functionality. The different ubi volumes were formatted to ubifs and had files created and erased. The ubi modules was reloaded and the list of LEB's added to the erased list was outputted, confirming the volume ids and LEB numbers were appropriate. Signed-off-by: NJoel Reardon <reardonj@inf.ethz.ch> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Artem Bityutskiy 提交于
This file is small and it does not make sense to have it separate from where everything else lives, so merge it with ubi.h. Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Artem Bityutskiy 提交于
Rename the 'attach_by_scanning()' function to 'ubi_attach()' and move it to scan.c. Richard will plug his fastmap stuff there. Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Artem Bityutskiy 提交于
We have a couple of initialization funcntionsn left which have "_scan" suffic - rename them: ubi_eba_init_scan() -> ubi_eba_init() ubi_wl_init_scan() -> ubi_wl_init() Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Artem Bityutskiy 提交于
After re-naming the 'struct ubi_scan_info' we should adjust all variables named 'si' to something else, because 'si' stands for "scanning info". Let's rename it to 'ai' which stands for "attaching info" which is a bit more consistent and has the same length, which makes re-naming easy. Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
-
由 Artem Bityutskiy 提交于
Rename 'struct ubi_scan_info' to 'struct ubi_attach_info'. This is part of the code re-structuring I am trying to do in order to add fastmap in a more logical way. Fastmap can share a lot with scanning, including the attach-time data structures, which all now have "scan" word in the name. Let's get rid of this word. Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
-
由 Richard Weinberger 提交于
We do not need this feature and to our shame it even was not working and there was a bug found very recently. -- Artem Bityutskiy Without the data type hint UBI2 (fastmap) will be easier to implement. Signed-off-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Artem Bityutskiy 提交于
UBI (and UBIFS) are a bit over-engineered WRT debugging. The idea was to link as few as possible when debugging is disabled, but the downside is that most people produce bug reports which are difficult to understand. This patch weeds out the 'ubi_dbg_dump_stack()' function and turns it into 'dump_stack()' - it is always useful to have stack dump in case of an error. Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
-
- 09 3月, 2012 3 次提交
-
-
由 Artem Bityutskiy 提交于
While looking at a problem reported by UBI around the PEB moving area I noticed that the 'MOVE_CANCEL_BITFLIPS' is a bit inconsistent name and 'MOVE_TARGET_BITFLIPS' better - let's rename it. Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Artem Bityutskiy 提交于
Now we have only one buffer so let's rename it to just 'peb_buf1'. Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
由 Josselin Costanzi 提交于
Remove the pre-allocated 'peb_buf2' buffer because we do not really need it. The only reason UBI has it is to check that the data were written correctly. But we do not have to have 2 buffers for this and waste RAM - we can just compare CRC checksums instead. This reduces UBI memory consumption. Artem bityutskiy: massaged the patch and commit message Signed-off-by: NJosselin Costanzi <josselin.costanzi@mobile-devices.fr> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
- 30 11月, 2011 1 次提交
-
-
由 Bhavesh Parekh 提交于
Under some cases, when scrubbing the PEB if we did not get the lock on the PEB it fails to scrub. Add that PEB again to the scrub list Artem: minor amendments. Cc: stable@kernel.org [2.6.31+] Signed-off-by: NBhavesh Parekh <bparekh@nvidia.com> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
-
- 01 6月, 2011 3 次提交
-
-
由 Artem Bityutskiy 提交于
If we have debugging enabled and switching to R/O mode because of an error - dump the stack to improve UBI error reporting and make the further diagnostics easier to do. Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
-
由 Artem Bityutskiy 提交于
Current layout does not allow us to add inline functions to debug.h which use the 'struct ubi_device' object, because it is undefined there. Move '#include "debug.h"' in "ubi.h" down so to make 'struct ubi_device" be defined. Additionally, this makes it possible to remove a bunch of forward declarations in "debug.h". This is a preparation to the next patch. Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
-
由 Artem Bityutskiy 提交于
This patch introduces debugfs support to UBI. All the UBI stuff is kept in the "ubi" debugfs directory, which contains per-UBI device "ubi/ubiX" sub-directories, containing debugging files. This file also creates "ubi/ubiX/chk_gen" and "ubi/ubiX/chk_io" knobs for switching general and I/O extra checks on and off. And it removes the 'debug_chks' UBI module parameters. Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
-
- 14 4月, 2011 1 次提交
-
-
由 Artem Bityutskiy 提交于
Fix checkpatch.pl errors and warnings: * space before tab * line over 80 characters * include linux/ioctl.h instead of asm/ioctl.h Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
-