Subject: [nfsv4] Question on Open Access

From: Bill Brown <[email-masked]>
Date: Fri, 25 Jul 2003 13:27:02 -0500 (CDT)

I'm on a client and open a file with OPEN4_SHARE_ACCESS_WRITE
only - no read access specified, and no truncate either.

Which servers out there are going to let me read the last partial
page using the stateid received from the open call without returning
a NFS4ERR_OPENMODE error?

_______________________________________________
nfsv4 mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/nfsv4

---

From: Spencer Shepler <[email-masked]>
Date: Fri, 25 Jul 2003 23:43:08 -0500

> a NFS4ERR_OPENMODE error?

We will allow the read if there are no current opens that deny read.

Spencer

---

From: Peter Staubach <[email-masked]>
Date: Mon, 28 Jul 2003 09:08:32 -0600

> We will allow the read if there are no current opens that deny read.

What happens if the client needs to read a block in the file in order
to do read-modify-write?  Does it need to be smarter about opening the
file?

		ps

---

From: Spencer Shepler <[email-masked]>
Date: Mon, 28 Jul 2003 10:29:34 -0500

> to do read-modify-write?  Does it need to be smarter about opening the

If the application needs to read, it should open it for read.  If the
client NFS client, on behalf of the application, needs to read before
a write can occur, then it may have to deal with the server that
denies the READ.  This means that the client would need to write
directly and avoid the traditional page-in/modify sequence.  In the
case of mapped files where the NFS client may not have a choice about
page-in, the client would be restricted and would have to return an
error.  Therefore, if the server can be "lenient" in handling READs to
occur when only opened for write access, that is best. 

As you imply, the client could open the file for READ on behalf of the
application but this may cause a conflict at the application level
since two applications may be accessing the file simultaneously; one
with write-only and the other with write/deny-read and the conflict
may occur if the write-only application is running on the optimistic
client would cause a conflict at open.  In the case of mapped files,
the NFS client may choose to upgrade the open for read in anticipation
of the page-in/write sequence and if there is an open at the server
that denys read, the application could at least receive and error on
the mapping of the file instead of at fault time.

A few choices, none are perfect but a combination should be effective.

Spencer