set_filetime problem
Simo Sorce
idra at samba.org
Sun Dec 16 05:58:02 GMT 2001
I just checked the HEAD code and samba 2.0.7 code and they seem identical.
So I think the problem is somewhere else.
I'm testing the proposed patch.
On Sun, Dec 16, 2001 at 12:36:56PM +0100, Juergen Hasch wrote:
> Hi,
> I want to come back to a message sent from Mike Black on the Samba list some
> time ago:
>
> List: samba
> Subject: set_filetime problem
> From: "Mike Black" <mblack at csihq.com>
> Date: 2001-06-01 11:45:55
> [Download message RAW]
>
> samba-2.2.0 on Linux 2.4.5
>
> When copying a file from client to samba server the file date/time is set to
> the \
> current time instead of the original file date/time. This works OK on 2.0.7
>
> Problem appears to be in smbd/replyc.c reply_close()
>
> The set_filetime works correctly.
> But, the close_file() call flushes the write cache which updates the date/time
> on the \
> file overruling the set_filetime.
>
> Solution:
> set_filetime should be called AFTER close_file. However close_file frees the
> fsp and \
> pending_modtime so a copy will have to be made before close_file. \
> ________________________________________ Michael D. Black Principal Engineer
> mblack at csihq.com 321-676-2923,x203
> http://www.csihq.com Computer Science Innovations
> http://www.csihq.com/~mike My home page
> FAX 321-676-2355
>
> ------------------------------------------------------------------------------
>
> I have the same problem here with current Samba_2_2 from CVS.
> When I set the write cache size to > 0, the file dates are lost
> when copying to a samba share.
> The following patch seems to correct this behaviour:
>
> --- reply.c.orig Sun Dec 16 12:14:33 2001
> +++ reply.c Sun Dec 16 12:27:40 2001
> @@ -2964,6 +2964,8 @@
> */
> int close_err;
>
> + /* flush write cache before setting mtime */
> + flush_write_cache(fsp, WRITE_FLUSH);
> /*
> * If there was a modify time outstanding,
> * try and set it here.
>
> Should it be done differently ?
> ...Juergen
>
>
--
Simo Sorce idra at samba.org
-------------------------------
Samba Team http://www.samba.org
More information about the samba-technical
mailing list