Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Dec 2014 09:28:16 -0500 (EST)
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        FreeBSD Filesystems <freebsd-fs@freebsd.org>, John Baldwin <jhb@freebsd.org>, Konstantin Belousov <kib@freebsd.org>
Subject:   RFC: new NFS mount option or restore old behaviour for Solaris server bug?
Message-ID:  <1190766207.2826601.1419690496079.JavaMail.root@uoguelph.ca>
In-Reply-To: <1894262154.2825656.1419690232046.JavaMail.root@uoguelph.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_2826599_1031187847.1419690496077
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Hi,

The FreeBSD9.1 and earlier NFS clients almost always (unless the
tod clock ticked to next second while the operation was in progress)
set the mtime to the server's time (xx_TOSERVER) for exclusive open.
Starting with FreeBSD9.2, the mtime would be set to the client's time
due to r245508, which fixed the code for utimes() to use VA_UTIMES_NULL.

This change tickled a bug in recent Solaris servers, which return
NFS_OK to the Setattr RPC but don't actually set the file's mode bits.
(The bug isn't tickled when mtime is set to the server's time.)
I have patches to work around this in two ways:
1 - Add a new "useservertime" mount option that forces xx_TOSERVER.
    (This patch would force xx_TOSERVER for exclusive open.)
    It permits the man page to document why it is needed-->broken Solaris servers.
2 - Use xx_TOSERVER for exclusive open always. Since this was the normal
    behaviour until FreeBSD9.2, I don't think this would cause problems or
    be a POLA violation, but I can't be sure?

I am leaning towards #2, since it avoids yet another mount option.
However, I'd like other people's opinions on which option is better,
or any other suggestions?

Thanks in advance for your comments, rick
ps: The trivial patch for #2 is attached, in case you are interested.

------=_Part_2826599_1031187847.1419690496077
Content-Type: text/x-patch; name=setservertime.patch
Content-Disposition: attachment; filename=setservertime.patch
Content-Transfer-Encoding: base64

LS0tIGZzL25mc2NsaWVudC9uZnNfY2xwb3J0LmMuc2F2CTIwMTQtMTItMjUgMTI6NTQ6MjUuMDAw
MDAwMDAwIC0wNTAwCisrKyBmcy9uZnNjbGllb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fbXRpbWU7CiAJcmV0dXJuICgxKTsK
------=_Part_2826599_1031187847.1419690496077--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1190766207.2826601.1419690496079.JavaMail.root>