Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] smb: client: skip cifs_lookup on mkdir
@ 2025-09-09 20:27 Henrique Carvalho
  2025-09-10 17:50 ` Steve French
  0 siblings, 1 reply; 7+ messages in thread
From: Henrique Carvalho @ 2025-09-09 20:27 UTC (permalink / raw)
  To: smfrench; +Cc: ematsumiya, linux-cifs, Henrique Carvalho

For mkdir the final component is looked up with LOOKUP_CREATE |
LOOKUP_EXCL.

We don't need an existence check in mkdir; return NULL and let mkdir
create or fail with -EEXIST (on STATUS_OBJECT_NAME_COLLISION).

Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
---
 fs/smb/client/dir.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
index 5223edf6d11a..d26a14ba6d9b 100644
--- a/fs/smb/client/dir.c
+++ b/fs/smb/client/dir.c
@@ -684,6 +684,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
 	void *page;
 	int retry_count = 0;
 
+	/* if in mkdir, let create path handle it */
+	if (flags == (LOOKUP_CREATE | LOOKUP_EXCL))
+		return NULL;
+
 	xid = get_xid();
 
 	cifs_dbg(FYI, "parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-09-12 12:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-09 20:27 [PATCH] smb: client: skip cifs_lookup on mkdir Henrique Carvalho
2025-09-10 17:50 ` Steve French
2025-09-10 20:28   ` Steve French
2025-09-10 21:09     ` Henrique Carvalho
2025-09-11 13:55       ` Stefan Metzmacher
2025-09-12  2:54         ` Steve French
2025-09-12 12:29           ` Henrique Carvalho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox