Fw: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling

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

 



[AMD Official Use Only]


Trying with Christian's Gmail, as he still didn't receive previous emails.


From: Das, Nirmoy <nirmoy.das@xxxxxxx>
Sent: Friday, October 8, 2021 2:17 PM
To: Koenig, Christian <Christian.Koenig@xxxxxxx>
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx <dri-devel@xxxxxxxxxxxxxxxxxxxxx>; intel-gfx@xxxxxxxxxxxxxxxxxxxxx <intel-gfx@xxxxxxxxxxxxxxxxxxxxx>; Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>; Maxime Ripard <mripard@xxxxxxxxxx>; Thomas Zimmermann <tzimmermann@xxxxxxx>; David Airlie <airlied@xxxxxxxx>; Daniel Vetter <daniel@xxxxxxxx>; Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>; Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
Subject: Re: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
 
Adding Christian as he didn't receive the full thread yet.


On 10/8/2021 1:07 PM, Greg KH wrote:
> On Fri, Oct 08, 2021 at 12:40:47PM +0300, Jani Nikula wrote:
>> On Fri, 08 Oct 2021, Nirmoy Das <nirmoy.das@xxxxxxx> wrote:
>>> Debugfs API returns encoded error instead of NULL.
>>> This patch cleanups drm debugfs error handling to
>>> properly set dri and its minor's root dentry to NULL.
>>>
>>> Also do not error out if dri/minor debugfs directory
>>> creation fails as a debugfs error is not a fatal error.
>> Cc: Greg
>>
>> I thought this is the opposite of what Greg's been telling everyone to
>> do with debugfs.
> Yes, that is not good.
>
> You should never care about the result of a debugfs_create* call.  Just
> take the result, and if it is a directory, save it off to use it for
> creating a file, no need to check anything.
>
> And then throw it away, later, when you want to remove the directory,
> look it up with a call to debugfs_lookup() and pass that to
> debugfs_remove() (which does so recursively).
>
> There should never be a need to save, or check, the result of any
> debugfs call.  If so, odds are it is being used incorrectly.
>
> thanks,
>
> greg k-h

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux