All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: Calum Mackay <calum.mackay@oracle.com>
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH] Add some tests for unsupported fattr4 attributes
Date: Mon, 29 Sep 2025 17:16:10 -0400	[thread overview]
Message-ID: <f86efa58-3dec-42e9-b992-884fc143457d@kernel.org> (raw)
In-Reply-To: <d195b486-a351-4ff7-838e-47d97f9ac0a1@oracle.com>

On 9/29/25 2:14 PM, Calum Mackay wrote:
> thanks Chuck,
> 
> I'm still catching up with pynfs patches; I'll get this (and the others
> queued up) in asap.

My patch deserves a smell test first, of course. I'm not at all sure
this is reasonable or proper Python.


> cheers,
> c.
> 
> 
> On 29/09/2025 9:16 pm, Chuck Lever wrote:
>> From: Chuck Lever <chuck.lever@oracle.com>
>>
>> Linux NFSD does not implement a handful of these NFSv4.0 fattr4
>> attributes. Ensure that NFSD's fattr4 result encoder is correctly
>> clearing the result mask and returning NFS4_OK.
>>
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---
>>   nfs4.0/servertests/st_getattr.py | 149 +++++++++++++++++++++++++++++++
>>   1 file changed, 149 insertions(+)
>>
>> diff --git a/nfs4.0/servertests/st_getattr.py b/nfs4.0/servertests/
>> st_getattr.py
>> index 1c47ebf60571..d423aa1df46d 100644
>> --- a/nfs4.0/servertests/st_getattr.py
>> +++ b/nfs4.0/servertests/st_getattr.py
>> @@ -521,6 +521,155 @@ def testOwnerName(t, env):
>>           t.fail_support("owner not a supported attribute")
>>       # print(res.resarray[-1].obj_attributes)
>>   +def testArchive(t, env):
>> +    """GETATTR on "archive" attribute
>> +
>> +    FLAGS: getattr all
>> +    DEPEND: LOOKFILE
>> +    CODE: GATT11a
>> +    """
>> +    c = env.c1
>> +    ops = c.use_obj(env.opts.usefile)
>> +    ops += [c.getattr([FATTR4_ARCHIVE])]
>> +    res = c.compound(ops)
>> +    check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(archive)")
>> +    if res.status == NFS4ERR_ATTRNOTSUPP:
>> +        t.fail_support("archive not a supported attribute")
>> +
>> +def testHidden(t, env):
>> +    """GETATTR on "hidden" attribute
>> +
>> +    FLAGS: getattr all
>> +    DEPEND: LOOKFILE
>> +    CODE: GATT11b
>> +    """
>> +    c = env.c1
>> +    ops = c.use_obj(env.opts.usefile)
>> +    ops += [c.getattr([FATTR4_HIDDEN])]
>> +    res = c.compound(ops)
>> +    check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(hidden)")
>> +    if res.status == NFS4ERR_ATTRNOTSUPP:
>> +        t.fail_support("hidden not a supported attribute")
>> +
>> +def testMimetype(t, env):
>> +    """GETATTR on "mimetype" attribute
>> +
>> +    FLAGS: getattr all
>> +    DEPEND: LOOKFILE
>> +    CODE: GATT11c
>> +    """
>> +    c = env.c1
>> +    ops = c.use_obj(env.opts.usefile)
>> +    ops += [c.getattr([FATTR4_MIMETYPE])]
>> +    res = c.compound(ops)
>> +    check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(mimetype)")
>> +    if res.status == NFS4ERR_ATTRNOTSUPP:
>> +        t.fail_support("mimetype not a supported attribute")
>> +
>> +def testQuotaAvailHard(t, env):
>> +    """GETATTR on "quota avail hard" attribute
>> +
>> +    FLAGS: getattr all
>> +    DEPEND: LOOKFILE
>> +    CODE: GATT11d
>> +    """
>> +    c = env.c1
>> +    ops = c.use_obj(env.opts.usefile)
>> +    ops += [c.getattr([FATTR4_QUOTA_AVAIL_HARD])]
>> +    res = c.compound(ops)
>> +    check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP],
>> "GETATTR(quota_avail_hard)")
>> +    if res.status == NFS4ERR_ATTRNOTSUPP:
>> +        t.fail_support("quota_avail_hard not a supported attribute")
>> +
>> +def testQuotaAvailSoft(t, env):
>> +    """GETATTR on "quota avail soft" attribute
>> +
>> +    FLAGS: getattr all
>> +    DEPEND: LOOKFILE
>> +    CODE: GATT11e
>> +    """
>> +    c = env.c1
>> +    ops = c.use_obj(env.opts.usefile)
>> +    ops += [c.getattr([FATTR4_QUOTA_AVAIL_SOFT])]
>> +    res = c.compound(ops)
>> +    check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP],
>> "GETATTR(quota_avail_soft)")
>> +    if res.status == NFS4ERR_ATTRNOTSUPP:
>> +        t.fail_support("quota_avail_soft not a supported attribute")
>> +
>> +def testQuotaUsed(t, env):
>> +    """GETATTR on "quota used" attribute
>> +
>> +    FLAGS: getattr all
>> +    DEPEND: LOOKFILE
>> +    CODE: GATT11f
>> +    """
>> +    c = env.c1
>> +    ops = c.use_obj(env.opts.usefile)
>> +    ops += [c.getattr([FATTR4_QUOTA_USED])]
>> +    res = c.compound(ops)
>> +    check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_used)")
>> +    if res.status == NFS4ERR_ATTRNOTSUPP:
>> +        t.fail_support("quota_used not a supported attribute")
>> +
>> +def testSystem(t, env):
>> +    """GETATTR on "system" attribute
>> +
>> +    FLAGS: getattr all
>> +    DEPEND: LOOKFILE
>> +    CODE: GATT11g
>> +    """
>> +    c = env.c1
>> +    ops = c.use_obj(env.opts.usefile)
>> +    ops += [c.getattr([FATTR4_SYSTEM])]
>> +    res = c.compound(ops)
>> +    check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(system)")
>> +    if res.status == NFS4ERR_ATTRNOTSUPP:
>> +        t.fail_support("system not a supported attribute")
>> +
>> +def testTimeBackup(t, env):
>> +    """GETATTR on "time backup" attribute
>> +
>> +    FLAGS: getattr all
>> +    DEPEND: LOOKFILE
>> +    CODE: GATT11h
>> +    """
>> +    c = env.c1
>> +    ops = c.use_obj(env.opts.usefile)
>> +    ops += [c.getattr([FATTR4_TIME_BACKUP])]
>> +    res = c.compound(ops)
>> +    check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_backup)")
>> +    if res.status == NFS4ERR_ATTRNOTSUPP:
>> +        t.fail_support("time_backup not a supported attribute")
>> +
>> +def testTimeAccessSet(t, env):
>> +    """GETATTR on "time access set" attribute (write-only)
>> +
>> +    FLAGS: getattr all
>> +    DEPEND: LOOKFILE
>> +    CODE: GATT11i
>> +    """
>> +    c = env.c1
>> +    ops = c.use_obj(env.opts.usefile)
>> +    ops += [c.getattr([FATTR4_TIME_ACCESS_SET])]
>> +    res = c.compound(ops)
>> +    check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP],
>> "GETATTR(time_access_set)")
>> +    if res.status == NFS4ERR_ATTRNOTSUPP:
>> +        t.fail_support("time_access_set not a supported attribute")
>> +
>> +def testTimeModifySet(t, env):
>> +    """GETATTR on "time modify set" attribute (write-only)
>> +
>> +    FLAGS: getattr all
>> +    DEPEND: LOOKFILE
>> +    CODE: GATT11j
>> +    """
>> +    c = env.c1
>> +    ops = c.use_obj(env.opts.usefile)
>> +    ops += [c.getattr([FATTR4_TIME_MODIFY_SET])]
>> +    res = c.compound(ops)
>> +    check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP],
>> "GETATTR(time_modify_set)")
>> +    if res.status == NFS4ERR_ATTRNOTSUPP:
>> +        t.fail_support("time_modify_set not a supported attribute")
>>     ####################################################
>>   
> 


-- 
Chuck Lever

  reply	other threads:[~2025-09-29 21:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29 20:16 [PATCH] Add some tests for unsupported fattr4 attributes Chuck Lever
2025-09-29 21:14 ` Calum Mackay
2025-09-29 21:16   ` Chuck Lever [this message]
2025-09-29 22:10     ` Calum Mackay
2025-09-30 11:34 ` Jeff Layton

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=f86efa58-3dec-42e9-b992-884fc143457d@kernel.org \
    --to=cel@kernel.org \
    --cc=calum.mackay@oracle.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.