From: Chuck Lever <chuck.lever@oracle.com>
To: Sagi Grimberg <sagi@grimberg.me>, Jeff Layton <jlayton@kernel.org>
Cc: Shaul Tamari <shaul.tamari@vastdata.com>, linux-nfs@vger.kernel.org
Subject: Re: Write delegation stateid permission checks
Date: Thu, 2 Jan 2025 17:42:42 -0500 [thread overview]
Message-ID: <c497a2c1-9bdd-4ccd-91e5-769f4708d9e7@oracle.com> (raw)
In-Reply-To: <3ee21c03-83a5-4ad8-a54f-5c076125e924@grimberg.me>
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
next prev parent reply other threads:[~2025-01-02 22:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-02 9:08 Write delegation stateid permission checks Shaul Tamari
2025-01-02 13:41 ` Jeff Layton
2025-01-02 15:40 ` Rick Macklem
2025-01-02 16:01 ` Chuck Lever
2025-01-02 16:17 ` Rick Macklem
2025-01-02 22:07 ` Sagi Grimberg
2025-01-02 22:42 ` Chuck Lever [this message]
2025-01-04 21:47 ` Sagi Grimberg
2025-01-03 20:58 ` Martin Wege
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c497a2c1-9bdd-4ccd-91e5-769f4708d9e7@oracle.com \
--to=chuck.lever@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=sagi@grimberg.me \
--cc=shaul.tamari@vastdata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox