14 Aug, 2014

1 commit

  • Pull quota, reiserfs, UDF updates from Jan Kara:
    "Scalability improvements for quota, a few reiserfs fixes, and couple
    of misc cleanups (udf, ext2)"

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    reiserfs: Fix use after free in journal teardown
    reiserfs: fix corruption introduced by balance_leaf refactor
    udf: avoid redundant memcpy when writing data in ICB
    fs/udf: re-use hex_asc_upper_{hi,lo} macros
    fs/quota: kernel-doc warning fixes
    udf: use linux/uaccess.h
    fs/ext2/super.c: Drop memory allocation cast
    quota: remove dqptr_sem
    quota: simplify remove_inode_dquot_ref()
    quota: avoid unnecessary dqget()/dqput() calls
    quota: protect Q_GETFMT by dqonoff_mutex

    Linus Torvalds
     

09 Aug, 2014

1 commit


06 Aug, 2014

1 commit

  • Commits f1f007c308e (reiserfs: balance_leaf refactor, pull out
    balance_leaf_insert_left) and cf22df182bf (reiserfs: balance_leaf
    refactor, pull out balance_leaf_paste_left) missed that the `body'
    pointer was getting repositioned. Subsequent users of the pointer
    would expect it to be repositioned, and as a result, parts of the
    tree would get overwritten. The most common observed corruption
    is indirect block pointers being overwritten.

    Since the body value isn't actually used anymore in the called routines,
    we can pass back the offset it should be shifted. We constify the body
    and ih pointers in the balance_leaf as a mostly-free preventative measure.

    Cc: # 3.16
    Reported-and-tested-by: Jeff Chua
    Signed-off-by: Jeff Mahoney
    Signed-off-by: Jan Kara

    Jeff Mahoney
     

11 Jun, 2014

1 commit


13 May, 2014

3 commits


08 May, 2014

14 commits


07 May, 2014

5 commits


18 Feb, 2014

1 commit

  • This has been this way for years, and every time I stumble across it I
    lose my lunch. After coming across it for the nth time in the Coverity
    results, I had to overcome the bystander effect and do something about
    it.

    This ignores the 79 column limit in favor of making it look like C
    instead of gibberish.

    The correct thing to do here would be to lose some of the indentation by
    breaking this function up into several smaller ones. I might do that at
    some point if I have the stomach to look at this again.

    (Also some of those overlong ternary operations would likely be more
    readable as regular if's)

    Signed-off-by: Dave Jones
    Signed-off-by: Linus Torvalds

    Dave Jones
     

21 Mar, 2012

1 commit


14 Sep, 2009

1 commit

  • When do_balance() balances the tree, a trick is performed to
    provide the ability for other tree writers/readers to check whether
    do_balance() is executing concurrently (requires CONFIG_REISERFS_CHECK).

    This is done to protect concurrent accesses to the tree. The trick
    is the following:

    When do_balance is called, a unique global variable called cur_tb
    takes a pointer to the current tree to be rebalanced.
    Once do_balance finishes its work, cur_tb takes the NULL value.

    Then, concurrent tree readers/writers just have to check the value
    of cur_tb to ensure do_balance isn't executing concurrently.
    If it is, then it proves that schedule() occured on do_balance(),
    which then relaxed the bkl that protected the tree.

    Now that the bkl has be turned into a mutex, this check is still
    fine even though do_balance() becomes preemptible: the write lock
    will not be automatically released on schedule(), so the tree is
    still protected.

    But this is only fine if we have a single reiserfs mountpoint.
    Indeed, because the bkl is a global lock, it didn't allowed
    concurrent executions between a tree reader/writer in a mount point
    and a do_balance() on another tree from another mountpoint.

    So assuming all these readers/writers weren't supposed to be
    reentrant, the current check now sometimes detect false positives with
    the current per-superblock mutex which allows this reentrancy.

    This patch keeps the concurrent tree accesses check but moves it
    per superblock, so that only trees from a same mount point are
    checked to be not accessed concurrently.

    [ Impact: fix spurious panic while running several reiserfs mount-points ]

    Cc: Jeff Mahoney
    Cc: Chris Mason
    Cc: Ingo Molnar
    Cc: Alexander Beregalov
    Signed-off-by: Frederic Weisbecker

    Frederic Weisbecker
     

19 Jun, 2009

1 commit

  • Several code paths in reiserfs have a construct like:

    if (is_direntry_le_ih(ih = B_N_PITEM_HEAD(src, item_num))) ...

    which, in addition to being ugly, end up causing compiler warnings with
    gcc 4.4.0. Previous compilers didn't issue a warning.

    fs/reiserfs/do_balan.c:1273: warning: operation on `aux_ih' may be undefined
    fs/reiserfs/lbalance.c:393: warning: operation on `ih' may be undefined
    fs/reiserfs/lbalance.c:421: warning: operation on `ih' may be undefined
    fs/reiserfs/lbalance.c:777: warning: operation on `ih' may be undefined

    I believe this is due to the ih being passed to macros which evaluate the
    argument more than once. This is old code and we haven't seen any
    problems with it, but this patch eliminates the warnings.

    It converts the multiple evaluation macros to static inlines and does a
    preassignment for the cases that were causing the warnings because that
    code is just ugly.

    Reported-by: Chris Mason
    Signed-off-by: Jeff Mahoney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     

31 Mar, 2009

5 commits

  • This patch strips trailing whitespace from the reiserfs code.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • This is the first in a series of patches to make balance_leaf() not
    quite so insane.

    This patch factors out the open coded initializations of buffer_info
    structures and defines a few initializers for the 4 cases they're used.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • ReiserFS panics can be somewhat inconsistent.
    In some cases:
    * a unique identifier may be associated with it
    * the function name may be included
    * the device may be printed separately

    This patch aims to make warnings more consistent. reiserfs_warning() prints
    the device name, so printing it a second time is not required. The function
    name for a warning is always helpful in debugging, so it is now automatically
    inserted into the output. Hans has stated that every warning should have
    a unique identifier. Some cases lack them, others really shouldn't have them.
    reiserfs_warning() now expects an id associated with each message. In the
    rare case where one isn't needed, "" will suffice.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • ReiserFS warnings can be somewhat inconsistent.
    In some cases:
    * a unique identifier may be associated with it
    * the function name may be included
    * the device may be printed separately

    This patch aims to make warnings more consistent. reiserfs_warning() prints
    the device name, so printing it a second time is not required. The function
    name for a warning is always helpful in debugging, so it is now automatically
    inserted into the output. Hans has stated that every warning should have
    a unique identifier. Some cases lack them, others really shouldn't have them.
    reiserfs_warning() now expects an id associated with each message. In the
    rare case where one isn't needed, "" will suffice.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • This patch makes leaf_paste_entries more consistent with respect to the
    other leaf operations. Using buffer_info instead of buffer_head
    directly allows us to get a superblock pointer for use in error
    handling.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     

28 Apr, 2008

1 commit

  • fs/reiserfs/do_balan.c:1467:10: warning: symbol 'ret_val' shadows an earlier one
    fs/reiserfs/do_balan.c:275:6: originally declared here
    fs/reiserfs/do_balan.c:1471:23: warning: symbol 'ih' shadows an earlier one
    fs/reiserfs/do_balan.c:249:67: originally declared here

    Signed-off-by: Harvey Harrison
    Cc: Chris Mason
    Cc: Jeff Mahoney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     

31 Mar, 2008

1 commit


13 Feb, 2007

1 commit


01 Jul, 2006

1 commit


13 Jul, 2005

1 commit

  • This was a pure indentation change, using:

    scripts/Lindent fs/reiserfs/*.c include/linux/reiserfs_*.h

    to make reiserfs match the regular Linux indentation style. As Jeff
    Mahoney writes:

    The ReiserFS code is a mix of a number of different coding styles, sometimes
    different even from line-to-line. Since the code has been relatively stable
    for quite some time and there are few outstanding patches to be applied, it
    is time to reformat the code to conform to the Linux style standard outlined
    in Documentation/CodingStyle.

    This patch contains the result of running scripts/Lindent against
    fs/reiserfs/*.c and include/linux/reiserfs_*.h. There are places where the
    code can be made to look better, but I'd rather keep those patches separate
    so that there isn't a subtle by-hand hand accident in the middle of a huge
    patch. To be clear: This patch is reformatting *only*.

    A number of patches may follow that continue to make the code more consistent
    with the Linux coding style.

    Hans wasn't particularly enthusiastic about these patches, but said he
    wouldn't really oppose them either.

    Signed-off-by: Linus Torvalds

    Linus Torvalds