Advisory file locks for RO volumes don't make a lot of sense, since
there are no possible writes to worry about. The fileserver already
does not track these, so don't even bother processing them in the
client.
Change-Id: Ie2a20d2f7af67799cfb8d30e72aa3e52a1ecc2d5
Reviewed-on: http://gerrit.openafs.org/8197
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
#endif /* F_GETLK64 && F_GETLK != F_GETLK64 */
AFS_GLOCK();
+ if ((vcp->f.states & CRO)) {
+ if (flp->fl_type == F_WRLCK) {
+ code = EBADF;
+ } else {
+ code = 0;
+ }
+ AFS_GUNLOCK();
+ crfree(credp);
+ return code;
+ }
code = afs_convert_code(afs_lockctl(vcp, &flock, cmd, credp));
AFS_GUNLOCK();
#else
) {
#endif
+
+ if ((avc->f.states & CRO)) {
+ /* for RO volumes, don't do anything for locks; the fileserver doesn't
+ * even track them. A write lock should not be possible, though. */
+ if (af->l_type == F_WRLCK) {
+ code = EBADF;
+ } else {
+ code = 0;
+ }
+ goto done;
+ }
+
/* Java VMs ask for l_len=(long)-1 regardless of OS/CPU */
if ((sizeof(af->l_len) == 8) && (af->l_len == 0x7fffffffffffffffLL))
af->l_len = 0;