Re: [PATCH v2 2/3] fs: create helper file_user_path() for user displayed mapped file path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 9, 2023 at 10:00 AM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
> On Sat, Oct 07, 2023 at 11:44:32AM +0300, Amir Goldstein wrote:
>
> > @@ -93,7 +93,8 @@ static void show_faulting_vma(unsigned long address)
> >               char *nm = "?";
> >
> >               if (vma->vm_file) {
> > -                     nm = file_path(vma->vm_file, buf, ARC_PATH_MAX-1);
> > +                     nm = d_path(file_user_path(vma->vm_file), buf,
> > +                                 ARC_PATH_MAX-1);
> >                       if (IS_ERR(nm))
> >                               nm = "?";
>
> Umm...  At one point I considered this:
>         if (vma->vm_file)
>                 pr_info("  @off 0x%lx in [%pD]  VMA: 0x%08lx to 0x%08lx\n",
>                         vma->vm_start < TASK_UNMAPPED_BASE ?
>                                 address : address - vma->vm_start,
>                         vma->vm_file, vma->vm_start, vma->vm_end);
>         else
>                 pr_info("  @off 0x%lx in [anon]  VMA: 0x%08lx to 0x%08lx\n",
>                         vma->vm_start < TASK_UNMAPPED_BASE ?
>                                 address : address - vma->vm_start,
>                         vma->vm_start, vma->vm_end);
> and to hell with that 'buf' thing...

It's fine by me.
That would be consistent with print_bad_pte().
I've never had to debug vma/pte faults, so I don't know
how much of the path is really valuable for debugging.

Thanks,
Amir.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux