• Liu Bo's avatar
    Btrfs: fix confusing worker helper info in stacktrace · 6939f667
    Liu Bo authored
    We've seen the following backtrace stack in ftrace or dmesg log,
    
      kworker/u16:10-4244  [000] 241942.480955: function:             btrfs_put_ordered_extent
      kworker/u16:10-4244  [000] 241942.480956: kernel_stack:         <stack trace>
    => finish_ordered_fn (ffffffffa0384475)
    => btrfs_scrubparity_helper (ffffffffa03ca577)        <-----"incorrect"
    => btrfs_freespace_write_helper (ffffffffa03ca98e)    <-----"correct"
    => process_one_work (ffffffff81117b2f)
    => worker_thread (ffffffff81118c2a)
    => kthread (ffffffff81121de0)
    => ret_from_fork (ffffffff81d7087a)
    
    btrfs_freespace_write_helper is actually calling normal_worker_helper
    instead of btrfs_scrubparity_helper, so somehow kernel has parsed the
    incorrect function address while unwinding the stack,
    btrfs_scrubparity_helper really shouldn't be shown up.
    
    It's caused by compiler doing inline for our helper function, adding a
    noinline tag can fix that.
    Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    [ use noinline_for_stack ]
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    6939f667
async-thread.c 10.7 KB