J Jia He #
Message details and related content
Background ========== Linus suggested printing full path for file instead of printing the components as '%pd'. Typically, there is no need for printk specifiers to take any real locks (ie mount_lock or rename_lock). So I introduce a new helper d_path_fast which is similar to d_path except it doesn't take any seqlock/spinlock. This series is based on Al Viro's d_path cleanup patches [1] which lifted the inner lockless loop into a new helper. [1] https://lkml.org/lkml/2021/5/18/1260 Test ==== The cases I tested: 1. print '%pD' with full path of ext4 file 2. mount a ext4 filesystem upon a ext4 filesystem, and print the file with '%pD' 3. print file path which has more than 256 chars,"-ENAMETOOLONG" will be returned 4. print file path with '%32pD' 5. all test_print selftests After this set, I found many lines containing '%pD[234]' should be changed to '%pD'. I don't want to involve those subsystems in this patch series before the helper is stable enough. You can get the lines by: $find fs/ -name \*.[ch] | xargs grep -rn "\%pD[234" fs/overlayfs/file.c:65: pr_debug("open(%p[%pD2/%c], 0%o) -> (%p, 0%o)\n", fs/nfs/direct.c:453: dfprintk(FILE, "NFS: direct read(%pD2, %zd@%Ld)\n", fs/nfs/direct.c:908: dfprintk(FILE, "NFS: direct write(%pD2, %zd@%Ld)\n", fs/nfs/write.c:1371: dprintk("NFS: nfs_updatepage(%pD2 %d@%lld)\n", fs/nfs/nfs4file.c:116: dprintk("NFS: flush(%pD2)\n", file); fs/nfs/file.c:69: dprintk("NFS: open file(%pD2)\n", filp); fs/nfs/file.c:83: dprintk("NFS: release(%pD2)\n", filp); fs/nfs/file.c:117: dprintk("NFS: llseek file(%pD2, %lld, %d)\n",