[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Dec 15 18:38:01 MST 2010


The branch, master has been updated
       via  a06519a Fix old bug in openX code, exposed when "strict allocate" is set to true.
       via  ecf48af Change strict allocate to default to true. (cherry picked from commit 820ea22a07b062b1717d35de8fa7051fc1067c3f)
      from  6bb89aa s4-tests: Added a speedtest for LDAP search operations with different accounts.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a06519a579f04c4728af01a169ba79c7149994db
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Dec 15 16:49:04 2010 -0800

    Fix old bug in openX code, exposed when "strict allocate" is set to true.
    
    We need to return the file size here, not the allocation size, but
    we were not updating the stat struct after the vfs_set_filesize()
    call. Ensure we always use fresh data in openX replies.
    
    Jeremy.
    
    Autobuild-User: Jeremy Allison <jra at samba.org>
    Autobuild-Date: Thu Dec 16 02:37:58 CET 2010 on sn-devel-104

commit ecf48af135e4c1ebc5aafe4b3dad785162f5949a
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Dec 15 13:32:09 2010 -0800

    Change strict allocate to default to true. (cherry picked from commit 820ea22a07b062b1717d35de8fa7051fc1067c3f)

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/smbdotconf/tuning/strictallocate.xml |   11 ++++++-----
 source3/param/loadparm.c                      |    2 +-
 source3/smbd/reply.c                          |   14 +++++++++-----
 3 files changed, 16 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/smbdotconf/tuning/strictallocate.xml b/docs-xml/smbdotconf/tuning/strictallocate.xml
index 1855574..9311eb6 100644
--- a/docs-xml/smbdotconf/tuning/strictallocate.xml
+++ b/docs-xml/smbdotconf/tuning/strictallocate.xml
@@ -10,9 +10,10 @@
     of actually forcing the disk system to allocate real storage blocks
     when a file is created or extended to be a given size. In UNIX
     terminology this means that Samba will stop creating sparse files.
-    This can be slow on some systems. When you work with large files like
-    >100MB or so you may even run into problems with clients running into
-    timeouts.</para>
+    Modern UNIX filesystems now support extents and so in Samba 3.6.0 we
+    have changed this parameter to default to "yes". On older filesystems
+    without extents you might want to turn this parameter to "no".
+    </para>
 
     <para>When you have an extent based filesystem it's likely that we can make
     use of unwritten extents which allows Samba to allocate even large amounts
@@ -28,9 +29,9 @@
     preallocation is probably an expensive operation where you will see reduced
     performance and risk to let clients run into timeouts when creating large
     files. Examples are ext3, ZFS, HFS+ and most others, so be aware if you
-    activate this setting on those filesystems.</para>
+    leave the default setting on those filesystems.</para>
 
 </description>
 
-<value type="default">no</value>
+<value type="default">yes</value>
 </samba:parameter>
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index ced8223..2f68f00 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -633,7 +633,7 @@ static struct service sDefault = {
 	false,			/* bWidelinks */
 	True,			/* bSymlinks */
 	False,			/* bSyncAlways */
-	False,			/* bStrictAllocate */
+	True,			/* bStrictAllocate */
 	False,			/* bStrictSync */
 	'~',			/* magic char */
 	NULL,			/* copymap */
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 26badc4..e5067cc 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1985,12 +1985,16 @@ void reply_open_and_X(struct smb_request *req)
 			reply_nterror(req, NT_STATUS_DISK_FULL);
 			goto out;
 		}
-		smb_fname->st.st_ex_size =
-		    SMB_VFS_GET_ALLOC_SIZE(conn, fsp, &smb_fname->st);
+		status = vfs_stat_fsp(fsp);
+		if (!NT_STATUS_IS_OK(status)) {
+			close_file(req, fsp, ERROR_CLOSE);
+			reply_nterror(req, status);
+			goto out;
+		}
 	}
 
-	fattr = dos_mode(conn, smb_fname);
-	mtime = convert_timespec_to_time_t(smb_fname->st.st_ex_mtime);
+	fattr = dos_mode(conn, fsp->fsp_name);
+	mtime = convert_timespec_to_time_t(fsp->fsp_name->st.st_ex_mtime);
 	if (fattr & aDIR) {
 		close_file(req, fsp, ERROR_CLOSE);
 		reply_nterror(req, NT_STATUS_ACCESS_DENIED);
@@ -2038,7 +2042,7 @@ void reply_open_and_X(struct smb_request *req)
 	} else {
 		srv_put_dos_date3((char *)req->outbuf,smb_vwv4,mtime);
 	}
-	SIVAL(req->outbuf,smb_vwv6,(uint32)smb_fname->st.st_ex_size);
+	SIVAL(req->outbuf,smb_vwv6,(uint32)fsp->fsp_name->st.st_ex_size);
 	SSVAL(req->outbuf,smb_vwv8,GET_OPENX_MODE(deny_mode));
 	SSVAL(req->outbuf,smb_vwv11,smb_action);
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list