VFS/recycle doesn't work when space available is really big!

René Nieuwenhuizen R.Nieuwenhuizen at cpb.nl
Wed Nov 13 12:12:00 GMT 2002


Hi,

When our filesystem was expanded beyond the 128 Gb limit the VFS/recycle 
code stopped functioning. I looked at the code and I think the variable 
"fsize"and "space_available" should be typed as SMB_BIG_UINT. Its not 
likely that either will ever become negative which currently 
"space_available" did when it's value became real big.

I've attached the patch as a cdiff.

-- 
René Nieuwenhuizen
Afdeling Informatietechnologie
Centraal Planbureau

Bezoekadres: Van Stolkweg 14, 2585 JR Den Haag
Postadres: Postbus 80510, 2508 GM Den Haag

T (070) 3383 342
F (070) 3383 350
I http://www.cpb.nl/nl/general/org/afdelingen/it/ 

--
================================================================================
Aan dit bericht kunnen geen rechten worden ontleend.
Het bericht is alleen bestemd voor de geadresseerde.
Indien dit bericht niet voor u is bestemd, verzoeken wij u dit onmiddellijk aan
ons te melden en de inhoud van het bericht te vernietigen.

This message shall not constitute any obligations.
This message is intended solely for the addressee.
If you have received this message in error, please inform us immediately and
delete its contents.
================================================================================
-------------- next part --------------
*** recycle.c.1	Wed Oct  9 22:27:14 2002
--- recycle.c	Wed Nov 13 13:03:11 2002
***************
*** 51,57 ****
  	char	*exclude;		/* which files to exclude */
  	char	*exclude_dir;		/* which directories to exclude */
  	char	*noversions;		/* which files to exclude from versioning */
! 	SMB_OFF_T max_size;		/* maximum file size to be saved */
  } recycle_bin_struct;
  
  /* Global Variables */
--- 51,57 ----
  	char	*exclude;		/* which files to exclude */
  	char	*exclude_dir;		/* which directories to exclude */
  	char	*noversions;		/* which files to exclude from versioning */
! 	SMB_BIG_UINT max_size;		/* maximum file size to be saved */
  } recycle_bin_struct;
  
  /* Global Variables */
***************
*** 297,308 ****
   * @param fname file name
   * @return size in bytes
   **/
! static SMB_OFF_T recycle_get_file_size(connection_struct *conn, const char *fname)
  {
  	SMB_STRUCT_STAT st;
  	if (default_vfs_ops.stat(conn,fname,&st) != 0) {
  		DEBUG(0,("stat for %s returned %s\n",fname,strerror(errno)));
! 		return (SMB_OFF_T)0;
  	}
  	return(st.st_size);
  }
--- 297,308 ----
   * @param fname file name
   * @return size in bytes
   **/
! static SMB_BIG_UINT recycle_get_file_size(connection_struct *conn, const char *fname)
  {
  	SMB_STRUCT_STAT st;
  	if (default_vfs_ops.stat(conn,fname,&st) != 0) {
  		DEBUG(0,("stat for %s returned %s\n",fname,strerror(errno)));
! 		return (SMB_BIG_UINT)0;
  	}
  	return(st.st_size);
  }
***************
*** 434,440 ****
  	char *base, *ext;
  	int i=1, len, addlen;
  	SMB_BIG_UINT dfree,dsize,bsize;
! 	SMB_OFF_T fsize,space_avail;
  	BOOL exist;
  	int rc;
  
--- 434,440 ----
  	char *base, *ext;
  	int i=1, len, addlen;
  	SMB_BIG_UINT dfree,dsize,bsize;
! 	SMB_BIG_UINT fsize,space_avail;
  	BOOL exist;
  	int rc;
  


More information about the samba-technical mailing list