The patch titled Subject: fs: proc: store PDE()->data into inode->i_private has been added to the -mm tree. Its filename is fs-proc-store-pde-data-into-inode-i_private.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/fs-proc-store-pde-data-into-inode-i_private.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/fs-proc-store-pde-data-into-inode-i_private.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Muchun Song <songmuchun@xxxxxxxxxxxxx> Subject: fs: proc: store PDE()->data into inode->i_private Patch series "remove PDE_DATA()". I found a bug [1] some days ago, which is because we want to use inode->i_private to pass user private data. However, this is wrong on proc fs. We provide a specific function PDE_DATA() to get user private data. Actually, we can hide this detail by storing PDE()->data into inode->i_private and removing PDE_DATA() completely. The user could use inode->i_private to get user private data just like debugfs does. This series is trying to remove PDE_DATA(). [1] https://lore.kernel.org/lkml/20211029032638.84884-1-songmuchun@xxxxxxxxxxxxx/ This patch (of 4): PDE_DATA(inode) is introduced to get user private data and hide the layout of struct proc_dir_entry. The inode->i_private is used to do the same thing as well. Save a copy of user private data to inode-> i_private when proc inode is allocated. This means the user also can get their private data by inode->i_private. Link: https://lkml.kernel.org/r/20211101093518.86845-1-songmuchun@xxxxxxxxxxxxx Link: https://lkml.kernel.org/r/20211101093518.86845-2-songmuchun@xxxxxxxxxxxxx Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx> Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx> Cc: Alexey Gladkov <gladkov.alexey@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/proc/inode.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/proc/inode.c~fs-proc-store-pde-data-into-inode-i_private +++ a/fs/proc/inode.c @@ -650,6 +650,7 @@ struct inode *proc_get_inode(struct supe return NULL; } + inode->i_private = de->data; inode->i_ino = de->low_ino; inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); PROC_I(inode)->pde = de; _ Patches currently in -mm which might be from songmuchun@xxxxxxxxxxxxx are mm-slab-make-slab-iterator-functions-static.patch mm-memcontrol-make-cgroup_memory_nokmem-static.patch fs-proc-store-pde-data-into-inode-i_private.patch fs-proc-replace-pde_datainode-with-inode-i_private.patch fs-proc-remove-pde_data.patch fs-proc-use-define_proc_show_attribute-to-simplify-the-code.patch