From: Benjamin Coddington <bcodding@redhat.com>
To: Alexander Aring <aahringo@redhat.com>
Cc: trondmy@kernel.org, anna@kernel.org, gregkh@linuxfoundation.org,
rafael@kernel.org, akpm@linux-foundation.org,
linux-nfs@vger.kernel.org, gfs2@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] nfs: sysfs: use default get_ownership() callback
Date: Tue, 08 Oct 2024 16:09:37 -0400 [thread overview]
Message-ID: <ECD4A28B-9987-42BC-91DC-8DED8CAEED21@redhat.com> (raw)
In-Reply-To: <20241003151435.3753959-5-aahringo@redhat.com>
On 3 Oct 2024, at 11:14, Alexander Aring wrote:
> Since commit 5f81880d5204 ("sysfs, kobject: allow creating kobject
> belonging to arbitrary users") it seems that there could be cases for
> kobjects belonging to arbitrary users. This callback is set by default
> when using kset_create_and_add() to allow creating kobjects with
> different ownerships according to its parent.
>
> This patch will assign the default callback now for nfs kobjects for
> cases when the parent has different ownership than the default one.
>
> Signed-off-by: Alexander Aring <aahringo@redhat.com>
> ---
> fs/nfs/sysfs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/nfs/sysfs.c b/fs/nfs/sysfs.c
> index a6584203b7ff..b5737464b892 100644
> --- a/fs/nfs/sysfs.c
> +++ b/fs/nfs/sysfs.c
> @@ -27,6 +27,7 @@ static const struct kobj_ns_type_operations *nfs_netns_object_child_ns_type(
> }
>
> static struct kobj_type nfs_kset_type = {
> + .get_ownership = kset_get_ownership,
> .release = kset_release,
> .sysfs_ops = &kobj_sysfs_ops,
> .child_ns_type = nfs_netns_object_child_ns_type,
> --
> 2.43.0
Hi Alex, if I understand this correctly, this patch just punts the ownership
callback up to fs_kobj, which, because it has no .get_ownership is just
going to be the same result: root.
Does this patch add value?
Ben
next prev parent reply other threads:[~2024-10-08 20:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 15:14 [PATCH 0/4] nfs: kobject: use generic helpers and ownership Alexander Aring
2024-10-03 15:14 ` [PATCH 1/4] kobject: add kset_type_create_and_add() helper Alexander Aring
2024-10-03 15:14 ` [PATCH 2/4] kobject: export generic helper ops Alexander Aring
2024-10-03 15:14 ` [PATCH 3/4] nfs: sysfs: use kset_type_create_and_add() Alexander Aring
2024-10-03 15:14 ` [PATCH 4/4] nfs: sysfs: use default get_ownership() callback Alexander Aring
2024-10-08 20:09 ` Benjamin Coddington [this message]
2024-10-09 14:56 ` Alexander Aring
2024-10-08 17:36 ` [PATCH 0/4] nfs: kobject: use generic helpers and ownership Alexander Aring
2024-10-08 20:12 ` Benjamin Coddington
2024-10-09 20:03 ` Anna Schumaker
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=ECD4A28B-9987-42BC-91DC-8DED8CAEED21@redhat.com \
--to=bcodding@redhat.com \
--cc=aahringo@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=anna@kernel.org \
--cc=gfs2@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=trondmy@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox