From a5177ef3939b79699639097b2cd42c23e1ff5dca Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 24 Jan 2025 13:45:31 +0100 Subject: [PATCH] smbd: Remove an unnecessary call to SMB_VFS_STAT() smb_fname came out of filename_convert_dirfsp(), which already stat'ed if the file exists. !VALID_STAT means new file. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/smbd/smb1_reply.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source3/smbd/smb1_reply.c b/source3/smbd/smb1_reply.c index 42d4845e717..d3f08a53706 100644 --- a/source3/smbd/smb1_reply.c +++ b/source3/smbd/smb1_reply.c @@ -829,11 +829,9 @@ void reply_getatr(struct smb_request *req) reply_nterror(req, status); goto out; } - if (!VALID_STAT(smb_fname->st) && - (SMB_VFS_STAT(conn, smb_fname) != 0)) { - DEBUG(3,("reply_getatr: stat of %s failed (%s)\n", - smb_fname_str_dbg(smb_fname), - strerror(errno))); + if (!VALID_STAT(smb_fname->st)) { + DBG_NOTICE("File %s not found\n", + smb_fname_str_dbg(smb_fname)); reply_nterror(req, map_nt_error_from_unix(errno)); goto out; } -- 2.47.2