From: Ralph Boehme Date: Thu, 19 Nov 2020 10:09:05 +0000 (+0100) Subject: smbd: README.Coding fixes in file_find_dif() X-Git-Tag: samba-4.14.0rc1~365 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cff6dff5c2a730bfb4915aa1182c0421e5db680f;p=thirdparty%2Fsamba.git smbd: README.Coding fixes in file_find_dif() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 4fa3bf4f716..7a7a772f5b5 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -741,25 +741,31 @@ files_struct *file_find_dif(struct smbd_server_connection *sconn, return NULL; } - for (fsp=sconn->files; fsp; fsp=fsp->next,count++) { - /* We can have a fsp->fh->fd == -1 here as it could be a stat open. */ + for (fsp = sconn->files; fsp; fsp = fsp->next,count++) { + /* + * We can have a fsp->fh->fd == -1 here as it could be a stat + * open. + */ if (file_id_equal(&fsp->file_id, &id) && - fh_get_gen_id(fsp->fh) == gen_id ) { + fh_get_gen_id(fsp->fh) == gen_id ) + { 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)) { + fsp->oplock_type != LEASE_OPLOCK)) + { struct file_id_buf idbuf; - DEBUG(0,("file_find_dif: 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 )); + + 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;