From: Volker Lendecke Date: Fri, 24 Jan 2025 12:45:31 +0000 (+0100) Subject: smbd: Remove an unnecessary call to SMB_VFS_STAT() X-Git-Tag: tdb-1.4.13~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5177ef3939b79699639097b2cd42c23e1ff5dca;p=thirdparty%2Fsamba.git 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 --- 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; }