From: Greg Kroah-Hartman <greg@kroah.com>
To: wahahab <wahahab11@gmail.com>
Cc: "Dan Carpenter" <dan.carpenter@oracle.com>,
"Joel Fernandes" <joel@joelfernandes.org>,
devel@driverdev.osuosl.org, "Todd Kjos" <tkjos@android.com>,
ghartman@google.com, astrachan@google.com,
linux-kernel@vger.kernel.org, "Arve Hjønnevåg" <arve@android.com>,
"Martijn Coenen" <maco@android.com>
Subject: Re: [PATCH v3] driver-staging: vsoc.c: Add sysfs support for examining the permissions of regions.
Date: Tue, 20 Nov 2018 10:56:25 +0100 [thread overview]
Message-ID: <20181120095625.GA17738@kroah.com> (raw)
In-Reply-To: <C815584A-8542-4491-A7C4-CF0274C00792@gmail.com>
On Tue, Nov 13, 2018 at 11:32:51AM +0800, wahahab wrote:
>
> > On 12 Nov 2018, at 8:40 PM, Greg Kroah-Hartman <greg@kroah.com> wrote:
> >
> > On Mon, Nov 12, 2018 at 04:49:30PM +0800, wahahab wrote:
> >>
> >>> On 10 Nov 2018, at 1:15 AM, Dan Carpenter <dan.carpenter@oracle.com <mailto:dan.carpenter@oracle.com>> wrote:
> >>>
> >>> On Wed, Nov 07, 2018 at 10:30:43AM +0800, Jerry Lin wrote:
> >>>> Add a attribute called permissions under vsoc device node for examining
> >>>> current granted permissions in vsoc_device.
> >>>>
> >>>> This file will display permissions in following format:
> >>>> begin_offset end_offset owner_offset owned_value
> >>>> %x %x %x %x
> >>>>
> >>>
> >>> (I'm not totally an expert on sysfs rules).
> >>>
> >>> Sysfs are supposed to be one value per file, so instead of doing this
> >>> you would create a directory with four files like
> >>> vsoc_device/begin_offset vsoc_device/end_offset etc. And each would
> >>> just hae a %x output.
> >>
> >> Thanks for your advice. I have started with this approach.
> >>
> >> But when I trying to create this kind of sysfs hierarchy. I encountered the difficulties of file organizing.
> >>
> >> My current thought is to create a folder under the device node called permissions and user can examine
> >> permission though file path like vsoc_device/permissions/permission1/begin_offset. But there comes a
> >> problem that it seems hard to determine the correct index of permission to make folder name unique.
> >>
> >> The solution I come up with is to use memory address of permission node to be the index of permission.
> >> So the path will be something like vsoc_device/permissions/0x4d23f/begin_offset.
> >> Is this OK for sysfs?
> >
> > Ick, that is messy. What exactly are you trying to export and why use
> > sysfs? Is this just debugging information? Who is going to use this
> > data?
>
> I felt that exporting these information in sysfs will add lots of complexities in this driver.
> And I’m not sure these informations are for user space or just for debugging.
>
> It seems there is a conflict of TODO messages between TODO file and the
> comment in vsoc.c.
>
> Should I use debugfs first for this patch?
If it is for debugging, yes. As I have no idea what this code is doing,
or what wants that information, it is hard to determine, sorry.
good luck!
greg k-h
prev parent reply other threads:[~2018-11-20 9:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 2:30 [PATCH v3] driver-staging: vsoc.c: Add sysfs support for examining the permissions of regions Jerry Lin
2018-11-07 9:15 ` Greg Kroah-Hartman
2018-11-08 0:49 ` wahahab
2018-11-08 1:44 ` Greg Kroah-Hartman
2018-11-09 17:15 ` Dan Carpenter
[not found] ` <6ADC007E-85BB-4CA1-89FB-9254937E8C63@gmail.com>
2018-11-12 12:40 ` Greg Kroah-Hartman
2018-11-13 3:32 ` wahahab
2018-11-20 9:56 ` Greg Kroah-Hartman [this message]
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=20181120095625.GA17738@kroah.com \
--to=greg@kroah.com \
--cc=arve@android.com \
--cc=astrachan@google.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=ghartman@google.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=tkjos@android.com \
--cc=wahahab11@gmail.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