--- samba-3.6.12/source3/lib/system.c.orig 2013-05-08 10:27:59.777009968 -0700 +++ samba-3.6.12/source3/lib/system.c 2013-05-08 10:44:42.772639580 -0700 @@ -529,11 +529,14 @@ static void make_create_timespec(const s void update_stat_ex_mtime(struct stat_ex *dst, struct timespec write_ts) { - dst->st_ex_mtime = write_ts; - - /* We may have to recalculate btime. */ - if (dst->st_ex_calculated_birthtime) { - dst->st_ex_btime = calc_create_time_stat_ex(dst); + /* Update the old write timestamp only for files */ + if(!S_ISDIR(dst->st_ex_mode)) { + dst->st_ex_mtime = write_ts; + + /* We may have to recalculate btime. */ + if (dst->st_ex_calculated_birthtime) { + dst->st_ex_btime = calc_create_time_stat_ex(dst); + } } }