Re: Write delegation stateid permission checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/2/25 5:07 PM, Sagi Grimberg wrote:



On 02/01/2025 15:41, Jeff Layton wrote:
On Thu, 2025-01-02 at 11:08 +0200, Shaul Tamari wrote:
Should the server check permissions for read access as well when
OPEN4_SHARE_ACCESS_WRITE is requested and DELEGATION_WRITE is granted
?

Possibly? When trying to grant a write delegation, the server should
probably also do an opportunistic permission check for read as well,
and only grant the delegation if that passes. If it fails, you could
still allow the open and just not grant the delegation.

Yes, that is what Chuck suggested at the time.


ISTR that Sagi may have tried this approach though and there was a
problem with it?

Not a problem per se, IIRC the thread left off that we need to sort out
access reference accounting for nfsd_file for both reads and writes for
a single write deleg...

I've been pondering this recently.

The desired outcome would be to deal with a OPEN(SHARE_ACCESS_WRITE)
by opening the file twice: once, WR_ONLY, for the OPEN state ID, and
once RW, for the write delegation.

Will that work? won't the two opens conflict with each other and
trigger a delegation recall?

Seems like NFSD will need a lot more logic to make this approach
work right.


--
Chuck Lever




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux