13 Feb, 2013

1 commit

  • Using /dev/pstore as a mount point for the pstore filesystem is slightly
    awkward. We don't normally mount filesystems in /dev/ and the /dev/pstore
    file isn't created automatically by anything. While this method will
    still work, we can create a persistent mount point in sysfs. This will
    put pstore on par with things like cgroups and efivarfs.

    Signed-off-by: Josh Boyer
    Acked-by: Kees Cook
    Signed-off-by: Tony Luck

    Josh Boyer
     

18 Dec, 2012

1 commit


27 Nov, 2012

2 commits

  • [Issue]

    Currently, a variable name, which identifies each entry, consists of type, id and ctime.
    But if multiple events happens in a short time, a second/third event may fail to log because
    efi_pstore can't distinguish each event with current variable name.

    [Solution]

    A reasonable way to identify all events precisely is introducing a sequence counter to
    the variable name.

    The sequence counter has already supported in a pstore layer with "oopscount".
    So, this patch adds it to a variable name.
    Also, it is passed to read/erase callbacks of platform drivers in accordance with
    the modification of the variable name.


    a variable name of first event: dump-type0-1-12345678
    a variable name of second event: dump-type0-1-12345678

    type:0
    id:1
    ctime:12345678

    If multiple events happen in a short time, efi_pstore can't distinguish them because
    variable names are same among them.

    it can be distinguishable by adding a sequence counter as follows.

    a variable name of first event: dump-type0-1-1-12345678
    a variable name of Second event: dump-type0-1-2-12345678

    type:0
    id:1
    sequence counter: 1(first event), 2(second event)
    ctime:12345678

    In case of a write callback executed in pstore_console_write(), "0" is added to
    an argument of the write callback because it just logs all kernel messages and
    doesn't need to care about multiple events.

    Signed-off-by: Seiji Aguchi
    Acked-by: Rafael J. Wysocki
    Acked-by: Mike Waychison
    Signed-off-by: Tony Luck

    Seiji Aguchi
     
  • [Issue]

    Currently, a variable name, which is used to identify each log entry, consists of type,
    id and ctime. But an erase callback does not use ctime.

    If efi_pstore supported just one log, type and id were enough.
    However, in case of supporting multiple logs, it doesn't work because
    it can't distinguish each entry without ctime at erasing time.

    As you can see below, efi_pstore can't differentiate first event from second one without ctime.

    a variable name of first event: dump-type0-1-12345678
    a variable name of second event: dump-type0-1-23456789

    type:0
    id:1
    ctime:12345678, 23456789

    [Solution]

    This patch adds ctime to an argument of an erase callback.

    It works across reboots because ctime of pstore means the date that the record was originally stored.
    To do this, efi_pstore saves the ctime to variable name at writing time and passes it to pstore
    at reading time.

    Signed-off-by: Seiji Aguchi
    Acked-by: Mike Waychison
    Signed-off-by: Tony Luck

    Seiji Aguchi
     

18 Jul, 2012

1 commit

  • With this support kernel can save function call chain log into a
    persistent ram buffer that can be decoded and dumped after reboot
    through pstore filesystem. It can be used to determine what function
    was last called before a reset or panic.

    We store the log in a binary format and then decode it at read time.

    p.s.
    Mostly the code comes from trace_persistent.c driver found in the
    Android git tree, written by Colin Cross
    (according to sign-off history). I reworked the driver a little bit,
    and ported it to pstore.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     

14 Jun, 2012

2 commits

  • Pstore doesn't support logging kernel messages in run-time, it only
    dumps dmesg when kernel oopses/panics. This makes pstore useless for
    debugging hangs caused by HW issues or improper use of HW (e.g.
    weird device inserted -> driver tried to write a reserved bits ->
    SoC hanged. In that case we don't get any messages in the pstore.

    Therefore, let's add a runtime logging support: PSTORE_TYPE_CONSOLE.

    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Acked-by: Colin Cross
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • There's no reason to extern it. The patch fixes the annoying sparse
    warning:

    CHECK fs/pstore/inode.c
    fs/pstore/inode.c:264:5: warning: symbol 'pstore_fill_super' was not
    declared. Should it be static?

    Signed-off-by: Anton Vorontsov
    Acked-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     

06 May, 2012

1 commit

  • After we moved inode_sync_wait() from end_writeback() it doesn't make sense
    to call the function end_writeback() anymore. Rename it to clear_inode()
    which well says what the function really does - set I_CLEAR flag.

    Signed-off-by: Jan Kara
    Signed-off-by: Fengguang Wu

    Jan Kara
     

06 Apr, 2012

2 commits

  • Merge batch of fixes from Andrew Morton:
    "The simple_open() cleanup was held back while I wanted for laggards to
    merge things.

    I still need to send a few checkpoint/restore patches. I've been
    wobbly about merging them because I'm wobbly about the overall
    prospects for success of the project. But after speaking with Pavel
    at the LSF conference, it sounds like they're further toward
    completion than I feared - apparently davem is at the "has stopped
    complaining" stage regarding the net changes. So I need to go back
    and re-review those patchs and their (lengthy) discussion."

    * emailed from Andrew Morton : (16 patches)
    memcg swap: use mem_cgroup_uncharge_swap fix
    backlight: add driver for DA9052/53 PMIC v1
    C6X: use set_current_blocked() and block_sigmask()
    MAINTAINERS: add entry for sparse checker
    MAINTAINERS: fix REMOTEPROC F: typo
    alpha: use set_current_blocked() and block_sigmask()
    simple_open: automatically convert to simple_open()
    scripts/coccinelle/api/simple_open.cocci: semantic patch for simple_open()
    libfs: add simple_open()
    hugetlbfs: remove unregister_filesystem() when initializing module
    drivers/rtc/rtc-88pm860x.c: fix rtc irq enable callback
    fs/xattr.c:setxattr(): improve handling of allocation failures
    fs/xattr.c:listxattr(): fall back to vmalloc() if kmalloc() failed
    fs/xattr.c: suppress page allocation failure warnings from sys_listxattr()
    sysrq: use SEND_SIG_FORCED instead of force_sig()
    proc: fix mount -t proc -o AAA

    Linus Torvalds
     
  • Many users of debugfs copy the implementation of default_open() when
    they want to support a custom read/write function op. This leads to a
    proliferation of the default_open() implementation across the entire
    tree.

    Now that the common implementation has been consolidated into libfs we
    can replace all the users of this function with simple_open().

    This replacement was done with the following semantic patch:

    @ open @
    identifier open_f != simple_open;
    identifier i, f;
    @@
    -int open_f(struct inode *i, struct file *f)
    -{
    (
    -if (i->i_private)
    -f->private_data = i->i_private;
    |
    -f->private_data = i->i_private;
    )
    -return 0;
    -}

    @ has_open depends on open @
    identifier fops;
    identifier open.open_f;
    @@
    struct file_operations fops = {
    ...
    -.open = open_f,
    +.open = simple_open,
    ...
    };

    [akpm@linux-foundation.org: checkpatch fixes]
    Signed-off-by: Stephen Boyd
    Cc: Greg Kroah-Hartman
    Cc: Al Viro
    Cc: Julia Lawall
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     

01 Apr, 2012

1 commit


21 Mar, 2012

2 commits


19 Nov, 2011

1 commit


17 Aug, 2011

1 commit

  • Life is simple for all the kernel terminating types of kmsg_dump
    call backs - pstore just saves the tail end of the console log. But
    for "oops" the situation is more complex - the kernel may carry on
    running (possibly for ever). So we'd like to make the logged copy
    of the oops appear in the pstore filesystem - so that the user has
    a handle to clear the entry from the persistent backing store (if
    we don't, the store may fill with "oops" entries (that are also
    safely stashed in /var/log/messages) leaving no space for real
    errors.

    Current code calls pstore_mkfile() immediately. But this may
    not be safe. The oops could have happened with arbitrary locks
    held, or in interrupt or NMI context. So allocating memory and
    calling into generic filesystem code seems unwise.

    This patch defers making the entry appear. At the time
    of the oops, we merely set a flag "pstore_new_entry" noting that
    a new entry has been added. A periodic timer checks once a minute
    to see if the flag is set - if so, it schedules a work queue to
    rescan the backing store and make all new entries appear in the
    pstore filesystem.

    Signed-off-by: Tony Luck

    Luck, Tony
     

23 Jul, 2011

2 commits


22 Mar, 2011

1 commit


21 Mar, 2011

1 commit


18 Mar, 2011

1 commit

  • 1) Change from ->get_sb() to ->mount()
    2) Use mount_single() instead of mount_nodev()
    3) Pulled in ramfs_get_inode() & trimmed to what I need for pstore
    4) Drop the ugly pstore_writefile() Just save data using kmalloc() and
    provide a pstore_file_read() that uses simple_read_from_buffer().

    Signed-off-by: Al Viro

    Tony Luck
     

07 Jan, 2011

1 commit


29 Dec, 2010

1 commit

  • Some platforms have a small amount of non-volatile storage that
    can be used to store information useful to diagnose the cause of
    a system crash. This is the generic part of a file system interface
    that presents information from the crash as a series of files in
    /dev/pstore. Once the information has been seen, the underlying
    storage is freed by deleting the files.

    Signed-off-by: Tony Luck

    Tony Luck