I duplicated your problem. I have a share exported from my test system,
which I have mounted on the same system. In a sequence of ls -l
operations, the reported mtime and ctime on a file can flip-flop back
and forth.
I've found the bad code, though I haven't figured out exactly how it
fits into the code paths that I think are being executed. The client
code (in smbfsgetattr(), smbfs_attr_cachelookup(), and
smbfs_attr_cacheenter(), and some friends) maintains a cache of file
attributes. When the entry isn't in the cache or is too stale to use,
you get the right answer for mtime and ctime. When the entry *is* in
the cache and recent enough, the values for mtime and ctime are swapped.
The problem is in this piece of smbfs_make_node():
np->r_ctime = fap->fa_mtime;
np->r_mtime = fap->fa_ctime;
Like I said, I don't entirely understand the code flow, but that sure
looks wrong, and indeed, patching it to swap the two references makes
the problem go away.
Gordon, do you want to do the fix, or would you like me to?
Bill Shannon wrote:
> I'm now 100% convinced that this is a bug in smbfs. It took me way too
> long to figure this out, but here's the simple proof:
>
> nissan$ ls -lm "/home/rosalind/My Pictures/2001/Stanford/DSCN0047.JPG"
> -rw-rw-rw- 1 shannon 665496 Mar 17 2002 /home/rosalind/My
> Pictures/2001/Stanford/DSCN0047.JPG
> nissan$ ls -lm "/home/rosalind/My Pictures/2001/Stanford/DSCN0047.JPG"
> -rw-rw-rw- 1 shannon 665496 Jul 3 07:30 /home/rosalind/My
> Pictures/2001/Stanford/DSCN0047.JPG
>
> Those two commands were executed one right after the other.
> The file is definitely not changing.
>
> Somehow, for some reason, smbfs is swapping the mtime and ctime values
> for files. (Evidence not above, but I saw this in my detailed rdist
> debugging.)
>
> I'll be filing a P1 bug as soon as I get a chance.
> _______________________________________________
> cifs-discuss mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/cifs-discuss
>
_______________________________________________
cifs-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/cifs-discuss