The branch, v3-6-test has been updated
       via  274fc73 Ensure we use vfs_fsp_stat(), not VFS_STAT directly, and 
store into fsp->fsp_name->st instead of a SMB_STRUCT_STAT on the stack.
       via  2ff6822 Merge branch 'v3-6-test' of 
ssh://git.samba.org/data/git/samba into v3-6-test
       via  dc38715 smbtorture: correct error handling in BASE-OPEN.
      from  1ef50b1 Change crediting so that the credits are returned on the 
interim async response. (cherry picked from commit 
58ebe1de32050fca71059c521f74488cfa5b3729)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit 274fc732d751429c7a6ce9d4257b3bde68ffa8cd
Author: Jeremy Allison <j...@samba.org>
Date:   Mon Dec 13 19:17:57 2010 -0800

    Ensure we use vfs_fsp_stat(), not VFS_STAT directly, and store into 
fsp->fsp_name->st
    instead of a SMB_STRUCT_STAT on the stack.
    
    Jeremy.
    (cherry picked from commit 68f8f220dcd20f4f04bc95916ae04da81a2cdda1)

commit 2ff682226bed8ac1f55caee4aaa7cc1e8c0d1a47
Merge: dc38715527d282545ba7b05051bda70067fe5d6a 
1ef50b15da1ca23afc2d3af6abe7f375e57946a1
Author: Jeremy Allison <j...@samba.org>
Date:   Mon Dec 13 17:08:08 2010 -0800

    Merge branch 'v3-6-test' of ssh://git.samba.org/data/git/samba into 
v3-6-test

commit dc38715527d282545ba7b05051bda70067fe5d6a
Author: James Peach <jpe...@samba.org>
Date:   Mon Dec 6 11:27:31 2010 -0800

    smbtorture: correct error handling in BASE-OPEN.
    
    There are a number of cases in BASE-OPEN where an initial failure cascades
    into multiple failures due to lack of cleanup between test phases. Fix
    all these so that they close open file handles correctly. Replace
    torture_comment with torture_result where appropriate so that the results
    output contains a useful diagnostic.

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

Summary of changes:
 source3/smbd/vfs.c |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index a35142e..3055e37 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -455,10 +455,10 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
 int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
 {
        int ret;
-       SMB_STRUCT_STAT st;
        connection_struct *conn = fsp->conn;
        uint64_t space_avail;
        uint64_t bsize,dfree,dsize;
+       NTSTATUS status;
 
        /*
         * Actually try and commit the space on disk....
@@ -474,19 +474,20 @@ int vfs_allocate_file_space(files_struct *fsp, uint64_t 
len)
                return -1;
        }
 
-       ret = SMB_VFS_FSTAT(fsp, &st);
-       if (ret == -1)
-               return ret;
+       status = vfs_stat_fsp(fsp);
+       if (!NT_STATUS_IS_OK(status)) {
+               return -1;
+       }
 
-       if (len == (uint64_t)st.st_ex_size)
+       if (len == (uint64_t)fsp->fsp_name->st.st_ex_size)
                return 0;
 
-       if (len < (uint64_t)st.st_ex_size) {
+       if (len < (uint64_t)fsp->fsp_name->st.st_ex_size) {
                /* Shrink - use ftruncate. */
 
                DEBUG(10,("vfs_allocate_file_space: file %s, shrink. Current "
                          "size %.0f\n", fsp_str_dbg(fsp),
-                         (double)st.st_ex_size));
+                         (double)fsp->fsp_name->st.st_ex_size));
 
                contend_level2_oplocks_begin(fsp, LEVEL2_CONTEND_ALLOC_SHRINK);
 
@@ -508,7 +509,7 @@ int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
        if (!lp_strict_allocate(SNUM(fsp->conn)))
                return 0;
 
-       len -= st.st_ex_size;
+       len -= fsp->fsp_name->st.st_ex_size;
        len /= 1024; /* Len is now number of 1k blocks needed. */
        space_avail = get_dfree_info(conn, fsp->fsp_name->base_name, false,
                                     &bsize, &dfree, &dsize);
@@ -518,7 +519,7 @@ int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
 
        DEBUG(10,("vfs_allocate_file_space: file %s, grow. Current size %.0f, "
                  "needed blocks = %.0f, space avail = %.0f\n",
-                 fsp_str_dbg(fsp), (double)st.st_ex_size, (double)len,
+                 fsp_str_dbg(fsp), (double)fsp->fsp_name->st.st_ex_size, 
(double)len,
                  (double)space_avail));
 
        if (len > space_avail) {
@@ -605,36 +606,36 @@ int vfs_slow_fallocate(files_struct *fsp, SMB_OFF_T 
offset, SMB_OFF_T len)
 int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len)
 {
        int ret;
-       SMB_STRUCT_STAT st;
+       NTSTATUS status;
        SMB_OFF_T offset;
        size_t num_to_write;
 
-       ret = SMB_VFS_FSTAT(fsp, &st);
-       if (ret == -1) {
-               return ret;
+       status = vfs_stat_fsp(fsp);
+       if (!NT_STATUS_IS_OK(status)) {
+               return -1;
        }
 
-       if (len <= st.st_ex_size) {
+       if (len <= fsp->fsp_name->st.st_ex_size) {
                return 0;
        }
 
 #ifdef S_ISFIFO
-       if (S_ISFIFO(st.st_ex_mode)) {
+       if (S_ISFIFO(fsp->fsp_name->st.st_ex_mode)) {
                return 0;
        }
 #endif
 
        DEBUG(10,("vfs_fill_sparse: write zeros in file %s from len %.0f to "
                  "len %.0f (%.0f bytes)\n", fsp_str_dbg(fsp),
-                 (double)st.st_ex_size, (double)len,
-                 (double)(len - st.st_ex_size)));
+                 (double)fsp->fsp_name->st.st_ex_size, (double)len,
+                 (double)(len - fsp->fsp_name->st.st_ex_size)));
 
        contend_level2_oplocks_begin(fsp, LEVEL2_CONTEND_FILL_SPARSE);
 
        flush_write_cache(fsp, SIZECHANGE_FLUSH);
 
-       offset = st.st_ex_size;
-       num_to_write = len - st.st_ex_size;
+       offset = fsp->fsp_name->st.st_ex_size;
+       num_to_write = len - fsp->fsp_name->st.st_ex_size;
 
        /* Only do this on non-stream file handles. */
        if (fsp->base_fsp == NULL) {


-- 
Samba Shared Repository

Reply via email to