[PATCH 6/6] VFS: Change vfs_mkdir() to return the dentry.

2025-02-26 Thread NeilBrown
vfs_mkdir() does not guarantee to leave the child dentry hashed or make it positive on success, and in many such cases the filesystem had to use a different dentry which it can now return. This patch changes vfs_mkdir() to return the dentry provided by the filesystems which is hashed and positive

[PATCH 5/6] nfs: change mkdir inode_operation to return alternate dentry if needed.

2025-02-26 Thread NeilBrown
mkdir now allows a different dentry to be returned which is sometimes relevant for nfs. This patch changes the nfs_rpc_ops mkdir op to return a dentry, and passes that back to the caller. The mkdir nfs_rpc_op will return NULL if the original dentry should be used. This matches the mkdir inode_op

[PATCH 4/6] fuse: return correct dentry for ->mkdir

2025-02-26 Thread NeilBrown
fuse already uses d_splice_alias() to ensure an appropriate dentry is found for a newly created dentry. Now that ->mkdir can return that dentry we do so. This requires changing create_new_entry() to return a dentry and handling that change in all callers. Note that when create_new_entry() is ask

[PATCH 2/6] hostfs: store inode in dentry after mkdir if possible.

2025-02-26 Thread NeilBrown
After handling a mkdir, get the inode for the name and use d_splice_alias() to store the correct dentry in the dcache. Reviewed-by: Jeff Layton Signed-off-by: NeilBrown --- fs/hostfs/hostfs_kern.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/hostfs/hostfs_ker

[PATCH 3/6] ceph: return the correct dentry on mkdir

2025-02-26 Thread NeilBrown
ceph already splices the correct dentry (in splice_dentry()) from the result of mkdir but does nothing more with it. Now that ->mkdir can return a dentry, return the correct dentry. Note that previously ceph_mkdir() could call ceph_init_inode_acls() on the inode from the wrong dentry, which wo

[PATCH 1/6] Change inode_operations.mkdir to return struct dentry *

2025-02-26 Thread NeilBrown
Some filesystems, such as NFS, cifs, ceph, and fuse, do not have complete control of sequencing on the actual filesystem (e.g. on a different server) and may find that the inode created for a mkdir request already exists in the icache and dcache by the time the mkdir request returns. For example,

[PATCH 0/6 v2] Change ->mkdir() and vfs_mkdir() to return a dentry

2025-02-26 Thread NeilBrown
This revised series contains a few clean-ups as requested by various people but no substantial changes. It is based on vfs/vfs-6.15.async.dir plus vfs/vfs-6.15.sysv: I dropped the change to sysv as it seemed pointless preserving them. I reviewed the mkdir functions in many (all?) filesystems and

Re: [PATCH 3/3] x86: avoid copying dynamic FP state from init_task

2025-02-26 Thread Benjamin Berg
On Wed, 2025-02-26 at 14:08 +0100, Ingo Molnar wrote: > > * Benjamin Berg wrote: > > > From: Benjamin Berg > > > > The init_task instance of struct task_struct is statically allocated and > > may not contain the full FP state for userspace. As such, limit the copy > > to the valid area of init

Re: [PATCH 3/3] x86: avoid copying dynamic FP state from init_task

2025-02-26 Thread Ingo Molnar
* Benjamin Berg wrote: > > Note that this patch, while it still applies cleanly, crashes/hangs > > the x86-64 defconfig kernel bootup in the early boot phase in a KVM > > guest bootup. > > Oh, outch. It seems that arch_task_struct_size can actually become > smaller than sizeof(init_task) if

Re: [PATCH 3/3] x86: avoid copying dynamic FP state from init_task

2025-02-26 Thread Ingo Molnar
* Benjamin Berg wrote: > From: Benjamin Berg > > The init_task instance of struct task_struct is statically allocated and > may not contain the full FP state for userspace. As such, limit the copy > to the valid area of init_task and fill the rest with zero. > > Note that the FP state is onl

Re: [PATCH v2 6/6] mm: pgtable: remove tlb_remove_page_ptdesc()

2025-02-26 Thread Kevin Brodsky
On 25/02/2025 04:45, Qi Zheng wrote: > The tlb_remove_ptdesc()/tlb_remove_table() is specially designed for page > table pages, and now all architectures have been converted to use it to > remove page table pages. So let's remove tlb_remove_page_ptdesc(), it > currently has no users and should not

Re: [PATCH v2 3/6] mm: pgtable: convert some architectures to use tlb_remove_ptdesc()

2025-02-26 Thread Kevin Brodsky
On 25/02/2025 04:45, Qi Zheng wrote: > Now, the nine architectures of csky, hexagon, loongarch, m68k, mips, > nios2, openrisc, sh and um do not select CONFIG_MMU_GATHER_RCU_TABLE_FREE, > and just call pagetable_dtor() + tlb_remove_page_ptdesc() (the wrapper of > tlb_remove_page()). This is the same

Re: [PATCH v2 1/6] mm: pgtable: make generic tlb_remove_table() use struct ptdesc

2025-02-26 Thread Kevin Brodsky
On 25/02/2025 04:45, Qi Zheng wrote: > Now only arm will call tlb_remove_ptdesc()/tlb_remove_table() when > CONFIG_MMU_GATHER_TABLE_FREE is disabled. In this case, the type of the > table parameter is actually struct ptdesc * instead of struct page *. > > Since struct ptdesc still overlaps with str

Re: [PATCH v2 2/6] mm: pgtable: change pt parameter of tlb_remove_ptdesc() to struct ptdesc *

2025-02-26 Thread Kevin Brodsky
On 25/02/2025 04:45, Qi Zheng wrote: > All callers of tlb_remove_ptdesc() pass it a pointer of struct ptdesc, so > let's change the pt parameter from void * to struct ptdesc * to perform > a type safety check. > > Signed-off-by: Qi Zheng > Originally-by: Peter Zijlstra (Intel) Reviewed-by: Kevin