]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: remove oplock paranoia check from file_find_dif()
authorRalph Boehme <slow@samba.org>
Thu, 1 Dec 2022 20:38:32 +0000 (21:38 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 9 Dec 2022 23:11:38 +0000 (23:11 +0000)
Since 4.16 stat opens will have a real fd, the only case where currently the fd
can still be -1 is a POSIX request on a symlink.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/files.c

index f551bc793026f70135fd2e932e4790b81a8ee2ab..ea1c31f4e85e74a98e56e67c50cdcf8c315a132d 100644 (file)
@@ -1564,22 +1564,6 @@ files_struct *file_find_dif(struct smbd_server_connection *sconn,
                if (count > 10) {
                        DLIST_PROMOTE(sconn->files, fsp);
                }
-               /* Paranoia check. */
-               if ((fsp_get_pathref_fd(fsp) == -1) &&
-                   (fsp->oplock_type != NO_OPLOCK &&
-                    fsp->oplock_type != LEASE_OPLOCK))
-               {
-                       struct file_id_buf idbuf;
-
-                       DBG_ERR("file %s file_id = "
-                               "%s, gen = %u oplock_type = %u is a "
-                               "stat open with oplock type !\n",
-                               fsp_str_dbg(fsp),
-                               file_id_str_buf(fsp->file_id, &idbuf),
-                               (unsigned int)fh_get_gen_id(fsp->fh),
-                               (unsigned int)fsp->oplock_type);
-                       smb_panic("file_find_dif");
-               }
                return fsp;
        }