15 Jan, 2012

1 commit

  • Fix a brown paperbag bug introduced by me in the previous commit. I was
    in hurry and forgot about the non-debug case completely.

    Artem: amend the commit message and tweak the patch to preserve alignment.
    This made the patch a bit less readable, though.

    Signed-off-by: Artem Bityutskiy

    Dominique Martinet
     

14 Jan, 2012

1 commit


13 Jan, 2012

2 commits

  • Before commit 56e46742e846e4de167dde0e1e1071ace1c882a5 we have had locking
    around all printing macros and we could use static buffers for creating
    key strings and printing them. However, now we do not have that locking and
    we cannot use static buffers. This commit removes the old DBGKEY() macros
    and introduces few new helper macros for printing debugging messages plus
    a key at the end. Thankfully, all the messages are already structures in
    a way that the key is printed in the end.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Switch to 'snprintf()' which is more secure and reliable. This is also a
    preparation to the subsequent key printing fixes.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     

12 Jan, 2012

2 commits

  • Patch 56e46742e846e4de167dde0e1e1071ace1c882a5 broke UBIFS debugging messages:
    before that commit when UBIFS debugging was enabled, users saw few useful
    debugging messages after mount. However, that patch turned 'dbg_msg()' into
    'pr_debug()', so to enable the debugging messages users have to enable them
    first via /sys/kernel/debug/dynamic_debug/control, which is very impractical.

    This commit makes 'dbg_msg()' to use 'printk()' instead of 'pr_debug()', just
    as it was before the breakage.

    Signed-off-by: Artem Bityutskiy
    Cc: stable@kernel.org [3.0+]

    Artem Bityutskiy
     
  • We switch to dynamic debugging in commit
    56e46742e846e4de167dde0e1e1071ace1c882a5 but did not take into account that
    now we do not control anymore whether a specific message is enabled or not.
    So now we lock the "dbg_lock" and release it in every debugging macro, which
    make them not so light-weight.

    This commit removes the "dbg_lock" protection from the debugging macros to
    fix the issue.

    The downside is that now our DBGKEY() stuff is broken, but this is not
    critical at all and will be fixed later.

    Signed-off-by: Artem Bityutskiy
    Cc: stable@kernel.org [3.0+]

    Artem Bityutskiy
     

11 Jan, 2012

1 commit


07 Jan, 2012

1 commit


04 Jan, 2012

7 commits


14 Dec, 2011

1 commit


22 Nov, 2011

1 commit


08 Nov, 2011

1 commit


07 Nov, 2011

1 commit

  • * 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
    writeback: Add a 'reason' to wb_writeback_work
    writeback: send work item to queue_io, move_expired_inodes
    writeback: trace event balance_dirty_pages
    writeback: trace event bdi_dirty_ratelimit
    writeback: fix ppc compile warnings on do_div(long long, unsigned long)
    writeback: per-bdi background threshold
    writeback: dirty position control - bdi reserve area
    writeback: control dirty pause time
    writeback: limit max dirty pause time
    writeback: IO-less balance_dirty_pages()
    writeback: per task dirty rate limit
    writeback: stabilize bdi->dirty_ratelimit
    writeback: dirty rate control
    writeback: add bg_threshold parameter to __bdi_update_bandwidth()
    writeback: dirty position control
    writeback: account per-bdi accumulated dirtied pages

    Linus Torvalds
     

02 Nov, 2011

2 commits


31 Oct, 2011

1 commit

  • This creates a new 'reason' field in a wb_writeback_work
    structure, which unambiguously identifies who initiates
    writeback activity. A 'wb_reason' enumeration has been
    added to writeback.h, to enumerate the possible reasons.

    The 'writeback_work_class' and tracepoint event class and
    'writeback_queue_io' tracepoints are updated to include the
    symbolic 'reason' in all trace events.

    And the 'writeback_inodes_sbXXX' family of routines has had
    a wb_stats parameter added to them, so callers can specify
    why writeback is being started.

    Acked-by: Jan Kara
    Signed-off-by: Curt Wohlgemuth
    Signed-off-by: Wu Fengguang

    Curt Wohlgemuth
     

26 Aug, 2011

1 commit


22 Aug, 2011

1 commit


19 Aug, 2011

1 commit

  • With
    $ grep -e UBIFS_FS_DEBUG -e DYNAMIC_DEBUG .config
    # CONFIG_UBIFS_FS_DEBUG is not set
    CONFIG_DYNAMIC_DEBUG=y

    Debug messages are kept in the object files due to the
    dynamic_pr_debug() macro, even if they are never going to be printed:
    $ make fs/ubifs/super.o
    $ strings fs/ubifs/super.o | grep 'compiled on'
    compiled on: Aug 11 2011 at 12:21:38

    Use plain printk to fix this.

    Signed-off-by: Michal Marek
    Signed-off-by: Artem Bityutskiy

    Michal Marek
     

23 Jul, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
    vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
    isofs: Remove global fs lock
    jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
    fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
    mm/truncate.c: fix build for CONFIG_BLOCK not enabled
    fs:update the NOTE of the file_operations structure
    Remove dead code in dget_parent()
    AFS: Fix silly characters in a comment
    switch d_add_ci() to d_splice_alias() in "found negative" case as well
    simplify gfs2_lookup()
    jfs_lookup(): don't bother with . or ..
    get rid of useless dget_parent() in btrfs rename() and link()
    get rid of useless dget_parent() in fs/btrfs/ioctl.c
    fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
    drivers: fix up various ->llseek() implementations
    fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
    Ext4: handle SEEK_HOLE/SEEK_DATA generically
    Btrfs: implement our own ->llseek
    fs: add SEEK_HOLE and SEEK_DATA flags
    reiserfs: make reiserfs default to barrier=flush
    ...

    Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
    shrinker callout for the inode cache, that clashed with the xfs code to
    start the periodic workers later.

    Linus Torvalds
     

21 Jul, 2011

1 commit

  • Btrfs needs to be able to control how filemap_write_and_wait_range() is called
    in fsync to make it less of a painful operation, so push down taking i_mutex and
    the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
    file systems can drop taking the i_mutex altogether it seems, like ext3 and
    ocfs2. For correctness sake I just pushed everything down in all cases to make
    sure that we keep the current behavior the same for everybody, and then each
    individual fs maintainer can make up their mind about what to do from there.
    Thanks,

    Acked-by: Jan Kara
    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     

08 Jul, 2011

1 commit

  • When the 1st LEB was unmapped and written but 2nd LEB not,
    the master node recovery doesn't succeed after power cut.
    We see following error when mounting UBIFS partition on NOR
    flash:

    UBIFS error (pid 1137): ubifs_recover_master_node: failed to recover master node

    Correct 2nd master node offset check is needed to fix the
    problem. If the 2nd master node is at the end in the 2nd LEB,
    first master node is used for recovery. When checking for this
    condition we should check whether the master node is exactly at
    the end of the LEB (without remaining empty space) or whether
    it is followed by an empty space less than the master node size.

    Artem: when the error happened, offs2 = 261120, sz = 512, c->leb_size = 262016.

    Signed-off-by: Anatolij Gustschin
    Signed-off-by: Artem Bityutskiy

    Anatolij Gustschin
     

04 Jul, 2011

12 commits

  • This patch cleans-up and improves the power cut testing:

    1. Kill custom 'simple_random()' function and use 'random32()' instead.
    2. Make timeout larger
    3. When cutting the buffer - fill the end with random data sometimes, not
    only with 0xFFs.
    4. Some times cut in the middle of the buffer, not always at the end.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Since the recovery testing is effectively about emulating power cuts by UBIFS,
    use "power cut" as the base term for all the related variables and name them
    correspondingly. This is just a minor clean-up for the sake of readability.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • This is a clean-up of the power-cut emulation code - remove the custom list of
    superblocks which we maintained to find the superblock by the UBI volume
    descriptor. We do not need that crud any longer, because now we can get the
    superblock as a function argument.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Now when we use UBIFS helpers for all the I/O, we can remove the horrible hack
    of re-defining UBI I/O functions.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Switch the rest of direct UBI calls to UBIFS helper functions.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Stop using 'ubi_leb_write()' directly and switch to the 'ubifs_leb_write()'
    helper.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Instead of using 'ubi_read()' function directly, used the 'ubifs_leb_read()'
    helper function instead. This allows to get rid of several redundant error
    messages and make sure that we always have a stack dump on read errors.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Introduce the following I/O helper functions: 'ubifs_leb_read()',
    'ubifs_leb_write()', 'ubifs_leb_change()', 'ubifs_leb_unmap()',
    'ubifs_leb_map()', 'ubifs_is_mapped().

    The idea is to wrap all UBI I/O functions in order to encapsulate various
    assertions and error path handling (error message, stack dump, switching to R/O
    mode). And there are some other benefits of this which will be used in the
    following patches.

    This patch does not switch whole UBIFS to use these functions yet.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • When switching to R/O mode due to an I/O error, always dump the stack, not only
    when debugging is enabled.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • This patch contains several minor clean-up and preparational cahnges.

    1. Remove 'dbg_read()', 'dbg_write()', 'dbg_change()', and 'dbg_leb_erase()'
    functions as they are not used.
    2. Remove 'dbg_leb_read()' and 'dbg_is_mapped()' as they are not really needed,
    it is fine to let reads go through in failure mode.
    3. Rename 'offset' argument to 'offs' to be consistent with the rest of UBIFS
    code.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Now we have per-FS (superblock) debugfs knobs, but they have one drawback - you
    have to first mount the FS and only after this you can switch self-checks
    on/off. But often we want to have the checks enabled during the mount.
    Introduce global debugging knobs for this purpose.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     
  • Separate out pieces of code from the debugfs file read/write functions and
    create separate 'interpret_user_input()'/'provide_user_output()' helpers. These
    helpers will be needed in one of the following patches, so this is just a
    preparational change.

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy