Index: smbd/trans2.c =================================================================== --- smbd/trans2.c (revision 23844) +++ smbd/trans2.c (working copy) @@ -4845,18 +4845,21 @@ allocation_size = smb_roundup(conn, allocation_size); } - if(allocation_size == get_file_size(*psbuf)) { - return NT_STATUS_OK; - } - DEBUG(10,("smb_set_file_allocation_info: file %s : setting new allocation size to %.0f\n", fname, (double)allocation_size )); - + if (fsp && fsp->fh->fd != -1) { /* Open file handle. */ if (vfs_allocate_file_space(fsp, allocation_size) == -1) { return map_nt_error_from_unix(errno); } + /* Changing the allocation size should set the last mod time. */ + fsp_set_pending_modtime(fsp, timespec_current()); + + /* + * This is equivalent to a write. Ensure it's seen immediately. + */ + set_filetime(fsp->conn, fsp->fsp_name, fsp->pending_modtime); return NT_STATUS_OK; } @@ -4875,6 +4878,11 @@ /* NB. We check for open_was_deferred in the caller. */ return status; } + + /* Changing the allocation size should set the last mod time. */ + fsp_set_pending_modtime(new_fsp, timespec_current()); + /* Don't need to call set_filetime as this will be flushed on + * close. */ if (vfs_allocate_file_space(new_fsp, allocation_size) == -1) { status = map_nt_error_from_unix(errno); close_file(new_fsp,NORMAL_CLOSE);