lkml.org 
[lkml]   [2012]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5/9] ext4: Avoid output message interleaving in ext4_error_<foo>
    Date
    Using pr_cont means that messages from multiple threads
    may be interleaved. Avoid this by using a single pr_<level>
    call in ext4_error_inode and ext4_error_file.

    Signed-off-by: Joe Perches <joe@perches.com>
    ---
    fs/ext4/super.c | 24 +++++++++++++++---------
    1 files changed, 15 insertions(+), 9 deletions(-)

    diff --git a/fs/ext4/super.c b/fs/ext4/super.c
    index 4e1d656..ac77a95 100644
    --- a/fs/ext4/super.c
    +++ b/fs/ext4/super.c
    @@ -517,11 +517,14 @@ void ext4_error_inode(struct inode *inode, const char *function,
    va_start(args, fmt);
    vaf.fmt = fmt;
    vaf.va = &args;
    - pr_crit("error (device %s): %s:%d: inode #%lu: ",
    - inode->i_sb->s_id, function, line, inode->i_ino);
    if (block)
    - pr_cont("block %llu: ", block);
    - pr_cont("comm %s: %pV\n", current->comm, &vaf);
    + pr_crit("error (device %s): %s:%d: inode #%lu: block %llu: comm %s: %pV\n",
    + inode->i_sb->s_id, function, line, inode->i_ino,
    + block, current->comm, &vaf);
    + else
    + pr_crit("error (device %s): %s:%d: inode #%lu: comm %s: %pV\n",
    + inode->i_sb->s_id, function, line, inode->i_ino,
    + current->comm, &vaf);
    va_end(args);

    ext4_handle_error(inode->i_sb);
    @@ -543,14 +546,17 @@ void ext4_error_file(struct file *file, const char *function,
    path = d_path(&(file->f_path), pathname, sizeof(pathname));
    if (IS_ERR(path))
    path = "(unknown)";
    - pr_crit("error (device %s): %s:%d: inode #%lu: ",
    - inode->i_sb->s_id, function, line, inode->i_ino);
    - if (block)
    - pr_cont("block %llu: ", block);
    va_start(args, fmt);
    vaf.fmt = fmt;
    vaf.va = &args;
    - pr_cont("comm %s: path %s: %pV\n", current->comm, path, &vaf);
    + if (block)
    + pr_crit("error (device %s): %s:%d: inode #%lu: block %llu: comm %s: path %s: %pV\n",
    + inode->i_sb->s_id, function, line, inode->i_ino,
    + block, current->comm, path, &vaf);
    + else
    + pr_crit("error (device %s): %s:%d: inode #%lu: comm %s: path %s: %pV\n",
    + inode->i_sb->s_id, function, line, inode->i_ino,
    + current->comm, path, &vaf);
    va_end(args);

    ext4_handle_error(inode->i_sb);
    --
    1.7.8.111.gad25c.dirty


    \
     
     \ /
      Last update: 2012-03-16 01:11    [W:0.029 / U:30.188 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site