• Kir Kolyshkin's avatar
    Move error reporting to inside open_proc and friends · 5661d806
    Kir Kolyshkin authored
    ...and make it correctly print the file name we were unable to open.
    Also, error from fdopen[dir]() is now reported with file name as well.
    
    Note that open_proc() and friends need to be macros in order for
    pr_perror() to show actual file name and line number where error occured.
    
    Historical note: the original version of this patch was way more radical,
    changing openat() to open() and thus removing pid_dir (replacing with pid
    when needed) and open_proc_dir(), changing openat() to open(). The word
    from Pavel is he wants to keep the openat/pid_dir optimization because
    it saves two dentry lookups in kernel code for each open(). Because of
    this optimization (and desire to print correct file name in case
    of error) we have to carry both pid and pid_dir everywhere.
    Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
    Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    5661d806
cr-dump.c 28.1 KB