summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'for-linus-4.1' of ↵Linus Torvalds2015-04-1559-2067/+323
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML updates from Richard Weinberger: - hostfs saw a face lifting - old/broken stuff was removed (SMP, HIGHMEM, SKAS3/4) - random cleanups and bug fixes * tag 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: (26 commits) um: Print minimum physical memory requirement um: Move uml_postsetup in the init_thread stack um: add a kmsg_dumper x86, UML: fix integer overflow in ELF_ET_DYN_BASE um: hostfs: Reduce number of syscalls in readdir um: Remove broken highmem support um: Remove broken SMP support um: Remove SKAS3/4 support um: Remove ppc cruft um: Remove ia64 cruft um: Remove dead code from stacktrace hostfs: No need to box and later unbox the file mode hostfs: Use page_offset() hostfs: Set page flags in hostfs_readpage() correctly hostfs: Remove superfluous initializations in hostfs_open() hostfs: hostfs_open: Reset open flags upon each retry hostfs: Remove superfluous test in hostfs_open() hostfs: Report append flag in ->show_options() hostfs: Use __getname() in follow_link hostfs: Remove open coded strcpy() ...
| * um: Print minimum physical memory requirementThomas Meyer2015-04-131-6/+35
| | | | | | | | | | | | | | | | Print a more sensible message about the minimum physical memory requirement. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Richard Weinberger <richard@nod.at>
| * um: Move uml_postsetup in the init_thread stackThomas Meyer2015-04-133-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | atomic_notifier_chain_register() and uml_postsetup() do call kernel code that rely on the "current" kernel macro and a valid task_struct resp. thread_info struct. Give those functions a valid stack by moving uml_postsetup() in the init_thread stack. This moves enables a panic() call in this early code to generate a valid stacktrace, instead of crashing. E.g. when an UML kernel is started with an initrd but too few physical memory the panic() call get's actually processed. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Richard Weinberger <richard@nod.at>
| * um: add a kmsg_dumperThomas Meyer2015-04-133-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a kmsg_dumper, that dumps the kmsg buffer to stdout, when no console is available. This an enables the printing of early panic() calls triggered in uml_postsetup(). When a panic() call happens so early in the UML kernel no earlyprintk/console is available yet, but with a kmsg_dumper in place the kernel message buffer will be outputted to the user, to give a better hint, of what the failure was. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Richard Weinberger <richard@nod.at>
| * x86, UML: fix integer overflow in ELF_ET_DYN_BASEAndrey Ryabinin2015-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Almost all arches define ELF_ET_DYN_BASE as 2/3 of TASK_SIZE. Though it seems that some architectures do this in a wrong way. The problem is that 2*TASK_SIZE may overflow 32-bits so the real ELF_ET_DYN_BASE becomes wrong. Fix this overflow by dividing TASK_SIZE prior to multiplying: (TASK_SIZE / 3 * 2) Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com> Signed-off-by: Richard Weinberger <richard@nod.at>
| * um: hostfs: Reduce number of syscalls in readdirRichard Weinberger2015-04-133-4/+12
| | | | | | | | | | | | | | | | | | Currently hostfs issues every time a seekdir(), in fact it has to do this only upon the first call. Also telldir() can be omitted as we can obtain the directory offset from readdir(). Signed-off-by: Richard Weinberger <richard@nod.at>
| * um: Remove broken highmem supportRichard Weinberger2015-04-136-93/+1
| | | | | | | | | | | | | | | | Highmem was always buggy and experimental on UML(i386). In times where 64 bit computers are default we can remove that experimental code. Signed-off-by: Richard Weinberger <richard@nod.at>
| * um: Remove broken SMP supportRichard Weinberger2015-04-1310-366/+2
| | | | | | | | | | | | | | | | | | | | | | | | At times where UML used the TT mode to operate it had kind of SMP support. It never got finished nor was stable. Let's rip out that cruft and stop confusing developers which do tree-wide SMP cleanups. If someone wants SMP support UML it has do be done from scratch. Signed-off-by: Richard Weinberger <richard@nod.at>
| * um: Remove SKAS3/4 supportRichard Weinberger2015-04-1318-814/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | Before we had SKAS0 UML had two modes of operation TT (tracing thread) and SKAS3/4 (separated kernel address space). TT was known to be insecure and got removed a long time ago. SKAS3/4 required a few (3 or 4) patches on the host side which never went mainline. The last host patch is 10 years old. With SKAS0 mode (separated kernel address space using 0 host patches), default since 2005, SKAS3/4 is obsolete and can be removed. Signed-off-by: Richard Weinberger <richard@nod.at>
| * um: Remove ppc cruftRichard Weinberger2015-04-1315-635/+0
| | | | | | | | | | | | | | | | That code is a relict from the early days of UML. ppc support was never completed nor worked. Let's rip it out. Signed-off-by: Richard Weinberger <richard@nod.at>
| * um: Remove ia64 cruftRichard Weinberger2015-04-136-70/+0
| | | | | | | | | | | | | | | | That code is a relict from the early days of UML. ia64 support was never completed nor worked. Let's rip it out. Signed-off-by: Richard Weinberger <richard@nod.at>
| * um: Remove dead code from stacktraceRichard Weinberger2015-04-131-5/+1
| | | | | | | | | | | | | | Remove left over code from commit 970e51feaddb (um: Add support for CONFIG_STACKTRACE) Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: No need to box and later unbox the file modeRichard Weinberger2015-03-263-20/+5
| | | | | | | | | | | | | | | | There is really no point in having a function with 10 arguments. Reported-by: Daniel Walter <d.walter@0x90.at> Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Use page_offset()Richard Weinberger2015-03-261-4/+2
| | | | | | | | | | | | The kernel offers a helper function for that, use it. Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Set page flags in hostfs_readpage() correctlyRichard Weinberger2015-03-261-4/+6
| | | | | | | | | | | | | | | | In case of an error set the page error flag and clear the up-to-date flag. If the read was successful clear the error flag unconditionally. Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Remove superfluous initializations in hostfs_open()Richard Weinberger2015-03-261-2/+2
| | | | | | | | | | | | Only initialize what we really need. Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: hostfs_open: Reset open flags upon each retryRichard Weinberger2015-03-261-0/+2
| | | | | | | | | | | | ...otherwise we might end up with an incorrect mode mode. Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Remove superfluous test in hostfs_open()Richard Weinberger2015-03-261-3/+1
| | | | | | | | Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Report append flag in ->show_options()Richard Weinberger2015-03-261-0/+3
| | | | | | | | | | | | hostfs has an "append" mount option. Report it. Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Use __getname() in follow_linkRichard Weinberger2015-03-261-14/+11
| | | | | | | | | | | | | | Be consistent with all other functions in hostfs and just use __getname(). Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Remove open coded strcpy()Richard Weinberger2015-03-261-5/+4
| | | | | | | | Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Add a BUG_ON to detect behavior changes of dentry_path_raw()Richard Weinberger2015-03-261-0/+7
| | | | | | | | | | | | | | | | | | hostfs' __dentry_name() relies on the fact that dentry_path_raw() will place the path name at the end of the provided buffer. While this is okay, add a BUG_ON() to detect behavior changes as soon as possible. Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Make hostfs_readpage more readableRichard Weinberger2015-03-261-6/+8
| | | | | | | | | | | | ...to make life easier for future readers of that code. Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Handle bogus st.modeRichard Weinberger2015-03-261-2/+4
| | | | | | | | | | | | | | Make sure that we return EIO if one passes an invalid st.mode into hostfs. Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: Allow fsync on directoriesRichard Weinberger2015-03-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically hostfs did not open directories on the host filesystem for performance and memory reasons. But it turned out that this optimization has a drawback. Calling fsync() on a hostfs directory returns immediately with -EINVAL as fsync is not implemented. While this is behavior is strictly speaking correct common userspace like dpkg(1) stumbles over that and makes it impossible to use hostfs as root filesystem. The fix is easy, wire up the existing host open/fsync functions to the directory file operations. Reported-by: Daniel Gröber <dxld@darkboxed.org> Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: hostfs_file_open: Fix a fd leak in hostfs_file_openRichard Weinberger2015-03-261-0/+1
| | | | | | | | | | | | | | In case of a race between to callers of hostfs_file_open() it can happen that a file describtor is leaked. Signed-off-by: Richard Weinberger <richard@nod.at>
| * hostfs: hostfs_file_open: Switch to data locking modelRichard Weinberger2015-03-261-6/+7
| | | | | | | | | | | | | | Instead of serializing hostfs_file_open() we can use a per inode mutex to protect ->mode. Signed-off-by: Richard Weinberger <richard@nod.at>
* | Merge tag 'upstream-4.1-rc1' of git://git.infradead.org/linux-ubifsLinus Torvalds2015-04-1538-1141/+1507
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull UBI/UBIFS updates from Richard Weinberger: "This pull request includes the following UBI/UBIFS changes: - powercut emulation for UBI - a huge update to UBI Fastmap - cleanups and bugfixes all over UBI and UBIFS" * tag 'upstream-4.1-rc1' of git://git.infradead.org/linux-ubifs: (50 commits) UBI: power cut emulation for testing UBIFS: fix output format of INUM_WATERMARK UBI: Fastmap: Fall back to scanning mode after ECC error UBI: Fastmap: Remove is_fm_block() UBI: Fastmap: Add blank line after declarations UBI: Fastmap: Remove else after return. UBI: Fastmap: Introduce may_reserve_for_fm() UBI: Fastmap: Introduce ubi_fastmap_init() UBI: Fastmap: Wire up WL accessor functions UBI: Add accessor functions for WL data structures UBI: Move fastmap specific functions out of wl.c UBI: Fastmap: Add new module parameter fm_debug UBI: Fastmap: Make self_check_eba() depend on fastmap self checking UBI: Fastmap: Add self check to detect absent PEBs UBI: Fix stale pointers in ubi->lookuptbl UBI: Fastmap: Enhance fastmap checking UBI: Add initial support for fastmap self checks UBI: Fastmap: Rework fastmap error paths UBI: Fastmap: Prepare for variable sized fastmaps UBI: Fastmap: Locking updates ...
| * | UBI: power cut emulation for testingdavid.oberhollenzer@sigma-star.at2015-04-134-2/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: David Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBIFS: fix output format of INUM_WATERMARKSheng Yong2015-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The INUM_WATERMARK is a unsigned 32bit value, `%d' prints it as negatave: [ 103.682255] UBIFS warning (ubi0:0 pid 691): ubifs_new_inode: running out of inode numbers (current 122763, max -256) Fix it as: [ 154.422940] UBIFS warning (ubi0:0 pid 688): ubifs_new_inode: running out of inode numbers (current 122765, max 4294967040) Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * | UBI: Fastmap: Fall back to scanning mode after ECC errorRichard Weinberger2015-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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: Alexander Block <Alexander.Block@continental-corporation.com> Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Remove is_fm_block()Richard Weinberger2015-03-263-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Add blank line after declarationsRichard Weinberger2015-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | Another checkpatch complaint: WARNING: Missing a blank line after declarations Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Remove else after return.Richard Weinberger2015-03-261-3/+3
| | | | | | | | | | | | | | | | | | | | | checkpatch.pl complains: WARNING: else is not generally useful after a break or return Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Introduce may_reserve_for_fm()Richard Weinberger2015-03-263-6/+28
| | | | | | | | | | | | | | | | | | ...and kill another #ifdef. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Introduce ubi_fastmap_init()Richard Weinberger2015-03-262-7/+8
| | | | | | | | | | | | | | | | | | ...and kill another #ifdef in wl.c. :-) Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Wire up WL accessor functionsRichard Weinberger2015-03-261-16/+12
| | | | | | | | | | | | | | | | | | Use the new WL accessor functions in fastmap. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Add accessor functions for WL data structuresRichard Weinberger2015-03-261-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | Fastmap need access to various WL data structures as fastmap tightly depends on WL. To make the access less invasive add accessor functions. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Move fastmap specific functions out of wl.cRichard Weinberger2015-03-263-463/+476
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fastmap is tightly connected to the WL sub-system, many fastmap-specific functionslive in wl.c. To get rid of most #ifdefs in wl.c move this functions into a new file and include it into wl.c Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Add new module parameter fm_debugRichard Weinberger2015-03-262-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If fm_debug is set fastmap debugging is enabled by default. This is useful if one wants to debug fastmap on an UBI device with serves the rootfs. The the UBI attach mechanism runs long before debugfs can be mounted and chk_fastmap set. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Make self_check_eba() depend on fastmap self checkingRichard Weinberger2015-03-261-1/+1
| | | | | | | | | | | | | | | | | | ...instead of generic self checking. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Add self check to detect absent PEBsRichard Weinberger2015-03-261-2/+84
| | | | | | | | | | | | | | | | | | | | | | | | This self check allows Fastmap to detect absent PEBs while writing a new fastmap to the MTD device. It will help to find implementation issues in Fastmap. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fix stale pointers in ubi->lookuptblRichard Weinberger2015-03-261-16/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some error paths the WL sub-system gives up on a PEB and frees it's ubi_wl_entry struct but does not set the entry in ubi->lookuptbl to NULL. Fastmap can stumble over such a stale pointer as it uses ubi->lookuptbl to find all PEBs. Fix this by introducing a new helper function which free()s a WL entry and removes the reference from the lookup table. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Enhance fastmap checkingRichard Weinberger2015-03-261-2/+5
| | | | | | | | | | | | | | | | | | | | | Don't update the fastmap upon detach if fastmap checking is enabled. This is poor men's power cut testing feature. :-) Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Add initial support for fastmap self checksRichard Weinberger2015-03-263-0/+20
| | | | | | | | | | | | | | | | | | | | | Using this debugfs knob fastmap self checks can be controlled. Signed-off-by: Richard Weinberger <richard@nod.at> Reviewed-by: Tanya Brokhman <tlinder@codeaurora.org>
| * | UBI: Fastmap: Rework fastmap error pathsRichard Weinberger2015-03-261-48/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If UBI is unable to write the fastmap to the device we have make sure that upon next attach UBI will fall back to scanning mode. In case we cannot ensure that they only thing we can do is falling back to read-only mode. The current error handling code is not powercut proof. It could happen that a powercut while invalidating would lead to a state where an too old fastmap could be used upon attach. This patch addresses the issue by writing a fake fastmap super block to a fresh PEB instead of reerasing the existing one. The fake fastmap super block will UBI case to do a full scan. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Prepare for variable sized fastmapsRichard Weinberger2015-03-261-2/+10
| | | | | | | | | | | | | | | | | | | | | The current code assumes that each fastmap has the same amount of PEBs. So far this is true but will change soon. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Locking updatesRichard Weinberger2015-03-265-44/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a) Rename ubi->fm_sem to ubi->fm_eba_sem as this semaphore protects EBA changes. b) Turn ubi->fm_mutex into a rw semaphore. It will still serialize fastmap writes but also ensures that ubi_wl_put_peb() is not interrupted by a fastmap write. We use a rw semaphore to allow ubi_wl_put_peb() still to be executed in parallel if no fastmap write is happening. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Set used_ebs only for static volumesRichard Weinberger2015-03-261-2/+3
| | | | | | | | | | | | | | | | | | If we set it for dynamic ones we might confuse various self checks. Signed-off-by: Richard Weinberger <richard@nod.at>
| * | UBI: Fastmap: Fix race after ubi_wl_get_peb()Richard Weinberger2015-03-262-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ubi_wl_get_peb() returns a fresh PEB which can be used by user of UBI. Due to the pool logic fastmap will correctly map this PEB upon attach time because it will be scanned. If a new fastmap is written (due to heavy parallel io) while the before the fresh PEB is assigned to the EBA table it will not be scanned as it is no longer in the pool. So, the race window exists between ubi_wl_get_peb() and the EBA table assignment. We have to make sure that no new fastmap can be written while that. To ensure that ubi_wl_get_peb() will grab ubi->fm_sem in read mode and the user of ubi_wl_get_peb() has to release it after the PEB got assigned. Signed-off-by: Richard Weinberger <richard@nod.at>
OpenPOWER on IntegriCloud