Subject: open upgrade/downgrade, NT and UNIX

From: "Sergey Klyushin" <[email-masked]>
Date: Mon, 1 Oct 2001 12:46:25 -0400

To solve open upgrade/downgrade problem on NT, I would like to ask UNIX
gurus,
if it's possible to change open_state_id meaning to
"file+open_owner+file_open_mode+file_share_mode".
file_open_mode - READ, WRITE or READ+WRITE
file_share_mode - DENY_NONE, DENY_READ, DENY_WRITE or DENY_READ+DENY_WRITE.

NT could handle multiple opens of the same file with the same open
mode+share mode
and only one close. It means NO open UPGRADE.
NT could handle open/downgrade if share mode is the same as for opened file
and open mode downgrades
from READ | WRITE to READ or WRITE.
Locks will be preserved on downgraded file.

To handle current open_state_id (file+open_owner), NT needs to implement one
of the following
1. Rely on Windows OS: close file, reopen it again, reassign previous locks.
Problems:
 - File could be deleted between close and reopen,
 - not all locks could be reassigned
2. Don't rely on Windows OS: Always open file with READ | WRITE, DENY_NONE
and
NFS Server checks READ and WRITE requests by itself.
Problems:
 - Replacing Windows Native API
 - file could be opened locally with open or share mode different than NFS
client requested.
(exmpl: NFS Client asks DENY_WRITE->NFS Server opens with DENY_NONE->locally
file could be opened with WRITE access)

The following example doesn't work on UNIX:
read_id = open (file, READ);
write_id = open (file, WRITE);
write (read_id,...) - fails
read (write_id,...) - fails
but, as I remember request for OPEN/UPGRADE is very important for UNIX for
some other reasons

Waiting for your comments.

Sergey